rakaly / cli

Rakaly server commands exposed locally
MIT License
11 stars 2 forks source link

Vicky 3 dates parsed wrong #15

Closed Groogy closed 1 year ago

Groogy commented 1 year ago

When trying to parse a vicky 3 save it will fail to parse the dates. It turns the date string into an int causing the save to be loaded wrong. For an example melt a vicky 3 file and check admirals/generals cooldown_repair_date value.

nickbabcock commented 1 year ago

Ah, the heuristic if a date is present fails on 1.1.1 (which is encoded as 43808760), as the heuristic says "hey, we're playing vic3, anything that decodes to a pre-1700 date must not be a date".

Thanks for the report, I'll push out a fix in a couple hours.

nickbabcock commented 1 year ago

I cut v0.4.6, which should have this fix in there (needs a few more mins to show up in github releases).

Let me know how it goes 😄

I don't think it's perfect yet, as there are some game state models that have a slightly different fixed / floating point encoding than others (like the _strength fields), but I haven't quite nailed down the pattern (it may literally just be anything that ends in _strength uses this alternative encoding). So in your travels if you come across, additional inconsistencies, let me know the pattern and I can adapt it.

EU4 spoiled me with consistent 32bit and 64bit fixed / floating point encoding

Groogy commented 1 year ago

Awesome thank you, will let you know when I do the next edit round for our mp game.

To go by what is fixed/floating point, you can use as a rule of thumb that if it is something that needs to be synced over the network it will be fixed point (i.e anything that affects gameplay), if it is cached values for the interface etc it will be a floating point