You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently the colors for map data is sent as hexadecimal strings where 8 bytes are used to represent color: AABBCCDD for rgba. Lua and factorio supports putting binary data in strings using string.char(0-255) which allows us to compress it to 4 bytes.
For additional compression we could also take advantage of the actual color palette in use being far more restricted by finding all relevant map colors, transferring them to the controller once and then using a single byte to index the color. This would give us a nice and compact 1 byte per tile for dump_mapview.
Similar reductions can also be done to the position coordinates. Currently the position is sent as a string, but sending long decimal numbers as strings takes a lot of space. The position could be sent losslessly as 2x8 bytes or truncated as 2x4 bytes, bringing us to a worst case of 9 bytes per tile before compression.
The text was updated successfully, but these errors were encountered:
Currently the colors for map data is sent as hexadecimal strings where 8 bytes are used to represent color: AABBCCDD for rgba. Lua and factorio supports putting binary data in strings using string.char(0-255) which allows us to compress it to 4 bytes.
For additional compression we could also take advantage of the actual color palette in use being far more restricted by finding all relevant map colors, transferring them to the controller once and then using a single byte to index the color. This would give us a nice and compact 1 byte per tile for dump_mapview.
Similar reductions can also be done to the position coordinates. Currently the position is sent as a string, but sending long decimal numbers as strings takes a lot of space. The position could be sent losslessly as 2x8 bytes or truncated as 2x4 bytes, bringing us to a worst case of 9 bytes per tile before compression.
The text was updated successfully, but these errors were encountered: