Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AI and Ghosts #4

Open
GoogleCodeExporter opened this issue Aug 8, 2015 · 0 comments
Open

AI and Ghosts #4

GoogleCodeExporter opened this issue Aug 8, 2015 · 0 comments

Comments

@GoogleCodeExporter
Copy link

1) Ghosts (and creatures in general too) should estimate HOW LONG THEY CAN 
SURVIVE. 
2) Based on that, they may choose one of the 2 general tactics - "the selfish" 
tactics (if calculated that we can win), or the "kamikaze" tactics (if we know 
more or less for sure that after N rounds we will DIE)

Ghosts should calculate every enemy troops with this formula:
"N" of ghosts before attack PLUS "X" killed enemies MINUS "Y"ghosts, killed by 
retaliation attack. The higher the number - the more "tasty" the victim troop 
is. If the caclulation returns negative result - the troop is deadly, and the 
attack is suicidal. If the number equals zero, we should attack that troop if 
no better victims are present on the battlefield.

Enemy troops from the ghosts' point of view can be classified into based on 
attack preference:
1) DEADLY - negative attack ratio
2) "not interesting" - zero attack ratio
3) "best victim" - highest attack ratio
4) "most harmful to enemy" - these are troops with worse ratio, but of great 
strategic importance to the enemy (i.e. archers)

The win strategy for ghosts is: 
1) STAY ALIVE - never attack deadly dangerous enemies
2) always prefer "best victims", only except cases when there's an enemy archer 
that can kill us ranged.

If we calculate that we can survive only N rounds - we must choose the kamikaze 
strategy.
1) Our #1 goal here is to attack the "most harmful to enemy" and kill as many 
as possible.

Here are several situations with comments:
1) 10 ghosts vs. 20 peasants, 20young mages, and 1 dragon.
round 1 - dragons move and kill 7 ghosts. 
Our calculations are that we will survive LESS THAN ONE round. 
Decision - move forward. Attacking dragons is useless (kill 0, instant death) - 
but there may be a chance that young mages may have bad morale or skip turn.
Next decisions will be based on the future situation.

2) 10 ghosts vs. 20peasants, 20young mages, and 1 dragon.
round1 - dragons move - but not attack, just move in our attack radius.
We calculate that we may WIN! Our goal is to wait until young mages skip their 
turn/or attack from max. distance at half damage, then move closer. 
round2 - dragons attack ghosts, and leave let's say 3-4 alive. Our turn, we 
feed on the best victim - young mages (so that their attack will be 1/2damage, 
and then on peasants, and we kill the dragon the last.

Original issue reported on code.google.com by [email protected] on 15 Jul 2010 at 11:21

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant