Terrain
DonkeyGravy
Join Date: 2012-02-27 Member: 147611Members
in Modding
I have been working on a mod and need to be able to make terrain. Normally I use mudbox and terragen to handle height-maps with some proprietary scripting to handle materials based off of flow maps generated in terragen. I have yet to plumb the depth of the NS2 code base so forgive this question should the answer exist - can we directly modify, add, or tweak the editor through the use of custom scripting? I would love to get my terrain system up and running in NS2 with the least amount of pain.
The other thing grating on me is how visibility is calculated. The system obviously lends itself to densely occluded scenes typical of what you will see indoors. Outdoors this may not always be the case... With all the processing being handled at run time I could see terrain presenting a major challenge to spark depending on hows its handled. Right now I am leaning towards breaking my terrain up into 512x512 chunks and then importing them into the editor to build my terrain 'mesh' back up piece by piece. I am avoiding large open vistas and most of the action is going to take place in and around big chunks of wreckage and in dense urban landscapes. My design doc was heavily influenced by the potential bottlenecks I saw popping up from the usage of CHC instead of more traditional methods.
Is there an engine limit to the number of triangles being rendered in any one frame? Is any geometric LOD being applied to objects in frame to reduce the number of polys? How many draw calls are being made to set up and render a scene - if your using D3DQUERYTYPE_OCCLUSION to check. You have to be doing some level of scene organization like an octree - so is there anything modders can do to tweak this or possibly add in some pre-processing to reduce the number of draw calls? Sorry for the deluge of questions. I'm just really interested in how your doing stuff so I can optimize my work as best I can. I have some ambitions goals for my mod and NS2 provides the perfect environment to execute.
The other thing grating on me is how visibility is calculated. The system obviously lends itself to densely occluded scenes typical of what you will see indoors. Outdoors this may not always be the case... With all the processing being handled at run time I could see terrain presenting a major challenge to spark depending on hows its handled. Right now I am leaning towards breaking my terrain up into 512x512 chunks and then importing them into the editor to build my terrain 'mesh' back up piece by piece. I am avoiding large open vistas and most of the action is going to take place in and around big chunks of wreckage and in dense urban landscapes. My design doc was heavily influenced by the potential bottlenecks I saw popping up from the usage of CHC instead of more traditional methods.
Is there an engine limit to the number of triangles being rendered in any one frame? Is any geometric LOD being applied to objects in frame to reduce the number of polys? How many draw calls are being made to set up and render a scene - if your using D3DQUERYTYPE_OCCLUSION to check. You have to be doing some level of scene organization like an octree - so is there anything modders can do to tweak this or possibly add in some pre-processing to reduce the number of draw calls? Sorry for the deluge of questions. I'm just really interested in how your doing stuff so I can optimize my work as best I can. I have some ambitions goals for my mod and NS2 provides the perfect environment to execute.
Comments
Another problem is that the engine stops drawing entities (players, ...) after a given distance, so it pretty much gives an upper limit the size of open areas.
Not really. There is no real way to script the editor. Proper height map terrain isn't supported currently I'm afraid.
<!--quoteo(post=1936833:date=May 17 2012, 05:24 PM:name=DonkeyGravy)--><div class='quotetop'>QUOTE (DonkeyGravy @ May 17 2012, 05:24 PM) <a href="index.php?act=findpost&pid=1936833"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->The other thing grating on me is how visibility is calculated. The system obviously lends itself to densely occluded scenes typical of what you will see indoors. Outdoors this may not always be the case... With all the processing being handled at run time I could see terrain presenting a major challenge to spark depending on hows its handled. Right now I am leaning towards breaking my terrain up into 512x512 chunks and then importing them into the editor to build my terrain 'mesh' back up piece by piece. I am avoiding large open vistas and most of the action is going to take place in and around big chunks of wreckage and in dense urban landscapes. My design doc was heavily influenced by the potential bottlenecks I saw popping up from the usage of CHC instead of more traditional methods.
Is there an engine limit to the number of triangles being rendered in any one frame? Is any geometric LOD being applied to objects in frame to reduce the number of polys? How many draw calls are being made to set up and render a scene - if your using D3DQUERYTYPE_OCCLUSION to check. You have to be doing some level of scene organization like an octree - so is there anything modders can do to tweak this or possibly add in some pre-processing to reduce the number of draw calls? Sorry for the deluge of questions. I'm just really interested in how your doing stuff so I can optimize my work as best I can. I have some ambitions goals for my mod and NS2 provides the perfect environment to execute.<!--QuoteEnd--></div><!--QuoteEEnd-->
We aren't using CHC anymore. We are using a similar system that BF3 uses. The mapper creates a simplified occlusion mesh that the engine uses to calculate what is visible.
I think your best option at this point is to create your terrain using the map editor directly. Depending how high res you want to go you can probably just use the "terrain" as the occlusion mesh directly. Or just create one on top of your terrain.
We would like to support proper terrain in the engine eventually but it isn't a priority for us yet.
I wish you luck with your mod!
Just to clarify. The limit isn't drawing. The limit is networking. We don't sync entities that are farther than 45 meters away (I think that is the number).
It is a good limit for NS2 but we can probably make this limit configurable for modders. If somebody really needs that just send me an email to remind me.