boskee / Minecraft

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

Let's work on this project again! #73

Closed Jimx- closed 5 years ago

Jimx- commented 11 years ago

This project has been left here alone for a long time...and obviously that there are more things that we can add to our game to make it fun...so let's start working on our game again! Since we divided pyCraftr into two parts(server and client), it's more complicated to deal with the synchronization things, @Nebual can you write an article explaining how server and client communicate and synchronize with each other? I think that will help. Anyway let's start working again!

ronmurphy commented 11 years ago

I second this, I had fun playing around and trying to do new, good code. We kind of obsessed over it the first time and burned out after a few weeks, lets see if we can set goals and go by a plan this time...

Nebual commented 11 years ago

Glad to see you guys are still here! I haven't seen Bertrand return yet though. If you guys ever want to reach me, pinging me on IRC is fast.

I'm terrible at writing documentation articles outside of code... Hmm... I'll refactor client.py to be a bit clearer (done! 47a085a1c45cf97b929a815e16ee49716c54d389), and then I'll write a tutorial explaining how player movement is synchronized. Client sends packets 8 (and 9 for jumping) via packetreceiver.send_movement(momentum, position), server listens for incoming packets and when it gets packet ID 8, it broadcasts the packet back to all other players, who hear "Player 3 just started moving from x,y,z!" and start simulating it. When the player stops moving, or changes direction, he sends out a new packet with his updated position, which other clients then use to correct their simulation.

... I'll write that out in more detail with examples on a Wiki page.