anno-mods / FileDBReader

A command line tool for working with a proprietary bluebyte file compression used in Anno 2205 and 1800.
15 stars 4 forks source link

Added interpretation of sparse grid of AreaIDs #22

Closed Atria1234 closed 1 year ago

Atria1234 commented 1 year ago

It is used for some islands in data24.rda use sparse grid to specify their AreaIDs. For example data/sessions/island/pool/colony01/colony01_l_05/colony01_l_05_river_01.

By the way I summarised that when //AreaIDs/block/mode is:

Shad0wlife commented 1 year ago

I believe that IsSparseEnabled is a Boolean and not a byte.

Also, //AreaIDs/val is actually Int16, but I always forget to make a PR for that. So /values might be Int16 as well. In practice it kind of doesn't matter, but if values contains the same data as val does, it should be kept as the same datatype, so byte should be fine for now.

Atria1234 commented 1 year ago

About the Byte vs Boolean. Isn't it represented with a byte anyway?

The //AreaIDs/val being interpreted as list of bytes might not be correct, but each grid cell contains pair of numbers. But I care only about the second one, because it stores if that grid cell is buildable. What would pairs (1, 32) be translated if they were interpreted as Int16? 288 or 8193. Either way worse to parse than just skip every second number.

Shad0wlife commented 1 year ago

Huh never actually thought about it being a pair of numbers. It would be 8193 by the way :D

On byte vs boolean: yes it is both saved as a byte. But byte gets displayed as a number while boolean is parsed to/from "True/False", and if you want that extra "syntax check" you could use Boolean.

taubenangriff commented 1 year ago

okay then, this should be good to go ahead. thanks!