Volumes Of Fun
http://www.volumesoffun.com/phpBB3/

Changing the floor base?
http://www.volumesoffun.com/phpBB3/viewtopic.php?f=23&t=676
Page 1 of 1

Author:  12aithe [ Tue Sep 20, 2016 9:32 pm ]
Post subject:  Changing the floor base?

Hi thank you for viewing this topic,

I just started to study the cubiquity .

I've been able to modify and dig into a good amount of things ....

My small issue is i'm trying to make a game where you could carve into the depths of the ground....

Now I know I could randomly generate this which is frustration at the moment because i do not have a huge grasp of the random generation " still not sure if it's my battle plan to randomly generate the terrain" .... as I get a better scope of detail....

However besides the point !

I want to be able to create a empty volume data with a lower base floor which will add my "dirt" lower and a bigger chunk. I know i might eventually find this but.... after reading comments threw volumedata on why not to change this or that...... I decided perhaps it would be easier to just ask.

So I can change the height of the invisible region.... however I would like to make a higher layer of ground with that region.


So I just need it to generate a higher terrain radther then hand sculpting one if that makes sense.....

Thank you in advance ,
Jake



EDIT:

I figured it like thanks too... I will get you're number foo...

The old version used to have a floor paramater for empty volumes ... so I simply did ...
(You may want to change the script if someone was trying to figure this out )

Open CreateEmptyTerrainVolumeData

Then added some simple math for the floor height.....
floorHeight = ?

I will come out with some stuff to hopefully help here m8's :)

Code:
using UnityEngine;
using UnityEditor;

using System.Collections;

namespace Cubiquity
{
   public class CreateEmptyTerrainVolumeDataAssetWizard : ScriptableWizard
   {
      public int width = 128;
      public int height = 32;
      public int depth = 128;
      public int floorHeight = 6;
      public bool generateFloor = true;
      
      void OnWizardCreate()
      {
           TerrainVolumeData data = VolumeDataAsset.CreateEmptyVolumeData<TerrainVolumeData>(new Region(0, 0, 0, width-1, height-1, depth-1));
         
         if(generateFloor)
         {
            // Create some ground in the terrain so it shows up in the editor.
            // Soil as a base (mat 1) and then a couple of layers of grass (mat 2).
            TerrainVolumeGenerator.GenerateFloor(data, floorHeight, (uint)1, floorHeight + 4, (uint)2);

         }
       } 
   }
}



Ps. the top will be rock where it says unit(The array on the triplanar array) set that to the corresponding grass to get the default

So for grass example :
Code:
TerrainVolumeGenerator.GenerateFloor(data, floorHeight, (uint)1, floorHeight + 4, (uint)0);

Author:  David Williams [ Wed Sep 21, 2016 9:24 pm ]
Post subject:  Re: Changing the floor base?

Glad you solved it!

Page 1 of 1 All times are UTC
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/