Index | FAQ | Search | Memberlist | Usergroups | Profile | Log in to check your private messages | Log in | Register

Map Display

| Inside3d Forums Forum Index -> Engine Programming

View previous topic :: View next topic
Author | Message
--- | ---
Team Xlink Joined: 25 Jun 2009 Posts: 320 |

Posted: Thu Jan 14, 2010 8:51 pm Post subject: Map Display |

Hello. Here is my idea: An easy way to display maps in the menu without having to modify the engine to be specific to the mod (It avoids having to have a custom engine to do it when your base engine could already do it for you.) There are a couple versions of it:
1. You could have a section in the menu where the maps are that would display all of the map names found in a folder (id1 most likely)
2. You could have it read a .lst file and display the names from there.
Do any engines have something like this already, has anyone done this? What would be the best way to go about accomplishing this?
Thank you.
_________________

Anonymous wrote:
if it works, it works. if it doesn't, HAHAHA!

Back to top |

Baker Joined: 14 Mar 2006 Posts: 1538 |

Posted: Thu Jan 14, 2010 8:56 pm Post subject: |

Listing maps ... JoeQuake lists the maps via the map menu. Qrack is based off JoeQuake and therefore does this. FitzQuake lists the maps via, I'm thinking the "maps" command and prints them on the console. DarkPlaces does the same. DirectQ does this I believe.
The weaknesses of at least JoeQuake's way for sure is that it also lists the item brush models (like healthboxes and ammo boxes) because those are also .bsp.
JoeQuake indicates if it is in the folder or in the pak file.
You probably have to "tune" it to trim it down to what you are intending to have it display. JoeQuake, for instance, displays the maps in any pak file loaded and at least in standard Quake even if a gamedir is being used, the id1 folder paks are always loaded so it's gonna list e1m1 and such.
_________________
Tomorrow Never Dies. I feel this Tomorrow knocking on the door ...

Back to top |

mh Joined: 12 Jan 2008 Posts: 910 |

Posted: Thu Jan 14, 2010 10:00 pm Post subject: |

DirectQ does it for sure but it's very Windows-API-ey; you could use the standard CRT versions of _findfirst/etc though (the advantage of the Windows API for me was that I could also get filesystem attributes, like whether or not it was a hidden file).
The method I use to exclude box models is to scan through the BSP looking for an "info_player_*" entity. Of course having this naming convention is only a convention, and a custom mod that totally rewrote it's QC could well call it "elephant" and cause my method to break.
_________________
DirectQ Engine - New release 1.8.666a, 9th August 2010
MHQuake Blog (General)
Direct3D 8 Quake Engines

Back to top |

Baker Joined: 14 Mar 2006 Posts: 1538 |

Posted: Thu Jan 14, 2010 10:23 pm Post subject: |

Ah, well making file system notes ... If I recall correctly, the JoeQuake way is not operating system portable directly. It uses some file listing functions that are Windows specific. And I'm thinking FitzQuake's code is also Windows specific.
You need a platform neutral file listing method, this can be located in fs_something.c or some such source file in DarkPlaces and plugged into the JoeQuake method, as it appears each operating system has it's own way of listing files in directory. More or less it is Windows versus everyone else ... again, if my memory is correct ... and DarkPlaces has a nice little "wrapper" it puts over that to bridge the differences.
/DarkPlaces source code is so handy! Half the time it is like a toolkit to solve any given problem, an engine coder's reference manual.
_________________
Tomorrow Never Dies. I feel this Tomorrow knocking on the door ...
Last edited by Baker on Thu Jan 14, 2010 10:25 pm; edited 1 time in total

Back to top |

Teiman Joined: 03 Jun 2007 Posts: 309 |

Posted: Thu Jan 14, 2010 10:24 pm Post subject: |

mh wrote:
DirectQ does it for sure but it's very Windows-API-ey; you could use the standard CRT versions of _findfirst/etc though (the advantage of the Windows API for me was that I could also get filesystem attributes, like whether or not it was a hidden file).
The method I use to exclude box models is to scan through the BSP looking for an "info_player_*" entity. Of course having this naming convention is only a convention, and a custom mod that totally rewrote it's QC could well call it "elephant" and cause my method to break.

Do people make new bsp models?
maybe a possible solution will be to "blacklist" these names b_nails.bsp as not a map. So before dumping the map list, compare against the blacklist.

Back to top |

mh Joined: 12 Jan 2008 Posts: 910 |

Posted: Thu Jan 14, 2010 11:00 pm Post subject: |

Teiman wrote:

mh wrote:
DirectQ does it for sure but it's very Windows-API-ey; you could use the standard CRT versions of _findfirst/etc though (the advantage of the Windows API for me was that I could also get filesystem attributes, like whether or not it was a hidden file).
The method I use to exclude box models is to scan through the BSP looking for an "info_player_*" entity. Of course having this naming convention is only a convention, and a custom mod that totally rewrote it's QC could well call it "elephant" and cause my method to break.

Do people make new bsp models?
maybe a possible solution will be to "blacklist" these names b_nails.bsp as not a map. So before dumping the map list, compare against the blacklist.

Actually they do, believe it or not. ne_tower for example is full of cogs that are huge BSP models (and that are a bitch on your FPS in most engines).
Nobody's (I think!) made an environment sky as a BSP model yet, but it's only a matter of time.
_________________
DirectQ Engine - New release 1.8.666a, 9th August 2010
MHQuake Blog (General)
Direct3D 8 Quake Engines

Back to top |

Display posts from previous:

| Inside3d Forums Forum Index -> Engine Programming | All times are GMT
Page 1 of 1

Jump to:

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Powered by phpBB © 2004 phpBB Group