junkdog / artemis-odb

A continuation of the popular Artemis ECS framework
BSD 2-Clause "Simplified" License
779 stars 113 forks source link

ClassArtemisSerializer #439

Closed junkdog closed 5 years ago

junkdog commented 8 years ago

The auto-convert route is probably the most sane use-case; out-of-sync identifiers in json blobs are easier to fix than renamed references in class files. Only "release" code really benefits from faster loading times/less GC; as such, it'll probably end up in the default maven/gradle plugins.

TODO

development branch: origin/439-compiled-serialization

Namek commented 8 years ago

what about some bandtwith-efficient approach rather than JSON? I'm thinking of https://github.com/Namek/artemis-odb-entity-tracker here

junkdog commented 8 years ago

The kryo backend produces smaller output (2/3 or so compared to json); but if you want to optimize bandwidth you probably only want to send the deltas (I'd make components atomic units). The specifics are a bit illusive though, and not really supported by the current serialization mechanism - unless you roll a custom serialization backend which internally filters and sends the correct deltas.

junkdog commented 7 years ago

development branch: origin/439-compiled-serialization

DaanVanYperen commented 6 years ago

@junkdog is this salvageable? otherwise perhaps close.

DaanVanYperen commented 6 years ago

Just some observations after updating the wiki and #510.

junkdog commented 6 years ago

BasePrefab hierarchy feels a bit smelly. It looks like a convenience harness but has some json logic leaking in.

Hmm, where do you mean? It's a dependency on artemis' serializer, but not json afaik. Should definitely provide a custom reader though - I thought there were at least some basic tests demonstrating custom ones.

The naming feels a bit unidiomatic.

I stole it from Unity3d; mostly

SaveFileFormat could use a bit of quality of life and documentation improvements, for example allow fetching entities by id,

Agreed; I'll see about expanding with more annotated examples. The impl itself begs for a cleaner rewrite, but that is unlikely to happen anytime soon.

Not sure about fetching by id, or which id do you mean? Any id recorded in the json is pretty volatile (id:s will likely change if re-saved).

Couldn't find it, is there DI for prefabs like for the component mappers?

yup; all new-ish artemis facilities auto-inject (where appropriate).

junkdog commented 6 years ago

is this salvageable? otherwise perhaps close.

with some work, yes, but still quite a few things remain. I can "manually" run basic compiled prefabs on my computer (compiler + bytecode transformations not done). moved it to 2.3.0.

DaanVanYperen commented 5 years ago

@junkdog cleaning out stale branches, still sponsoring this?

junkdog commented 5 years ago

Ice-boxing this for now, but I wouldn't mind revisiting it - if it fulfills a need.