Green Rollover Red Rollover Arrow Rollover Focused Userbar Register Button Rollover Red Button Rollover
Welcome Guest ( Log In / Register )

Explanation of Empire At War's AI "engine"

Avatar of Drieick

Drieick

Category: Coding
Level: Intermediate
Created: Monday February 25, 2008 - 3:03
Updated: Monday May 5, 2008 - 22:43
Views: 6349
Summary: Taken from the forums, a tutorial on EAW's AI

Rating

Staff says

5.0

Members say

-

Average

5.0/5.0

1 vote

Page 1 2 3 4 5 6
I'm not sure how much the community knows of it, but I'm basically just going to explain how it works.

Anyway, it basically just translates into a form of Lua. Or, that is what I predict.

Variables and how they're interpreted
Here are the variables, which obivously start with the word "Variable_":

Variable_Target
Variable_Enemy
Variable_Self
Variable_Human

What they mean depends on how and where they're used; for example, if it's Galactic mode, Target could mean a planet and Variable_Self could mean the player attributes. However, in tactical mode, Variable_Target could mean a unit or a location on the map. Currently, on Target appears in the Lua source (defined in PGBaseDefitions.lua)
I'm not sure how exactly it determines locations, because there's no obvious grid, so I'm just going to assume it's square pixel by square pixel, which is inefficient (Grid would be faster... or a bigger squareXsquare scaled grid).

---------------Self-Interruption---------------
Variable_Target locations are selected in ground maps from the AI zones defining collections of contiguous of map cells (either procedurally calculated or hand painted by the editor). In space maps its a simple coarse grid.
-SCC (Original Post)

What this means is, from what I know, is the "AI zones" are simply the Passability Code Brush used in the map editor; in space, Target is used on grids (a location on the grid). To clarify something, this is when Variable_Target is used to determine a LOCATION; Variable_Target determines both units and locations. I am not sure if it determines planets in the Galactic Map.
---------------Self-Interruption---------------

Where and how are they defined? In the AI/Goals folder, as you can see here:


<Upgrade_Starbase>
    <AIGoalApplicationFlags> Friendly </AIGoalApplicationFlags> <!-- Filter for who is applies to -->
    <GameMode> Galactic </GameMode> <!-- Where it'll be used -->
    <Category> Infrastructure </Category> <!-- The category budget it's in -->
    <Reachability> Any </Reachability>
    <Time_Limit> 30.0 </Time_Limit>
    <Build_Time_Delay_Tolerance>1.2</Build_Time_Delay_Tolerance>
    <Is_Like>
        Build_Scanner,
        Build_Initial_Starbase_Only,
        Build_Jamming_Station
    </Is_Like>
</Upgrade_Starbase>

What I don't know is what the Is_Like, Reachability, Time_Limit and Build_Time_Delay_Tolerance tags means; anyone know? The variables by themselves don't mean anything yet, so don't worry about it yet.

Links / Downloads

 HitsAdded
NameSpace and TestFunction (Page 6)2607February 25, 2008 - 3:19
News article pertainting to tutorial3063February 25, 2008 - 3:07
The original thread2978February 25, 2008 - 3:06

Add comment

Please enter your message below. Max 10000 characters.