Are you, in fact, a pregnant lady who lives in the apartment next door to Superdeath's parents? - Commodore

Create an account  

 
AI overland movement

A thread for discussing the MoM in-game AI.

Please note: the thread title is focused on the current negative, dysfunctional AI. I know that everybody and his brother too can suggest a great and complicated algorithm that would work perfectly or works in game XY. But it's impossible in 99% of cases to implement something into the game architechture if you don't know how it is built, how many space is there in the code, how many man-hours it would take to accomplish your suggestion.

So this thread focuses more on the phenomenology of the MoM AI. Let's describe what's wrong on different stages of game AI, let's suggest (in general way) what could be better, what should AI treat differently, which cases it should discern.


Important notes:
1) Repairing whole parts of AI takes a LOT of time (repair feature X, test, new trouble in feature Y, repair Y, trouble in X again...). I am not prepared to do it unless it improves the game experience in a massive way.
2) I will not reveal and describe the AI routines, unless really necessary. I believe a game should conserve its AI secret, because one of main goal of playing single player games is "to beat the code", to find the AI weaknesses. If they're revealed, the game gets ultra-boring.


TO PONDER list
--------------------

Major
- AI would aggressively use flyers, floaters and ships against ships of a wizard (AI or player) [b0rsuk]
- move floating islands to island towers
-

Minor
- Floating Island usage (earlier plus some extra conditions?) [b0rsuk]
- base continent expansion on personnality [SDragon]
-
Reply

Floating Island

Floating Island fills much the same role as ships, but should be easier to fix as far as algorithms are concerned. The AI never uses Floating Islands.

You admitted in a PM that while AI now uses ships, it has some problems. Most notably AI uses suboptimal paths. It can look roughly like this:

1. Build infrastructure (city near water, shipyard...)
2. Find a ship
3. Travel potentially very far with the ship to an army that needs transport
4. Load units to the ship and transport them.

It's complex considering AI must have cities near water to build a shipyard, must build the right buildings, produce a Trireme, and only then it can transport units. Doing this effectively requires good planning ahead, and can be complicated.

Fortunately, there's a common Sorcery spell Floating Island. Using this method, AI would be able to completely skip points 1 and 2. (Ok I admit I have very foggy idea how does the algorithm look like). But, in any case, it sounds a good deal less complicated than transporting with proper ships. Because it's a common spell, many AI wizards would benefit from it. It's a low-hanging fruit.

I propose the following general algorithm:

1. Check if you can cast the Floating Island spell
2. Find a group of units* or an important unit** which would benefit a lot from being transported across water
3. Advance that group or unit towards water
4. Summon Floating Island
5. Load units and transport them
6. Unsummon the island immediately after crossing water***.

* Floating Island is much more cost effective than Water Walking if you can transport several units at once. Casting cost is the same: 50, and maintenance is 1 and 5.

** Important units would be mostly Settlers.

*** The island is expensive to maintain

I hope this doesn't sound patronizing. I'm just trying to help :-).

-------------------------
I don't like your point 2. This sounds like security through obscurity. it also contradicts one of points in Philosophy section of Dungeon Crawl Stone Soup manual:

Quote:Things ought to work in an intuitive way. Crawl definitely is winnable without
spoiler access. Concerning important but hidden details (i.e. facts subject to
spoilers) our policy is this: the joy of discovering something spoily is nice,
once. (And disappears before it can start if you feel you need to read spoilers
- a legitimate feeling.) The joy of dealing with ever-changing, unexpected and
challenging strategic and tactical situations that arise out of transparent
rules, on the other hand, is nice again and again.
Reply

It generally works so:
AI does not build buildings with some real purpose, it just randomly chooses shipyard (which have a small RNG weight). Then, after a time, it builds trireme. Which waits. And waits.
And then comes an opportunity, the ship goes to a special focal point, picks up its cargo. And it leaves for a New world.

Similar with Floating island. The summoned unit is here (after a time), until opportunity arrises. It is hardly elegant, but it works. If it works, why break it? I could probably make FI summons happen earlier... Yes, I think I could do this.

Quote:which would benefit a lot from being transported
Hey, this is not an algorithm. How do you write "benefit" in assembler?

