How to make multiplayer.

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By roma

How to make multiplayer? I need very little: I want the client to send data to the server, and the server to send information to the client. The server must be on another PC in the local network. Data size (of course, approximately): 30 kb. The speed is not very important, but the frequency of sending should be about 30 times per second. Enter the code, please, because I don’t know anything about the network. Is this even possible? If so, please write :slight_smile:

What follows the I need very little: part of the above is FAR from very little. It’s highly unlikely that anyone is going to simply write your network code for you - especially in the form of a forum post. There are many nuances and details in networking code that simply don’t make that a viable workflow.

More generally, you won’t get far with a multi-player game (or game dev in general) by asking others to write the code for you.

There are many tutorials, you tube videos, and other resources online to assist you with both general game dev skills and Godot networking specifically. If you’re serious, I suggest that you spend some time learning.

If you have problems or questions along the way, this community is a great place to ask for additional input and guidance.

jgodfrey | 2023-03-10 20:03

And can you tell me where to look for a guide on sending data over the network (maybe it’s TCP with disabled features, or maybe it’s UDP with additional features)? I don’t know where to dig, all the guides are on NetworkedMultiplayerPeer(), but I need a simple data send.

roma | 2023-03-11 10:33

This is the best series I know of for networking, but it is for 3.x:
https://www.youtube.com/watch?v=lnFN6YabFKg&list=PLZ-54sd-DMAKU8Neo5KsVmq8KtoDkfi4s

I think you should check and try it out, then see how the networking api changed in 4.0 and convert your “simple” project manually.

zhyrin | 2023-03-11 15:10

Sorry, I didn’t answer for a long time. I found a multiplayer video for Godot 4.0: https://www.youtube.com/watch?v=n8D3vEx7NAE&ab_channel=DevLogLogan.
But sorry, I need a raw connection between PCs (Such as: UDP or TCP. Although ENet or QUIC is better) to send data. But I did not find any tutorial. Are there any? (Example of functions on this page (this is a module for Godot 3, but I need its functionality in Godot 4): GitHub - perdugames/gdnet3: An ENet wrapper for Godot 3.)

roma | 2023-03-12 17:03

You probably won’t find tutorials for that. Godot is made to be easy to pick up, it abstracts such low-level stuff for you.
Of course it does use tcp/udp, but you’ll have to firgure it out on your own.

zhyrin | 2023-03-16 09:07

Oh no… Do internet haven’t tutorial?! I can’t without tutotial…

roma | 2023-03-17 11:31