Conversation
makeMonster() places the monster on a river tile, and doMonsterSprite() kills any monster whose hot spot is over water, so a spawn was killed on its first tick while still standing on the river it appeared on. That function also ends a monster that comes back within 60 px of origX/origY, which initSprite sets to the spawn point, so a monster turned for home and vanished with 712 of its 1000 ticks left. Gate both exits on count, which initSprite sets to 1000 at spawn and the turn-for-home transition resets, so the monster lives at least MONSTER_SPAWN_GRACE ticks. The count != 0 term stays, preserving the exhaustion semantics. The window has to be that large. The monster moves 2 pixels a tick against 16-pixel tiles and keeps stepping back into the water, so a 20-tick window moves the death to tick 20. Measured over 40 spawns per setting, seeds set before the city load so each run starts from the same world: with no window 4 monsters die within two ticks and 16 within 100, with a 20-tick window none die before tick 20 and 16 still die within 100, with 500 none die within 100 and the earliest is tick 214. 500 is the figure micropolisJS uses for the same check (monsterSprite.js: tileValue === RIVER && this.count < 500). A monster can still be killed earlier by leaving the map, which doMonsterSprite() ends with a c == -1 test of its own.
jquast
marked this pull request as ready for review
September 29, 2026 17:15
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
makeMonster() places the monster on a river tile, and doMonsterSprite() ends a monster whose hot spot is over water, or one that comes within 60 px of its spawn point, so a spawned monster died almost immediately.
The same eight spawns after this commit:
simcity-monster-fixed.mp4
Depends on #15 (the loader fix) and #20 (the monster bindings) to run the commands above.