I don't know if I'm weird or if it's just normal to get random reverse engineering urges.
-
okay I think that 6-byte-chunks thing at the top of the file is items. I went and sat on top of an item, then edited the file so instead of 5-chunks it had 0, then reloaded the area (by hyperspacing out and then back in ) and suddenly the item is gone
-
which does mean I can figure out how many items are in each area, easily. Read the 3rd byte of every area file!
-
I have done so. The Area you start in is the only one with zero items.
-
yeah I narrowed down the item I'm floating over to one specific chunk.
I set the last short in the chunk to 4312 and the item changed Z coord to (approx) 4761.The value was original 4615 and it was at Z coord 6794. ugh.
-
WHY ARE THE SCALES DIFFERENT
-
I'm gonna need a spreadsheet for this
-
yeah this makes no sense.
-
the first byte seems to be which icon to use. I can adjust it, and the thing still picks up as the mining probe, but it looks different in the preview
-
next byte seems to be what it is.
I set it to 08 and got a Data Storage Laser Disk [sic]I think this guy was murdered, I found out from looking at the files that there's a dead body you can find somewhere, and I think it's mr. Allen
-
ahh. I think it's (effectively) using big endian numbers. See, the coordinates aren't linear X/Y, they're "which sector" and then (maybe) "where within the sector".
-
which I think means it has a positional resolution of like 35 meters, given that each sector is 10km across
-
fuck me these are nibble addresses
I entered "87", which is hex 0x57, and it's in sector E07
E is the 5th letter of the alphabet. so it's sector E07. -
so if I change it to 71 (hex 0x47) it should move to sector D07
-
hey look there it is.
-
Foone🏳️⚧️replied to Foone🏳️⚧️ last edited by [email protected]
okay so the 6-byte format is:
byte 0: icon
byte 1: what it is
byte 2: what sector it is inbytes 3-5 are for intra-sector positioning (presumably). now to try and figure that shit out
-
-
okay this is weird. Byte 3 is the x-position within the sector, and it can have (valid) positions between -19 and +19.
If you go above or below that range, it'll get placed into neighboring sectors, which fucks up the game's item detection. It only looks in the current sector for items, but it won't see an item that's one sector over but positioned at -50
-
byte 4 is Y-position using the same rules (origin is at bottom left)
No idea what byte 5 means. it's set to 18, but changing it to 0 or FF or anything in between seems to change nothing
-
okay I can figure out where all the items are now
C:\DOSBox-X\drive_c\Echelon\py>python decode.py ..\Az.ARE az.out
header=(0, 144),n_items=5
icon=0,itemid=2,sector=D04,x=6528,y=4992,c6=31
icon=96,itemid=128,sector=D11,x=7552,y=7040,c6=3
icon=108,itemid=152,sector=D11,x=3712,y=4992,c6=33
icon=20,itemid=41,sector=E06,x=5760,y=6784,c6=18
icon=18,itemid=38,sector=L11,x=3456,y=7296,c6=1 -
I wonder if it'll break if I put all 242 items into one area
-
Foone🏳️⚧️replied to Foone🏳️⚧️ last edited by [email protected]
so the game works by only having a 3x3 sector grid rendered, but those sectors are inside of Areas, and it can only have one area loaded at once. So if you're at sector B02, you have A01, A02, A03, B01,B02,B03, C01,C02,& C03 loaded.