I
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Re: I need a tutorial for simple networking
Hate to bring the bad news, but networking is never easy, even when you wrap yourself with all sorts of helper tools and libraries. The tutorials that you already found were probably the easy ones - that's how much a hustle there is to undertake.
Simplest case scenario is when server has static globally reachable address. Then server opens up a host and listens to incoming connections, then accepts connections and binds virtual player objects to them, which then read out data from the sockets. Client connects to globally available address and binds that socket to a global state, through which it will send data to server and receive back from it.
You can send arbitrary data over the network and it's not constrained by anything; it's a good idea to use some protocol. You can send a string of numbers and assume they have specific meaning on either end, alternatively you can serialize data as a table with string keys for example, then reading and writing data to the network will be a lot simpler.
Revisit the tutorials you found earlier and try to get it working. That's just how it is and there's no way around it.
Simplest case scenario is when server has static globally reachable address. Then server opens up a host and listens to incoming connections, then accepts connections and binds virtual player objects to them, which then read out data from the sockets. Client connects to globally available address and binds that socket to a global state, through which it will send data to server and receive back from it.
You can send arbitrary data over the network and it's not constrained by anything; it's a good idea to use some protocol. You can send a string of numbers and assume they have specific meaning on either end, alternatively you can serialize data as a table with string keys for example, then reading and writing data to the network will be a lot simpler.
Revisit the tutorials you found earlier and try to get it working. That's just how it is and there's no way around it.
Re: I need a tutorial for simple networking
Damn okay. Thought this will be the answer
Thanks for your quick reply anyway
Thanks for your quick reply anyway
Re: I need a tutorial for simple networking
I've only dabbled with networking a little, but it should be noted that setting up a server and learning how to use some sort of protocol like UDP is the easy part. Of course you want to send as little data as possible to the clients so you have to come up with some format where only the important changes in the game are passed to the clients.
Depending on the type of game you are making things get progressively more complicated. If it's a turn-based game like chess then you could probably get away with simple HTTP requests. But with action games where players can make moves at the same time, then you have to deal with the issue of concurrency. For example, clients may be synced 5-10 times per second, but you want everything on the screen to be interpolated and to move and react at 60 FPS or more.
And of course there are many small challenges like running all of the logic and validation on the server so that clients can't cheat, lobbies, matchmaking, etc.
Depending on the type of game you are making things get progressively more complicated. If it's a turn-based game like chess then you could probably get away with simple HTTP requests. But with action games where players can make moves at the same time, then you have to deal with the issue of concurrency. For example, clients may be synced 5-10 times per second, but you want everything on the screen to be interpolated and to move and react at 60 FPS or more.
And of course there are many small challenges like running all of the logic and validation on the server so that clients can't cheat, lobbies, matchmaking, etc.
Who is online
Users browsing this forum: Ahrefs [Bot], Semrush [Bot] and 1 guest