Those frustrated Monsters!

So I've continued to look into why it seems like the AI is able to get around monsters easier than humans.

I know what the code says but I also know what I see with my own eyes.  

I've finally reached a conclusion as to why it seems like AI players don't get attacked by monsters as much -- it's all in the movement.

Elemental games are based on a simulatenous move system. This is a hold-over from War of Magic which was a multiplayer game.  

The attacks, however, occur based on hit detection. That is, a unit moves into a tile, it sees if there is a unit there and if so, a hit occurs and that is worked out.

If human beings were fast enough, they could avoid getting attacked by monsters simply by moving their unit before the monster moves into that tile. As a practical reality, humans aren't fast enough.  But you know who are? Computer players.  

Picture this scenario:

for i = 1 to number_of_players

MoveUnitsforPlayer(i)

Where the monster player is the last player to move.

So what happens is that a monster will target say a pioneer on turn 50.  On turn 51, the AI player moves its unit and the monster moves to the tile the AI unit was in (missing it). This is exacerbated when they are off screen since movement is instant when there's nothing to animate.

That said, I can assure you that the monsters do attack cities just as often as human players. Statistically, it's the same amount and I have added code so that the AI will occasionally when when one of its cities gets destroyed by monsters to better communicate that yea, the AI has a real problem with monsters city-wise.

But unit wise, it's going to take some thought on how to do this.  Most of the easy solutions would result in late game turns taking much longer (everyone moving at once is great).

I may, just to be a bastard, reverse the order of moving so that the monsters move first. :-)

 

15,189 views 17 replies
Reply #1 Top



I may, just to be a bastard, reverse the order of moving so that the monsters move first.

End of quote

I would go for this one :), at least then players would see the AI get pounced on more-often.

There is another method to try with the simultaneous moves. One could try the pause to attack method, where if I have a stronger army than you, I will wait to take peak where you are going before I actually move, so I can pounce on your stack and win a battle. Basically have the unit peak at the unit it wishes to attack and see where it is moving to and then move to that location (basically leading the target if we are speaking about shooting). This will be an imperfect solution, but it will prevent the ring-around the rosy scenario that plays. Of course there are other logic checks that need to happen, like if they want to attack and they want to attack, who should perform that attack... scenario. Simply put the monster shouldn't move in that case the "weaker" stack should move.

As always I would love to see what solution you provide and I like the monsters moving first...

Reply #2 Top

don't know what's wrong with monsters moving first? i mean - the player practically moves last anyway, so from the human POV nothing really changes. you could perhaps implement it in an opt-in beta or one of your frogboy special builds and let players try it out. if it doesn't work, you can still go for a more complicated solution.

Reply #3 Top


 I have added code so that the AI will occasionally when when one of its cities gets destroyed by monsters to better communicate that yea, the AI has a real problem with monsters city-wise.

End of quote

I think this is an important step so it's a little more transparent.  Monsters moving first is probably ok, I agree that maybe in a beta first.

Reply #4 Top

Have your AI actively update a table that contains ALL units' pathing coordinates, and pass this to MoveUnitsforPlayer(): checking for combat interceptions before enacting.  The amount of the table that needs to be passed/checked could be limited by adding a relative location threshold equivalent to the highest possible movement range, and/or by organizing the table cartographically.

However, I don't know what parts of your AI are actively computed during the player's turn, and which are relegated to the clicking of the Turn button, so consequentially I'm not sure how processor/time-consuming or feasible this notion is.

 

Edit:

If the monsters and denizens of the wildlands are the only "faction" that determine combat scenarios by a sort of collision detection, then just have them go first.  That is.. assuming all the other AI factions compute proximities and plan out combat scenarios.  If so, my notion above is null and void; monsters first.

Reply #5 Top

Monsters move first is fine.  From the player's perspective that is how it already works anyway.

Reply #6 Top

Thank you Frogboy!!! One of our number one gripes! Monsters moving first is a great start to fixing this!

Reply #7 Top

Figured this out as early as oct 3rd 2013 :P

 

https://forums.elementalgame.com/448682/page/1/#3401162

 

If you don't wanna read the whole thing, tldr: version is.

"Edit: Oh to solve this problem... Its very easy, just let the Monsters and ruffians and wildlands have their own turn phase instead of simultaneous turns. And then, human players will witness lots of murdering going on instead of being hidden. Barbarians in Civ 5 have their own turn phase they murder AI units. Fix plz stardock."