----------------

As far as ships go, I'd probably like to hear any suggestions about "when, under which conditions, should AI try to leave for other continent". I know how to change this, so we may discuss it.

Quote:security through obscurity
It is not about security, but about fun. When I start to think about the AI being a bunch of equations, I usually stop playing. I like the AI mystery and AI surprising the player. No surprise = boredom.
Reply

What if the ships AI behaviour are determined by the wizard personality types?

Expansionist essentially set as possible after turn 30?
Militarist could use number of armies as a determining factor. Armies > X?
Perfectionist might want at least 2-3 villages built up with the caveat at expansion occurs if there's no terrain for new hamlets.
Pragmatist might want 2 villages built and a set number of armies to guard them prior to expansion.
Theurgist might consider expanding if there's no more 'readily' available mana source on their continent.

Not sure if this would make the behaviour too 'predictable' but just throwing it out there.
Reply

kyrub Wrote:Similar with Floating island. The summoned unit is here (after a time), until opportunity arrises. It is hardly elegant, but it works. If it works, why break it? I could probably make FI summons happen earlier... Yes, I think I could do this.

If you decide to do that, it could be better to make FI summons happen earlier BUT cease or become less frequent once proper ships show up. If AI doesn't know how to summon an island in an emergency, then I don't see the point of making it use FI in later stages.

kyrub Wrote:Hey, this is not an algorithm. How do you write "benefit" in assembler?

Aren't you using a pathfinding algorithm at some point ? If changing movement type to swimming would significantly shorten* the path, I would consider it a benefit.

* or changing movement type to swimming would allow AI to attack juicy, otherwise unreachable targets.
Reply

The AI has plenty resources, so it's better to have it produce too many ships than too few. Would it be possible for it to keep a tally of its total naval power as a guideline for its decisions? Should be affected by the land mass setting, of course, so it'll give much higher priority to navy with a small land mass map.
Reply

b0rsuk Wrote:it could be better to make FI summons happen earlier BUT cease or become less frequent once proper ships show up.

Note taken. This is simple and you're right.

Quote:how to summon an island in an emergency
Again: try defining emergency. If you make a reappearing, valuable example of an AI-discernable situation with clear criterias, it could be done. And I would do it.


@Catwalk
The number of ships is already kept. (I decreased the max number because it was sky-high.) What decision you thought should be influenced by it?
Reply

kyrub Wrote:Again: try defining emergency. If you make a reappearing, valuable example of an AI-discernable situation with clear criterias, it could be done. And I would do it.

I'll be thinking about it. But it's difficult without knowing what the algorithms used are. One emergency definition idea could be like this:
"I have a strong army here and it would be able to reach poorly protected targets if it could swim. And no ships nearby."

Meanwhile, something that could be improved would be making AI ships more aggressive. Especially ships without cargo, galleys and warships. The AI could also be more agressive against ships controlled by player, since player will genrally have few but important ships. I dislike it a bit (different decision based on whether the enemy is player or another AI wizard isn't elegant). So if you want a more general solution which would also work against player, how about this: AI would aggressively use flyers, floaters and ships against ships of a wizard (AI or player) who has small number of ships.
Reply

Quote:making AI ships more aggressive
Ahh. Very good, this has totallly skipped my attention before. Added to the list above.

@SDragon
I'll copy your suggestion to the other thread about colonization / expansion / economy. Some interesting opinions, I'd like to use AI personnalities much more as well. But it has to be discussed thoroughly, I guess.
Reply

I got a better idea. Instead of summoning Floating Island in the early turns of the game, link it to the number of ships the wizard has on the same plane. The wizard would summon Floating Islands as long as he or she 1) has units on the same plane 2) has few or no ships on the same plane. This solution has all the benefits and is more future-proof. Implications:

- if for some reason AI loses lots of ships and/or the ability to build ships (loses cities with shipyards), in the mid or late game, it will still be able to recover using Floating Islands.
- It will help when AI goes through a tower to another plane. The AI may have enough ships on its home plane, but it will be a while before it will also populate the other plane with ships. This should be especially helpful for tiny tower isles.
Reply



Forum Jump: