NTAI X discussion
Posted: 16 Nov 2005, 21:07
NTAI & X
This just happens to be one of those I type offline, so any spelling complaints are to be blamed on FLWriter.
After doing extensive research, I found a lot of information based around a game called swarmz written in game maker where 3 swarms battled it out in a simple game where each swarm tried to kill off the other swarms and survive to win. The creator so swarms commented on using the system as a brain like system where each action was represented by a swarm.
Having done more research into this sort of thing, I combined it with a set of thought processes I had going on that where meant to change the very nature of NTAI.
Currently all AI's in this community are global structures that assign units commands based on the global situation, essentially simple macro-management. They all work on global structures, agents, that make absolute decisions, do number crunching and data pushing on statistics given by the engine every frame or on every event. Their decisions are based on the whole situation, and they don't tailor the decisions to the user. There is no consequential behaviour save minor unexpected surprises (JCAI has a set of routines in its construction code so that 2 units will help each other build something, but NTAI has this too, yet I haven't coded any of it, it's simply a pleasant consequences of how the engine deals with commands). Units dont learn, only an approximation of statistics that determine what should be built.
So, my idea was to take this whole situation, the convention of the spring AI developer, and turn it upside down literally. I decided to take away the Global high level orientated structure and put the unit first, and not the great director. Afterrall the director holds a dictatorship in the conventional AI, as a king or queen used to, yet today it is seen that a government or ruler serves their country and not the other way round. Put the unit in charge of their future actions, and let the directors not be commanders, but influencers, advisors, helpers, providers, not controllers.
Units thus would have their set of every possible action as a swarm, each action being scored and the score determining the size and power of a swarm. The swarm that won represented the action that was going to be taken.
So what needs to be done to let the units revolt against their evil agent masters, How will they overthrow the functor and chaser classes and gain the freedom to build and attack whatever they want? First of all, in the crossover from Dictatorship to democratic AI system, we need to give the users the ability to disobey. Implement a unit class, give it an execute(command* c) function and let that function be the gateway. Give the unit the basic swarming brain design and give the command action a huge multiplier till more actions can be added.
Ahem,.. how do we create consequential behaviour then? Surely under this system the only things affecting 2 units in the same position are their abilities? So I it through and came upon a simple solution. Units need a personality. It needs to be based on the circumstances of the area they where built in and what the AI was doing at the time of creation, as well as their attributes. For example fast moving units have less patience, and are more excitable than a slow moving behemoth, while a fark built on the edge of the AI's base is not going to be scared of building defences or radar towers nearer the enemy base on solo mission, but a con kbot built in the middle of a heavily guarded base would be better working in a large group of units with similair abilities, keeping safe.
I then thought that units need to change to suite the situation. So i thought that each decision that can be represented by a swarm is weighted by a units personality. If thats warm wins then it influences the units personality. For example a fark built in the middle of a base in a large group is going to get more confident if it reclaims an enemy unit.
So units have a personality that effects their actions, which in itself creates a whole set of unit dynamics and consequential behaviour such as weak defenceless units wont wander off by themselves near the enemy.
So units can then change their personalities based on events and their actions. Events are given to all units with a basic personality attatched to them which is then applied to all units, and how much their attitudes change depends on the existing personality.
What about the problem of an incoherent mass of units? Firstly I propose a map grid, with the map split into 128x128 size squares. These squares will have their own personality structures, represented by what events took place on them and the units that passed by. For example a choke point will show as a region of strong foreboding. Thus units that had a low confidence attribute would never consider going there and the swarms representing those options would be small. This map would also have influences. For example a unit decides it would be best to attack a point or a player, this view is imprinted on the grid square and fades, during which it can affect units with similair ideas, as a re-inforcing factor, or as a changer of their attributes. A units main emotion at the time is also imprinted, this is their current decided action and their personality attribute represented by that action. This taints the attributes of other units too.
So we have a grid map that helps influence unit behaviour and lets units influence eachother. This map would be saved to file, and if a pre-existing one is present then a composite map is created, an amalgamation of an AI's experience on that map. When a game is started the composite map is loaded and is updated with the information amassed over a game.
Aswell as this a unit has an attitude towards a player, a map, a tactic, and each building. Initially only a player and a unit type will have an associated attitude. Then an associative system where pairs of items are put together. For example a player and a tactic definition, a groups of map vectors and a personality attribute, a unit type and a tactic, etc. This may lead on to further projects other than skirmish AI by adding more associative logic, associable objects and basic inference abilities.
In this situation the globalised agents that used to exist still exist but their role is the equivilant of a government advisory board, or a charity, or a regulator, not a dictator or a strict regime.
But these agents have been running the game for a while now, and they've been successful at making a working AI, and they have advantages, for example why should each and every unit calculate the same data when a single object can do it. Thus as well as map grid influencers, there will be global influences, mostly given by agents. These agents will act as co-ordinaters and influencers with global influencers that can influence a unit and maybe make that unit agree then issue out localized influences that re-inforce the messages..
So gabba posted his research and I started looking at voronoi diagrams and how it would affect such an AI as this. By adding more spatial awareness, the AI could overload with information processing. My thought is to generate an initial voronoi diagram and from that create 2, one that augments the map grid, by overlaying on top and having the vertexes and corridoors inbetween given attributes like the map grids, then from that zones are generated by generating a third voronoi diagram using the vertexes of the second as the points to generate the first. This would create a zone system, which itself would have attributes, but would give the AI a much better idea of what territory it had conquered, and could even be adapted for the player, creating the equivilant of borders and conquered are representations as seen in xxx(forgotten name of game).
Thus the AI could earmark a set of these zones as targets that it needs to conquer, or a corridoor in the second diagram as a good point to take, or to create barriers, such as walls of DT to protect them by building them across a corridoor or around a zone in the the 3rd voronoi diagram, or along the border.
Further more this could be enhanced by making scouting position a list of interesting places for a unit to consider visiting. These would be the detected mex hotspots, the vertexes on voronoi diagram represent large open spaces, the ajoining lines represent coriddors of mobility and paths between spaces. Starting positions could also be read directly from the map file and checked by the AI.
The vertexes being open spaces would also allow for much better generic building placement, by allowing buildings simply to be placed around these vertexes, otherwise the existing algorithms would mean that paths and coridoors would end up blocked or filled with defences that couldn't be used, and any number of congestion problems.
This also adds the better attack co-ordination by showing multiple paths to the enemy, and allowing extra weights to be added by calculating trafficability, and coverage etc as shown in gabbas research, which when combined with the map grid I discussed above would lead to a bigger improvement in how an AI uses its experience.
On a side note:
Anti AI tactics for other AI's
Versus JCAI
Build lots and lots of cheap units. JCAI doesnt account for lots and lots and lots of weak units.
versus AAI
Mess with its learning, send out lots and lots of very cheap and inneffective units of a certain type so that AAI is encouraged to build a certain type of unit. Then send out a good task force and the lack of a decent mixture on AAI's behalf would be its downfall.
OTAI
Get the player number and allyteam of OTAI then peek at its stored information in the AI buffers, change it if you want to play dirty tactics, or use it to detect OTAI then make judgements about what its doing and how to defend.
NTAI & ZcAIn
build lots of unreclaimable features on mex spots and places you dont want it to build. This should mess up the interfaces ClosestBuildSite enough. If not place mines. A minefield of weak mines should be enough to stop NTAI effectively attacking you if its replensihed, and it should halt NTAI's base creep effectively if huge range low damage mines are placed in strategic positions.
This just happens to be one of those I type offline, so any spelling complaints are to be blamed on FLWriter.
After doing extensive research, I found a lot of information based around a game called swarmz written in game maker where 3 swarms battled it out in a simple game where each swarm tried to kill off the other swarms and survive to win. The creator so swarms commented on using the system as a brain like system where each action was represented by a swarm.
Having done more research into this sort of thing, I combined it with a set of thought processes I had going on that where meant to change the very nature of NTAI.
Currently all AI's in this community are global structures that assign units commands based on the global situation, essentially simple macro-management. They all work on global structures, agents, that make absolute decisions, do number crunching and data pushing on statistics given by the engine every frame or on every event. Their decisions are based on the whole situation, and they don't tailor the decisions to the user. There is no consequential behaviour save minor unexpected surprises (JCAI has a set of routines in its construction code so that 2 units will help each other build something, but NTAI has this too, yet I haven't coded any of it, it's simply a pleasant consequences of how the engine deals with commands). Units dont learn, only an approximation of statistics that determine what should be built.
So, my idea was to take this whole situation, the convention of the spring AI developer, and turn it upside down literally. I decided to take away the Global high level orientated structure and put the unit first, and not the great director. Afterrall the director holds a dictatorship in the conventional AI, as a king or queen used to, yet today it is seen that a government or ruler serves their country and not the other way round. Put the unit in charge of their future actions, and let the directors not be commanders, but influencers, advisors, helpers, providers, not controllers.
Units thus would have their set of every possible action as a swarm, each action being scored and the score determining the size and power of a swarm. The swarm that won represented the action that was going to be taken.
So what needs to be done to let the units revolt against their evil agent masters, How will they overthrow the functor and chaser classes and gain the freedom to build and attack whatever they want? First of all, in the crossover from Dictatorship to democratic AI system, we need to give the users the ability to disobey. Implement a unit class, give it an execute(command* c) function and let that function be the gateway. Give the unit the basic swarming brain design and give the command action a huge multiplier till more actions can be added.
Ahem,.. how do we create consequential behaviour then? Surely under this system the only things affecting 2 units in the same position are their abilities? So I it through and came upon a simple solution. Units need a personality. It needs to be based on the circumstances of the area they where built in and what the AI was doing at the time of creation, as well as their attributes. For example fast moving units have less patience, and are more excitable than a slow moving behemoth, while a fark built on the edge of the AI's base is not going to be scared of building defences or radar towers nearer the enemy base on solo mission, but a con kbot built in the middle of a heavily guarded base would be better working in a large group of units with similair abilities, keeping safe.
I then thought that units need to change to suite the situation. So i thought that each decision that can be represented by a swarm is weighted by a units personality. If thats warm wins then it influences the units personality. For example a fark built in the middle of a base in a large group is going to get more confident if it reclaims an enemy unit.
So units have a personality that effects their actions, which in itself creates a whole set of unit dynamics and consequential behaviour such as weak defenceless units wont wander off by themselves near the enemy.
So units can then change their personalities based on events and their actions. Events are given to all units with a basic personality attatched to them which is then applied to all units, and how much their attitudes change depends on the existing personality.
What about the problem of an incoherent mass of units? Firstly I propose a map grid, with the map split into 128x128 size squares. These squares will have their own personality structures, represented by what events took place on them and the units that passed by. For example a choke point will show as a region of strong foreboding. Thus units that had a low confidence attribute would never consider going there and the swarms representing those options would be small. This map would also have influences. For example a unit decides it would be best to attack a point or a player, this view is imprinted on the grid square and fades, during which it can affect units with similair ideas, as a re-inforcing factor, or as a changer of their attributes. A units main emotion at the time is also imprinted, this is their current decided action and their personality attribute represented by that action. This taints the attributes of other units too.
So we have a grid map that helps influence unit behaviour and lets units influence eachother. This map would be saved to file, and if a pre-existing one is present then a composite map is created, an amalgamation of an AI's experience on that map. When a game is started the composite map is loaded and is updated with the information amassed over a game.
Aswell as this a unit has an attitude towards a player, a map, a tactic, and each building. Initially only a player and a unit type will have an associated attitude. Then an associative system where pairs of items are put together. For example a player and a tactic definition, a groups of map vectors and a personality attribute, a unit type and a tactic, etc. This may lead on to further projects other than skirmish AI by adding more associative logic, associable objects and basic inference abilities.
In this situation the globalised agents that used to exist still exist but their role is the equivilant of a government advisory board, or a charity, or a regulator, not a dictator or a strict regime.
But these agents have been running the game for a while now, and they've been successful at making a working AI, and they have advantages, for example why should each and every unit calculate the same data when a single object can do it. Thus as well as map grid influencers, there will be global influences, mostly given by agents. These agents will act as co-ordinaters and influencers with global influencers that can influence a unit and maybe make that unit agree then issue out localized influences that re-inforce the messages..
So gabba posted his research and I started looking at voronoi diagrams and how it would affect such an AI as this. By adding more spatial awareness, the AI could overload with information processing. My thought is to generate an initial voronoi diagram and from that create 2, one that augments the map grid, by overlaying on top and having the vertexes and corridoors inbetween given attributes like the map grids, then from that zones are generated by generating a third voronoi diagram using the vertexes of the second as the points to generate the first. This would create a zone system, which itself would have attributes, but would give the AI a much better idea of what territory it had conquered, and could even be adapted for the player, creating the equivilant of borders and conquered are representations as seen in xxx(forgotten name of game).
Thus the AI could earmark a set of these zones as targets that it needs to conquer, or a corridoor in the second diagram as a good point to take, or to create barriers, such as walls of DT to protect them by building them across a corridoor or around a zone in the the 3rd voronoi diagram, or along the border.
Further more this could be enhanced by making scouting position a list of interesting places for a unit to consider visiting. These would be the detected mex hotspots, the vertexes on voronoi diagram represent large open spaces, the ajoining lines represent coriddors of mobility and paths between spaces. Starting positions could also be read directly from the map file and checked by the AI.
The vertexes being open spaces would also allow for much better generic building placement, by allowing buildings simply to be placed around these vertexes, otherwise the existing algorithms would mean that paths and coridoors would end up blocked or filled with defences that couldn't be used, and any number of congestion problems.
This also adds the better attack co-ordination by showing multiple paths to the enemy, and allowing extra weights to be added by calculating trafficability, and coverage etc as shown in gabbas research, which when combined with the map grid I discussed above would lead to a bigger improvement in how an AI uses its experience.
On a side note:
Anti AI tactics for other AI's
Versus JCAI
Build lots and lots of cheap units. JCAI doesnt account for lots and lots and lots of weak units.
versus AAI
Mess with its learning, send out lots and lots of very cheap and inneffective units of a certain type so that AAI is encouraged to build a certain type of unit. Then send out a good task force and the lack of a decent mixture on AAI's behalf would be its downfall.
OTAI
Get the player number and allyteam of OTAI then peek at its stored information in the AI buffers, change it if you want to play dirty tactics, or use it to detect OTAI then make judgements about what its doing and how to defend.
NTAI & ZcAIn
build lots of unreclaimable features on mex spots and places you dont want it to build. This should mess up the interfaces ClosestBuildSite enough. If not place mines. A minefield of weak mines should be enough to stop NTAI effectively attacking you if its replensihed, and it should halt NTAI's base creep effectively if huge range low damage mines are placed in strategic positions.