Search Unity

Need: Difficult Terrain for Ninja Camp Project

Discussion in 'General Discussion' started by UnLogick, Nov 16, 2012.

  1. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,745
    Hey guys

    Ninja camp is coming up and I've decided to try out a new concept for terrains. The base concept is that I'll have multiple triangular patches of heightmaps, with different orientation and make them blend together seamlessly.

    Like this:
    $EarlyTerrain1.png

    This will allow us to make steep surfaces without triangle stretching! It will also allow us to make cliff overhangs! It will not however allow us to make small details that doesn't match the heightmap concept.

    It will also allow us to make planets, floating islands, like this:
    $EarlyPlanet1.png

    However since I'm not an artist I need some help creating fantastic sample terrains. It gotta look good so I can get some backing among my colleagues to fully explore this. There are many pitfalls ahead but I'm hoping to fully explore the feasibility of this terrain angle during this ninja camp. And if it works out hopefully eventually get this into Unity as a proper feature. ;)

    I would like two types of meshes:
    1. Detailed mesh of cliff side, riverbed, etc. - key features: steep slope + cliff overhang. :)
    2. Complete planet mesh. - key feature: round, please keep it roundish, not too steep and without overhangs! :)
    Please stay don't go above 1 million vertices. Its a tech demo not a streaming world demonstration. :)
    -I'd prefer if you only use 64k, but I don't want that to be a limiting factor.

    Thanks,
    Joen Joensen
     

    Attached Files:

    Last edited: Nov 16, 2012
  2. ColossalDuck

    ColossalDuck

    Joined:
    Jun 6, 2009
    Posts:
    3,246
    YES PLEASE. Many videos of progress are now expected of you... I DEMAND THEM.
     
  3. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
  4. imaginaryhuman

    imaginaryhuman

    Joined:
    Mar 21, 2010
    Posts:
    5,834
    Not fair, I want ninja camp too!

    The terrain idea sounds cool, looks like you have basically lots of small triangular height maps and then presumably would use subdivision to implement some kind of easy LOD control as you zoom in closer? Can you generate planets with it in the way you can kind of like with fractals, like in Terragen2, or that one space sim that's been developed for a while where you can be flying out in space and then swoop in through the atmosphere to close-up mountains and eventually rocks/details? That'd be cool.

    So is the data stored in like an octree or something so you can position these little mesh patches anywhere in space? So you can make like volumetric land with lots of layers of holes inside it (think slab of swiss cheese), or does it only support a single continuous `surface` which can undulate and hang-over a bit, like scrunching up a blanket?

    Either way good luck with it, sounds neat.
     
  5. HeadClot88

    HeadClot88

    Joined:
    Jul 3, 2012
    Posts:
    736
    Ok, I am so happy I logged in today!

    YAY, PLANET MESHES! I am so excited!

    What do you need from me? I Will do anything!

    EDIT: Ok, Now that i calmed down and did a little bit of research.

    Perlin Noise Toggle able Perlin Noise would be the way to go with the planets meshes.

    Also have a look at Etherea 1 For Unity As far as I am aware it is 50.00 on his website.

    EDIT2: Oh and I forgot to ask will this be a pro only feature?
     
    Last edited: Nov 16, 2012
  6. SevenBits

    SevenBits

    Joined:
    Dec 26, 2011
    Posts:
    1,953
    Sounds fantastic. It seems the terrain experts on this thread would be very suited to this type of thing. I'm sure they'll find this thread soon enough.
     
  7. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,745
    First let me make this abundantly clear: ninja camp projects are research projects. It means I'll get a week or two to play with a tech that may or may not prove useful. Right now its just an idea in my head. There are no white papers on this, to my knowledge this particular approach have never been fully explored before. And it especially don't mean this will actually become a feature in unity! Even though my initial prototype was more successful that I could imagine, I was able to make those screenshot after about 1 day of tinkering, and moving/rotating those handles on the planet view warps the terrain accordingly real time inside Unity.


    @KHopcraft: I'll do my very best not to disapoint you. But first step is to make something awesome! And then I'll try to add videos.


    @Lars: Well as cool as the halo wars terrain is, its still designed for a particular piece of hardware, for a particular terrain size, for a particular performance goal and finally for a particular game genre. That goes against everything I want for Unity! The fact that its designed for a completely flat world is sorta the death blow for me. But it is truly very pretty and all the stuff he says that is not trying to optimize for his particular needs and scale is very to the point.

    But I want something that can be streamed endlessly, I want something that can be used for flat worlds, planets, hollow planets, floating isles in space and everything in between! If you absolutely must have that last ounce of performance on a specific platform... well then I guess this is not the solution you're looking for. :)


    @ImaginaryHuman: I had considered subdivision as my main LOD scheme, as its easily achievable in the short amount of time I have for a ninja camp. I'm not sure it will hold water for a full fledged feature though. And yes going from planet to up close view is one of the things I'm hoping to achieve. Its also why I asked that anyone kind enough to provide me with a planet mesh would not make it too complex. Making a showcase for a heightmap solution on a planetary scale is challenge enough for that particular map. The other map is about showing exactly what kind of power this can give to your normal RPG/FPS kinda game, where you are deep into the canyons staring up at the steep mountain sides. :)


    @HeadClot88: Well one use as ImaginaryHuman mentions is of course procedurally generated planets. But I'm hoping I'll also manage to introduce proper editing workflows that allows you to edit the terrain directly in the editor in an efficient way.
     
  8. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,745
    I took a haven't looked at Etheria's solution for planets. That's so much more than just a planet terrain. Its star maps, atmosphere, procedural generation all tied into one neat package. The triangular patch terrain engine I'm gonna explore during this ninja camp, would let you have overhangs and caverns while preserving Etheria's orbit to surface transition. And make it easier for players to edit their own planets, but it will not address any of the other features that Etheria has implemented. As such it would be a small adjustment to adjust the pack to take advantage of these terrain features.
     
  9. CharlieSamways

    CharlieSamways

    Joined:
    Feb 1, 2011
    Posts:
    3,424
    Going to be a douche, Collaboration :3
     
  10. janpec

    janpec

    Joined:
    Jul 16, 2010
    Posts:
    3,520
    Completly agree, thats why you shouldnt bother spending too much time on those cliffy terrains. Mesh modeled rocks are still way to go combined with heightmap terrain. Even if you do implement somehow magically terrain sculpting feature that can be used for cliffs it will still be limited by triangle number, splatmaps and what not, in the end rocks modeled are enough.
     
  11. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,745
    @janpec: Well in my book steep slopes, rock slides or massive rock formations, that is the actual terrain! I want to see that LOD in the distance. And not just as mesh decals.

    Why shouldn't this be possible as terrain?
    http://www.google.dk/search?q=cave+...nW0QW6t4DYAw&ved=0CAoQ_AUoAQ&biw=1097&bih=612

    Anyways, you are of course right, its easier as mesh and that's why this solution will have mesh support. If I have time I'd even like to add a foundation system to the meshes. Both to ensure there are no gaps and to cut a hole in the terrain underneath it. That way cutting a hole in the terrain is as easy as providing a cave entrance and applying it with the foundation feature.

    Ask any artist for an epic landscape and odds are he'll produce overhangs, tiny paths on practically vertical mountain sides and the like... that really should be supported!
     
    Last edited: Nov 16, 2012
  12. HeadClot88

    HeadClot88

    Joined:
    Jul 3, 2012
    Posts:
    736
    Just got an Idea - Why not take a idea from the folks over at Crytek when It comes to caves.

    Cut a hole in the terrain and Replace it with a cave mesh - Created in a Seperate 3rd Party app such as Blender, 3DS max, etc.

    I might be taking a step in the wrong direction here. So Correct me if so.
     
  13. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,745
    Well I hardly think you can credit Crytek for that solution, its essentially the industry standard. ;)
    And its what I meant with this part:
    But in theory, if the caves are big enough for it to make sense you could also make the caves with this new terrain system.
     
  14. Hangout

    Hangout

    Joined:
    Feb 1, 2011
    Posts:
    38
    I would even appreciate it it could be an efficient implementation of a "Restricted Quadtree triangulated terrain" in short RQT.
    It seems you're going in that direction and that seems great. Definitely a need for that, for our usage the triangulation of the current Terrain is just to poor.
     
  15. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,745
    Well this has the usual height map downfall of dealing with quads instead of triangles... (no truly organic shapes) but the overall concept can be reduced to work on triangles as well, you just have to split/traverse them a bit differently. But it goes beyond what I hope to accomplish in two week.

    My primary focus will actually be the workflow. This is a rather complex setup, going for quads like everyone else would be a lot easier. My primary concern would be that it might be too difficult to use. But I just think its time someone actually took a real shot at this. If I can make a cool terrain editor out of it, I'm sure we'll be able to optimize it.
     
  16. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    Awesome RnD man, are you gonna change the vegetation/detail mesh painting too? since you're gonna make a new terrain engine in Unity. So maybe in the future we will be able to use the vegetation/detail painting in custom mesh too.
     
  17. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,745
    Quick update: While it worked like a charm workflow was simply horrible, by default point density would be exactly in the wrong places. And the way to move point density was clumsy and too restricting.

    Also I realized that a vector field terrain doesn't have to be a flat world, its more an optimized mesh field than anything else, very powerful for the designer and infinitely flexible for the creative. So by the end of today I will be making round planets with vector fields!

    But its still the same cry out - I really need a cool mesh terrain that will help me present this stuff proper.
     
  18. LumaPxxx

    LumaPxxx

    Joined:
    Oct 3, 2010
    Posts:
    339
    those would be used in my next mobile game,is there anyone you need?

    tell me, i will send the file to you.


    $terrain.jpg
     
  19. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,745
    Now this is awesome. I got a feeling that I could do some really awesome stuff with F. One of the nice features of Vector Field terrain is that you can actually do exact placement of vertices, so I can preserve the detail on those platou edges and then "compensate" by having fewer vertices on the flat segments. It has a nice mix of vertical and flat giving a very high total surface. As well as some solid steep slopes that I can carve a few holes into.

    Thanks man.
     
  20. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    hi unlogick,

    nice that you will a look into vector fields… ;-)
    and "f" is a good choice i think, as it has pretty steep slopes which would produce terribly stretched textures on heightmap based terrains…
    good luck for your work!

    lars
     
  21. LumaPxxx

    LumaPxxx

    Joined:
    Oct 3, 2010
    Posts:
    339
    UnLogick ,PM to you ,enjoy

    if still need more,just ask.:)
     
  22. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,745
    Thanks Lars.

    To be honest rendering the Vector Fields is not really that hard. LOD is a bit more work but it's not really that bad. People will have to get used to think about UV rather than have the always autogenerated UV of the old terrain engine. We can auto generate it most of the time but occassionally they will have to dig out an UV move tool to fix a bit of stretch or tiling mismatch.

    But doing collision on Vector Fields is essentially a mesh collider, which is both expensive to set up and expensive to test against. Even on smallish terrains this has a real impact on start up time. I'm looking into if there is some assumption we can make on the nature of the VectorField to optimize them, without limiting the creativity of the designer, but its kinda hard.

    I fully understand why people prefer the inaccuracies and flaws of a heightmap on a Vector Field and avoid the problem all together. And that solution should work fine for many rts games, especially if the map designer has this in mind. Unfortunately I doubt people will be as forgiving in a first person shooter when they've set up a perfect sniping position only to realize that enemy bullets fly through the ground and hit them despite their cover, or even worse their own bullets is blocked by terrain visibly below them.
     
  23. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,527
    I hope you include Wacom pressure for the next terrain tools.
     
  24. TheOtherMonarch

    TheOtherMonarch

    Joined:
    Jul 28, 2012
    Posts:
    867
  25. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
  26. botumys

    botumys

    Joined:
    Apr 16, 2009
    Posts:
    707
    ...and custom brushes, slopes tools, brushes's size preference for each tool, erosion tool, vertex color painting tool, more than 4 normal maps without artifacts, fading effect on detail to replace actual clipping solution, adaptative detail filling based on distance, higher resolution for trees billboards...
     
  27. janpec

    janpec

    Joined:
    Jul 16, 2010
    Posts:
    3,520
    Lol +1000 to thats. Actually thats all current terrain need at top priority. Basically copying Epics Landscape tools is pretty much all we need including erosion tools, slopes tool, vertex material painting, wast landscapes of many connected terrains. World Machine is great software to design terrains, but lets face it once you have to create ten or even hundred terrains (considering for distant terrains) then it becomes pain in the ass becouse it consumes a lot of time. WIth erosion like tools and Zbrush like sculpting tools inside of Unity you can replace it and speed up production for 10 times.
     
  28. jasonkaler

    jasonkaler

    Joined:
    Feb 14, 2011
    Posts:
    242
    I'm a little surprised it took unity this long to see that terrains don't have to be so limited.
    +10 votes to adding this ASAP.
     
  29. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,745
    Hey guys.

    Edward and me is doing our best not to disappoint you, but although rendering and editing the terrain is going well there are still lots of problems primarily with Collision and LOD.

    I was thinking just adding a proper landscape editing API to allow user made filters. I think that would cover those use cases nicely. I envision something like:
    • Filter 1 - calculates steepness and selects areas that should be eroded
    • Filter 2 - does the actual erosion on the selection
    Now if someone wants to take more variables into account for finding the proper erosion(build up and collateral) areas they can write their own replacement for Filter 1 and still use the function from Filter 2 to perform the actual erosion. Their new filter could even call Filter 1 and then modify its result before passing the selection to Filter 2.

    Finally if the user wants full control, he can select the areas on the terrain by hand and then apply Filter 2 to add erosion to that area. I'm hoping this would unleash the community and let people make the best terrains ever.

    Custom Brushes - you mean like a grayscale image or? Would brush size be scaling or clipping the image?

    Details:
    Fade Effect on detail - essentially an alternate material with an extra [0-1] float in its shader, allowing it to fade, disintegrate or what not.
    Adaptative detail filling - you mean adjusting the density based on distance? Or are you talking about LOD on details?

    Because of the time scope of Ninja-camp we'll be ignoring details for now.
     
  30. imaginaryhuman

    imaginaryhuman

    Joined:
    Mar 21, 2010
    Posts:
    5,834
    I wish you guys best of luck, its a cool project .... how does this compare with a voxel terrain project that a previous ninja camp was working on? What became of it?
     
  31. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,745
    A voxel terrain is an entirely different beast. They have some significant advantages and some annoying problems. Personally I don't like them, but that is entirely a matter of taste. We still have the voxel terrain ninja camp project lying on a shelf and the same may happen to this. Several people have already made voxel terrains inside unity, but we strive for making a feature available for all users instead of just a subset of our users. So if we release a new terrain system it must be able to support all the normal "expected" use cases of a terrain, and not just a few of them.

    Ninja camp projects are primarily research projects into how good a feature really is and an estimation on the amount of work and the number of expected problems it will cause. Its a way we break out of our daily routines at unity and embrace interesting technology.
     
  32. virror

    virror

    Joined:
    Feb 3, 2012
    Posts:
    2,963
    I hope you give us plenty of updates and screenshots during the development of this : D
    Very interesting : )
     
  33. botumys

    botumys

    Joined:
    Apr 16, 2009
    Posts:
    707
    custom brushes : yes import grey scale images to use them in the editor. I know that a workaround exists, but a simple "add custom brush" button could be nice. And also :
    -A rotation value (fixe or random) because actually brushes are aligned always in the same direction.
    -A min/max slope value to paint only on slopes, steps or flat surfaces.

    Brush size scale the image.

    Details:

    -fade effect :to be honest, I don't code shaders but is the solution is simple it could be nice to see this feature in next updates :)
    Adaptative detail filling, yes, adjusting the density based on distance and not only set a density value for all the terrain. This value could be set for each detail (objects or billboards). the idea is for example, keep big bushes visible in the distance and remove smallers details earlier.

    good luck for the camp!
     
  34. virror

    virror

    Joined:
    Feb 3, 2012
    Posts:
    2,963
    How did it go? : D
     
  35. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,745
    Well we made a very nice presentation to our colleagues. It already looks very good! But then the trouble starts. :)

    One of the main issues is actually collision handling. The only way to make precise collision on this thing is a mesh collider. However terrains tends to be quite large so that would kill all performance on startup. There are some optimizations that could be done to speed up collision initialization; like pre-baked collision meshes. But they require work on physics that will definitely wait for a physics upgrade. Besides that only works with static terrains so dynamic terrains will still pay the full price making this solution unusable.

    When it comes to approximations there are many ways to "fake" it; but each have their own problems and choosing between them could become a complex dilemma that I wouldn't want for the average terrain user.

    I still believe its the right approach, and I'll continue to work on this during my FAFFs(fridays are for fun). :)
     
  36. imaginaryhuman

    imaginaryhuman

    Joined:
    Mar 21, 2010
    Posts:
    5,834
    It's funny how projects sometimes have unexpected twists like that that are just kind of side effects of the `logic` of the design. Good luck though with figuring out ways to get around the problems.
     
  37. botumys

    botumys

    Joined:
    Apr 16, 2009
    Posts:
    707
    Thanks to take a look on a new terrain system.
    Btw, about terrain editing, when you have time, check the one include in Hero engine, I'm using it actualy and it is very powerfull.