[GH-ISSUE #1218] Server tick stalls with many mobs on a scoreboard team #309

Closed
opened 2026-11-02 15:38:05 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @pirut on GitHub (Oct 22, 2026).
Original GitHub issue: https://github.com/horizon-rust/horizon/issues/1218

With mobs on a scoreboard team, the server tick grows with the cube of the mobs on the team: 100 mobs with half on a team cost 37.7 ms per tick, 500 cost about 4.3 s per tick.

tick_creature_entities calls mob_world_base for every mob. That rebuilds the player view (its allies set scans every mob UUID) and, with any scoreboard team, makes an owned copy of every mob's team, each a clone of the team's player set. Several mob queries (MobWorld::seen, the nearest-living-entity sensors, the look-at goal, FollowParentGoal, natural spawning's box checks) also scan every mob instead of the tick's position grid, which adds up past a few hundred mobs.

Originally created by @pirut on GitHub (Oct 22, 2026). Original GitHub issue: https://github.com/horizon-rust/horizon/issues/1218 With mobs on a scoreboard team, the server tick grows with the cube of the mobs on the team: 100 mobs with half on a team cost 37.7 ms per tick, 500 cost about 4.3 s per tick. `tick_creature_entities` calls `mob_world_base` for every mob. That rebuilds the player view (its allies set scans every mob UUID) and, with any scoreboard team, makes an owned copy of every mob's team, each a clone of the team's player set. Several mob queries (`MobWorld::seen`, the nearest-living-entity sensors, the look-at goal, `FollowParentGoal`, natural spawning's box checks) also scan every mob instead of the tick's position grid, which adds up past a few hundred mobs.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#309
No description provided.