Noobhub - Free Opensource Multiplayer And Network Messaging For Coronasdk

well, each socket connect  (each user) takes about 16 kb of memory on server, if I remember correct.

Unless you have millions of gamers playing simultaneously on one server - you should not worry.

There are pros and cons for both. Here’s a brief note: 

https://clientarea.ramnode.com/knowledgebase.php?action=displayarticle&id=52

They’re virtualization systems:

http://openvz.org

http://www.linux-kvm.org

What kind of pings are you guys getting when you use Noobhub’s default server to test? I’m easily getting pings of 300-500 and after doing some research found out that nothing other than UDP should be used for real-time multiplayer games like FPS or fighting. I’m making a fighting game.

Is there an inherent limitation to Noobhub’s latencies and nothing I can do about it?

Thanks

Noobhub’s client is using a straightforward TCP socket connection. You can switch to udp by calling socket.udp() before socket.connect. This may have additional consequences as I have not tested noobhub’s client after doing this.

When I reworked noobhub’s client for my pusherhub client, my pings against pusher.com’s server(s) are consistent to my pings against google.com (about 25ms). There’s nothing in noobhub’s client (I am extremely familiar with it) to cause increased latency other than using rather large messages in the form of text and using TCP, which are negligible.

Since Noobhub routes connections through server (the noobhub server),  of course it increases latency from client to client.

That’s the price you pay to easily interact through any NAT (average wifi network for example) and all the advantages of publish/subscribe paradigm.

So it really depends on where your server is, and how far all clients are from it. Ideally, you should have a server in each important region, like, West Europe/ US West / US East / Asia, and before going into multiplayer game should decide where geographically user is and use corresponding server. And server better be with enough CPU because the one I provided for demo is really cheap and slow, it adds ~100 msec latency (dont remember exact value; a lot!) compared to the production one I use in the same region.

My average ping from client-to-client-and-back is about 100-150 msec, which is 50-75 msec of actual latency on message  delivery from one end to another. For me, its an appropriate value to do prediction and lag-compensation.

In case of UDP that’s a lot more difficult. You have to do a workaround to make it work through NAT, add layers of packets synchronize/acknowledge/resend on failure. TCP/IP does that for you.

And to reduce latency, also get rid of relay server, which means code really complicated p2p communication, and implement game logic on top of it. 

When I was making Noobhub, I kept speed 1st priority (as much as TCP and relay server can), and simplicity - 2nd.

Hope this helps.

Cheers!

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

Another poster mentioned trying to use UDP earlier, but overtorment replied that you can’t use UDP with Noobhub, that’s just the way it is, but was wondering about the trade-offs. Also, random question but I’ve never heard of Pusher and just checked it out, what sort of ways could it help to use it for my Corona SDK game?

How much is it to rent a server for small-scale, say up to 1000 connections? I read about $2/month for VPS hosting, was wondering if you had any recommendations (my first time doing this).

I am getting around 160-180 ms of latency from using the ping command in my command line, and the same latency as well when launching two instances of my game on my simulator using the default server. I’m sitting at a Starbucks that has slower-than-average WiFi, so I guess this is normal? 

I opted for Noobhub since there seems to be more discussion and support going on as opposed to AutoLAN though it uses UDP.

Right now I’m trying to get the synchronizing between player positions to smooth out - player 2 moves his character using buttons on screen, but if I repeatedly send messages about his new x,y positions it ends up looking really laggy on player 1’s screen since the latency isn’t consistent. Do you have any tips for how to fix this, especially if the latency is high? Do I slow down the game itself based on the slowest player? 

P.S It was reading that article that led me to post here :P. I assume I’m currently faced with the problem of the  original Quake (Client-Server but with medium-high latency) that needs client-side prediction and lag compensation to fix?

> overtorment replied that you can’t use UDP with Noobhub, that’s just the way it is,

It’s the server that would be difficult (total rewrite?) to change to UDP. But if you use a server or service that supports UDP, you could rework the noobhub client.

Pusher.com is a message publish/subscribe relaying service that uses an HTTP(s) API or websocket. It’s ideal for chat services and probably more.

hey overtorment,

Is it possible to get the server time from node server.

thanks in advance!

Anyone hosted Noobhub on VPS but couldn’t connect to it?

In one instance, I was getting the “connection error” messages in Corona SDK, but after I opened all the IP ports in iptables it seemed to work, yet what is supposed to happen normally (where I can open two emulators and connect through the sample Noobhub server) does not occur anymore. 

EDIT:  Nevermind, it didn’t work when I tried forever start node.js -v but it works with just plain old node node.js with all the ports open.

Hi

overtorment ,

We are going to develop a multiplayer card game using Unity3D and want use to  NOOBHUB

Do you have in C# code ( Client Side ) for the NoobHub instead of JS ??

Regards,

Gokul

I was going to code it, but Im too rusty with Unity3D.

Anyway, client lib is extremely simple, check out lua client. Just make your own client for Unity!

And dont forget to share it, its opensource after all :slight_smile:

Trying to host this on Heroku.

Td3VXVO.png

But I get the following log output.

I have already changed the last line in node.js to server.listen(cfg.port || process.env.PORT);

Anyone have luck with this?

I dont think heroku provides you dedicated public IP.

Better use simple VDS. I recommend https://www.digitalocean.com/ this is where I host all my instances.

I have VPS set up at DigitalOcean as well (with two other servers, see below). One thing to keep in mind with them is they only offer KVM and it requires more memory overhead than OpenVZ in general. So make sure you get a plan with more RAM (IMHO at least 1GB for KVM). I’ve seen certain tasks fail with 512MB.

Other VPS providers I use who offer both OpenVZ and KVM are:

RamNode: https://clientarea.ramnode.com/aff.php?aff=552 (affiliate link, use LEB35 code for 35% recurring off)

Prometeus.nethttp://www.prometeus.net (in Italy)

They all provide great service so far.

Cheers,

Dave

I’m actually currently hosting it on a cheap $15/year VPS at https://liquid-solutions.biz/, it works, but was wondering if Heroku servers would be faster latency wise. Thanks for the suggestions

In order to decrease latency even more, I would recommend renting dedicated hardware server, instead of virtual one.

I’m new to this, do you mind telling me the differences between these options and what the jargon means? How does the RAM get used for my game in general?

well, each socket connect  (each user) takes about 16 kb of memory on server, if I remember correct.

Unless you have millions of gamers playing simultaneously on one server - you should not worry.

There are pros and cons for both. Here’s a brief note: 

https://clientarea.ramnode.com/knowledgebase.php?action=displayarticle&id=52

They’re virtualization systems:

http://openvz.org

http://www.linux-kvm.org

I have noobhub in aws ebs,  and I notice that everynow and then I get this on the log :

------------------------------------- /var/log/nodejs/nodejs.log ------------------------------------- New client: 127.0.0.1:38034

(with different port), is that normal? How is this possible?