Noobhub - Free Opensource Multiplayer And Network Messaging For Coronasdk

Hi guys, just spreading the word about Noobhub, a library Ive built to create network multiplayer games and apps.

There are already several apps from different developers who happily use Noobhub in production.

Previous official discussion was here http://developer.coronalabs.com/code/noobhub  but who knows, maybe official discussion will move here.

Code is available on Github https://github.com/Overtorment/NoobHub

  • * Connections are routed through socket server with minimum latency, ideal for action games.
  • * Simple interface. Publish/subscribe paradigm in action.
  • * Server written on blazing fast Nodejs.
  • * Socket connections, works great through any NAT (local area network), messages delivery is reliable and fast.

Repo includes server code (so you can use your own server) and Corona lua client. More clients to come. You can test on my server, credentials are in the repo!

Lua code may serve as an example of how LuaSocket library works.

PS. First post on new forums. Hooray!

EDIT. If you like Noobhub, please give it a star on Github!

@overtorment

I have been trying to develop a web interface to NoobHub … All I have managed to get is a php page to connect get back 1 line then close the connection… Is it potentially possible to do something like this?

 

Also, we released our app last Wednesday for the App Store, Google Play, and Amazon App Store that uses NoobHub!

Has anyone had reports of socket connections not working well or not at all when users are on 3G? I know some users could possibly have issues but wondering if this is a widespread problem.

 

Actually, there’s a php client in the repo. Its provides console  access to the channel, so you can type commands to channel and receive what’s the other end sending. I use it for remote debugging on real device.

It can be handy to implement simple commands in Lua, so you can type lile. “Img1.x = 100” in console and this will instantly apply in your app (handy to fix issues on real device instead of simulator)

Could you also post the link to your app…?

 

 

 

 

Experienced no issues on this  yet… Anyway gona implement silent reconnect mechanism in Lua client, that should fix most connection issues.

 Actually, there’s a php client in the repo. Its provides console

 access to the channel, so you can type commands to channel and receive
what’s the other end sending. I use it for remote debugging on real
device.

 

Yeah I saw that… It actually was were I started from… Was hoping to have at least a one way access to the NoobHub stream via the web… Was able to create a super fast RealStudio client that *could* be compiled for he web…

 

 

 Could you also post the link to your app…?

HT+phoenix

 

Website – http://bit.ly/YUp7Uz

iTunes – http://bit.ly/ZJo1tf

Amazon App Store – http://amzn.to/ZMODM1

Google Play – http://bit.ly/ZB4c5O

 

It is an app geared toward the security sector… We started work last June/July but was back burnered because there wasn’t any good communication implementation out there … Took about little over a month to refactor it to utilize NoobHub (and massively clean up the code)… Spent a good chunk of time with disconnect situations (the code will try to reconnect to the server if it detects it can’t reach the server)…

Spent a good chunk of time with disconnect situations (the code will try to reconnect to the server if it detects it can’t reach the server)…

 

well then, share this code if you coded this in noobhub.lua   :stuck_out_tongue:

 
I didn’t change anything in the noobhub.lua file but I’ll just give a gist of what I did …
 

local subscribeChannel = function ( event )    if connected == false then       hub = nil hub = noobhub.new ( { server = serverIP; port = serverPORT; } );       print ( "trting to connect to:" .. serverIP .. ":".. serverPORT)    end       local function testListener ( message )       // DO STUFF HERE    end    if connected == false then       print ( "trying to subscribe" )       canPublish = hub:subscribe( { channel = ( lobby ); callback = testListener; })       connected = canPublish    end end function publishNOOB ( msg )    if canPublish == true then       testA = hub:publish ( { message = { a = msg, } });       connected = testA canPublish = testA    else       connected = false       if hub then          hub:unsubscribe ( )       end       subscribeChannel ( )    end end function t:timer ( event )    publishNOOB ( "KEEP ALIVE" ) end subscribeChannel () timer.performWithDelay ( 1000, t, -1 )

There needs to be a bunch of variables that need to be declared and what not but … I basically send out a keep-alive post every so often to make sure it can post… probably not the best solution but it seems to work… at least when I manually bring down the server and bring it back up…

Hi Overtorment / all !

What you think of this comment : http://coronalabs.com/blog/2013/03/20/corona-cloud-1-0-is-here/#comment-17706

I am still building my realtime game with noobhub and I really am very happy with it. But I must admit I really have no clue on how the virtual server will hold with say couple thousand players ping pong-ing.

