Performance and General Mapping Guidelines

xtcmenxtcmen Join Date: 2004-04-20 Member: 28040Members, Squad Five Blue
edited March 2013 in Mapping
Hello,

After my experience with Jambi, I figured I can post some helpful tips/guidelines to help all the mappers out there.

Performance Guidelines

1. Draw Calls
As a rule of thumb, each room should have less than 1300 draw calls. Each prop, light and texture generates its own unique draw call. To check this number, type r_stats 1. If you find yourself going over the limit, I recommend reducing the amount of lights/props in your room. Also keep this in mind when planning to create big rooms. It can be very hard to stay under 2000 draw calls with bigger rooms.

Ex: Hub on tram has over 1800 draw calls.
Gravity on Jambi has over 1800 draw calls.

I get performance drops in both of these rooms, especially when there are cysts.

2. Shadows
Every light that has shadows turned on, should have a shadow fade rate. If you set your shadow fade rate to 0, then the game will render the shadow throughout the entire map. 0.1 or 0.2 work well depending on how big the room is. If you really want your shadows to be on at a distance, I recommend 0.05. You should try not to go below that.

As a rule of thumb, each room should have less than 20 Shadows. For optimal performance, you should aim for less than 10. type r_stats 1 in console to look at the number of shadows generated.

3. Central Locations
In General, central locations tend to cause performance drops because the game may still render other parts of the map, even though you have proper occlusion. It is important to keep this in mind when designing centralized locations so FPS drops will not be a big issue. This is one of the biggest issues with Hub on tram. Thankfully, Hub is not a tech point so its not a huge deal. But if your map has a centralized tech point, then try designing the location so the adjacent rooms are not too close to the room so the game will not render the adjacent rooms.

4. Occlusion Geometry
This is very important. I recommend creating the occlusion geometry right after the entire map is grey boxed.

General Mapping Guidelines

1. Grey box Testing
THIS IS THE MOST IMPORTANT THING ANY MAPPER CAN DO. Grey box testing will allow you to change the design of your map very easily. Grey geometry is very malleable, and can be changed quickly. Once your map is textured, it can be very hard and time consuming to make changes to the design of your map. I recommend talking with Howser and getting your map in the Sunday Weekly Custom map PT sessions. Be sure to check the end of the post for a list of things to check when grey box testing.

2. Draw Distance
After a certain distance, NS2 will not render player/game play models. The max distance is roughly the distance between North and South Tunnels in Hub on Tram. Keep this in mind when designing rooms, especially large ones.

3. Commander Invisible and Vents
For some reason, when a vent has some textures in the Commander Invisible group, the entire vent may not show up Orange on the player map. To get around this, create a duplicate version of your map file, and get rid of all the commander invisible faces. Then render the mini-map and combined that mini-map file with your original map file.

4. Commander Invisible
You are much better off if you add all the faces that need to be in the commander invisible group while you grey box test. It can be annoying to add them later once you room is textured and has props.

5. Layer
Layer as you go. Do not wait to the last minute to add everything into a layered group.

6. Spacing - Howser
Spacing is something that's subjective and based on the context of the area/areas and where the room is positioned in the map and how its intended to play. However, somethings just don't work like, long tight corridors, huge empty open spaces, stupidly low ceilings or tiny tech point areas. I recommend loading up an official map such as tram, and follow its measurements.

Welding
I personally like to weld everything. There is a simple way to "Un-weld" your vertices so you can move faces around easily. Simply, cut a face and paste it. When you paste it again, the vertices should be disconnected.

Grey Box Check List
-Check Arc spots on tech points. If I had a dime every time a mapper had an unfavorable siege location, I could buy a few copies of NS2. The range is bigger than you think.
-Run distances between tech points. Everyone loves a balanced map.
-Hallway sizes. Are they too narrow? Too Wide open? Can an onos/exo fit in every hallway?
-Room Spacing
-Commander invisible - Is the commander's view clean?
-Occlussion Geo
-Drifer/cyst pathing
-RT locations - Are the res nodes spread out evenly? Try to maintain a TP-RT-TP-RT chain.



That is really all I can think of for now. I hope this was helpful. I learned almost all of this by studying official ns2 maps. I highly recommend loading one of them up in spark, and take a look around.

