Multiplayer
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Multiplayer
I have done my best to try to understand lue-enet via the wiki and honestly im lost. Im well aware multiplayer and anything online is mind blowingly difficult but at the moment it feels like im not even on the right path, if anyone could point me in the right direction like keywords to search for, libs that could help, good tutorials, etc I would very much appreciate it!
Re: Multiplayer
I recommend this library: https://github.com/Overtorment/NoobHub
With this library I made a Paper.io game where I could play it with friends, I'm still working with it on another project and this library is (relatively) very easy to use. What is difficult especially when making a multiplayer game is above all the synchronization between the players, making a good lobby / queue system (if necessary) that is not buggy, the movement of the players because the information coming from the server cannot be refreshed as many times as the number of images per second, etc...
If you need help with it, don't hesitate, I could advise you.
In any case I must warn you, making a multiplayer game is not that difficult as you can hear (when you have the right tools) but it takes a lot of time to develop for it to work well. For example with my Paper.io I took as much time to develop the multiplayer system as to really develop the game.
So prepare to drink coffee or something energizing, but it's possible, I did it
With this library I made a Paper.io game where I could play it with friends, I'm still working with it on another project and this library is (relatively) very easy to use. What is difficult especially when making a multiplayer game is above all the synchronization between the players, making a good lobby / queue system (if necessary) that is not buggy, the movement of the players because the information coming from the server cannot be refreshed as many times as the number of images per second, etc...
If you need help with it, don't hesitate, I could advise you.
In any case I must warn you, making a multiplayer game is not that difficult as you can hear (when you have the right tools) but it takes a lot of time to develop for it to work well. For example with my Paper.io I took as much time to develop the multiplayer system as to really develop the game.
So prepare to drink coffee or something energizing, but it's possible, I did it
Re: Multiplayer
I appreciate the advice and kind words, Ill check out the lib and see what I can do! Thanks for pointing me in the right direction and talking about the struggles you came across so I can prep for themBigfoot71 wrote: ↑Wed Feb 01, 2023 6:27 pm I recommend this library: https://github.com/Overtorment/NoobHub
With this library I made a Paper.io game where I could play it with friends, I'm still working with it on another project and this library is (relatively) very easy to use. What is difficult especially when making a multiplayer game is above all the synchronization between the players, making a good lobby / queue system (if necessary) that is not buggy, the movement of the players because the information coming from the server cannot be refreshed as many times as the number of images per second, etc...
If you need help with it, don't hesitate, I could advise you.
In any case I must warn you, making a multiplayer game is not that difficult as you can hear (when you have the right tools) but it takes a lot of time to develop for it to work well. For example with my Paper.io I took as much time to develop the multiplayer system as to really develop the game.
So prepare to drink coffee or something energizing, but it's possible, I did it
Re: Multiplayer
Also is there any docs or tutorials on how to use it(outside of the git)?
Re: Multiplayer
Unfortunately I haven't found anything personally except this old blog post explaining how to launch a real server (which is not local) available only on the way back machine, so it will only be useful to you at the end: https://web.archive.org/web/20151222131 ... 5-minutes/
But if you understood the principle presented in the Löve2D UDP tutorial then the example in the readme should be more than enough to understand how it works, it even seems to me that there is an example already written for Löve2D in the repository. (and yes he is here)
And it's certainly the easiest library to use of its kind, the principle is still the same as in the UDP tutorial, it's just a client sends a message to the server and the server dispatches it to everyone , it's up to you to put in the message who will be the target and its content.
If despite everything this library is not suitable there are others which are listed here: https://github.com/love2d-community/awe ... networking
But if you understood the principle presented in the Löve2D UDP tutorial then the example in the readme should be more than enough to understand how it works, it even seems to me that there is an example already written for Löve2D in the repository. (and yes he is here)
And it's certainly the easiest library to use of its kind, the principle is still the same as in the UDP tutorial, it's just a client sends a message to the server and the server dispatches it to everyone , it's up to you to put in the message who will be the target and its content.
If despite everything this library is not suitable there are others which are listed here: https://github.com/love2d-community/awe ... networking
Re: Multiplayer
Thank you for all the helpful links and information!Bigfoot71 wrote: ↑Thu Feb 02, 2023 3:24 pm Unfortunately I haven't found anything personally except this old blog post explaining how to launch a real server (which is not local) available only on the way back machine, so it will only be useful to you at the end: https://web.archive.org/web/20151222131 ... 5-minutes/
But if you understood the principle presented in the Löve2D UDP tutorial then the example in the readme should be more than enough to understand how it works, it even seems to me that there is an example already written for Löve2D in the repository. (and yes he is here)
And it's certainly the easiest library to use of its kind, the principle is still the same as in the UDP tutorial, it's just a client sends a message to the server and the server dispatches it to everyone , it's up to you to put in the message who will be the target and its content.
If despite everything this library is not suitable there are others which are listed here: https://github.com/love2d-community/awe ... networking
Re: Multiplayer
I think my main question about it (/struggle) was just how to start with it, I understand the concepts but as for bash and json im kind of lost and when i type in the lines it gives I just get errors about not finding the variable (requiring the lib didnt change the error)
Re: Multiplayer
You don't have to worry about JSON files yourself, they are automatically generated by NoobHub. To be able to launch the server (if that's where you're stuck) you need NodeJS and the WS library (WebSockets).fridays18 wrote: ↑Thu Feb 02, 2023 4:04 pm I think my main question about it (/struggle) was just how to start with it, I understand the concepts but as for bash and json im kind of lost and when i type in the lines it gives I just get errors about not finding the variable (requiring the lib didnt change the error)
To do this here are the commands to get them (you're talking about bash so I'm going to assume you're on a Debian like distro).
- First make sure you have access to the latest versions of the packages:
Code: Select all
sudo apt update
- Install NodeJS and NPM which is the "module manager" of NodeJS (like PIP for Python or LuaRocks for Lua):
Code: Select all
sudo apt install nodejs npm
- Now go to the server folder of NoobHub, open a terminal there and download the WS library:
Code: Select all
npm install ws
- Once that's done you should be able to start the server like this:
Code: Select all
node node.js
Code: Select all
buffer_size: 1024 * 16, // buffer allocated per each socket client
I hope to be quite clear and precise, at the slightest problem do not hesitate!
Re: Multiplayer
Hello I apologize for the late response and misunderstanding, I am on windows I only mentioned bash because ofBigfoot71 wrote: ↑Thu Feb 02, 2023 9:33 pmYou don't have to worry about JSON files yourself, they are automatically generated by NoobHub. To be able to launch the server (if that's where you're stuck) you need NodeJS and the WS library (WebSockets).fridays18 wrote: ↑Thu Feb 02, 2023 4:04 pm I think my main question about it (/struggle) was just how to start with it, I understand the concepts but as for bash and json im kind of lost and when i type in the lines it gives I just get errors about not finding the variable (requiring the lib didnt change the error)
To do this here are the commands to get them (you're talking about bash so I'm going to assume you're on a Debian like distro).
- First make sure you have access to the latest versions of the packages:
Code: Select all
sudo apt update
- Install NodeJS and NPM which is the "module manager" of NodeJS (like PIP for Python or LuaRocks for Lua):
Code: Select all
sudo apt install nodejs npm
- Now go to the server folder of NoobHub, open a terminal there and download the WS library:
Code: Select all
npm install ws
Just a precision, you can receive errors concerning JSON files from Löve2D (I don't remember exactly the wording of these errors) this will be due, if it happens, to the fact that you send too much data than the server can only roughly managed. To overcome this problem you should increase the size allocated in memory to the server by modifying this line in the `node.js` file:
- Once that's done you should be able to start the server like this:
Code: Select all
node node.js
(obviously tried to reduce as much as possible what you send to the server, I specify it because if you come across this error it is not easy to guess it the first time)Code: Select all
buffer_size: 1024 * 16, // buffer allocated per each socket client
I hope to be quite clear and precise, at the slightest problem do not hesitate!
Code: Select all
$ nodejs node.js
Code: Select all
hub = noobhub.new({ server = "127.0.0.1"; port = 1337; });
Re: Multiplayer
I finally figured out how to boot the server using shell, but now I have no clue how to do anything regarding connecting it to my main.lua file considering the github file is massive and theres not any info on how to require and change what on the github lol
Who is online
Users browsing this forum: Ahrefs [Bot], Amazon [Bot], Google [Bot] and 3 guests