Haxe Forum > HaXe remoting inmultiplayer games?
-
Roman Apr 06 at 11:31
Hi there,
I didn't find any info about how suitable Haxe remoting for multiplayer games (asynchronous socket remoting, server is neko, client is flash). Is it compact enough and serialization fast for multiplayer shooting-and-running game? Or I should write my own socket server? -
Arnaud May 03 at 15:52
Hi,
I think haxe is fine with that.
Basically, most of the communication time is network latency anyway, not the microseconds spent of client/server side.
With flash/neko, you can establish raw TCP connections. Everything, or almost everything is already there. You even have some remoting functionality if you wish.However, as usual, the main issue is "how" you want to organize it, especially if you want a cheat safe game.
The easiest thing to do is to have a copy of the game state on the server, and each action of the player is checked against there.
However, if a player shoots and has to wait a few hundred milliseconds, it's quickly unbearable. Even small latencies are make the game feel really sluggish."My" workaround this is to work with copies of the game state on both the client and the server. That way, the client can be very responsive, and the server still check that nothing is abnormal. Being able to reuse all that code on both sides is definitely an advantage.
Cheers,
Arnaud -
Arnaud May 03 at 15:55
...this forum lacks an "edit" functionality :/
So, basically, let me repeat: worrying about the socket implementation and the speed of serialization is pointless. The bottleneck is not there. Both are fast enough. The difficulty is how to deal with network latency, and everything else.
-
Arnard
The forum could be improved in many ways but.. the forum source is online so it's possible to submit a patch for improvements. Source can be found here:
https://github.com/ncannasse/hxWiki/blob/master/src/handler/Forum.hxI have been reluctant to look at the source as it required 2.09 features prior to 2.09 release, but I guess it maybe easier now... any takers?
-
Roman May 05 at 16:05
Arnaud, thank you very much for your reply!
This is strange that this forum is so abandoned and it took so long to anyone ansver my question... Haxe is young and there must be lots of people with quesions an ansvers... -
"
Haxe is young and there must be lots of people with quesions an ansvers..."
If you post your question here : https://groups.google.com/forum/?hl=en#!forum/haxelang I'm pretty sure you get an answer the same day. :)Jan
-
Roman May 14 at 11:41
Jan, no it wasn't me.