Use of Bundle for Multiplayer #1424
Replies: 1 comment 2 replies
-
|
Hi, You are correct about Bundle. Conceptually, it is similar to a JSON object.
The answer is yes and no. The multiplayer service is still in development, though basic replication exists. So whilst you cannot send 100% of your entity data, there are a few parts of it that you can send via the service. Here's a standalone sample that shows how to use multiplayer service and its basic replication. See if this supports your use case. There is also an older video tutorial with a slightly different example, so may be useful.
The net service (reasonably stable) provides lower level networking APIs, such as TCP/UDP/websocket connections or http requests. The multiplayer service (still in development) sits on top of the net service and provides gameplay APIs, such as the ability to send entity or input data. Finally, if the above doesn't support your use case, feel free to elaborate on it here, so we can turn it into a feature request, for later implementation. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
In the Dokumentation you can read about the fxgl-net Module. Id like to implement a Muliplayer and to my understanding there is an Multiplayer option.
I was hoping there would be an easy way to send the entire game world state, but I'm a bit confused about the purpose of the Bundle() class. It seems like it just stores data similarly to a JSON object, meaning it only supports serializable objects.
So my question is, is there a way to send an entire Entity (or multiple entities) over the network?
Or do I always have to manually extract and send the entity's data as a separate object?
Where exactly is the net module used or integrated within FXGL? I’ve found some built-in features and a few examples that use it. I also came across the multiplayer system here:
https://github.com/AlmasB/FXGL/blob/dev/fxgl/src/main/kotlin/com/almasb/fxgl/multiplayer/MultiplayerService.ktt
I was hoping to find something similiar to net. But it seems scattert throughout the repository?
Beta Was this translation helpful? Give feedback.
All reactions