Comments

  • PandademicPandademic Join Date: 2013-02-26 Member: 183359Members
    Yes, this kind of information is invaluable.
  • HowserHowser UK Join Date: 2010-02-08 Member: 70488Members, NS2 Playtester, Squad Five Blue, Reinforced - Shadow, WC 2013 - Shadow, Subnautica Playtester, Retired Community Developer
    That's a really good post, short, to the point and very informative.
    A point I'd like to stress is the importance of scale and spacing of a map. Through playing a lot of custom maps it seems to be the most common problem. Spacing is something that's subjective and based on the context of the area/areas and where the room is positioned in the map and how its intended to play. However, somethings just don't work like, long tight corridors, huge empty open spaces, stupidly low ceilings or tiny tech point areas. Think about every species and gameplay scenario when building your rooms.
    I've also noticed several maps also feel scaled up/down. Next to each other the rooms and corridors look fine, but in gameplay you feel like a bug or a giant.
    The best solution to this (for me personally) was to study the existing maps, open them up and make measurements, copy and place planes of the spaces you feel would work in your map. Using rules, and reference entities (ready room start etc) are all well and good but to develop a higher understanding of the interaction of space in NS2, you need to study what works and what doesn't.
  • deathshrouddeathshroud Join Date: 2010-04-10 Member: 71291Members
    edited March 2013
    great post op, really does help, often i personally get carried away with rooms and before oyu know it your deleting stuff and trying to think of ways to do it cheaper.
  • DarkSeraphDarkSeraph Join Date: 2004-06-07 Member: 29174Members
    edited March 2013
    This should be webbed for reference for new mappers.

    Edit: Actually added to the guidelines & resources should be ok.
  • alibialibi Join Date: 2009-11-20 Member: 69445Members
    Great post. Some of this information should have been supplied long ago.
  • WhiteDevilWhiteDevil Join Date: 2012-09-16 Member: 159559Members, Reinforced - Shadow
    As I'm currently on my grey boxing phase I follow those rules with my mapping, great tips for new mappers. Thanks for the information about the performance also, it will come in handy later. I didn't know how ns2 handles draw calls until now.
  • SolarisSolaris Join Date: 2003-05-11 Member: 16213Members
    xtcmen wrote: »
    -Check Arc spots on tech points. If I had a dime every time a mapper had an unfavorable siege location, I could buy a few copies of NS2. The range is bigger than you think.

    quick question: What exactly IS the range of ARCs, so I can play around with Circles in the editor to check for bad spots. The wiki just says "range 26". 26 WHAT?


  • SamusDroidSamusDroid Colorado Join Date: 2013-05-13 Member: 185219Members, Forum Moderators, NS2 Developer, NS2 Playtester, Squad Five Gold, Subnautica Playtester, NS2 Community Developer, Pistachionauts
    edited December 2013
    Type distance in console, with cheats on. Look at something.
  • HowserHowser UK Join Date: 2010-02-08 Member: 70488Members, NS2 Playtester, Squad Five Blue, Reinforced - Shadow, WC 2013 - Shadow, Subnautica Playtester, Retired Community Developer
    @SamusDroid: I did not know that, you useful bastard! Thanks
  • SamusDroidSamusDroid Colorado Join Date: 2013-05-13 Member: 185219Members, Forum Moderators, NS2 Developer, NS2 Playtester, Squad Five Gold, Subnautica Playtester, NS2 Community Developer, Pistachionauts
  • SolarisSolaris Join Date: 2003-05-11 Member: 16213Members
    SamusDroid wrote: »
    Type distance in console, with cheats on. Look at something.
    While not really a helpful answer to my question (shows ~"26" like the wiki does), the command itself is quite useful.
    I ended up just pulling an ARC in sandbox mode, look at the radius when deployed, and then load the map in the Editor to meassure the distance.
    I'll use 1280" radius circles from now on. The real range seems to be a tiny bit smaller, but better be safe than sorry.

  • xtcmenxtcmen Join Date: 2004-04-20 Member: 28040Members, Squad Five Blue
    Solaris wrote: »
    SamusDroid wrote: »
    Type distance in console, with cheats on. Look at something.
    While not really a helpful answer to my question (shows ~"26" like the wiki does), the command itself is quite useful.
    I ended up just pulling an ARC in sandbox mode, look at the radius when deployed, and then load the map in the Editor to meassure the distance.
    I'll use 1280" radius circles from now on. The real range seems to be a tiny bit smaller, but better be safe than sorry.

    1280 seems about right... As a competitive player I was always able to eye ball it. Good luck on your map and I am glad this helped you (somewhat) haha

  • FivzFivz Join Date: 2013-05-01 Member: 185072Members
    ARC range should be about 900. Just make a 1024 radius circle and that should be about the range of the arc.
  • MelancorMelancor Join Date: 2003-12-15 Member: 24415Members
    The maximum distance (at which models are visible) is 1536 units, or 39 meters. In spark, you can invoke a "relevancy range circle" object to visualize.
  • MouseMouse The Lighter Side of Pessimism Join Date: 2002-03-02 Member: 263Members, NS1 Playtester, Forum Moderators, Squad Five Blue, Reinforced - Shadow, WC 2013 - Shadow
    I believe at some point a clause was added that overrode this 1536 unit restriction. It meant that everything that was in the current location would be rendered, no matter how far away it was from the player.
    I haven't checked this in a while though.
  • BeigeAlertBeigeAlert Texas Join Date: 2013-08-08 Member: 186657Members, Super Administrators, Forum Admins, NS2 Developer, NS2 Playtester, Squad Five Blue, Squad Five Silver, NS2 Map Tester, Reinforced - Diamond, Reinforced - Shadow, Subnautica Playtester, Pistachionauts
    To clarify: there is no maximum draw distance for static props/geometry in spark. The 40 meter limit applies to entities in the level, so you should still try to keep draw distances < 40 meters, otherwise you may see players pop in and out of existence.
  • SamusDroidSamusDroid Colorado Join Date: 2013-05-13 Member: 185219Members, Forum Moderators, NS2 Developer, NS2 Playtester, Squad Five Gold, Subnautica Playtester, NS2 Community Developer, Pistachionauts
    BTW, a long time ago I added arc_range and relevance_range entities in the editor, which will show a circle of radius that arc's will file and the relevance range of entities.
  • Kouji_SanKouji_San Sr. Hινε Uρкεερεг - EUPT Deputy The Netherlands Join Date: 2003-05-13 Member: 16271Members, NS2 Playtester, Squad Five Blue
    SamusDroid wrote: »
    BTW, a long time ago I added arc_range and relevance_range entities in the editor, which will show a circle of radius that arc's will file and the relevance range of entities.

    Neat! I used to use circles polygons for that, even as far back as Valve Hammer time!
Sign In or Register to comment.