Question: I am new to Java game programming, but the more I read the more I'm confused, because I've seen several different approaches to make a game loop:
1. The standard approach, that uses the Timer class (seems to be less precise).
2. The more precise approach that uses System.nanoTime.
3. A simple approach that uses scheduleAtFixedRate.

Which one should generally be preferred and where are the advantages/disadvantages of each approach? Thanks in advance for any info.

Answer: 
I'd just use some simple binary Format, especially if you don't want users to easily edit the file (and also to remove some redundancy).

For example, for a new Trainer you just add the number of Creatures he got.

Then, for every creature, you just add the creature data/stats (assuming they're fixed length or you can determine their length).

From your example above, the first trainer's dataset would just be something like this:

```
5,              12, 1, 3, 4, 6, 13, 1, 2, 5, 13, 1, 4, 5,  11, 1, 3, 5,  16, 1, 2, 7
↑Number of sets ↑ Start of #1    ↑Start of #2 ↑ Start of #3 ↑ Start of #4 ↑ Start of #5

```

Note that these would be bytes rather than actual textual numbers written to the file (might depend on the min/max values as well).
It depends on how you're storing things internally.

Here's an example, though it's not terribly efficient, that uses your format:

```
public Vector<Trainer> loadData(BufferedReader in) throws IOException {
  Vector<Trainer> trainers = new Vector<Trainer>();

  String line = in.readLine();
  String[] split;
  while (line != null) {
    split = line.split(";");
    if (split[0].equals("@Trainer")) {
      int count = Integer.parseInt(split[1]);
      Trainer t = new Trainer();
      for (int i=0; i < count; i++) {
        t.add(Pokemon.createMonster(in.readLine().split(";")));
      }
      trainers.add(t);
    }
    line = in.readLine();
  }
  return trainers;
} // end loadData()

```

I'm also sidestepping the issue of the varying parameter counts for each type of pokemon by passing the split array on to the creation method.

Strictly speaking, you don't *really* need the "@Trainer" and "@Pokemon" bits, because the system will automatically differentiate between trainers and monsters. That's how helpful the monster-count information is.

If you'd rather, you could also store things in a database, like SQLite, and pack things into tables instead.

Here are some example tables:

```
CREATE TABLE Trainers (
  id INTEGER PRIMARY KEY,
  name TEXT NOT NULL
);
CREATE TABLE Monsters (
  id INTEGER PRIMARY KEY,
  type INTEGER NOT NULL,
  owner INTEGER FOREIGN KEY (Trainers.id),
  parameters TEXT NOT NULL
);

```

By using a `parameters` column, you're avoiding the need for individual columns for each parameter for each monster type. Formatting would be whatever you want, including the semicolon-separated method you mention.