Forum

Automatically Determining Gamedir Start Map

Discuss programming topics for the various GPL'd game engine sources.

Moderator: InsideQC Admins

Automatically Determining Gamedir Start Map

Postby Baker » Wed Aug 20, 2014 1:28 am

This works for single player in all the instances I have tried:

1) startmap_named_start = 0,
2) startmap_undergate_intro_rockgate,
3) startmap_start_in_name,
4) startmap_same_as_gamedir,
5) startmap_alphabest,

If the gamedir contains a map named "start", you have the start map.
Failing that, if the gamedir contains a map named "undergate", "intro" or "rockgate", you have the start map.
Failing that, use any map that has the name "start" in it (strstr (mapname, "start"))
Failing that, use any map that has the same name as the gamedir (gamedir lunsp1, use map lunsp1)
Failing that, due to lack of information use the highest alphabetical match.

(This is, of course, excluding health boxes and such.)

And, to my surprise, this method revealed to me that NE_RUINS has a map named start. 99% of the time I played that typing game "ne_ruins; map ne_ruins"
The night is young. How else can I annoy the world before sunsrise? 8) Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
User avatar
Baker
 
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Re: Automatically Determining Gamedir Start Map

Postby szo » Wed Aug 20, 2014 8:36 am

Baker wrote:[...]
Failing that, use any map that has the name "start" in it (strstr (mapname, "start"))

This is stupid/wishful thinking/whatever else you prefer (no offense)

Baker wrote:Failing that, use any map that has the same name as the gamedir (gamedir lunsp1, use map lunsp1)

This is stupid too (even more stupid, again no offense). I almost always name my mod directory as "a" or "x".
szo
 
Posts: 132
Joined: Mon Dec 06, 2010 4:42 pm

Re: Automatically Determining Gamedir Start Map

Postby Spirit » Wed Aug 20, 2014 9:13 am

Curl the Quake Injector XML and choose the first <startmap> ;)
Improve Quaddicted, send me a pull request: https://github.com/SpiritQuaddicted/Quaddicted-reviews
Spirit
 
Posts: 1031
Joined: Sat Nov 20, 2004 9:00 pm

Re: Automatically Determining Gamedir Start Map

Postby Baker » Wed Aug 20, 2014 9:19 pm

szo wrote:
Baker wrote:[...]
Failing that, use any map that has the name "start" in it (strstr (mapname, "start"))

This is stupid/wishful thinking/whatever else you prefer (no offense)

My stupid and wishful thinking moves mountains and gets results! :D I'm MH jr. :mrgreen:

Spirit wrote:Curl the Quake Injector XML and choose the first <startmap> ;)

Actually, I'm trying to avoid Quaddicted metadata for anything that doesn't explicitly require it.

Examples: Unpacking a zip. It is easily possible to poke around the zip contents.

This is another example, it works flawlessly so far. And I think I have a method for determining -quoth, -hipnotic and such automatically.

The metadata at Quaddicted is invaluable, but it lacks a couple of things (is a map coopable?)
The night is young. How else can I annoy the world before sunsrise? 8) Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
User avatar
Baker
 
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Re: Automatically Determining Gamedir Start Map

Postby Spike » Wed Aug 20, 2014 9:55 pm

baker, startmap_sp+startmap_dm aliases in a couple of engines will be executed by the 'new game' option if they exist in preference to using 'map start'. these are explicit and so should have the highest priority.
these should thus have the highest priority, but may additionally set other cvars so you'd need to parse it carefully if you're explicitly after the map name for some reason.

no matter what you try, there is no foolproof way. A mod might even have two (maybe).
Spike
 
Posts: 2892
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Re: Automatically Determining Gamedir Start Map

Postby Baker » Wed Aug 20, 2014 9:59 pm

Spike wrote:baker, startmap_sp+startmap_dm aliases in a couple of engines will be executed by the 'new game' option if they exist in preference to using 'map start'. these are explicit and so should have the highest priority.
these should thus have the highest priority, but may additionally set other cvars so you'd need to parse it carefully if you're explicitly after the map name for some reason.

no matter what you try, there is no foolproof way. A mod might even have two (maybe).


What is an example of a mod that uses that feature? Lardarse told me about the feature ages ago, but I don't know of a test case mod.

[If you know of a test case ...]
The night is young. How else can I annoy the world before sunsrise? 8) Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
User avatar
Baker
 
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Re: Automatically Determining Gamedir Start Map

Postby Spirit » Thu Aug 21, 2014 10:03 am

Baker wrote:Examples: Unpacking a zip. It is easily possible to poke around the zip contents.

Wait until you find the zips that require manually sorting files into subdirectories.

Baker wrote:The metadata at Quaddicted is invaluable, but it lacks a couple of things (is a map coopable?)

That's what tags are for. ;)
Improve Quaddicted, send me a pull request: https://github.com/SpiritQuaddicted/Quaddicted-reviews
Spirit
 
Posts: 1031
Joined: Sat Nov 20, 2004 9:00 pm


Return to Engine Programming

Who is online

Users browsing this forum: No registered users and 1 guest