- Joined
- Jan 30, 2013
- Messages
- 12,440
INTRODUCTION
Greetings everyone, this is Daffa the Mage bringing you an AI related tutorial. Before moving on, this tutorial is a theory-typed tutorial, thus there will be a lot of logic and... MATH involved. Some text rain too. There will also be some sample codes to help to understand in Warcraft 3 context.
For this tutorial, I will use DotA Template from TheHelperNet for GUI triggers in this tutorial.
GETTING STARTED
Before proceeding, I hope you have a basic understanding of maths (addition, subtraction, multiplication, and division) as well as logic (>,<,>=,<=,==,!=) beforehand.
For Warcraft 3 materials :
- World Editor (1.24+)
- Decent Understanding of Trigger Editor (this tutorial uses GUI, for Wurst, Jass and vJass user who's allergic to GUI, please pardon me)
I also assume you understand that this is exclusively focused on AoS genre. For other genres, I will have a different tutorial approaching them.
WHAT IS AI?
I'll quote Wikipedia here :
In computer science, Artificial intelligence (AI), sometimes called machine intelligence, is intelligence demonstrated by machines, in contrast to the natural intelligence displayed by humans and other animals.
In Warcraft 3 context, this means that AI is the part where Computer players act and display a sense of intelligence as an attempt to actively partake in the game.
A map with AI greatly increases the enjoyment of the map itself, and the replayability will increase with the existence of AI. The more dynamic the AI is, the further replayability it gives. In addition, it allows a map to be played in singleplayer (the poor people who are too busy to arrange schedule with others or afford Warcraft 3). This makes AI one of the most rewarding things to do for a mapper.
Truth be told, the difficulty justifies this
AI IN AOS
So, now, we'll get started with the theories. Let's go!
RESTRICTIONS
In AoS, there are several basic restrictions to remember :
- Each player only has one 'main' hero
- Gold is gained by 3 methods: Killing, Assist and Auto-Generation
- There are items to buy
- Each hero has it's own skill set
- There are some stat attributes, different per hero
For now however, we presume all those restrictions above are followed.
ACTIONS
In AoS, there are actions that a hero can do :
- Attack
- Heal
- Standby
- Skill Selection
- Skill-Cast
- Purchase Items
- Use Items
APPROACH TO AOS AI
There are a lot of approaches for AoS AI. The simplest one would be the suicidal AI approach. With Skill-Cast handled by Warcraft 3 (unless Channel is used), one would only need to construct the Skill Selection and Purchase Items. This is by far the fastest to code between them (even faster if Item Purchasing is skipped out). One main flaw is the fact AI dies easily, and in AoS with punishing death, it's a no-go.
The next approach is the 'state' approach. This approach makes the user involved in Attack, Heal, Skill Selection and Item Purchasing parts. Skill-Cast and Use Items is usually parted to Warcraft 3 default mechanic (though some code it themselves) and Standby is usually scrapped out to simplify the code. This AI is flawed when it comes to denying kills and it lacks complex decision making.
The last approach I found, which is mostly theory but surely applicable to DotA's successor, DotA 2, according to one paper I read is the Fuzzy Logic approach. This approach allows a player to have more dynamic gameplay and makes the AI adapt to the player. This one is very complex, and since I still study this approach, I will mostly focus on the theory (lots of math here).
Other than these 3 approaches, they usually are still within bound of one of these three, so I suppose these should be sufficient. For this tutorial, I will focus on Suicidal AI only. Finite State improves from Suicidal by adding decision on what 'state' the AI is in. Fuzzy further improves it by giving AI the weighing of available options.
WHAT'S NEXT?
Making Your Own AoS AI - Suicidal AI Approach
Last edited: