Plan for increasing item limit

Jump to navigation Jump to search

This plan is DONE; there is now a limit of 32000 item definitions.

Previously there were a maximum of 254 available items. Your inventory consists of 200 slots that can each contain up to 99 copies of an item. There is no code for gracefully handling the situation where you gain an item that you do not have room for.

The inventory data is just a single 16 bit integer for each slot. The low 8 bits is the item ID + 1 (0 for blank) and the high 8 bits is the number of items (which can only be 1 to 99 so actually only 7 bits are ever used) The item data is stored in the player's inventory in this same format.

  • Write a Type to store inventory slots. It should have at the very least a member for item ID and a member for item count (done)
  • Make the SAV file support convert from the old format and store as this new type (done)
  • Convert all item inventory related code in game to use this new Type. (done)
  • Test the heck out of it (done)
  • Write new SAV support for the inventory data (done)
  • Re-write equip menu, which still uses 8-bit item IDs (done)
  • Allow more than 254 items (done)
  • Allow the game author to set the max size of the inventory
  • Write a trade/drop screen where a player can handle inventory overflows by making room. (This is now the Plan for full-inventory handling)
  • Test the heck out of it again