Tactical AI for Wargame

Started by
20 comments, last by Woody FX 20 years, 3 months ago
Personally I don''t think influence mapping is going to help you much with such a small play area. But good luck anyway.
Advertisement
Maybe your right Kylotan but I think I will be using it as I have not come across anything else that I can see solving my problems.

Will post back during the week once I get a start into it.

But I still think it will de the most difficult part of the game to get right. As I feel AI makes a game.

I''m confident I’ll get it, but I know I’ll be back here looking for peoples opinions again

Thanks
Just a couple of thoughts that may or may not help in your decision process. These are the sorts of high level things you need to determine before you design your AI, because they typically determine the AI tools/techniques used.

1) Do you want individual units to move and make decisions by themselves, move and act in concert with their surrounding characters/unit, or accept orders from the Commanding Officer of the army?

2) If you want to go with the CO approach (which is most likely), do you want a heirarchical approach to orders? I.e., the Army-CO says 'Archers attack the left flank' and the Archer-CO determines how to do this?

3) Alternatively, do you want an Army-CO that micromanages every decision on the battlefield (down to which units/troops move to which positions, which units/troops retreat, etc)?


On an agent level, you'll want to at least implement a state machine for each indivual troop so that you can manage their actions and state changes. Your AI is really just the mechanism by which you choose an action to achieve a desired state change for each unit.

Other thoughts:

Because their is an opposition player, a game tree approach suggests itself for evaluating moves. HOWEVER, I'd actually suggest that you don't do this, simply because of the computational resources required to expand a single layer of the tree: each side has 20 units and each unit has at least 3 actions (Move, Attack & Retreat). Thats a large set of combinations to consider. To get an estimate of the search space, multiply the number of units by the number of actions and raise the result to nth power, where n is the depth of the search you want to consider. Thats the size of the state space at depth n, given the current state.

Personally, I would use a combination of Influence Mapping (for analysis of the important tactical areas of the battleground) along with Utility Theory for an assessment of the value of action outcomes. The basic premise is to determine the tactically sensitive areas on the map and move appropriate forces in to maintain dominance in those areas, or an ability to interdict into those areas when needed.

There is, of course, another level at which to understand this problem, which Kylotan was discussing... and that is the relationships between units. The rules of the game and the functionality of units will generally dictate the sorts of relationships that can be formed. For example, Archers might be able to shoot at targets up to 3 hexes away. Therefore, Archers can attack a hex that a melee attacker may also be attacking. We might designate this as 'support fire', or 'supression'. Thus, we might write a functional notation representation of this relationship: suppress(archer_unit_1,enemy_pikeman_unit_7). Or, in terms of the relationship between friendly units, we might write supporting(archer_unit_1,swordman_unit_13). Thus, if we had a system for deriving actions for the battle, this might be one of the outputs of this system. The sorts of relationships that can be formed will dictate the gameplay and hence dictate the sort of AI that you need to play the game on behalf of the computer (which is what Kylotan was trying to get at, I believe). You need to write all of these things down. You need to decide exactly how units could work together within the scope of the game rules and then you should sit down and run through a battle (or ten) on paper. Write down all of the things that you think are relevant to the analysis of the battle scene. Write down all of the things that you think are relevant to the decision process of a player of this game. Once you have this information, then and only then are you in a position to choose the right AI representation and tool for this problem.

I hope this information has helped. I'm more than happy to discuss any aspect of this thread with you further, so don't hesitate to ask more questions or pass on more information!

Cheers,

Timkin

[edited by - Timkin on January 18, 2004 11:38:31 PM]
quote:Original post by Predictor
You might try a fuzzy logic solution. I am thinking of a system which accepts some basic assessments of the current game situation, and outputs broad strategic indicators, like:

if LEFT_FLANK is CRUMBLING then ADVANCE_LEFT_RESERVES

The fuzzy part wouldn''t need to be terribly precise, so your hardware constraint shouldn''t matter.

-Predictor
http://will.dwinnell.com



I think thats a good idea, if you defined lets say 5 units as the left flank when they were deployed, and 3 as the reserves, then when lets say 3 units from the left flank are destroyed, you move up the 3 reserves. I have no expierence in AI but it that would make it pretty easy i think.
quote:Predictor wrote:
You might try a fuzzy logic solution. I am thinking of a system which accepts some basic assessments of the current game situation, and outputs broad strategic indicators, like:

