Conquest: How to select maps?

Discuss programming in the QuakeC language.
Post Reply
Wazat
Posts: 771
Joined: Fri Oct 15, 2004 9:50 pm
Location: Middle 'o the desert, USA

Conquest: How to select maps?

Post by Wazat »

I'm working on building the town right now. I'm no mapper but things are still going fairly well. However, one of the key features of the town is actually a coder's job: how to let the player select which map to play next.

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
Note that instead of "e1m1" I might print the actual name of the map...

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!
When my computer inevitably explodes and kills me, my cat inherits everything I own. He may be the only one capable of continuing my work.
Tei
Posts: 193
Joined: Mon Oct 25, 2004 12:22 pm

Re: Conquest: How to select maps?

Post by Tei »

Wazat wrote: 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?)
maybe:

e1m4
1
23:15
1
ENMAP
e1m3
4
20:01
2
ENDSESION
1



Change file?
I forgot the limits of FRIK_FILE,

If you are limited to append to a ever growming map.sav:

e1m4
1
23:15
1
ENMAP
e1m3
4
20:01
2
ENDSESION
1
e1m4
1
23:15
1
ENMAP
e1m3
4
20:01
2
ENDSESION
2
e1m4
1
23:15
1
ENMAP
e1m3
4
20:01
2
ENDSESION
3


you can have
startagame.bat file and continueplaying.bat file
so startgame.bat file delete maps.sav and launch darkplaces
Wazat
Posts: 771
Joined: Fri Oct 15, 2004 9:50 pm
Location: Middle 'o the desert, USA

Post by Wazat »

I'm still wondering what the best way to do this is. It's kind of the most important part of the town, besides the shops. :)
When my computer inevitably explodes and kills me, my cat inherits everything I own. He may be the only one capable of continuing my work.
Tei
Posts: 193
Joined: Mon Oct 25, 2004 12:22 pm

Post by Tei »

Maybe you can spawn teleporters with a serial no. Then save info on that serial no.

Ohh.. maybe its needed to add extension to FRIK_FILE to able to nuke files, or something.
Wazat
Posts: 771
Joined: Fri Oct 15, 2004 9:50 pm
Location: Middle 'o the desert, USA

Post by Wazat »

I think I will do it with linked lists. I'll load the file into a linked list of entities for display, and I'll likewise load it into entities when the player beats the level, so I can make changes to the map they just beat (if they got a better time or found more secrets, etc) or add a new one whereever I need to in the file (instead of just appending to the bottom), and then just write a new file (or rewrite the old from scratch).

Question 3: What information should be stored on each map?
I'm going to keep track of this stuff so far:
-# of times map was beaten
-# of secrets found
-# of enemies killed
-Any key items found or quest items completed
Is there anything else?

Thanks for trying to help, Tei. If anyone has any ideas that could help me, please say so. You all did vote for the town, after all. ;)
When my computer inevitably explodes and kills me, my cat inherits everything I own. He may be the only one capable of continuing my work.
Supa
Posts: 164
Joined: Tue Oct 26, 2004 8:10 am

Post by Supa »

Wazat wrote:Question 3: What information should be stored on each map?
I'm going to keep track of this stuff so far:
-# of times map was beaten
-# of secrets found
-# of enemies killed
-Any key items found or quest items completed
Well, if you were planning on giving rewards for finding secrets, list them - else just list key/quest items.
aut viam inveniam aut faciam
Post Reply