Reply #8 Top

Quoting Ericridge, reply 7

Figured this out as early as oct 3rd 2013
End of Ericridge's quote

older

still

Reply #9 Top

@cardinal, it's not remotely that simple unfortunately.

The movement system is asynchronous to the movement command system. The AI and the unit objects post (as opposed to send) their messages to move and the move takes place async.  The plus side is that it dramatically reduces the turn-times (see Civ V for the other way) but on the down side moves can't be course corrected (which they can be in Civ V).

Reply #10 Top

Just for the sake of argument; the monsters and the ai need a plan before the turn ends.  If their turn ends in the same square 'presto'.  it's al' dente'

Reply #11 Top

I used to play FE with <CreaturesMoveLimit> set to 2 or higher, and not only was the strategic map more fun, but also - mobs had no problem catching moving targets.

Just food for thought.

Reply #12 Top

That's pretty good idea cardinal, that would force me to stop lots of my chessy tactics cuz I exploited that the monsters only can move one tile a turn. xD Definitely will make me lose few armies XD

 

Even that wolf army is a threat is I get wounded decently by darklings early in the game. :P

 

Cuz i do this alot, burn all movement next to monster. Then Pass to next turn so that i have all movement again, and proceed to attack that monster lair and then retreat. Monsters cannot retaliate anymore. Especially if the trolls was next to darklings.

 

And the problem about AI getting all the powerful monsters at their starting places.. is quite actually easy to solve problem.

Just make the map bigger. That's all. Atm, Huge map of FE:LH is like 1/10th the size of Huge maps for Civ5 by default.. <_<

Then you can finally give AI starting places weaker monsters too with powerful monsters deeper in and they'll get mulched less by monsters at the start.

 

I know what the AI felt like once, My starting place was nesting ground for Forest drakes. Seriously. I had to go everywhere with fullblown army just to ensure that forest drakes won't try to murder me until I was ready to kill them. And there was tons of pack drakes running around in my lands because of those forest drakes spawning them. My first village was just six tiles away from a forest drake's nest, or was it 12.. ach, been like a month since i finished that map. But it was the map where I learned that Boar spears is good weapon.

 

As it is at the moment.. you're waging a war for the ownership of islands, a island that somehow have lot of varied terrain, magic ftw.

Reply #14 Top

Quoting Frogboy, reply 9

@cardinal, it's not remotely that simple unfortunately.

The movement system is asynchronous to the movement command system. The AI and the unit objects post (as opposed to send) their messages to move and the move takes place async.  The plus side is that it dramatically reduces the turn-times (see Civ V for the other way) but on the down side moves can't be course corrected (which they can be in Civ V).
End of Frogboy's quote

I've complained about, er, commented on the simultaneous move system on and off over the years. I know it's not possible to change (heck, probably hasn't been since WoM was even a month into development), but I'm really not sure the late-game turn-time trade-off was worth it (putting aside multiplayer) (this is said having spent a decent chunk of my life waiting for Civ5 turns to end). I also find it sometimes produces a confusing results when three (let alone four+) players are all acting around the same area.

I am somewhat curious what Frogboy/Kael/etc think about it, in retrospect. I'd guess that the turn-time savings are significant and my complaints are relatively minor. I wonder what GalCiv 3 will use?

Reply #15 Top

Monsters move first period!

Reply #16 Top

Monsters move first solves the most obvious problem of monsters missing the AI, but the underlying problem still exists and will be visible with the AI struggling to target each others armies.

It would still be a worthwhile improvement though.

Reply #17 Top

Quoting Mistwraithe, reply 16

Monsters move first solves the most obvious problem of monsters missing the AI, but the underlying problem still exists and will be visible with the AI struggling to target each others armies.
End of Mistwraithe's quote

I think the reason this issue is more prevalent with monsters is because they can only move 1 tile per turn... I wouldn't be able to catch anybody either.

 

Edit: otherwise, if you look at Frogboy's AI as more of an RTS AI that pauses until you hit the Turn button it might make a bit more sense - it did for me.  Encounters don't really need to be mutually calculated by all factions (global AI) to ensure intersecting paths and plans, any more than they do in multi-player RTS games.  Player A acts according to their strategy, Player B acts according to theirs: they clash at times.

All the game needs is a system for tactical battles and simultaneous-turn multi-player would be within reach.  I'd support a Kickstarter for it.