Noobhub - Free Opensource Multiplayer And Network Messaging For Coronasdk

I don’t know what to say, for some reason now it works just fine… I’m starting to think the problem was somewhere on our server side, but of course the server guy says everything is just fine, but we all know that until I’ll show him hard evidence of something wrong he’ll go on saying it’s fine…

Aside from that point, I would still love to know how I can see the log messages generated by noobhub for future use :slight_smile:

well, make sure that in file node.js verbose is set to true, and then rerun server

$ nodejs node.js  

it will print debug output straight to stdout, there you will be able to spot if smth is wrong.

also, one of the developers had such case: he was using forever.js to run Noobhub.  foreverjs was writing all output to text file logs, and verbose was set to true by default. his server ran out of space and Noobhub could not start (foreverjs actually, Noobhub doesnt rely on filesystem).

Cheers!

Well, seeing as of right now I’m only in the testing phase of the project, our server shouldn’t have a problem with the size of the log, we had log files generated by other projects that were 10 gigs in size. yes, it managed to kill our server in the end, but I don’t think we’re there yet.

Again, I’m must be missing something in the whole process, since in the node.js file, which I will call “the server” from now on so we’ll know what I’m talking about, I see no where a refrence to “stdout”… the only thing there is is this function that writes the log:

\_log = function(){         if (cfg.verbose) console.log.apply(console, arguments);     };

does that means the log would be written only while the console php file is run? or there is no connection to one another?

Since what I’m trying to debug is not the php client, but my corona client, where are the log lines for connections coming from corona are being saved?

I’m sorry I’m so hard headed about this issue, but I’ve never dealt with this type of service before I don’t know my left from right…

Hi overtorment,

I am a starter of corona from hong kong (so my english may not be very well) but i am willing to make a multiplayer game by NoobHub.

However after reading the files i am confused how should i start with.

Could u please give me a brief introduction of how to use your codes?

Hi overtorment,

I am a starter of corona from hong kong (so my english may not be very well) but i am willing to make a multiplayer game by NoobHub.

However after reading the files i am confused how should i start with.

Could u please give me a brief introduction of how to use your codes?

Hey there again overtorment, good news!! I was able to battle this out with the server guy, he was “kind” enough to give me permissions to view the server space where the script was run and then, finally, get access to the log file, I’m sorry this took so long, but that guy is impossible, can’t have him killed, yet… too much power in one persons hands, always a recipe for trouble.

Any way, since I wasn’t able to get direct access to the log file until now (he set up an auto system which took my modified node.js file from a specific folder and copy it to the right place, closed the old process, and started the new one, it’s a drag…), what I have done it a type of “internal/external” log, where if a specific user connects, lets call him “admin”, then any message or connection being passed to the hub makes the hub send the admin any information I may need, like who the message from, to, their socket status, if exist and so forth, which helped for solve the problem I had, which was a simple lowercase/uppercase problem, like most problems in life…

Thanks again for all the help and the great work you’ve done on this code.

overtorment - Thanks for this! This is great example code. 

Question, have you considered leaning on REDIS to make this more scalable?

Sorry for the delayed answer.

No modification is needed for Noobhub at all. If you want to know how it works, read the server’s source code, Im proud I fitted it in ~50 lines. Also, google for Publish / Subscribe paradigm.

As always, I recommend following readings on multiplayer networking:

https://developer.valvesoftware.com/wiki/Source_Multiplayer_Networking

http://gafferongames.com/networking-for-game-programmers/what-every-programmer-needs-to-know-about-game-networking/

http://gafferongames.com/networking-for-game-programmers/

First of all, this is amazing and just what I was looking for, thanks for the hard work overtorment.

I was able to run node.js from terminal in OSX and communicate with the sample app running on the corona simulator, but when I try to test on an actual device and send data to the server running on my mac I get nothing. Also worth noting, I’m as green as they come when it comes to networking. Any idea what I could be doing wrong?

@marble68  yes I have. I considered Redis, but at the moment I dont have tasks which require such scalability.

@Jorge Sanchez

May I suggest that you are using loopback addres, such as “localhost” or “127.0.0.1” ? Also, might be something with Firewall.

@sochunhong1 reat the Readme file on github.

Cheers!

A noob question…

how do you unsubscribe and close the connection???

Thanks in advance!

Is there a way to modify Noobhub myself so that UDP is also supported?

I am using it for a real-time multiplayer game, I have not tested with 3G or 4G LTE yet but feel that in some cases I will need it. This research paper mentions TCP is a lot slower for mobile networks if its not WiFi: http://www.hindawi.com/journals/ijcgt/2009/530367/. The research paper is from 2009, and I don’t know if the TCP used in testing had “no-delay”, or whether or not Node.js can tackle a lot of these speed issues and technology has improved since to make the difference between TCP and UDP somewhat closer.

I haven’t gotten around to testing the latencies for myself yet since I am in China at the moment and my server is in Seattle, so the results would not be desirable any way. 

Dear overtorment,

“Once somebody needs to find a gaming partner, he posts a message to the lobby channel, like, ‘who_wants_to_play’.
Every client on lobby who is up for a game, answers ‘i_wanna_play’.”
 

How if some clients get in to the lobby after the hosts sent  ‘who_wants_to_play’? How can they join the host?

Thanks,

Jason

I would imagine that a list of games would be visible in the lobby channel that are available for joining, but that might require modification in Noobhub? Or maybe a timer.performWithDelay function that continually publishes “who_wants_to_play” in the channel until the game is officially closed from additional players joining?

I’d like to know the answer as well.

And overtorment, if you can advise on what sort of topics I can read up on to better understand how Noobhub works, that would be much appreciated

Hi @overtorment.

Thanks for developing the library. I am going to develop a multiplayer game and it will save me a lot of time.

Best,

Renato

Hey guys, I have just added compatibility with Gideros, if anyone uses it.

Sorry for the delayed answer.

No modification is needed for Noobhub at all. If you want to know how it works, read the server’s source code, Im proud I fitted it in ~50 lines. Also, google for Publish / Subscribe paradigm.

As always, I recommend following readings on multiplayer networking:

https://developer.valvesoftware.com/wiki/Source_Multiplayer_Networking

http://gafferongames.com/networking-for-game-programmers/what-every-programmer-needs-to-know-about-game-networking/

http://gafferongames.com/networking-for-game-programmers/

Hi @overtorment,

My game is almost finished and i am looking for a cheap vps to upload the nude.js,

Since my budget is very tight i found digitalocean the cheapest one but what about ip and dns? how much that costs?

DigitalOcean provides ip with a VPS, so no problem, you can connect to noobhub server via IP.

If you need a domain, you can get one at Godaddy for about 10 bucks and tie it to digitalocean’t VPS.

If you are new user, AWS provides 1 year of free vm (x-small type) that you could use to that