flame-engine / flame

A Flutter based game engine.
https://flame-engine.org
MIT License
9.27k stars 908 forks source link

Networking #383

Closed aloisdeniel closed 2 years ago

aloisdeniel commented 4 years ago

Do you plan to add helpers for networking too?

Implementing everything on top of UDP can be tedious and having basic helpers to manage package ordering, prediction for example would be very useful I guess.

For exemple Godot provides high level networking helpers.

This low level tools would be useful for real-time multiplayer games that need fast updates. In the meantime WebSockets should be fine for a majority of games I suppose.

spydon commented 4 years ago

Hello, I'm a bit puzzled, why would you need to implement everything on top of UDP? You can use all of Flutters excellent networking libraries.

erickzanardo commented 4 years ago

Not on the foreseeable future, Netcode is something very complex that requires maybe its own project, and we still have bunch on other areas of Flame to improve/work.

And like spydon said, there is plenty of good network libraries for flutter, which could easily be used alongside Flame.

One thing that I hope that we can do someday, is to enable support for colyseus https://colyseus.io/

But even that should be something for the future.

aloisdeniel commented 4 years ago

@spydon Relying on TCP (HTTP/Websocket) is not performant enough for realtime communications. Real time games generally use UDP to avoid the extra cost of synchronisation of the TCP layer (packet ordering, packet ack).

@erickzanardo Thanks !

erickzanardo commented 4 years ago

Will keep this open for reference from people with the same questioning.

@aloisdeniel if you come up with some helpers for that and want to contribute, send us some PRs, that would be awesome!

aloisdeniel commented 4 years ago

@erickzanardo Sure! I'll to try to use websockets first to see if it is enough, but wanted to ask if you thought about something else first. :) If I go further with UDP I'll share my reflections here.

erlend-sh commented 3 years ago

There’s a community-supported version of Nakama for Flutter here: https://github.com/Allan-Nava/nakama-flutter https://github.com/heroiclabs/nakama/issues/593

erickzanardo commented 3 years ago

@flame-engine/flame-colab We should probably add a section on our docs, explaining that Flame don't have any out of the box netcode helpers and link this project mentioned by erlend-sh (and any other if exists) and then close this issue. Wdyt?

erickzanardo commented 2 years ago

Closing this as we now have information about this on the documentation.