OK, I have set up the primary data structures for the game and written the save/load routines.
…ouch. This is the EEPROM breakdown.
Farm: 747 bytes
Player: 69 bytes
NPCS: 32 bytes
= 846 Bytes
So not a heck of a lot of wiggle room. Also with those structures sitting in RAM and that pesky sBuffer we’re hitting 82% of RAM already. I’m going to have to calloc my data structures to avoid the USB write issues already.
But, all that money (EEPROM bytes) buys us the following.
32 NPC’s, we only need to store their affection levels, which is a single byte.
storage for the following tools with 4 levels of available upgrading (2 bits per tool). Axe, Hoe, Pick, Watering Can, Pail, Shears, Scythe, Fishing Rod.
Players money (4 bytes).
total days through game (2 bytes). This is enough for 65535 before wrap around, probably could get away with one byte.
Players lumber (1 byte)
Players stone (1 byte)
Players max stamina (1 byte)
8 character names for player, farm, dog, horse. (32 bytes)
2 bytes for horse and dog affection.
A max 10 item backpack, (items are 2 bytes, 1 byte for ID and 1 for quantity).
An item in the hand and a tool in the hand.
The farm has the following.
a 24x16 field for planting crops. This is far and away the biggest user of space. Each crop tile is a byte, with 4 bits for ID (enough for 4 crops each season and 3 extra) and 4 bits for growth stage.
16 x 3 bytes to indicate if a crop tile was watered. If you don’t water the crops, they don’t grow.
Space for 8 chickens, 8 cows and 8 sheep, each with an 8 character name and a byte to store affection.
space for 16 trees in an orchard. Each tree is a byte (2 bits for ID, 6 bits for growth).
A 20 item storage chest and a 20 item fridge to put stuff into. 80 bytes here.
So yeah, These are the features I want to support. The next step is to see how much space it takes to store the farm and associated menu screens in progmem. That will give me the ‘rest of game’ budget. If there is not enough space, it will go from farming/dating game to just ‘farming game’