Another networking question

Monkey Forums/Monkey Programming/Another networking question

EdzUp(Posted 2013) [#1]
Having dabbled with the async TCP networking system also looking at the examples I am wondering can monkey networking actually be used for a constant connection networking system?

What I mean is basically the client connects to a LAN server and stays connected throughout the game until they close the connection in some way or other. All the examples that come with monkey and the way everything is laid out gives the impression that its more for internet servers and not for LAN gaming.

I would like to see more done with the network side of monkey bringing it in line with BlitzMax where you can host servers, connect to them and do all manner of different things with the networking side of it all.


ImmutableOctet(SKNG)(Posted 2013) [#2]
Well, besides UDP, we pretty much already have fully functioning networking capabilities via TCP(Unofficially):

iOS(UDP may be possible), Android(UDP works reasonably well), GLFW(UDP works without any issues), STDCPP(I'm only aware of my library running with this(UDP currently)), HTML5(UDP is not possible...?), Flash(UDP is not possible...?), XNA(Only on specific platforms, 'normal' x86/64 based Windows being one of them), Windows 8, and whatever else(UDP may be possible, no idea about TCP).

You could look into Ferdi's port of 'Push-Button' for TCP based networking on most of the platforms. For UDP, all there is right now is QuickSock(My library) for GLFW and STDCPP(STDCPP was only tested on Windows), and ANet(Sub_Zero's library) for Android(Which hasn't been updated in a while).

So for TCP you're covered almost completely. UDP is a bit more annoying on some of these platforms though. And what sucks about it is that UDP is pretty much going to be your best choice for large games.

I have a lot of experience when it comes to networking for games, and I'll tell you this now, don't use TCP for anything complicated. I started with TCP and got nothing but headaches and high bandwidth usage(Which isn't much of an issue for LAN games).

It's generally best to build a reliable packet system around something UDP based. You may be able to get away with using TCP for small things, like an in-game chat, or file sending. Unless of course your game is simple enough / compressed and managed enough to be handled on TCP completely, but I doubt it is/will be.

When it comes to LAN specifically, I've heard of some 'older' protocols that are optimized for local networks specifically. But it's usually a good idea to use better accepted and more capable protocols, like TCP or UDP.

But at the end of the day, the truth is that Monkey's networking(On all platforms) will never be as awesome as BlitzMax. But hey, if you're only supporting desktop platforms, you could always use MonkeyMax, or whatever they're calling it these days.


EdzUp(Posted 2013) [#3]
Yeah I too have a long networking since Novell NetWare :-)

I have been using blitzmax and c++ with enet but I just wanted to look at monkey, networking is the one area which monkey should officially be improved on :-)


ImmutableOctet(SKNG)(Posted 2013) [#4]
Well, I'd say both networking, and better desktop support. I'm still waiting for an officially supported way to change the display mode on GLFW/Other. Sure there are ways to do it currently, but it's a hassle when I end up practically having to rewrite it(I'm looking at you V67). That's the kind of thing I'd rather have as a part of Monkey, not as an external module.

But on the topic of networking, I actually don't mind the way it is now. I get complete control over the networking in my games. Which can be a double edged sword, because I'm responsible for ANYTHING that may go wrong.

I just wish Mark would properly endorse modules like QuickSock, ANet, and PushButton, they've proven to be pretty stable(Other than maybe ANet with UDP). But at the end of the day, networking tends to be the least multi-platform friendly feature of Monkey.

So, I'm thinking that the most we can expect(Officially) is some kind of TCP server option.


EdzUp(Posted 2013) [#5]
Yeah there is loads of features that would make it much better, what im looking for is a networking module that supports all the current targets without it games can only be written for very specific targets which isnt a good thing when there are requests on the non-networked targets for x feature etc.


Sub_Zero(Posted 2013) [#6]
New version of anet is available, i've done some bugfixes and now the udp server is working:

http://www.monkeycoder.co.nz/Community/posts.php?topic=3275