RTS / MOBA networking methods.

I will try to make some kind of moba game. I didn’t really do any networking before for a game, so some tutorials on this topic would be nice. Or maybe just few main outlines of it. What I mean is for example: do I just stream data to clients or does the client request for certain information?

Show us what information you have already read, and what questions you have. That way we don’t risk putting effort into writing an informative reply that means little to you (either because you know too little, or too much).

I have probably none knowledge other than that TCP transfers 100% info and is slow and UDP loses info sometimes and is fast.
So for game you use UDP and probably stream data to clients, but how would that work? I would make a huge mess which I would be cleaning for a long time…

this isn’t thread for ‘how to send’ but rather ‘how to structure networking’

Blam:

What Every Programmer Needs to Know About Game Networking
Make sure you check the ‘related posts’ at the bottom.

I remember directing someone to another really good article on this subject, but I can’t find it…

I would checkout kryonet as a medium for multiplayer with your first attempt at multiplayer with a java game. It has a built in serialization library (transfers all data to and from bytes in between client and server) with an easy setup. It features both TCP and UDP transfer of information, the TCP is much better built and maintained compared to the UDP, but the UDP still works fine for sending position info and health info and other things like that. Essentially all you do is make a network listener for a client and server (built into KN) and send packets from 1 to another then in the listener check if a received object is an instanceof whichever packet class you were sending. The only issue I have ever found with kryonet is that the ByteBuffer size is really garbage and when you have like 10 clients syncing 100’s of entity data and map data the server will just $h1t itself and say im done and crash so you gotta try to keep packets only sending primitive data types of java instead of entire custom classes