Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TCP and UDP support #27

Open
rgzr opened this issue Mar 30, 2020 · 10 comments
Open

TCP and UDP support #27

rgzr opened this issue Mar 30, 2020 · 10 comments
Labels
enhancement New feature or request question Further information is requested

Comments

@rgzr
Copy link

rgzr commented Mar 30, 2020

As I understand, currently only http and websocket for the realtime are implemented, although nakama server supports TCP and UDP too. ¿Are there any plans on supporting UDP transport for allowing unreliable sending packets? TCP would be nice to have but websocket covers the same purpose.
Also, ¿can raw binary data be sent through the websocket? So, ¿is the en/decoding to base64 needed?

Thank you in advance and thank you very much for the work you've done, this technology looks promising!

@novabyte
Copy link
Member

Hey @rgzr. Thanks for the kind words. I'll answer each of these questions inline.

¿Are there any plans on supporting UDP transport for allowing unreliable sending packets? TCP would be nice to have but websocket covers the same purpose.

Yes Nakama supports UDP (technically rUDP - optionally reliable) on messages but it requires messsages between client and server to use our realtime protobuf format. I'll have a discussion with @Faless on what would need to be done to use Protobuf from GDScript. The optional reliability layer would also need to be implemented in the socket code.

Also, ¿can raw binary data be sent through the websocket?

Yes the WebSocket can be switched to binary mode instead of text format but it would also require Protobuf as described above.

So, ¿is the en/decoding to base64 needed?

Even in text mode you can send your binary payloads over the socket but they'll be base64 encoded so that the decoder can unpack the binary on the server receiver side.

Hope this makes it clearer.

@novabyte novabyte added enhancement New feature or request question Further information is requested labels Mar 31, 2020
@rgzr
Copy link
Author

rgzr commented Apr 6, 2020

Thank you @novabyte, this makes it much clearer.

So, for now we can't send unreliable data. The best option for now is to send data through weboscket reliable transport using base64 encoded binary, and switching to rUDP with realtime protobuf when it's implemented.

If help is needed maybe I can colaborate.

@novabyte
Copy link
Member

novabyte commented Apr 6, 2020

@rgzr Yep this is the best approach (and in truth it works pretty well) until we find a way to support Protobuf in GDScript or bridge between GDNative and GDScript. You won't need to base64 your message content because the SDK already does that for you.

If help is needed maybe I can colaborate.

Would be great to collaborate I just don't have the time at the moment to investigate what's needed for Protobuf in Godot.

@jknightdoeswork
Copy link
Contributor

Hey @novabyte , There is a protobuf implementation for godot: https://github.com/oniksan/godobuf

I'm sure @Faless knows about it.

I can't verify how good the godobuf implementation is, as I havent used it, but it's implementation does not require gdnative, which makes it extremely accessible and matches the design philosophy of the nakama-godot sdk.

@gdomaradzki
Copy link

So is it currently not possible to use Nakama's rUDP socket? I want to build something that is server authoritative and uses rUDP, how should I go about that? Maybe use Nakama's LUA or Go implementation instead?

@novabyte
Copy link
Member

@gdomaradzki Until its possible to interface efficiently with Protobuf generated netcode it won't be possible to use one of the other socket transports in the game server.

@dpweberza
Copy link

Has there been any progress here with support for UDP in Godot?

@lugehorsam
Copy link

@dpweberza not at the moment though @dsnopek has been working on tighter integration with the Godot network APIs.

@exotexot
Copy link

Any update on this ?

@neondeex
Copy link

neondeex commented Nov 8, 2024

Any update on this ?

Did you find any update?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

8 participants