boskee / Minecraft

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

The Multiplayer Update #72

Closed Nebual closed 11 years ago

Nebual commented 11 years ago

I've been working on what has become a complete restructure of the project, to bring in multithreading and networking and start splitting code into Client and Server. At this point I believe it is stable enough to be merged into the main repo, so the rest of you can work on it :D

I've put a fair amount of documentation into my commits, as well as in #70 and IRC of course.

Bertrand, Ron, and I have been testing it extensively; I'll leave my test server up at the default connection IP.

Some features remain offline and commented out (such as the chat command parser or server configs) but a significant amount of architecture is now in place for us to build around.

Woot! going to go sleep now

BertrandBordage commented 11 years ago

This was not ready to be merged IMO… Lots of issues to solve to get back to previous performance/quality.

Nebual commented 11 years ago

Perhaps, but now we're back to having one codebase to work on, and I don't have to keep resolving conflicts between the two. Point at problems and we can fix them :D

BertrandBordage commented 11 years ago

Obvious problem: lots of freezes during sector updates. Obvious problem for computers with a modest GPU: exposed blocks are calculated sector by sector, ignoring others. This leads to something like 50 times more exposed blocks than there should be. Apply the same factor to the number of polygons and you get an idea of how much GPU power is wasted here. Before, on my GF laptop: 40 avg FPS. After: 2 avg FPS…

For other problems (mainly crashes), I'll comment code.

Nebual commented 11 years ago

Regarding exposed blocks: What does your debug line at the top of the GUI say about Blocks Shown when you connect to my server? I get around 26400/480000, which is significantly better than before the Server update. It will be better still once the server knows player locations and precaches an area around them, but if you experience low FPS I don't believe its due to too many blocks shown.

BertrandBordage commented 11 years ago

If you don't move, yes, you have about 30000 shown blocks with lots of undesired exposed blocks like this: http://i.imgur.com/eE5LyYZ.jpg If you move just 20 meters away and wait for the sectors to download and show, that's just terrible. About 100k blocks shown, 1M blocks loaded and impossibility to play. And it never hides nor deloads. http://i.imgur.com/6pTAC8g.jpg

Nebual commented 11 years ago

Hop in IRC, I'm fairly unfamiliar with unicode.

And try lowering G.DELOAD_SECTORS_RADIUS to 8. Personally I never noticed a correlation between blocks shown and FPS, I'm at 150-200 solidly if I don't change sectors, regardless of the number of exposed. I don't have an amazing graphics card either (GTX 460) but I guess that just goes to show the difference between a laptop's low power/heat GPU and a standalone.

Also, I notice my FPS doubles to 300 when my mouse is moving. I have a strong suspicion this isn't actually true, since it doesn't make any sense, but it might mean pyglet is executing the frame more based on mouse movement, which might cause some problems, especially for those with low FPS to start with.