Advertisement

AI conquest deadlock

Started by March 24, 2015 05:53 PM
18 comments, last by Krypt0n 9 years, 9 months ago

I made a "perfect" AI :D It calculates what planets are best for conquest, take into account distance from their homeworld, lenght of the current and future borders, etc. It makes decisions at that level very intelligently.

And it does not work at all :D

The problem is, another AI calculates these variables too and sooner or later (with the stress on the "sooner" part) two AIs want exactly the same planet. And they send thousands and thousands of ships so these can die on the orbit of the planet since another AI sends a constant volley of reinforcements there too :D Also, since the player can accept loses and does not fight "to the death" (accepting conquered planets that AI disires a lot) the AIs tend to ignore the player.

So the effect is 2 AIs fighting over like 2-5 super important planets (where ownership changes all the time and no one gains anything) and leave vast area of less desirable planets untouched, and the player can grab any number of these without a fight :)

Ugh... :D Ideas how to fix it?

Stellar Monarch (4X, turn based, released): GDN forum topic - Twitter - Facebook - YouTube

factor in difficulty and risk?

Possibly exploration, or colonization size?

From what I understand, the AI should be fighting over those planets if they're "super important". However, they should dedicate a much smaller group to spreading/exploring safer areas.

Advertisement

Ugh... biggrin.png Ideas how to fix it?

Randomness.

Humans tend to be somewhat unreliable at crafting perfect strategies. Add some RNG-based 'miscalculations' to your AI, and they should stop prioritising the exact same planets as each other.

Tristam MacDonald. Ex-BigTech Software Engineer. Future farmer. [https://trist.am]

Some thoughts:

Make the AI less binary all or nothing. Have it set a primary and secondary target, with the primary target for colonization being the most desirable, while the secondary target is one that is less desirable but easier to get.

Have the AI realize an area is hotly contested and give up on trying to hold it, if it keeps changing hands.

And, while I echo randomness, what you may want to do is assign random personalities to each AI. An aggressive expansionist may do as they are now, constantly fighting over the 'best' planets. A turtle AI may prefer nearer planets of 'desirable' planets, just slowly growing and consolidating it's territory. A sneaky AI may prefer conflict only where they can bring overwhelming forces to bare, and leave 'desirable' planets alone if they constantly lose them. This makes their behavior more consistent, and reproducible, and they won't start ping-ponging back and forth between two decisions.

You may also want to give AIs different goals. Maybe one's concentrating on economy, so planets with highly tradeable resources are more desirable. Maybe one is concentrating on building dreadnaughts and so wants metals or radioactive materials. One might want to increase it's population, so wants farm planets more. Etc. Or alien races that require hotter / colder / higher grav / lower grav / toxic atmospheres, so that 'best' planets are entirely different per race.

It sounds like you're saying the 2-5 planets are super important, but not super important enough to send your entire army there. Or are you saying it's important enough to send your whole army, but not if both AI's always pick the same 2-5 planets?

For the first issue, give the AI a value for just how important it is. What number of ships is worth losing to try taking that planet? For the second issue, you can give a variety of strategies. One might focus more ships on one of the high value planets, instead of weighing them equally, to ensure a decisive victory over it. This works because you don't know what opponents might be sending there. Another strategy might be to spread military out more, taking a large number of lesser planets, leaving the highly contested planets for the other players to fight over. You can also have the AI pay attention to how much other players have sent to the planet. Maybe they become averse to a planet after suffering too many losses.

Radiant Verge is a Turn-Based Tactical RPG where your movement determines which abilities you can use.

It sounds like Transport Tycoon AI routes :) due to short range planning

justin.gif

Seems AI needs a SWOT analysis including big picture rather than gambling on "best" planet.

Better don't let all go for blonde :)

mostates by moson?e | Embrace your burden

Advertisement

The AI should consider the expected cost of conquering planets and the expected loss of leaving planets undefended and use, for example, a randomized strategy. If planet A is worth 50 and, being under attack by someone else, costs 40 to conquer right now, undefended planet B that is worth 20 and costs 10 to conquer is equally good and it should be chosen as an invasion attempt target with the same probability as planet A, or more often (possibly always) because planet A is an excessive commitment of limited armed forces.

Omae Wa Mou Shindeiru


Randomness.

This.

Just use a pseudo random distribution depending on the position of the home planet. This way different home planets will have most important planets which are different from other civilisation. A simple pseudo random approach, which will deliver always the same random value relative to the home planet, is a perlin noise lookup (lookup=location of target planet, offset=home planet location). Considering the nature of perlin noise, then not only single planets, but whole areas get higher or lesser prioritiies.

I think your "perfect" AI needs to be smarter smile.png

It's obviously not really a good strategy if it can easily be beaten by sidestepping the AI.

DifferentName and LorenzoGatti has some good points, it's not a sane strategy to always just go all in on the most important planet, you should also consider where other agents are, and what can be conquered for low cost.

Also, adding some personality besides just random factors could be fun. Maybe some faction is very vindictive, and like to punish other factions that attacks them. Maybe some like to prey on the weak. Etc.

Your AI should not know about every planet. They should slowly build their knowledge from what they have nearby. By proximity, it is impossible for them to fight it out for the same planets at first (though it is perfectly ok for them to fight it out later).

Also, consider resistance/stability. You should artificially inflate the value your AI awards to planets based on how easy they are to retain (in such a way that they might claim back a planet they've lost once, over trying to re-conquer that highly prized planets where 100B have died).

This topic is closed to new replies.

Advertisement