AI

Blitz3D Forums/Blitz3D Beginners Area/AI

mindstorms(Posted 2006) [#1]
I am trying to make a strategy game simular to age of empires or starcraft. I am at the point where an AI is needed, and have brainstormed on what it might have to be.

5 Different "modes" for AI
 1.  scouting:  always in background, explores map with 1-2 units, only becomes active if less than that

 2. build base:  includes resources and building buildings.  Switches off with military for resource consumption. starts with high piority, but loses some as game progresses

 3. build military:  builds military units, choosing which units based on type of map, type of civ, and what resources are available.  Trades off with build base for resource consumption.  Becomes more important (higher priority) later in game.

 4. attack:  active when there is a certain amount of units built (probable around 10).  Works in the background, and the units attack the most dense area of enemy buildings/units.

 5.  under attack:  immediately ovverides rosource consumption to make more units, unless there are already more units than those attacking.  Sends up to 10 more units than the attacking army to stop them.  Once enemy stops attacking, goes to lowest priority.




Priorities of building units

1.  higher priority if there is a civ bonus for that unit/special unit.

3.  Higher priority (by alot) if there is enough resources for 3 of them.

4.  Lower priority if already lots of units (makes diversity)

Building Placement

1.  If resource collection point, has to be within 3 "grid" squares from the resource.

2.  Must be at least 3 "grid" squares from other buildings.

3.  Higher priority locations go to places close enough to your buildings, but closer to the enemies (makes the AI build towards you)

4.  Higher priority (not much) of military buildings near resource collection buildings (for protection)



Is this along the right lines? Am I missing anything important? I have never done AI this complicated before.


Dreamora(Posted 2006) [#2]
Priority of units: Should depend on scouted enemy army -> create counter units.

Attack: ... OR the estimated enemy strength is weaker (perhaps even the counter units that could easily be killed) OR the enemy is on the way to take an important spot (expansion etc) that will be weak defended for some time and thus a good target.

build base / military: Woulnd't hardcode it that strong but train a neural network for different strategies (tech, fast attack, powerfull, sneak and attack, .... ).
Depending on the strat, buildings will stay on high performance in later game as well just because of upgrades etc while focusing on a few, powerfull units (just as an example)


Beside that I think it seems to be quite good layed out ... although AI is the only part of a game that can't really be planned upfront ... some outlines, ok ... the rest will normally show up and crystalize during the hundreds of testsessions trhough tester feedback ...


mindstorms(Posted 2006) [#3]
This is probably silly, but what is a neural network?

That is good advice!


Matty(Posted 2006) [#4]
A neural network is totally unnecessary in a game like this. In simplest terms it is a tool for determining the relationship between a set of inputs and the resulting output. It also requires 'training' and a feedback mechanism to let it know when it is 'on the right track'.


Andy(Posted 2006) [#5]
>This is probably silly, but what is a neural network?

A computer representation of how 70's scientists believed the brain to function.

NN's can be useful because they are easy to program and get good generalized results easily, but they require training and in order to be efficient they need to be trained using datasets which accurately represent their environment. The last point is their achillesheel, in that the training of such a network is crucial to performance.


Andy


mindstorms(Posted 2006) [#6]
Thanks everyone!