boskee / Minecraft

Simple Minecraft-inspired program using Python and Pyglet
MIT License
207 stars 33 forks source link

Singleplayer: now launches server in a subprocess #94

Closed Nebual closed 5 years ago

Nebual commented 5 years ago

subprocesses are entirely isolated in memory, unlike threads, so there's no Global Interpreter Lock to cause clientside FPS drops when the server is busy. Also, this just generally feels tidier, as with isolated memory there's less risk of Singleplayer having divergent behaviour from Dedicated.

I'm having somewhat inconsistent results on reading stdout of the server subprocess, when run inside PyCharm's debugger, it outputs immediately, whereas when I launch singleplayer with python3 main.py, I don't see "Server: " messages until the thread is joined when shutting down, I can't tell if the weirdness is threading, subprocess stdout, or something else...

This PR is pointing at my python3 branch, and thus requires python3.

r58Playz commented 5 years ago

The game loads much faster now.