Jump to content
  • Advertisement
crmbzy

Artemis ECS + Kryo network sync

This topic is 583 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm using artemis-odb for my prototype. I have managed to get the "KryoArtemisSerializer" to work and serialize my world (or just a few selected entities). I now want to transmit this data to another peer (I am doing this with Kryonet). The de-serialize is working, the only problem I ran into is, that I can't seem to tell the "WorldSerializationManager" to update my entities instead of always creating them.

I use

world.getSystem(WorldSerializationManager.class).load(inputstream, SaveFileFormat.class);

to load the data from my byte input stream that was created by Kryo. Is there another way to de-serialize the entities and process them manually?!

Any insights highly appreciated!!

Share this post


Link to post
Share on other sites
Advertisement

Hi, a bot twitter account retweeted this under jobs ;)

There's unfortunately no straightforward way of deserializing entities without creating new ones. It could *probably* be done with a custom serializer based on the Kryo one, but I'm not sure how much work it'd entail + might require some changes to the underlying artemis code.

The culprit is the EntityPoolFactory - which always creates new entities when deserializing; but even if entities are matched against existing ones, new components would be instantiated during each deserialization, which may be somewhat costly in terms of performance/GC - depending on how frequently entities are updated.

 

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!