rustrogueliketutorial icon indicating copy to clipboard operation
rustrogueliketutorial copied to clipboard

After 4.14 Better AI, if a player kills an enemy and immediately tries to move into the tile, it is still blocked

Open Simpuis opened this issue 6 years ago • 5 comments

Have been able to reproduce this in your web assembly version as well, bug is not present in section before Better AI and appears in the Better AI chapter. Kill an enemy and then move into that enemy's spot without letting a turn pass and the game ignores it, like the tile is blocked.

Simpuis avatar Dec 20 '19 15:12 Simpuis

The map indexing system never reruns after damage, as such an enemy can have been killed, and then the player gets his turn, without the map indexing system running in between. A simple fix for this would be to have delete_the_dead unblock the tile, although there might be a better way where delete_the_dead doesn't have to handle it.

Simpuis avatar Dec 21 '19 13:12 Simpuis

Thanks! This has been on my "to fix" list internally for a bit, I'm pondering how to redo the indexing system to be a bit better about this (and catching mid-turn updates in general).

thebracket avatar Jan 14 '20 14:01 thebracket

Any news? What is the design rationale behind the indexing system at all instead of simply grabbing entities' position components when it's necessary? It's fast enough in Python (!) so speed is not a concern!

Zireael07 avatar Mar 01 '20 12:03 Zireael07

What is the design rationale behind the indexing system at all instead of simply grabbing entities' position components when it's necessary?

1.6. Dealing Damage > Indexing what is where

One way to do it would be to iterate the Position components and see if we hit anything; for low numbers of entities that would be plenty fast. We'll take a different approach, and make the map_indexing_system help us.

smokku avatar Apr 02 '20 20:04 smokku

Sorry about the slowdown, I've been working ridiculous hours. The indexing system mostly exists to prevent everything from needing to be able to reach into the ECS world and iterate positions, over and over again. I'm replacing it with an API-based system that is significantly more robust and easy to fix. The new chapter 57A starts this, and I'm gradually applying it to new chapters.

thebracket avatar Apr 16 '20 19:04 thebracket