I have been developing a text-based rpg in C++, using sqlite as my database.
When it comes to interactions that change the world around the player in some permanent fashion I have been unable to find a satisfactory method of storing them.
The player kills a character then if they return to the same area I do a check in my "game_data" table for "character_x_is_dead" and if the character is dead then the player sees the body on the floor, if they are alive then the player can talk to them.
Is there a better way to handle this type of thing without having to impose conditions on an area that are checked and then the correct output is picked from a list of possibilities? (I'm just thinking about how as the game gets bigger and the player does more things this table is just going to grow more and more with potentially a lot of the contents becoming no longer needed)
Edit - clarification about "list of interactions"
By this phrase I mean any interactions that may alter how the player is allowed to interact with an area, hopefully these examples might make it clearer:
- The first time the player talks with the innkeeper at the starting town they get given some money - when they talk to the innkeeper the next time, the money adding event should not fire again.
- After the player has gone through a dungeon, any chests they open should still be empty if they come back later.
- If the player helps a character then the next time they talk to the character they give one of their positive responses instead of their standard ones.