Home » Renegade Discussions » Mod Forum » Dedicated VIS tutorial for the Dedicated
( ) 1 Vote
Dedicated VIS tutorial for the Dedicated [message #31310] |
Tue, 15 July 2003 13:09 ![Go to next message Go to next message](/theme/Renegade_Forums/images/down.png) |
![](http://renegadeforums.com/images/avatars/Petrova2.jpg) |
YSLMuffins
Messages: 1144 Registered: February 2003 Location: Moved a long time ago (it...
Karma: 0
|
General (1 Star) Moderator - Mod Forum |
|
|
I was trying to upload this yesterday, but I know why it wasn't working now. I promised this a long time ago, so here it is, FINALLY.
Dedicated VIS tutorial for the Dedicated
By YSLMuffins
1.1 Introduction
1.2 Getting Started
2.1 Getting the VIS sectors done
2.2 Important VIS sector notes: THE PLAYER in THIRD PERSON
2.3 Important VIS sector notes: THE PLAYER in a VEHICLE
2.4 VIS Sectors on a map with FLYING UNITS ENABLED
2.5 My personal VIS set up recommendations/known VIS issues
3.1 Getting VIS set up in the Commando Level Editor
3.2 Detailed Manual VIS point placement
3.3 VIS troubleshooting
3.4 Retouching VIS after the fact
1.1 So you're creating a map and you want your map to be played by as many people as possible? What's the best way to do this? Make sure that the map gives the best performance as possible! What's one way to do this? Get VIS set up on your map!
VIS is short for VISibility, as far as I know. It's Renegade's way of speeding up performance on their huge single player levels and on their online multiplayer maps. By way of invisible meshes called "VIS sectors" located all over the map, each sector has its own data on what can and cannot be seen from that particular point--so for example, if you're inside the Hand of Nod your computer won't waste time rendering the inside of the GDI Barracks (with proper vis data), or the barracks period if you can't even see it. The end result saves your video card and CPU from processing useless data and can leave it to focus on what's important: what's right around you.
Now, setting up vis properly can be time consuming, and most smaller maps should do fine without it, says Greg Hjelstrom, lead programmer for Renegade. On bigger, higher poly maps, though, vis is a must--and if there are parts of your map where the FPS drops dramatically, you'll want to seriously consider setting up vis for your map. Besides, all of WW's maps have a vis system in place!
1.2 Getting started
I assume you've downloaded the Renegade Public Tools. Navigate to your Program Files > Renegade Public Tools > HowTo > Multiplayer Maps > mp_hourglass folder. Open the mp_hourglass.gmax scene in RenX. Hit the "Select by Name" button and select everything in this diagram. Hide them after they're selected. Everything that's left is the vis group. Ungroup it.
![http://www.n00bstories.com/image.fetch.php?id=1290850900](http://www.n00bstories.com/image.fetch.php?id=1290850900)
Here are the vis sectors for the map Hourglass. Notice the important characteristics that these vis sectors share:
* Most every POLYGON on the map has been cloned into separate individual vis sectors. A vis sector is basically a hidden mesh with the vis option checked in the W3D options. See diagram.
* Each vis sector is hidden.
* Each vis sector is located a meter or two below the actual terrain.
* The vis sectors are located in every place the player, whether on foot or in a vehicle, can move (actually, every place where the player's CAMERA can move; more on this later).
* The vis sectors are not one huge mesh.
Study this setup--you'll have to mimic this type of setup on your own map.
![http://www.n00bstories.com/image.fetch.php?id=1269677994](http://www.n00bstories.com/image.fetch.php?id=1269677994)
2.1 Getting the vis sectors done
This is probably the most tedious part of the process--if you do it right. I personally recommend getting your VIS sectors done before you texture your terrain, as hundreds of tiny meshes with a material texture assigned to them take longer to load than hundreds of tiny meshes with NO textured assigned to them (you can also always use the UVW remove option under the utilities pane, which is the same pane that contains w3d tools).
The lazy way to do it would be to clone your terrain ground and Explode it. Select your terrain, clone it, select all of the faces of your mesh by hitting the ELEMENT selection button, click your terrain, scroll down to the Explode box in the Editable Mesh tab, set the number by the button to 0.0, and hit explode. Pick a name for your exploded meshes, and hit OK. See Diagram.
![http://www.n00bstories.com/image.fetch.php?id=1112067633](http://www.n00bstories.com/image.fetch.php?id=1112067633)
Now, I no longer recommend this method because (1) you can end up with thousands of VIS sectors, meaning thousands of unnecessary VIS sample points, and (2) WW doesn't do this. The Explode function separates a mesh, when set to 0, into individual triangle FACES, which are not only awkward vis sectors, but unnecessary and extraneous.
Detaching your vis sectors manually may take a lot more time, but it could save your vis system from crumbling entirely when you try to Auto-Generate the vis for your entire map (ie, LevelEdit crashing when trying to Build the vis sample points). If you notice on the Hourglass gmax scene, you'll notice that WW did not "explode" their VIS sectors--they selected a polygon or two, hit the DETACH button, and gave it a name. You could end up with hundreds of sectors, but not thousands upon thousands compared with using the explode method.
Give your vis sectors a unique name followed by a number, so when it comes time to Select them all you can easily assign them the vis sector W3d properties: HIDE and Vis. Group all of your vis Sectors, and lower them all by two meters along the Z-axis.
2.2 Important vis sector notes: THE PLAYER in THIRD PERSON
It's not where the player currently is that's important in the vis culling system--it's where the CAMERA is located. See diagram. When the Player is in first person mode, the camera is located exactly where the player is standing. When the Player is in third person or inside a Vehicle, that is no longer the case.
http://www.n00bstories.com/image.fetch.php?id=1225947811
By looking at the crude diagram I've crudely supplied, consider this: the camera is always BEHIND the player depending on the direction the player is looking and the camera swings around the player as the player moves the mouse. This may be obvious, but you may not have consciously realized this.
Also consider these situations:
http://www.n00bstories.com/image.fetch.php?id=1143924794
First diagram: the player has backed up against a wall that has the PHYSICAL and CAMERA w3d characteristics checked. The player's camera cannot move beyond the wall, so when the player is perfectly against the wall the player is also smashed against the camera so that the player's view is probably obstructed by the player's character model. The vis sector in green, in this case, is fine. This case also applies if the wall slants at an ACUTE angle against the ground.
http://www.n00bstories.com/image.fetch.php?id=1378494543
Second diagram: the player has backed against a wall that has the Physical and Camera w3d characteristics checked. The wall slants backwards against the ground at a degree greater than 90 degrees (pretend it's a mountain or something). The vis sector ends at the base of the wall, but since the wall slants backwards so that the player's camera can move beyond the vis sector, the vis sector MUST be extended PAST the wall. As you can see by the Red camera circle in the diagram, the player's camera has moved out of the vis sector. Whenever the player's camera stumbles outside of any vis sector, nothing could happen--or everything could turn invisible for the player (a vis glitch).
http://www.n00bstories.com/image.fetch.php?id=1200279661
Third diagram: the player has backed against an INVISIBLE barrier that blocks the player from falling off the cliff, but the invisible barrier does (and should not) have the CAMERA w3d property selected. The player's camera has moved past the invisible barrier and the cliff itself! However, because the VIS sectors extend past the cliff, the player should experience no vis glitches when this situation is encountered ingame.
http://www.n00bstories.com/image.fetch.php?id=1305981946
Now, in the gmax scene, we can put these situations to the test. Study this diagram. Get the picture now?
2.3 Important VIS sector notes: THE PLAYER inside a VEHICLE
Fireup Level Edit, load the map UNDER, and click the SHOW VIS SECTORS button. See diagram. Enter walkthrough mode, change the camera to third person, and escape walkthrough mode. Click the Camera menu, and click on GDI_Mammoth_Tank. Enter the walkthrough mode again--see something different? This is how you can walk around the map in your own virtual mammoth tank, minus the model and the speed.
http://www.n00bstories.com/image.fetch.php?id=1174469405
When you make your vis sectors, you must not only consider the FIRST and THIRD person cameras--you must also consider the VEHICLE cameras.
If you remember from the crude Camera diagram, the vehicle camera travels around a much larger radius than the Third Person camera. Walk around the map Under with the mammoth tank Camera. You'll notice the green highlighted vis Sectors as you walk around. If you ever have a landmark ramp like on under, you'll have to make sure your VIS sectors extend beyond the physical ramp beyond a much larger area, but ONLY if a vehicle can get up there. You'll probably only have to test using the Mammoth Tank camera, because I believe that is the camera that circles the largest radius. If you have the Mammoth tank camera covered, you have the rest of the vehicles covered. (The Nod_Mobile_artillery camera appears to be larger, but it seems pretty obsolete since if you look up the Havoc model gets in your way; this was patched with the flying patch.) You'll want to consider making sure the player can't get too close to the edge, or rely on the player not getting so close to the edge that they fall off!
2.4 Vis Sectors on a map with FLYING UNITS ENABLED
When you have flying units enabled, you must have additional layers of vis sectors in addition to the vis sectors you have on the ground. Each vis layer should be separated 10 meters on the Z axis. See diagram. Hopefully you won't have this many vis layers, but you should get the idea. You should continue to have vis layers until you hit the flight roof.
http://www.n00bstories.com/image.fetch.php?id=1088724513
The 10 meters number is directly dependant on the VIS Sample height that you can increase/decrease in Level Edit. 10 meters is the default, but increasing this number, while it can cut down on VIS layers, it will vastly increase the auto-generate VIS processing time. I recommend leaving the VIS sample height at the default. More on this later.
http://www.n00bstories.com/image.fetch.php?id=1226460079
Consider what WW did apparently on C&C_City_Flying. It was mostly likely because the team was short on time, but WW basically added square vis sectors 30x30 each all over the map, even in areas where there were already vis sectors. Since WW seems to have gotten this to work, perhaps you can too. According to the diagram, there are four layers of vis sectors, each layer covering the entire map. The first layer seems to have been made from scratch, and each additional layer was cloned from the first.
This could get complicated, but I'll leave it up to you to get things done. I don't have anymore specific advice on making vis sectors for flying maps.
2.5 My personal vis set up recommendations/known vis issues
The GDI/Nod Power plants need to have additional vis set up on them--the default VIS sectors are faulty. Even if you aren't going to include flying units on your map, locate the FLYING_BUILDINGS_SETUP.gmax available on the WW FTP and merge the GDI and Nod Power plants onto your own map. They include the necessary VIS that you'll need if you do not have terrain under your buildings (you have holes cut out of your terrain to specially fit each building, like WW does, right?).
I recommend adding vis sectors outside of the windows of the Hand of Nod. They are common places for vis glitches. See diagram, except do this for all the windows.
http://www.n00bstories.com/image.fetch.php?id=1214976225
3.1 Getting vis set up in the Commando Level Editor
So you've finally gotten your vis sectors done in gmax. Now you're ready for the work in Level Edit!
Make sure you've generated your Pathfind sectors and whatnot, so the Human Pathfind Generator is already on the map. See diagram.
http://www.n00bstories.com/image.fetch.php?id=1291727342
First, go to the VIS menu and DISCARD VIS DATA.
Next, go to the Edit Menu and REPARTITION THE CULLING SYSTEMS.
Third, go back to the VIS menu and BUILD THE DYNAMIC CULLING SYSTEM. This step will take a little while.
Fourth, go take a nap or something while this is chugging away. Go to the VIS menu, and hit Auto Generate VIS. In the dialog that pops up, set the Granularity to 5 (my personal recommendation). I recommend 5 because this could save you a vast amount of time while checking for VIS glitches
Fifth, walk around the map, look for vis glitches, and take MANUAL VIS point samples.
3.2 Detailed Manual VIS Point placement
The auto-generate VIS function is not going to be perfect. You'll have to walk around the map and check for vis glitches. Over my experience here are common places where vis glitches occur:
* The doorways at every building
* The Hand of Nod interior looking out through the windows
* The GDI Advanced Guard tower just as you enter through the doorway
* Tunnel entrances
* The roofs and ramps of the buildings on Flying maps
When dealing with this places, hit CTRL + SHIFT + T to hide the doors of the base buildings so you can enter/exit freely and check for vis glitches.
When you find a vis glitch, hit CTRL + ~ to take a manual vis point sample. The invisible object that should be visible should become visible. See diagram.
Here is before; notice the obvious vis glitch?
http://www.n00bstories.com/image.fetch.php?id=1319628235
After hitting CTRL + ~, pay attention to the status window at the bottom. Here is the after result:
http://www.n00bstories.com/image.fetch.php?id=1358339130
I think you should get the idea now. Run around the map, around the areas I suggested, and check for vis glitches.
3.3 Vis troubleshooting
I'm trying to fix this vis glitch, but I keep getting a BACKFACE LEAK OVERFLOW ERROR!
This means there is a BACKFACE at that particular point. Backfaces prevent the vis sampling system from generating a vis sample because the vis system thinks the player is in an invalid location (ie, under a mountain) and won't generate a sample. See diagram.
http://www.n00bstories.com/image.fetch.php?id=1077964987
To show backfaces, hit the SHOW backface button. Everything that appears in BRIGHT GREEN is a backface. According to Greg Hjelstrom, the vis system needs there for not to be any backfaces, or a very tiny amount, because this saves the vis system from performing needless processing.
To fix the backface problem, go to the vis menu and hit VIEW VIS window. Try the manual vis point sample again--this is when something should appear in the VIS window. Move the mouse around the window until you see BACKFACE! Go to the instances tab and locate the particular mesh that has the backface exposed. Clear the checkmark by it and try to do the vis sample again. This should fix the VIS glitch.
http://www.n00bstories.com/image.fetch.php?id=1207560975
However, if this method cannot solve the vis glitch, or if hiding that mesh with the backface makes something turn invisible that you don't want to turn invisible, you will have to go back to gmax and fix the problem manually. This means you'll have to start the vis process in Level Edit ALL OVER AGAIN, so as you work, use the Toggle backfaces button often and be mindful of backfaces on the battlefield!
I keep getting a "Vis Sample Rejected - No Vis Sector or Vis Sector ID not assigned!" error!
If the vis glitch is severe, you will have to go back to gmax and add a new vis sector to that location. You will have to start the vis process in Level edit all over again. Study section 2 again, as this is probably most likely the culprit behind your vis glitch problem.
3.4 Retouching VIS after the fact
After exporting your map, and after you've closed Level Edit, should you find more vis glitches in game, reopen your map in Level Edit and fix the vis glitch. Before you save your level again, make sure you go to the EDIT menu and REPARTITION the CULLING systems. This is very important--if you don't do this, the vis data could be COUNTER-PRODUCTIVE and actually SLOW down the player's FPS. Do this every time before you export your level again, and your arduous vis work will pay off!
Edit: Last updated 8-2-06
-YSLMuffins
The goddess of all (bread products)
See me online as yslcheeze
[Updated on: Tue, 01 August 2006 22:05] Report message to a moderator
|
|
|
|
|
|
|
Dedicated VIS tutorial for the Dedicated [message #31460] |
Tue, 15 July 2003 22:18 ![Go to previous message Go to previous message](/theme/Renegade_Forums/images/up.png) ![Go to next message Go to next message](/theme/Renegade_Forums/images/down.png) |
![](http://renegadeforums.com/images/avatars/Petrova2.jpg) |
YSLMuffins
Messages: 1144 Registered: February 2003 Location: Moved a long time ago (it...
Karma: 0
|
General (1 Star) Moderator - Mod Forum |
|
|
Hmmm, I'd also like to bring up another point about hills.
Say you've got a lot of hilly terrain on your map. It's my theory that the VIS auto-generate sample seems to be based on the first person camera.
![http://www.n00bstories.com/image.fetch.php?id=1374534014](http://www.n00bstories.com/image.fetch.php?id=1374534014)
If you open up Hourglasss I think you'll notice all of the manual VIS points high in the air over the hill. If you switch to the first, or even third, person camera while on the hill, you'll notice you won't see a lot from the hill. But change to a vehicle camera you'll see a lot more--but apparently the auto-generate VIS sample doesn't consider the vehicle cameras. It appears that VIS glitches are common with a land form like the hill on Hourglass, or even on a smaller scale, if you have a sharp, sudden rise in elevation several meshes over the hill might be accidentily turned invisible by the VIS sample.
So, if you've got a lot of hilly terrain, like Hourglass, on a smaller scale, be sure to walk around with the vehicle camera and check for VIS glitches.
-YSLMuffins
The goddess of all (bread products)
See me online as yslcheeze
|
|
|
Dedicated VIS tutorial for the Dedicated [message #31477] |
Wed, 16 July 2003 01:54 ![Go to previous message Go to previous message](/theme/Renegade_Forums/images/up.png) ![Go to next message Go to next message](/theme/Renegade_Forums/images/down.png) |
![](http://renegadeforums.com/images/custom_avatars/12.jpg) |
Dante
Messages: 1039 Registered: February 2003
Karma: 0
|
General (1 Star) |
|
|
didn't see it mentioned, but if you move your view below the map, and "unhide" all the vis layers, it seems to go MUCH faster with high settings on the granularity and flight ceiling.
just some xp talking
RenEvo
|
|
|
|
Goto Forum:
Current Time: Fri Aug 30 10:53:57 MST 2024
Total time taken to generate the page: 0.00746 seconds
|