I am thinking about building turn-based strategy "game engine" in Python. I would like to use a database to hold information about game objects and ORM to support game logic. I have next to none experience with ORMs but I am experienced with SQL.
The database is probably going to be:
- With a lot of data but with simple structure - just a few relations and foreign keys, nothing complex
- Updates to the database will be in "batches" for each turn, but I need the history of each turn database state retained - so I can look at any game turn state in past
I would like to:
- Write as less as possible - preferably be able to use implicit constructors and useful implicit prints
- Seamlessly update the database structure between turns by adding or removing columns or changing relations without everything falling apart, preferably by just updating the classes
What ORM would meet my needs? Does it even make sense?
Clarifications:
History - At turn #5 player spots something which he does not think is right. It probably happened few turns ago. I would like to be able to see the game state at turn #2 and #3 to double check. I guess I can create a backup of the database each turn but I was thinking if there is more elegant solution.
Updating the database structure - Lets say I have class Unit with two attributes, attack
and defense
. I create a lot of objects of type Unit and store it in the database. Around turn #25 I realize that I also need attribute morale
. I would like to add it with minimal work and let the database update the tables for me. How would I do that?