Terasology / ModuleTestingEnvironment

3 stars 15 forks source link

createClient fails while initializing engine state #74

Closed keturn closed 2 years ago

keturn commented 3 years ago

createClient fails with an NPE from somewhere beneath TerasologyEngine.changeState (currently in TerasologyCanvasImpl).

Looking at the code for createClient, I see it jumps right in to things without going through anything like TestingStateHeadlessSetup. As a client, it's true that it doesn't need to do most of the setup that the host does (because it will get that configuration from the host when it connects), but there might be some stuff along the lines of EntitySystemSetup that needs to happen?

keturn commented 3 years ago

I've always been amazed that MTE's multi-client simulation works at all. I was afraid there were too many places in the code still using global variables to be able to do this all in one process!

On the one hand, it's a killer feature if we trust it. So many of the bugs that crop up during module development are from people overlooking multiplayer, writing code that happens to work locally but that doesn't get saved and communicated properly.

On the other hand, it looks like we only have a single test suite that makes use of it today.

jdrueckert commented 3 years ago

On the one hand, it's a killer feature if we trust it. So many of the bugs that crop up during module development are from people overlooking multiplayer, writing code that happens to work locally but that doesn't get saved and communicated properly.

Totally agree! I would love to get to a point where we can actually trust it and put it into wider use!

keturn commented 3 years ago

@DarkWeird It looks to me like https://github.com/MovingBlocks/Terasology/pull/4907 told StateLoading that hasLocalClient implies “has UI”, which is not true for MTE.

DarkWeird commented 3 years ago

@DarkWeird It looks to me like https://github.com/MovingBlocks/Terasology/pull/4907 told StateLoading that hasLocalClient implies “has UI”, which is not true for MTE.

Yeah. It is true for real game, not MTE. We can use context.get(GraphicsSubsystem.class) != null instead netmode.hasLocalClient()

keturn commented 2 years ago

has has been somewhat addressed by some fixes for headless since then, and is further improved by https://github.com/MovingBlocks/Terasology/issues/5030

[closing because I can't transfer issues between MovingBlocks and Terasology]