Announcement

Collapse
No announcement yet.

Utility for level information?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • MH
    replied
    OK, here's most of the items on your list which I believe can be usefully extracted:
    Code:
    Map name:     Introduction
    File name:    maps/start.bsp
    Skill Modes:  Yes
    CD Track:     4
    Surfaces:     5556
    Entities:     385
    Models:       55
    
                                      +------+------+------+------+
                                      | EASY | NORM | HARD |  DM  |
                                      +------+------+------+------+
    ambient_drip                      |   1  |   1  |   1  |   1  |
    ambient_drone                     |   4  |   4  |   4  |   4  |
                                      +------+------+------+------+
    func_bossgate                     |   1  |   1  |   1  |   1  |
    func_door                         |   5  |   5  |   5  |   5  |
    func_episodegate                  |   4  |   4  |   4  |   0  |
    func_wall                         |   2  |   2  |   2  |   7  |
                                      +------+------+------+------+
    info_intermission                 |   4  |   4  |   4  |   4  |
    info_null                         |   1  |   1  |   1  |   1  |
    info_player_coop                  |   4  |   4  |   4  |   4  |
    info_player_deathmatch            |   2  |   2  |   2  |   6  |
    info_player_start                 |   1  |   1  |   1  |   1  |
    info_player_start2                |   1  |   1  |   1  |   1  |
    info_teleport_destination         |   2  |   2  |   2  |   4  |
                                      +------+------+------+------+
    item_armor2                       |   0  |   0  |   0  |   1  |
    item_armorInv                     |   0  |   0  |   0  |   1  |
    item_artifact_super_damage        |   0  |   0  |   0  |   1  |
    item_cells                        |   0  |   0  |   0  |   3  |
    item_health                       |   0  |   0  |   0  |   4  |
    item_rockets                      |   0  |   0  |   0  |   4  |
    item_shells                       |   0  |   0  |   0  |   2  |
    item_spikes                       |   0  |   0  |   0  |   3  |
                                      +------+------+------+------+
    light                             | 224  | 224  | 224  | 224  |
    light_flame_large_yellow          |  10  |  10  |  10  |  10  |
    light_fluoro                      |   1  |   1  |   1  |   1  |
    light_fluorospark                 |   1  |   1  |   1  |   1  |
    light_torch_small_walltorch       |  31  |  31  |  31  |  31  |
                                      +------+------+------+------+
    misc_fireball                     |   3  |   3  |   3  |   3  |
                                      +------+------+------+------+
    monster_zombie                    |   9  |   9  |   9  |   8  |
                                      +------+------+------+------+
    trigger_changelevel               |   5  |   5  |   5  |   5  |
    trigger_multiple                  |  12  |  12  |  12  |   2  |
    trigger_onlyregistered            |   5  |   5  |   5  |   5  |
    trigger_setskill                  |   4  |   4  |   4  |   3  |
    trigger_teleport                  |   7  |   7  |   7  |   8  |
                                      +------+------+------+------+
    weapon_grenadelauncher            |   0  |   0  |   0  |   1  |
    weapon_lightning                  |   0  |   0  |   0  |   1  |
    weapon_nailgun                    |   0  |   0  |   0  |   1  |
    weapon_rocketlauncher             |   0  |   0  |   0  |   1  |
    weapon_supernailgun               |   0  |   0  |   0  |   1  |
    weapon_supershotgun               |   0  |   0  |   0  |   1  |
                                      +------+------+------+------+
    worldspawn                        |   1  |   1  |   1  |   1  |
                                      +------+------+------+------+
    Totals                            | 345  | 345  |   0  | 711  |
                                      +------+------+------+------+
    The only other item is exits which I haven't done yet, but I see a way of doing it so it's just a matter of time and code.

    For various reasons I don't believe the others are possible or practical. I'd love to be proven wrong but for now I don't see any way.

    Specific examples:

    Brushes don't even exist in a BSP file - brushes are cut into BSP surfaces and then discarded so we have no way of getting a count. I've replaced them with a surfaces count.

    Anything that depends on an entity name is right out. Nothing in the engine mandates any entity naming convention. A mod author could create an entity classname of "elephant" that functions as a player start position. This covers switches, teleporters, secrets, spawn points, as well as the specific entity types you listed in your original post.

    It would be possible (but messy) to get the classname of the spawnpoint that the player entered the map on (assuming that this is run in the engine) but that's useless for the other spawnpoint types.

    The entity counts by classname I provide here should give you much the same info, but whether or not it's meaningful depends on the classnames that the mod author has chosen.

    New graphics are possible but impractical. We'd need to hard-code a list of all old textures in the engine (or in a hypothetical utility) and even that wouldn't be enough. Quake allows different textures to have the same name, so we'd also need checksums for them all. Furthermore, any graphics that are not stored in the BSP (skins, menu graphics, etc) are flat out impossible to pull info on from the BSP. Not going to be done.

    Sounds aren't stored in the BSP at all. A sound classname for certain types is, but the actual sound file name isn't; it comes from QC. Other sounds are associated with types of entity. Even if it was practical we'd have to assume that the BSP info was extracted from a game directory where we could backtrack up the filesystem tree to get the sounds directory, then go through the same checksum nightmare as for new graphics. Also not going to be done.

    Whether or not SP or DM modes are available can't be inferred from the counts per mode as the mapper may have just neglected to set spawnflags.

    Coop mode depends entirely on the coop spawn point being present, and as the modder could have called that anything we can't assume. Same goes for DM and SP spawn points.

    Now, maybe I could test for the well-known names on the assumption that a modder won't actually change them, and display the info if a count is present, but I can never definitively say "no". Anyway the entity counts will give you the same, so it doesn't really seem necessary.

    I'm dubious about including skills here as there will nearly always be at least two skills available in an SP map - even if the mapper hasn't set the correct spawnflags. One of those is nightmare, which has different behaviour coming from the QC (you'd need a full-blown QC interpreter and a test suite to determine if the QC contains code to support that, by the way).

    Amazing what you find when you turn over stones, isn't it?
    Last edited by MH; 03-23-2010, 07:38 PM.

    Leave a comment:


  • MH
    replied
    It's going to be built into my engine, so it'll be out when my new engine release is out (maybe a week or so). I guess though that it wouldn't be difficult to extract the code for a standalone utility.

    Still no acceptable solution for level size so I'm just leaving that out.

    Leave a comment:


  • Akumadevil
    replied
    Hey guys, any progress on this?

    Leave a comment:


  • MH
    replied
    The more I think about it, the more I think that number of leafs is the way to go. =peg= is quite correct about map extents not being a good indicator, and number of surfaces is useless as it's possible to use many surfaces for tiny detail. A leaf can be really tiny of course, but in general they tend to average a radius of about 2000 so they do represent a fairly well-defined volume in which a player can do stuff.

    Leave a comment:


  • =peg=
    replied
    Size is a tricky one, for the outer limits or ground area are often not really representative of how large a level "feels". A map can be kinda smallish, yet spacious enough to feel quite large, or the other way around. What I'm getting at, I guess, is the overall "volume" that players can freely move around in. And then there is the amount of tactical items as well as their lay-out within that volume, and the number of different routes from one to another..

    For example, take a map like q3dm6qw.. At first glance it may seem rather large, but it does allow players to move quickly, due to its openness (lots of space to rocket-jump and bunny at high speed). In fact, one can get from the yellow armor to the red armor and back to yellow, within 15 seconds pretty easily (which takes you all around the map) making the map feel a lot smaller.

    I'm using multi-player-maps as a reference here, because I think that's where automatically calculated map-sizes would be most beneficial. Some mods already pick an appropriately sized map based on the number of (active) players, however, those map-sizes still need to be determined before-hand ("manually" so to speak), and with 350+ maps on server, some way to automate that would be great

    Of course, in general, single-player-maps (at least the custom ones) are usually a lot larger then any multi-player-map, so maybe there should be two different scales for both varieties..

    Leave a comment:


  • MH
    replied
    I guess measuring the bounds of the BSP (i.e. from the vertex data) would be a start. Factor in number of surfaces and number of leafs and then run a few maps to get ballpark figures and we'll have something workable. I'd see it maybe using tiny/small/medium/large/huge or something like that, with the ID maps hovering around the small/medium end of the scale.

    Leave a comment:


  • Zop
    replied
    Mh is already on the case! I'm curious if you know of a trick to get a "size" of a level?

    Leave a comment:


  • MH
    replied
    Here's what I've currently got for the start map - I haven't bothered sorting them yet, and there's none of the additional info or column headers (yet).
    Code:
    info_null                           1   1   1   1
    info_intermission                   4   4   4   4
    ambient_drone                       4   4   4   4
    info_player_start2                  1   1   1   1
    item_artifact_super_damage          0   0   0   1
    item_cells                          0   0   0   3
    weapon_lightning                    0   0   0   1
    func_episodegate                    4   4   4   0
    info_player_coop                    4   4   4   4
    ambient_drip                        1   1   1   1
    func_bossgate                       1   1   1   1
    info_player_deathmatch              2   2   2   6
    item_health                         0   0   0   4
    weapon_nailgun                      0   0   0   1
    item_shells                         0   0   0   2
    weapon_supershotgun                 0   0   0   1
    item_armor2                         0   0   0   1
    weapon_grenadelauncher              0   0   0   1
    item_rockets                        0   0   0   4
    weapon_rocketlauncher               0   0   0   1
    item_spikes                         0   0   0   3
    weapon_supernailgun                 0   0   0   1
    item_armorInv                       0   0   0   1
    func_wall                           2   2   2   7
    trigger_multiple                   12  12  12   2
    monster_zombie                      9   9   9   8
    trigger_changelevel                 5   5   5   5
    trigger_setskill                    4   4   4   3
    trigger_onlyregistered              5   5   5   5
    func_door                           5   5   5   5
    info_teleport_destination           2   2   2   4
    light_fluoro                        1   1   1   1
    light_fluorospark                   1   1   1   1
    trigger_teleport                    7   7   7   8
    misc_fireball                       3   3   3   3
    light_torch_small_walltorch        31  31  31  31
    light_flame_large_yellow           10  10  10  10
    light                             224 224 224 224
    info_player_start                   1   1   1   1
    worldspawn                          1   1   1   1
    The 4 number columns are easy/normal/hard/deathmatch counts (nightmare is the same as hard). Right now it just draws to the console but it would be quite easy to dump to file instead (just switch the Con_Printf to an fprintf if a filename is supplied as an arg to the command).

    Is "levelstats" a good name for the command, by the way?

    Leave a comment:


  • Akumadevil
    replied
    Whatever can be done with the limited information I suppose.

    Leave a comment:


  • MH
    replied
    Hmmm - it may not be 100% possible in that format as a lot of it is tied down to the ID entity set, and nothing in Q1 mandates naming conventions for (the majority of) entities. No reason why a monster entity can't be called "badguy_woofwoof" for example, and there's nothing to connect that to the friendly name "Rottwieler". Likewise a secret might be called "hiddenstuff" and a map exit might be called "mapexit" (instead of "trigger_changelevel"). I was thinking possibly along the lines of giving counts of entities based on their classnames.

    Leave a comment:


  • Akumadevil
    replied
    You are the man. I mocked up an example text output below:

    Code:
    -------------------- INFO -------------------
    
    Map name:	Introduction
    Filename: 	intro.bsp
    Exits: 		e1m1.bsp, secret1.bsp
    Switches: 	5
    Teleporters:	2
    Secrets:	3
    Size:		Large
    Spawn points:	4
    Single player:	Yes
    Skill modes:	Yes
    Cooperative:	Yes
    Deathmatch:	Yes
    New graphics:	Yes
    New sounds:	Yes
    CD track:	5
    Brushes:	100
    Entities:	100
    Models:		100
    
    ------------------ MONSTERS -----------------
    
    		|------|------|------|------|
    		| EASY | NORM | HARD |  DM  |
    	    	|------|------|------|------|	
    Rotfish     	|  5   |  7   |  9   |      |
    Rottwieler  	|      |      |      |      |
    Zombie		|      |      |      |      |
    Grunt		|      |      |      |      |
    Ogre		|      |      |      |      |
    Enforcer	|      |      |      |      |
    Knight		|      |      |      |      |
    Death Knight	|      |      |      |      |
    Fiend		|      |      |      |      |
    Scrag		|  10  |  12  |  16  |      |
    Spawn		|      |      |      |      |
    Vore		|      |      |      |      |
    Shambler	|      |      |      |      |
    Other*		|      |      |      |      |
    		|------|------|------|------|
    TOTAL		|  15  |  19  |  25  |      |
    		|------|------|------|------|
    
    ------------------- ITEMS -------------------
    
    		|------|------|------|------|
    		| EASY | NORM | HARD |  DM  |
    	    	|------|------|------|------|	
    Small Shells   	|  5   |  7   |  9   |      |
    Big Shells  	|      |      |      |      |
    Small Nails	|      |      |      |      |
    Big Nails	|      |      |      |      |
    Small Rockets	|      |      |      |  1   |
    Big Rockets	|      |      |      |      |
    Small Cells	|      |      |      |      |
    Big Cells	|      |      |      |      |
    Small Health	|      |      |      |      |
    Big Health	|  10  |  12  |  16  |      |
    Shotgun		|      |      |      |      |
    Super Shotgun	|      |      |      |      |
    Nailgun		|      |      |      |      |
    Super Nailgun	|      |      |      |      |
    Grenade Launcher|      |      |      |      |
    Rocket Launcher	|      |      |      |  1   |
    Lightning Gun	|      |      |      |      |
    Green Armour	|      |      |      |      |
    Yellow Armour	|      |      |      |      |
    Red Armour	|      |      |      |      |
    Silver Key	|      |      |      |      |
    Gold Key	|      |      |      |      |
    Rune		|      |      |      |      |
    Quad Damage	|      |      |      |      |
    Pentagram	|      |      |      |      |
    Ring of Shadows	|      |      |      |      |
    Biosuit		|      |      |      |      |
    Megahealth	|      |      |      |      |
    Other*		|      |      |      |      |
    		|------|------|------|------|
    TOTAL		|  15  |  19  |  25  |  2   |
    		|------|------|------|------|
    
    ---------------------------------------------
    
    * Not sure if you can name the custom monsters/items (i.e. wizard)
    This is all just guesswork as I don't know what's in a BSP file.

    Cheers,
    Daniel.

    Leave a comment:


  • Zop
    replied
    It would be pretty easy to do everything but the size in perl, including the different number of items/monsters for each skill level or deathmatch mode. To get the size, I could whip something up in quakec that chooses tons of random points in the map to get a percent of space compared to the max size (of non-enhanced quake requiring levels), and thus a value that can be compared between levels.

    How do you want the output to be arranged?

    Leave a comment:


  • Mr.Burns
    replied
    Originally posted by mhquake View Post
    ...Other problem: it's possible to spawn new entities while the map is running; this means that the info may very well vary at different times during play. Again, doing it from the engine suggests the solution of just providing the current state based on the contents of sv.edicts.
    This is true. Some Quake mods such as Deathmatch Plus will actually allow Admins to place new entities within a map to help even up the map in the event of someone camping out the RL for example.

    Like the idea of the utility though, particularly if you could intergrate it in to a server browser. I wonder if some easier (non Qstat) means of browsing servers could be on the wish list for those "server" engine coders amongst us

    Kind regards

    Monty

    Leave a comment:


  • MH
    replied
    Hmmm - seems easy enough in concept, I might just integrate that idea into my engine (via a levelstats command).

    Edit: Coupla problems. The reported info will vary depending on game mode and skill. Integrating it into the engine gives a logical solution - just provide the info for the current map in the current mode and skill.

    Other problem: it's possible to spawn new entities while the map is running; this means that the info may very well vary at different times during play. Again, doing it from the engine suggests the solution of just providing the current state based on the contents of sv.edicts.
    Last edited by MH; 03-03-2010, 01:17 PM.

    Leave a comment:


  • Spirit
    replied
    Oh, *some day* I will write that for Quaddicted. I swear...!

    Leave a comment:

Working...
X