dkfans / keeperfx

Open source remake and Fan Expansion of Dungeon Keeper.
https://keeperfx.net/
GNU General Public License v2.0
778 stars 78 forks source link

Fleeing units should teleport away #2825

Open Loobinex opened 11 months ago

Loobinex commented 11 months ago

Creatures, including imps, that flee, will refuse to use their teleport spell and instead will walk. This is not their optimal choice.

I've done some initial investigations, and it is unrelated to the minimum distance to teleport. The creature_combat_flee function calls creature_move_to and that one does not consider teleporting. However, if I do add the option to teleport into creature_combat_flee I get them to teleport, but inconsistently, so further investigation is needed.

yani commented 11 months ago

It might be a big change and could make lvl 10 imps almost unkillable.

walt253 commented 11 months ago

It might be a big change and could make lvl 10 imps almost unkillable.

I disagree. But maybe one could add a rule in rules.cfg something like TeleportFleeBehavior = 0 for the classic and legacy ruleset, but it's set to 1 for the standard ruleset.

yani commented 11 months ago

Maybe a fun mechanic would be to randomize the chances of them teleporting. It would look like they sometimes forget to teleport because they are too scared to remember that they can.

Putting a delay on the teleport or randomizing their chances would at least make them still able to get targeted.

Loobinex commented 11 months ago

Maybe a fun mechanic would be to randomize the chances of them teleporting. It would look like they sometimes forget to teleport because they are too scared to remember that they can.

Putting a delay on the teleport or randomizing their chances would at least make them still able to get targeted.

Teleport is not instant. They still take a meteor to the face even when they do.

yani commented 11 months ago

Teleport is not instant. They still take a meteor to the face even when they do.

As they should.

AdamPlenty commented 11 months ago

Teleport to where? How can we ensure they don't teleport straight into another battle?

walt253 commented 11 months ago

Teleport to where? How can we ensure they don't teleport straight into another battle?

To their Lair? That they should already do in case of Mistress with low health, I think?🤔

For the Imps I don't know... Isn't the Dungeon Heart their initial flee point?🤔

Loobinex commented 11 months ago

Teleport is not instant. They still take a meteor to the face even when they do.

As they should.

Damn straight.

Teleport to where? How can we ensure they don't teleport straight into another battle?

Where they would run to. Either a bit away, or possibly simply the 'flee pos', which is their lair or dungeon hearth. It's just 'why run when you can teleport'.