mburbea/koar-item-editor

ItemMemoryInfo struct

Closed this issue · 1 comments

This is the most well known of Amalur's structs in the cheating community. However, it is still not 100% understood what everything does in it. I believe this is actually a runtime representation of a simType as non-items also have one of these things.

Offset Length Name Example Desc
0 4 Item Id 32 03 A2 03
4 4 0B 00 00 00 0B 00 00 00
8 5 Header 68 D5 24 00 03
13 4 Data length 23 00 00 00 (13 + 4 + 35) how did I miss this?!*
17 4 Unknown int 64 00 84 01 Varies between save games could be related to game state.
21 4 Effect count 01 00 00 00
25 4 First effect 9D C6 1C 00 ItemBuff_longbow_unique02b
29 4 4 FFs FF FF FF FF
33 4 Unknown constant? 00 00 00 00 Usually zeros
37 4 Current durability 00 00 28 42 Stored as a float
41 4 Max durability 00 00 28 42 Stored as a float
45 4 Stack count 01 00 00 00 1 for equipment
48 2 Flags 04 01 If the second byte has 80 set it's a quest item and stuck in your inventory. 40 = cannot stash
51 1 Has Custom Name 00 1 equal yes, 0 equal no.

Now if an item has a name which this one doesn't, then it'll have the following additional offsets to consider:

Offset Length Name Example Desc
52 4 Name Length 04 00 00 00
56 Variable Name content 43 6F 6F 6C Cool. I think the US Steam version game uses Latin-1, could be utf8?

This ALSO probably explains why adding an effect or changing your item's name corrupts your save game, The game when it loads from disk for the first time probably has some tolerance for corrupted save games, but when it encounters the invalid data length it just plain halts.

As per @peterthieroff a dev on the remaster the logic is the following for this section::

add_to_stream(stream, m_my_owner);

  add_to_stream(stream, m_owner_buffs);
  add_to_stream(stream, m_pocket);
  add_to_stream(stream, m_durability);
  add_to_stream(stream, m_max_durability);
  add_to_stream(stream, m_stack_count);
  add_to_stream(stream, m_item_flags);