Storing data for a pokemon like game

The game I’m developing is close to Pokemon. How should I store the data? I am currently thinking of text files where I save the map and have a corresponding textfile for the trainers and their teams on the “current” screen. However this leaves me with a LOT of textfiles.

At the moment I’m thinking of something like this, however I haven’t coded this yet so I can still easily change this.

@Trainer;5;
@Pokemon;12;1;3;4;6;
@Pokemon;13;1;2;5;
@Pokemon;13;1;4;5;
@Pokemon;11;1;3;5;
@Pokemon;16;1;2;7;
@Trainer;3
@Pokemon;13;1;4;5;
@Pokemon;11;1;3;5;
@Pokemon;16;1;2;7;

Where the first column is the “type” of the entry. If the first is Trainer the second is his number of Pokemon. If the first is Pokemon the second is the level, the third the type, the fourth/fifth/sixth the IDs of his attacks. (How should I store the attacks? A seperate textfile where I just store the attacks?)

I am currently finding myself with having such a huge amount of data that I’m starting to wonder wether I should be using a Database instead?

Using Java(LWJGL).

Additionally:
Posted this on stackexchange already, though wanted more expert opinions on this! :slight_smile:

I am no expert, but is your game suitable for serialization?

You could create a class that holds everything about your characters, then pass your data to it, store using that class objects, and save to a file. Then you could build some retriever methods like getPokemonAttackCount() etc. So when you open the file, you just read the object, extract the data then send to the relevant classes/methods.

I think I made it sound complex, but it is not that hard.

It’s very similar to Pokemon.
The problem is not saving my current game state, the problem is storing things that are set(the environment). For example where a trainer is positioned and what his pokemon are, what the attacks of his pokemon are, etc.
I am unsure wether to use a Database(SQLite?) or text files. Or maybe there is another very different approach?

I’d probably just go with text files for most of the information, they’re easy to use.

True, however I would still need to encrypt them somehow otherwise users would be able to edit them and make the game easier. Probably just binary or something.

[quote]True, however I would still need to encrypt them somehow otherwise users would be able to edit them and make the game easier. Probably just binary or something.
[/quote]
Unless you are going for a big game, with high score/multi-player as an important feature, I wouldn’t care.

If anybody liked my game enough to mod, and play with it, I would be super happy.

But if you have a boner for encryption then go for it :wink:

I think you shoud give trainers / pokemon their own id, and cleate an data file for each entity for data storage.
Then in your map you could just add an entry for npcxxx / pkmnxxxx or something.
Many datafiles does not seem like an problem, since you only have to refrence the id ths way and gives a lot of flexibility.

If you want to block people from editing files, online storage is your ONLY solution.
Everything whats send (and later decoded) by the client can be changed (because you need to include decription code, what could easly be found in your code).