Terrain

DonkeyGravyDonkeyGravy Join Date: 2012-02-27 Member: 147611Members
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.

Comments

  • DghelneshiDghelneshi Aims to surpass Fana in post edits. Join Date: 2011-11-01 Member: 130634Members, Squad Five Blue, Reinforced - Shadow
    Outdoor environments are not supported in any way by the Spark engine. They had realtime occlusion in the game a long time ago, but it slowed down the game so much that they decided to rely on occlusion geometry. Occlusion geometry is basically a very simple "wrapping" around the map you need to create yourself. Without occlusion geometry, Spark will render the whole map regardless of visibility. Occlusion geometry is based on indoor environments, so unfortunately it won't work for your project.
  • YuukiYuuki Join Date: 2010-11-20 Member: 75079Members
    Well you can still make a big open area if there is not too much stuff I guess.

    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.
  • MurphyIdiotMurphyIdiot NS2 programmer Join Date: 2008-04-17 Member: 64095Members, Super Administrators, NS2 Developer, Subnautica Developer, Pistachionauts, Future Perfect Developer
    <!--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-->I have been working on a mod and need to be able to make terrain ... can we directly modify, add, or tweak the editor through the use of custom scripting?<!--QuoteEnd--></div><!--QuoteEEnd-->

    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!
  • MurphyIdiotMurphyIdiot NS2 programmer Join Date: 2008-04-17 Member: 64095Members, Super Administrators, NS2 Developer, Subnautica Developer, Pistachionauts, Future Perfect Developer
    <!--quoteo(post=1936960:date=May 18 2012, 06:32 AM:name=Yuuki)--><div class='quotetop'>QUOTE (Yuuki @ May 18 2012, 06:32 AM) <a href="index.php?act=findpost&pid=1936960"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->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.<!--QuoteEnd--></div><!--QuoteEEnd-->

    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.
  • AsranielAsraniel Join Date: 2002-06-03 Member: 724Members, Playtest Lead, Forum Moderators, NS2 Playtester, Squad Five Blue, Reinforced - Shadow, WC 2013 - Shadow, Subnautica Playtester, Retired Community Developer
    you might even make that number modifyable by the mapper, so that the optimal value of each map can be found.
Sign In or Register to comment.