Using a database to save the state of a game?

Hi Everyone,

I am just after a little bit of advice really. I started learning c#, thought I'd make a game to help keep me motivated. Nothing flashy, based it on managing a rugby team. Thought it would allow me to do some manipulation of variables, learn some UI and so on. I've got to the stage where I am up and running, modelling some games just two teams involved, random number generating the results and so on.

I am loving it so much though that I'm starting to get a bit carried away and take it a bit serious. I want to actual model the games and create something a bit more impressive.

Now to the problem. I want to move the game from the two teams and have lots of teams, put in some competitions, track results, track team finances/transfers and fixtures and track the players within those teams too. I thought the best way of doing this would be to drop in a database(SQL lite or something) and use this. But I think this would mean that my users could only play one game at a time? If they wanted a second game then I would have to wipe and recreate the database and they would lose their initial game. I then thought that when saving a game, I could ensure that a file is written to a text doc that was basically a sql script that would recreate the whole database on the load of the program, but then that sounds ridiculous. Especially if I have as many competitions/players in the game as I would like to have(told you I was getting a bit carried away didn't I?), as the inserts on sqllite for that many updates are going to be a bit slow. I also thought that maybe the database isn't the right to go. I could save the game state to an xml then load all the data into memory when the game is first loaded and just store them as objects. Again this sounds clunky and memory hungry. I am not sure what's the best option to go for and looking for advice. How do I manage the data needs of the game? How do I save the game state(the data in the game) and allow it to be reloaded? Should I use a db? or do I have an alternative here?

Cheers for any advice anyone can give me.

by Senseicads via /r/csharp