I am a complete beginner in this topic.
I don't know where to start. I don't want to make anything complicated I want to send numbers from one PC to another.
test project: a clicker and I want to know all the clicks that have been clicked so far.
or a game like cursor hangout (on replit link:https://replit.com/@TechPandaPro/Cursor-Hangout?v=1)
something simple but I want to learn love2d networking with luasocket or something else.
I need help with this topic a tutorial or documentation or a link to a wiki would be nice
Online games in love2d
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Re: Online games in love2d
You can follow this tutorial with explained networking with UDP.
There is also TCP and lua-enet. The difference is, that in UDP, you do nit have guaranteed, that client or server received message, but it is faster (used for example in streaming or online games, when you send a lot of data about position - if client wouldn’t receive first oacket, the it would receive another packets in some time).
In TCP, you have guaranteed that the client received it (or you get error when it is not received), but is is little slower, as it sends more oackets in background to verify, the client received it. It is used in applications, when you need to be sure client received content (for example www, mail, file transfer, …).
UDP and TCP are raw internet protocols used everywhere. Then you have enet, which is protocol on top of UDP with some enhancements (for example chcecking, if client really received the message), and if I remember correctly, it also packs tables automatically, so no need to worry about how to send tables. Documentation: lua-enet
There is also TCP and lua-enet. The difference is, that in UDP, you do nit have guaranteed, that client or server received message, but it is faster (used for example in streaming or online games, when you send a lot of data about position - if client wouldn’t receive first oacket, the it would receive another packets in some time).
In TCP, you have guaranteed that the client received it (or you get error when it is not received), but is is little slower, as it sends more oackets in background to verify, the client received it. It is used in applications, when you need to be sure client received content (for example www, mail, file transfer, …).
UDP and TCP are raw internet protocols used everywhere. Then you have enet, which is protocol on top of UDP with some enhancements (for example chcecking, if client really received the message), and if I remember correctly, it also packs tables automatically, so no need to worry about how to send tables. Documentation: lua-enet
Re: Online games in love2d
There was already a similar topic some time ago (see until the last post, there are examples and an interesting suggestion by togFox)
However, before going there, I strongly advise you to do and understand the UDP tutorial offered by Andlac, it will help you get started and understand the main principles, after all that is done and with the information given in this other topic. you should be ready to make great multi games
https://love2d.org/forums/viewtopic.php?f=4&t=94276
However, before going there, I strongly advise you to do and understand the UDP tutorial offered by Andlac, it will help you get started and understand the main principles, after all that is done and with the information given in this other topic. you should be ready to make great multi games
https://love2d.org/forums/viewtopic.php?f=4&t=94276
Re: Online games in love2d
Besides that wiki tutorial that Andlac028 pointed to and Bigfoot71's thread, if you're not brand new to coding and you explicitly ask it not to show any code so it focuses on the theory alone, then in my experience ChatGPT can be a useful tool if you use it like a smart web search.
If you ask it to write code then it might generate something unusable, so rather ask it something like "using LuaSocket, without showing any code, what are the steps to making two PCs communicate with UDP". Then ask follow-up questions or to expand on certain things -- in my case, I had to ask "what if both PCs can send and receive?" to get it to talk about bidirectional communication.
I used it in the past to learn how to write a raw HTTP socket server in Python, it's very useful if you know how to wield it.
Who is online
Users browsing this forum: Ahrefs [Bot], Bing [Bot] and 3 guests