Today Elemental Beta 1C should be going up. This is the AI beta. From a player’s point of view, it’s largely meaningless because the computer players are still very primitive. But from a technical point of view, it’s a key milestone because hundreds of APIs have been written that can now be enhanced to make the AI more intelligent.
Previous check-in(s)
// Building a City
· -if it's the first city, it looks for a tile location adjacent to a food tile. When it finds one, it will build the city there
· -for any other city, it looks for a tile adjacent to a mineable resource (like, ore or a shard, etc..)
// After building a city
· -look for and grab nearby goodie huts in 'r' tile radius of the city (where r is 20 for now)
// City Build Mode
· -will leave early if no buildable tiles or subtiles
· -Will not queue up more than one imp at a time
· -randomly selects a buildable imp
· -attempts to find a tile or subtile within the city to place the imp on (might not fit anywhere)
· -Implications: an AI city will never have more than one imp under construction at a time. It's possible that serveral turns will go by where an AI city doesn't have anything under construction (due to randomly picking an imp, and then seeing if it fits anywhere)
// Research
· -leave early if no cities (no cities = no population = no research points)
· -if not already researching a category, pick a random one
// Research Breakthough
· randomly pick one of the breakthrough techs
· 50/50 chance to continue with current category or pick a new category (new one will be random)
This Check-in
// Unit Design
· only do it every 't' turns (where t is 10 for now)
· assign random name (eventually we want to name based on battle strength, xml driven)
· Assign random weapons
· Assign random armor
· Assign random equipment
· if SumOfAllStats is greater than an existing design, save this design, including the turn number it was created
// City train unit
· leave early if already training a guy
· randomly pick a design and use it
· sure we aren't training guys that were designed x turns ago (where x is 100 for now)
// HIGHLIGHTS
+ AI now attempts to design a unit type every 10 turns. Keeps it if it is better than at least one of that faction's previously designed unit types (during that game)
+ AI picks a random unit to train, so long as it wasnt designed more than 100 turns ago, otherwise a different one is choosen to be trained
// DETAILS OF CHANGED FILES
+ MainMapViewWindow.cpp
- checking in some changes I missed for the ability to use the debug shortcut keys in Release by specifing USE_DEBUG_KEYS
- fixed some else if statements that had the "else" and the "if" on different lines
+ AISkeleton .h/.cpp
- Added a pure virtual function called AIDesignUnit() that is meant to be overridden by your AISkeleton-derrived class.
+ AiBasic .h/.cpp
- Added a declarations and definition of AIDesignUnit()
- added function AICompareToDesigns(), which takes a unit type pointer and compares it to all the other unit types designed by AI during that particular game.
- Added a variable to keep track of the last turn that this AI successfully designed a unit
- AI will not attempt to train units if net income is below 0.0
- AI will not train a unit that was designed more than 100 turns ago
+ UnitType .h/.cpp
- Added function GetStat(index) which will return the value of the stat at index. Still need to add code to sum up the modifiers
- added functions for SigmaStat. SigmaStat is all your stats summed up. functions added are CalcSigmaStat(), and two variations of CompareMySigmaStatTo() which takes either another unit type pointer, or a ulong for the other sigma stat value.
- changed AddUnitType to return a BOOL so you can tell if it failed or not
- added stat copying to the copy constructor
For the most part, the AI is just picking random stuff. The way AI development works is that you create the plumbing and then refine over months.
Now, for those of you not in the beta, this is still very primitive stuff. So don’t envy the beta group here as they’re suffering through lots of pain still and will continue to do so for at least another month and a half before the game remotely becomes “enjoyable” IMO.
We will be continuing to use the 2D sprite engine for the game until the beta group determines the game is enjoyable without having to rely on its state of the art engine that we have disabled presently.