No trees around spawn causes game freezing #4293

Open
opened 2024-05-16 14:52:21 +02:00 by teknomunk · 1 comment
Member

MineClone2 version: tested both 0.86.2 and development master

What happened?

While investigating a world that caused gameplay to freeze repeatedly to the point of being unplayable, I found that the source of the large freezes was the function can_find_tree() inside mod/PLAYER/mcl_spawn when there were no trees around spawn. The repeated pathfinding attempts consumed large amounts of main thread CPU time every time spawn moved, and spawn was moving every 30 seconds.

What should happen:

The game should not freeze periodically.

Steps to reproduce

  1. Load the world in the attached zip file.
  2. Watch the debug log for world spawn point moving.
  3. Verify that while the spawn point is being moved chests, barrels and all other blocks that use lua code do not function until the new spawn point is selected.
MineClone2 version: tested both 0.86.2 and development master ### What happened? While investigating a world that caused gameplay to freeze repeatedly to the point of being unplayable, I found that the source of the large freezes was the function can_find_tree() inside mod/PLAYER/mcl_spawn when there were no trees around spawn. The repeated pathfinding attempts consumed large amounts of main thread CPU time every time spawn moved, and spawn was moving every 30 seconds. ### What should happen: The game should not freeze periodically. ### Steps to reproduce 1. Load the world in the attached zip file. 2. Watch the debug log for world spawn point moving. 3. Verify that while the spawn point is being moved chests, barrels and all other blocks that use lua code do not function until the new spawn point is selected.
teknomunk added the
bug
performance
#P3: elevated
labels 2024-05-16 14:52:24 +02:00
Contributor

A good read about world spawn and different seeds: #515. And the other relevant issue I mentioned on Discord: #1230.

A good read about world spawn and different seeds: #515. And the other relevant issue I mentioned on Discord: #1230.
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 Participants
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: VoxeLibre/VoxeLibre#4293
No description provided.