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 » Fri May 30, 2014 9:36 am

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 » Mon Jul 14, 2014 10:25 am

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: 546
Joined: Tue Mar 12, 2013 7:11 pm

Re: Noobhub - opensource multiplayer library for LÖVE

Post by Jeeper » Mon Jul 14, 2014 11:21 am

Very nice! Keep up the good work.

User avatar
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 » Tue Jul 15, 2014 8:35 am

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 » Tue Jul 29, 2014 9:28 pm

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: 317
Joined: Mon Jun 24, 2013 5:16 am

Re: Noobhub - opensource multiplayer library for LÖVE

Post by ArchAngel075 » Wed Jul 30, 2014 3:10 am

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 » Wed Jul 30, 2014 9:35 pm

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 » Fri Mar 20, 2015 5:29 pm

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 » Tue Mar 24, 2015 1:58 pm

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 » Tue Oct 13, 2015 10:53 am

Up!
Just pushed some fixes :)

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 5 guests