Btw how you guys compensate for lag and how to test lag?

grtz Jack

Compensating for lag: https://developer.valvesoftware.com/wiki/Source_Multiplayer_Networking

Sockets on 3G - some issues with certain providers but on the whole should work fine.

Ive used similar RESTfull cloud solution for multiplyayer, and I must ssay that laga were terrible. REST will never have a good latency, thats the reason why Ive built Noobhub. There were reportings that with proper tuning single nodejs server can hold up to 1 million concurrent connections. Anyway, if youre worried - set up several servers, and create a decision mechanism on which particcular server each user will hang. Obviously, US users should use server in US, that will greatly improve latency; same for european users.

[quote name=“chrisevans1001” post=“171321” timestamp=“1364120051”]Compensating for lag: https://developer.valvesoftware.com/wiki/Source_Multiplayer_Networking   Sockets on 3G - some issues with certain providers but on the whole should work fine.[/quote] I used same tutorial to learn multiplayer networking and latency compensation. As for connections - once I implement auto-reconnect and resubscribe, hope there wont be any issues with connectivity at all. Unless the internet link is totally dead, of course.

@overtorment

I have been trying to develop a web interface to NoobHub … All I have managed to get is a php page to connect get back 1 line then close the connection… Is it potentially possible to do something like this?

 

Also, we released our app last Wednesday for the App Store, Google Play, and Amazon App Store that uses NoobHub!

Has anyone had reports of socket connections not working well or not at all when users are on 3G? I know some users could possibly have issues but wondering if this is a widespread problem.

 

Actually, there’s a php client in the repo. Its provides console  access to the channel, so you can type commands to channel and receive what’s the other end sending. I use it for remote debugging on real device.

It can be handy to implement simple commands in Lua, so you can type lile. “Img1.x = 100” in console and this will instantly apply in your app (handy to fix issues on real device instead of simulator)

Could you also post the link to your app…?

 

 

 

 

Experienced no issues on this  yet… Anyway gona implement silent reconnect mechanism in Lua client, that should fix most connection issues.

 Actually, there’s a php client in the repo. Its provides console

 access to the channel, so you can type commands to channel and receive
what’s the other end sending. I use it for remote debugging on real
device.

 

Yeah I saw that… It actually was were I started from… Was hoping to have at least a one way access to the NoobHub stream via the web… Was able to create a super fast RealStudio client that *could* be compiled for he web…

 

 

 Could you also post the link to your app…?

HT+phoenix

 

Website – http://bit.ly/YUp7Uz

iTunes – http://bit.ly/ZJo1tf

Amazon App Store – http://amzn.to/ZMODM1

Google Play – http://bit.ly/ZB4c5O

 

It is an app geared toward the security sector… We started work last June/July but was back burnered because there wasn’t any good communication implementation out there … Took about little over a month to refactor it to utilize NoobHub (and massively clean up the code)… Spent a good chunk of time with disconnect situations (the code will try to reconnect to the server if it detects it can’t reach the server)…

Spent a good chunk of time with disconnect situations (the code will try to reconnect to the server if it detects it can’t reach the server)…

 

well then, share this code if you coded this in noobhub.lua   :stuck_out_tongue:

 
I didn’t change anything in the noobhub.lua file but I’ll just give a gist of what I did …
 

local subscribeChannel = function ( event )    if connected == false then       hub = nil hub = noobhub.new ( { server = serverIP; port = serverPORT; } );       print ( "trting to connect to:" .. serverIP .. ":".. serverPORT)    end       local function testListener ( message )       // DO STUFF HERE    end    if connected == false then       print ( "trying to subscribe" )       canPublish = hub:subscribe( { channel = ( lobby ); callback = testListener; })       connected = canPublish    end end function publishNOOB ( msg )    if canPublish == true then       testA = hub:publish ( { message = { a = msg, } });       connected = testA canPublish = testA    else       connected = false       if hub then          hub:unsubscribe ( )       end       subscribeChannel ( )    end end function t:timer ( event )    publishNOOB ( "KEEP ALIVE" ) end subscribeChannel () timer.performWithDelay ( 1000, t, -1 )

There needs to be a bunch of variables that need to be declared and what not but … I basically send out a keep-alive post every so often to make sure it can post… probably not the best solution but it seems to work… at least when I manually bring down the server and bring it back up…

Thx for your replies. Any chance on an example for auto-reconnect / resubscribe? 

I have just added auto-reconnect in case of network failure.

Grab it from Github.

You rock  B)