Kryonet/Kryonet alternatives

Kryonet seems perfect for my first online project. But i’ve done alot of reading on TCP vs. UDP and UDP really sounds like a better option.

“KryoNet does not currently implement any extra features for UDP” - Kryonet’s github

Is there a library like Kryonet that is UDP based? Or am I being silly and TCP is perfectly acceptable?
My game cannot lag for half a second while waiting for a packet resending and reorginizing.

Read this :

Very convincing.

But maybe he is wrong?

You can send data via UDP using KryoNet - “connection.sendUDP(object);”

UDP and TCP have their pros and cons. If you really want to get down and dirty with networking in a large scale game, use both. But for small games TCP should be fine. I doubt it would lag half a second behind unless you’re doing something very network intensive constantly.

In my opinion:

Use TCP when you need to transfer data like: login/register data, entities data (when first time in view range).

Use UDP when you need to transfer data like: movement update, actions, entities state updates.

+1 Events that need to be completed with a low chance of dropped packets should be sent using TCP. Any sort of login information, inventory changes etc…

Anything that doesn’t absolutely need to actually make it to the client (movement updates) can be sent using UDP.

Question :
If i use libgdx + kryonet, will i be able to enjoy the cross-platform in android/desktop/html
OR NOT?

I know its stupid, kill me for asking that, but i dont know.

Kryonet is not built off of the Android networking API, so as far as I know, no it will not.

Dang it. So it seems i will just make a desktop game.

Edit :
Kryonet is a networking library, that works both on desktop and android, and it is very easy to use (just look at the example from the page).

I just dont know if it still applies, i guess i will risk it :slight_smile:

Kryonet+LibGDX definitely works for both desktop and Android (evidence).

I can’t comment on iOS or HTML.

UDP doesnt work with robovm
but tcp does