Effecient Storing of Information in Files

I am coding a tower defense game with SFML and for the tower upgrades I think I'm going to have a bunch of arrays and whatnot to hold all of the upgrade information. I was thinking it would make things a lot neater if I put all of this information in a .txt or .dat file like I did with the map data. As I thought more about it I was wondering what efficiency I could get out of this storage method, if really matters.
Does anybody else do this? And what way do you go about it?
Last edited on
My suggestion would be not to overthink it and go with whatever storage method is easiest to deal with, then address any problems when or if they appear.
You can use xml or json for handling missions / setting the textures, cost, and damage of your towers and vice versa with monsters. This is a common thing that games do.

Overall, you need to ask yourself if you will actually use these files, because nothing is wrong with putting it all in c++. (of course you would wanna put monster wave info in a file, if it already isn't in your map file).
I realize it's a bit of a pointless question but anyway, I don't know how to do xml/json so I'll leave that alone this time around. As for the upgrades I'll probably define it all in the c++ file since afterwards it most likely won't change much.

However, the waves right now are defined in a 2D vector of type Enemy which is constructed with a struct EnemyType which is what I use to define the separate enemies and their textures, values, etc. and I feel like it would be a little weird to translate to the file so I might just define it all in the c++ file as well. The first index of the 2D Enemy vector is the round number BTW, so for each round I just push back what Enemies I would like, afterwards I will probably have random rounds
Topic archived. No new replies allowed.