- Joined
- Jun 1, 2008
- Messages
- 341
THE BASICS OF TRIGGERING REALISTIC AI IN GUI |
WARNING - THIS IS A TUTORIAL OF DIFFICULTY 8/10 DO NOT ATTEMPT LIGHTLY |
WORK IN PROGRESS |
Table of Contents |
Section 1: The Theory |
Section 2: Initialisation |
Section 3: AI Movement |
Section 4: AI Attacking |
Section 5: AI Spellcasting |
Section 6: AI Interactions |
Section 7: My Final Words |
Section 1: The Theory | ||||||||||||||
Artificial Intelligence is one of the single most complex elements of game computation, it requires many checks and calculations regarding real-time positions, facing angles, damage/health calculations and many other variables. This Tutorial is going to go over how we can make an efficient AI using GUI in the World Editor that will be able to interact with an RPG/ORPG as a professional human player (who happens to make no mistakes, ever) would. So What should it do? Basically, in a typical RPG/ORPG, a player will need to do the following:
Believe it or not its actually really quite simple; lets go through the list and look at what the possible solutions for each scenario might be:
|
Section 2: Initialisation | ||||||||
This is where the fun begins. So first things first and as you should have guessed by the section name this is the part of the tutorial where we will be setting up things that should be done either at the start of a relevent event or at map initialisation. Lets jump straight in then: What is it we're going to do first? The very first thing we need to do is to set up the AI players detection. This is a pretty simple task and can be done in a numerous amount of ways, however i have shown only one, of which i have found to be most reliable and simple. In my example i have chosen to use 10 players leaving one (player brown) for creeps and a second (Dark Green) for neutral units, i.e villagers etc.. We will see why this is important later. Just know that 10 is always a good number for players in RPG's. You will also notice i have used some Global Variables as listed below, insure you declare these variables before you attempt to enter the triggers.
So as can be seen we have run checks for each of the players using an integer count as (All Players) can sometimes not pick up the targets we might want to include. The checks include, if the player is simply not playing, i.e the slot was closed. It also includes, if the player has been assigned a difficulty computer setting or if the player is not Brown or Dark Green. You should also notice that there have been checks to decide which groups to put the players in. If the player was not given a difficulty in the lobby room, then it will come under the else catagory and thus will be assigned a difficulty of Normal. So now that we have the AI we can refer to it using the player groups to find its difficulty setting. |
FEEL FREE TO LOOK OVER THE TUTORIAL SO FAR SUGGESTING IMPROVEMENTS AND CHECKING FOR MISTAKES ALTHOUGH I WILL BE CHECKING TOO FEEDBACK ON THE CURRENT STAGES WILL ALSO BE GREATLY APPRECIATED, BOTH GOOD AND BAD
|
Last edited: