MovingBlocks / Terasology

Terasology - open source voxel world
http://terasology.org
Apache License 2.0
3.69k stars 1.34k forks source link

PrepareWorld step takes too long on headless #5024

Open keturn opened 2 years ago

keturn commented 2 years ago

loadProcesses.PrepareWorld currently documents itself as "loops until world is pre-generated or 5 second elapsed," and it's good to its word:

https://github.com/MovingBlocks/Terasology/blob/2d0c434654b797b71e9a0d00004b3b79f3a4c5e7/engine/src/main/java/org/terasology/engine/core/modes/loadProcesses/PrepareWorld.java#L32-L38

The problem is that the HeadlessWorldRenderer looks like this: https://github.com/MovingBlocks/Terasology/blob/b27c8e274d06f56ed821340008a30b41628dccb9/engine/src/main/java/org/terasology/engine/core/subsystem/headless/renderer/HeadlessWorldRenderer.java#L124-L126

so that loading step always takes five seconds in headless, no matter how much or how little time it takes to generate chunks.

This goes a long way to explaining why even the simplest possible MTE test always takes at least five seconds.

keturn commented 2 years ago

I wouldn't try to tackle this before finishing #4798.

I already tried the simple thing of changing the return false to a return true, and while the first MTE test in the run was fine, the next one had problems.