Jump to content


How to get AI to work


No replies to this topic

#1 nip

    Grunze-Catz

  • Member
  • 608 posts

Posted 07 November 2006 - 16:34

How to add AI to maps

includes three parts:
1. AI scripting
2. Trigger areas and player start points
3. Waypoint paths
_______________________________________________________________________

AI scripting

The map is finished and you wanna include AI do the following: open "Edit Player List" and remove every player. When a message pops up saying "There are x objects using this team. Do you wish to continue?" click "Yes". When all players are removed click "Add Skirmish Players", click "OK" and save. First part is done. (Pic 1)
_______________________________________________________________________

Trigger areas and player start points (Pic 2)

To layout the trigger area of a player's base use the "TempBuildingSize" object. Can be found in object list under Civilian>Structure. The base area should be roughly the size of the "TempBuildingSize". Layout two trigger areas around the base area. The inner trigger area is called "InnerPerimeterX" and the outer trigger area is called "OuterPerimeterX" where X is the number of the start location (Player_1_Start, Player_2_Start, etc.). When the base trigger areas are done create one more trigger area that includes everything that is not part of a base area or their perimeters. This trigger area is called "CombatZone". Place the corresponding player start points into each base area.

About

OuterPerimeter:
When enemy units breach the outer perimeter of an AI-controlled base the available units address the threat. Don't create an outer perimeter too big nor too small because the AI may react too soon or too late.

InnerPerimeter:
When the inner perimeter is breached the AI drops everything to address this threat. The inner perimeter shouldn't be much larger than the base area itself. However, if there is a choke point or some other tactical advantage some distance from the base, it makes sense to define the inner perimeter to include this point.

CombatZone
Incursions into the combat zone signal the AI that the stakes of the game have been elevated. Every map has only one combat zone.

Player Start Points
It's the point on the map where AI places the command center. And the AI measures it's build radius from this point. If the AI build faction structures at wrong places, on roads or railtracks or on top of supply piles for example, move the player start point around 'til the AI does fine. It's much easier than do rework part of the map.
_______________________________________________________________________

Waypoint paths

The waypoint paths define the base entrances and every base got three of them named

CenterX

FlankX

BackdoorX

where X is the number of the base area these paths lead into. Depending on map layout the waypoint paths can be short or rather long. If the map isn't too big and hasn't too many choke points or rivers a waypoint path can be placed right outside a base beyond the outer perimeter leading just inside the inner perimeter. If your map got choke points like bridges, narrow areas it makes sense to stretch the waypoint path across the bridge(s) or through the choke point(s) to prevent AI pathfinding issues aka lag. Also for the same reason it is a good idea to split waypoint paths if a map includes more than two players and has several choke points, see (Pic 3).


About

Center
It defines the most direct route into a base. On easy setting the initial attack usually comes from this route.

Flank
It defines the secondary route into a base.

Backdoor
It's the least obvious and often most vulnerable route into a base. On hard setting the initial attack may come from this route.
_______________________________________________________________________

Testing the map

When finished give it a try and check the map using hard AI because it builds additional buildings thus need more space. To make it easier include some indestructable tanks at your start position, make them teamPlyrCivilian and unmanned. So you can capture them and check the whole map under play conditions without the need to defend yourself all the time. Reveal the entire map permanently for local player and force enable the radar. This script for testing purpose is placed into teamPlyrCivilian script folder. When everything works fine remove this script and the indestructable units and release your map.

Edited by Revantheemperor, 03 November 2007 - 13:45.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users