For those who aren't familiar with the feature, I'd like to have a computer terminal the player can walk up to and use to select maps. This computer will bring up a menu that lists all the maps the player has played (in various campaigns & episodes), and all the maps that are now available to him.
New episodes and side quests should be easy to add to Conquest, without ever recompiling the source code, meaning the creator just needs to add his episode to some .cfg file the game reads and it will be listed.
For example, the player has played the first classic Quake episode through e1m4, and the third episode up through e3m2. He has also played some campaign called "dread", and the last map he played in the episode was dread07.bsp. He also has various monster dungeons and other side-quests he can play. The last map he played was e1m4, so it should probably be displayed first in the list so he can continue easily (or have the menu scroll down to it automatically when the player first opens the menu).
So an implementation might look like this:
Code: Select all
Select map:
Episode 1 Times played Best time Best secrets
>e1m5 0 0 0
e1m4 1 23:15 1
e1m3 4 20:01 2
e1m2 2 15:34 0
e1m1 1 05:18 3
Episode 2
e2m1 0 0 0
Episode 3
e3m2 0 0 0
e3m1 1 12:02 0
Episode 4
e4m1 0 0 0
Shadow of the Dreadlords
dread7 0 0 0
dread6 1 25:15 2
dread5 1 33:49 6
dread4 1 22:32 3
dread3 1 15:10 4
dread2 1 42:13 1
dread1 1 12:55 2
When the player beats a level, he goes to town instead of the next map in the series. There he can change his equipment, heal, etc before going to the warp gate and proceeding to the next map.
Question 1: How do I store all these maps in a file?
I'm using FRIK_FILE to store stats and other stuff, so I could just create a file for maps called "maps.sav" and start dumping maps in there... but how do I organize the file? Should I just append the most recent map to the end and leave it otherwise unordered? Or should I try to organize it by episode? (if so, how?)
Question 2: Once the player is ready to proceed to the next map from the town, how do I display the map list to him?
Menus are usually easy, but this one has some added difficulties because I have to load the list of options from a file and sort out the beaten maps from the un-beaten ones, and preferrably even sort them by episode. This is not something I want to do every time the code needs to re-display the menu, so I'm thinking I need to spawn an entity for each map in the file once when the player opens the menu, and use that entity to store the name of the map, its episode, number of times beaten, and other info, and then link that entity into the appropriate sorted linked list (there would be multiple linked lists, one for each episode). That's the best way I can think of doing it, especially if the maplist file isn't ordered.
Is there a better way?
Comments and help would be greatly appreciated!