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.

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 on other sites

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.

• Game Developer Survey

We are looking for qualified game developers to participate in a 10-minute online survey. Qualified participants will be offered a \$15 incentive for your time and insights. Click here to start!

• 13
• 18
• 15
• 10
• 9