Skip to content
This repository has been archived by the owner on Nov 3, 2020. It is now read-only.

Fix infinite loops in Combat AI #96

Open
darkf opened this issue Feb 13, 2017 · 2 comments
Open

Fix infinite loops in Combat AI #96

darkf opened this issue Feb 13, 2017 · 2 comments

Comments

@darkf
Copy link
Owner

darkf commented Feb 13, 2017

Can happen in several situations. I've noticed with the final challenge in arcaves, as well as in Klamath Downtown.

If it finds itself getting into an infinite loop it should report that and provide more information.

The logic should also be inspected and possibly cleaned up.

@darkf
Copy link
Owner Author

darkf commented Dec 17, 2017

I've added a failsafe recursion bail-out in case this happens.

I also fixed one of the causes: combat wouldn't end when changing elevation, so combatants on the old elevation would still try to walk towards / attack the player, which isn't possible. It would then get stuck being unproductive and softlock the game.

The rest of the logic should still be audited...

@darkf
Copy link
Owner Author

darkf commented Jan 6, 2018

NPCs now prefer the closer targets instead of arbitrary ones.

NPCs should stop trying to target NPCs they can't see (don't have a line of sight / objCanSeeObj) or have a path to, so they don't try to creep towards an NPC across the map or inside a room.

In fact, NPCs in rooms might not even need to be triggered as hostile. This should be checked.

# for free to subscribe to this conversation on GitHub. Already have an account? #.
Projects
None yet
Development

No branches or pull requests

1 participant