CleverRaven / CleverRaven/Cataclysm-DDA
Monster idle movement does not adhere to monster speed / speed setting
- Dominant language
- C++
- Stars
- 13.1k
- Forks
- 4.6k
- Avg merge
- 2d 1h
- Merged PRs (30d)
- 205
Description
# Describe the bug
Zombies, and probably other monsters, wander (seemingly) aimless around as long as they didn't detected the player's character or other points of interest (sound, possibly also smell, as well as other creatures of opposing factions).
During this "wandering", they might move slower than usual - which seems reasonable, since Runner Zombies probably won't run in circles in their downtime.
However, some Zombies can also move faster than they should, (quickly moving Crawling Zombies), which should not be possible - at least not in players sight.
It's even more obvious when a player makes changes to the `Monster speed` option, as having it decreased does not effect wandering creatures.
# Steps To Reproduce
1. Set the Monster speed option of a fresh world to 1% and create the world (I suggest creating a new world, as changing the setting of the monsters speed in an existing world requires a restart of the game to take effect).
2. Create a character and give them the `Debug Invisibility`, `Debug Deodorizer` & `Debug Silent Walk` traits.
3. Spawn in a `zombie snapper` in a field (with no tall grass around, not sure if that affects it).
4. Observe how it moves around every few seconds (holding down `5` or `.` keys).
5. Stand a few steps back and remove the `Debug Invisibility` trait.
6. Painstakingly (or -fully) watch how it slowly crawls a tile about all 200 seconds.
# Expected behavior
I'd expect a monster to move at max it's "speed" setting (while also minding the global speed multiplier)... Especially if that monster has no legs (Crawler example) it probably wouldn't suddenly speed down the street.
# Screenshots
I was able to catch an example with a few Runner Zombies and a Zombie Dog which move repeatedly at 1 tile a second in a world with a 1% speed setting...:

# Versions and configuration
- OS: Windows 7 64-Bit
- Game Version: 0.E-8128-gc363e33 [64-bit]
- Graphics Version: Tiles
- Game Language: English [en]
- Mods loaded: [
Dark Days Ahead [dda]
]
# Additional context
* Just to clarify: You can observe this bug in normal gameplay, with a normal Monster speed setting. For example on the mentioned `crawling zombie`, which can move multiple tiles in succession while wandering, but should only be able to move 1 tile every 5 seconds (based on a monster speed of 20).
* Monsters that have a speed lower than 100 are not affected by this if the global `Monster speed` multiplier is set to 1% (as they can't move at all).
* As far as I can tell this bug (or part of it) exists since a very, very long time and could be what caused the behavior reported in #45768.
* It also might or might not be directly responsible for causing "jumping" monsters, as experienced and described over [in the forum by zantanzuken](https://discourse.cataclysmdda.org/t/have-zombies-speed-been-increased/25431/19?u=valase) and myself a few times.
* It's a bit weird that a monster with 100 speed - like the Zombie Snapper in my example and tests - has a movement speed of 1 tile all 200 turns/seconds if set to 1% speed and not 100 seconds (1 % of 100 is 1; moving on a tile that requires 100 move points; logically 100 seconds to move 1 tile) - but that's not part of this report.
* It's also possible to observe a similar behavior if the Monster speed setting is set to 1000% (moving a tile every few seconds instead of moving multiple times a second)... But as mentioned, it makes sense that they aren't jumping all over the place while they don't hunt anything, so this is fine.
Contributor guide
Research direction
No source file, test, or entry point is named. Start by reproducing the idle movement with the Monster speed setting and trace the code handling wandering monsters, including crawling and very low speed values. Done means idle movement respects the monster speed and global multiplier without unexpectedly moving too quickly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- game-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100