Artemis ECS + Kryo network sync

Started by
1 comment, last by junkdogAP 6 years, 1 month ago

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!!

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.

 

artemis-odb - highly optimized and a continuation of the popular artemis ECS framework.

This topic is closed to new replies.

Advertisement