Noobhub - opensource multiplayer library for LÖVE

Showcase your libraries, tools and other projects that help your fellow love users.
User avatar
OmarShehata
Party member
Posts: 259
Joined: Tue May 29, 2012 6:46 pm
Location: Egypt
Contact:

Re: Noobhub - opensource multiplayer library for LÖVE

Post by OmarShehata »

Oh wow! This is exactly what I've been looking for! I was just about to start the painstaking process of writing multiplayer from scratch. Thank you so much, will definitely use this in my game.
Overtorment
Prole
Posts: 17
Joined: Sat Jan 11, 2014 3:33 pm

Re: Noobhub - opensource multiplayer library for LÖVE

Post by Overtorment »

a quick-start guide on how to setup your own server http://www.develephant.net/noobhub-mult ... 5-minutes/
User avatar
Jeeper
Party member
Posts: 611
Joined: Tue Mar 12, 2013 7:11 pm
Contact:

Re: Noobhub - opensource multiplayer library for LÖVE

Post by Jeeper »

Very nice! Keep up the good work.
drunken_munki
Party member
Posts: 134
Joined: Tue Mar 29, 2011 11:05 pm

Re: Noobhub - opensource multiplayer library for LÖVE

Post by drunken_munki »

nil
Last edited by drunken_munki on Mon Feb 09, 2015 6:44 pm, edited 1 time in total.
superich
Prole
Posts: 1
Joined: Tue Jul 29, 2014 9:24 pm

Re: Noobhub - opensource multiplayer library for LÖVE

Post by superich »

Hello Lovers,

Long time creeper, first post. I've been spending the last month or so trying to make heads or tails of networking. Finally got on my feet with lua-enet, but then I found this beautiful library! I was wondering if anyone's got any _even easier_ tutorials than what's on OT's github. I've gotten his example up and running on my VPS, but I'm a total javascript noob and not very networking savvy. Specifically looking for an example of broadcasting to all peers, and another example of sending to individual peers.

Thanks!
User avatar
ArchAngel075
Party member
Posts: 319
Joined: Mon Jun 24, 2013 5:16 am

Re: Noobhub - opensource multiplayer library for LÖVE

Post by ArchAngel075 »

How does noob hub operate with large packets of data being sent at once?

I currently am writing up a multiplayer game (not yet shown on these forums, but in due time) and when starting I looked at lua-enet and luaSocket to determine which should be used. lu-enet won as it had automatic packet fragmenting which as far as i know luaSocket does not.

If, for instance, I send some needed data on connect, like a map file (Lua export of Tiled), maybe images that are custom skins player made (rescaled by server for minimum bandwidth and smaller file size) and lastly a up to 500kb JSON-ed table which represents a cooked version of the gameworlds database containing all the needed objects that are active in the world, that's around 30-enemies and 2-players and others-most of data arises from pointlight-sources that contain bulk infomation to render them properly.

With all the data, being sent as a whole packet instead of manual fragmentation, does noobhub fragment on its own and ensures reliability and sequence or does noobhub expect developers to atleast be more careful and send the packet fragmented and manually?

---

Otherwise it is good to see a wonderful multiplayer code helper popping up, as when i started my first multiplayer concept using LUBE i found it daunting - then moving to lua-enet supported by LÖVE things became easier since it auto-fragmented packets making my worries of event slightly bloated packets slowing down game.

---

If the above question is answered as "yes-does auto fragment" then ill be more inclined to see if perhaps i can swap out lua-enet to see if i get gains in speed and effieciency against lua-enet...
Overtorment
Prole
Posts: 17
Joined: Sat Jan 11, 2014 3:33 pm

Re: Noobhub - opensource multiplayer library for LÖVE

Post by Overtorment »

ArchAngel075 wrote:How does noob hub operate with large packets of data being sent at once?

I currently am writing up a multiplayer game (not yet shown on these forums, but in due time) and when starting I looked at lua-enet and luaSocket to determine which should be used. lu-enet won as it had automatic packet fragmenting which as far as i know luaSocket does not.

If, for instance, I send some needed data on connect, like a map file (Lua export of Tiled), maybe images that are custom skins player made (rescaled by server for minimum bandwidth and smaller file size) and lastly a up to 500kb JSON-ed table which represents a cooked version of the gameworlds database containing all the needed objects that are active in the world, that's around 30-enemies and 2-players and others-most of data arises from pointlight-sources that contain bulk infomation to render them properly.

With all the data, being sent as a whole packet instead of manual fragmentation, does noobhub fragment on its own and ensures reliability and sequence or does noobhub expect developers to atleast be more careful and send the packet fragmented and manually?

---

Otherwise it is good to see a wonderful multiplayer code helper popping up, as when i started my first multiplayer concept using LUBE i found it daunting - then moving to lua-enet supported by LÖVE things became easier since it auto-fragmented packets making my worries of event slightly bloated packets slowing down game.

---

If the above question is answered as "yes-does auto fragment" then ill be more inclined to see if perhaps i can swap out lua-enet to see if i get gains in speed and effieciency against lua-enet...
Thats a good question.
Noobhub wont split data in chunks. It just json encodes published message, and pushes it to channel. The server has the connections pool, and for each connection it allocates buffer in heap memory. It is configurable, and default value is 8 kb. If your message exceeds that amoun t- that's bad, it wont be delivered.
Increasing this amount is also a bad idea, because nodejs server even on poor hardware can easily keep thousands of connections. If every connection will allocate 500kb of heap memory just for any case (like, transmitting game assets) - your server will most likely will run out of RAM. So Noobhub is tuned for in-game interactions only ( sending messages like, {"action":"move","coordinates":{"x":111, "y":222}} ).

So my suggestion is that you use to transmit game assets anything that works best for you, and try Noobhub for actual multiplayer interaction. Check out the demo project, its very simple.
Also, compared to lua-enet, theres no need to install anything additionally. Noobhub utilizes built-in lua-sockets directly.
The drawback is that Noobhub at the moment is TCP only, and Pub/Sub messages are routed through 3rd party (which is nodejs server)

Hope this helps. Cheers!
Overtorment
Prole
Posts: 17
Joined: Sat Jan 11, 2014 3:33 pm

Re: Noobhub - opensource multiplayer library for LÖVE

Post by Overtorment »

Hello guys,

Im happy to announce that latest version was recently pushed to Github. Mostly memory leak fixes.

One of Noobhub users reported that Noobhub happily serves 1.1k CCU (concurrent users) utilizing only 6% CPU on only one processor core, and consuming not more than 600 Mb RAM in peak. About 95k multiplayer games runs through this instance daily.
And not a single millisecond of performance degradation (latency) on 1k CCU!

Cheers!
User avatar
ejmr
Party member
Posts: 302
Joined: Fri Jun 01, 2012 7:45 am
Location: South Carolina, U.S.A.
Contact:

Re: Noobhub - opensource multiplayer library for LÖVE

Post by ejmr »

I scraped multiplayer long ago in the game I've been working on, but if this library had existed at the time I might have kept the multiplayer gameplay. Just wanted to say nice job and thank you for writing and sharing this library. Keep up the good work!
ejmr :: Programming and Game-Dev Blog, GitHub
南無妙法蓮華經
Overtorment
Prole
Posts: 17
Joined: Sat Jan 11, 2014 3:33 pm

Re: Noobhub - opensource multiplayer library for LÖVE

Post by Overtorment »

Up!
Just pushed some fixes :)
Post Reply

Who is online

Users browsing this forum: Semrush [Bot] and 135 guests