Re: python socket server allow multiple clients to connect

@22
Communication styles vary depending on what your goals, RTS's for example may rely heavily on asynchronous lockstep models, whereas FPS's may be more authoritative and freestyle with client side prediction and server corrections. How it works, generally speaking, is a client connects to a server and a server connects to the client, their "channel" consists of a local representative class on either end that handles sending and recieving information.

In an async lockstep model, clients and server label packets with a number ID, like Packet 132. Clients will spam the server with packet for turn 132, and the server waits until it hears from everyone before sending out packet 132. Once the clients recieve packet 132, they start sending packet 133, which indirectly tells the server that they recieved the previous packet, again waiting until it recieves packet 133 from everyone before sending it out, and repeating the cycle. When a client recieves the new packet, it executes it and waits for the next.

Input in this case is a bit of an illusion, players don't move characters forward in a multiplayer game, servers do. The player presses a key, it talks to the server, the server tells everyone "Player X is moving", and then it moves. Sometimes there's a delay involved however between the time the client talks to the server and the server responds, so you have whats called Client Side Prediction, where it "predicts" what should happen and goes ahead and does it before the server responds, if it gets it wrong, the server "corrects" it when it gets a response, which is usually the type of model used in FPS's.

So: You press left. It stuffs the command into packet XYZ and ships it to the server. The server waits until it gets packet XYZ from everyone, then broadcasts it to all of you. You recieve packet XYZ and run the command. The character moves.

-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
  • ... AudioGames . net Forum — Developers room : camlorn via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : Zarvox via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : camlorn via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : camlorn via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : Zarvox via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : bhanuponguru via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : ashleygrobler04 via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : ashleygrobler04 via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : bhanuponguru via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : magurp244 via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : camlorn via Audiogames-reflector

Reply via email to