if LEFT_FLANK is CRUMBLING then ADVANCE_LEFT_RESERVES

The fuzzy part wouldn''t need to be terribly precise, so your hardware constraint shouldn''t matter.



quote:Squirell responded:
I think thats a good idea, if you defined lets say 5 units as the left flank when they were deployed, and 3 as the reserves, then when lets say 3 units from the left flank are destroyed, you move up the 3 reserves. I have no expierence in AI but it that would make it pretty easy i think.



Given the hardware limitations, I thought a straightforward fuzzy logic rule base was a realistic and flexible option. Let''s review: "No Floating-point calculations. 33mhz cpu. 256kb(yeah kb) of Heap space. (the total game needs to be just under 52KB".


-Predictor
http://will.dwinnell.com




On the Game Boy Advance there is a very highly regarded strategy game Called Advanced Wars.

I have never played it but it is supposed to be fantastic.

Does anybody know how the AI is done for that??

Though i think it is probably a whole lot more powerful than the platform i going for.

Thanks for all your input
Actually i dont think the combat is Tactical to the same extend as a board game(hex) so its probably not a example.

Brian
Hey Woody FX, I''m on the same trouble here, I''m doing almost an exact game; and this one is my last practice before I leave college (soot, my english is kinda poor here). I''m using squares in a 2d scenario, my battles are sopposed to be historical of the Independence war of my country (Bolivia), so I''m using only 3 types of units: Infantry (with rifles and knifes), Cavalry (with swords) and Cannons.

I already made the UML diagram of the final product, now I have to actually program the thing (only one battle, the most important one). I haven''t decided the tool for doung it and since my PC isn''t the state of the art right now (Celeron 500, 196 RAM) I''m probably using only VB and MatLab.

I plan to use a vectorial matrix (vectors within a matrix) for the scenario and my troops won''t have any ''panic'' meter.

I''m sorry if this whole reply text is useless right now, but I just wanna make you know. I''m doing some research right now, and be sure I will be posting some reply here but later on.

Anyway, why don''t we get in contact for future references?, you can write me to:

walt20977@yahoo.com

Play well, play hard, play more!
Hi Woody,

I don''t think anyone can give you 1 right answer to your question. Here is an idea though:

Consider your problem as such: Given n units, each with an offsenive and defensive score, what can you do within one turn to maximze these scores?

Different units must have different attack / defensive abilites against other units. Therefore their proximity to these units would be one influence. ie) knigths -vs- archers would be bad for knights, good for archers.

Topographical Position is another influence of this score. Being atop a hill would give you an advantage (depending on how you wrote your game).

So what you have to do is figure out how to position each piece so that you can maximize the total attack and or defence.

One way to do this would be to statically precompute a score for each type of unit at each point along your terrain. Then modify this map based on the positions of friendly and enemy units.. Consult with this to figure out where to make each move, for each piece. You would then modify this map by adjusting for the proximity of any adjacent units.

To make your AI more aggressive / passive, you would probably want to modify how important defence and offence are to your evaluation.

So this will give you a way to make short term decisions. To make long range strategic decisions you can do all kinds of things-- if it were me, I would sit down and figure out a few different strategies that you think will work, and have your program pick one of these randomly (or not).

It''s not exactly a perfect solution, but hopefully it will give you an idea or two. I can think of a number of ways to improve this.

Best regards,
Will
------------------http://www.nentari.com
Hey Will,

Yeah i''ve plan has begun to form in my mind about how to handle this!

I will maybe get units to work together and work out how to maximise the score for all units on each turn.

Working out the odds on each unit probably winning there battles and been safe in the next turn and try and keep a well positioned cover unit (or 2) at the end of each series of turns by the AI to join in the Attack on any of the player units that didnt perish during the earlier attacks of it will be kind of like chess ( except you can move all your pieces on each turn.

So maybe influcne mapping may not be needed.. though i would like to give it a try.

I mailed you about a certain Alliance a few days ago. Did you get a chance to take a look?

This topic is closed to new replies.

Advertisement