Advertisement

Combinations and permuations

Started by October 18, 2010 02:19 AM
0 comments, last by IADaveMark 13 years, 11 months ago
Hello!
I am making a castle defense style game, where are 2 castles. Player castle and enemy castle. There are 3 different units to hire:
Swordsman, archer, horserider.

The units have points:
Swordsman(1), archer(2.5), horserider(3).


Player has made archer and swordsman. Total 3.5 points.
The AI have to understand the serious of the threat. The higher the points the bigger is the threat.

Now the AI have to make some soldiers to defend itself. So it have to hire soldiers whose total points are little bit higher than player points. It have to make the table and watch witch combination gives result where the points are a little bit higher than player's soldier points amount.

Here's the table that helps to understand:

http://img34.imageshack.us/img34/9097/picyk.jpg


The problem is that player can make up to 5 soldiers whose maximum points can be 15.

This means that AI have to also make a decision where it's points are the same this means that the table can be like this:

005
050
500

400 4 swordsmen
040 4 archers
004 4 horses
104 1 swordsmen, 4 horses
014 1 archer, 4 horses
401 4 swordsmen, 1 horse
410 4 swordsmen, 1 archer

the combinations can also be:
212
302
221
113
etc etc


How to make this kind of tables?
Why are you making a table in the first place? Why can't you just use the values of the units, the total value of the army and use that value to make decisions?

You're making this harder that it should be.

Dave Mark - President and Lead Designer of Intrinsic Algorithm LLC
Professional consultant on game AI, mathematical modeling, simulation modeling
Co-founder and 10 year advisor of the GDC AI Summit
Author of the book, Behavioral Mathematics for Game AI
Blogs I write:
IA News - What's happening at IA | IA on AI - AI news and notes | Post-Play'em - Observations on AI of games I play

"Reducing the world to mathematical equations!"

This topic is closed to new replies.

Advertisement