It is currently Wed Nov 20, 2019 4:52 am


All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Changing the floor base?
PostPosted: Tue Sep 20, 2016 9:32 pm 
User avatar

Joined: Tue Sep 20, 2016 8:51 pm
Posts: 6
Location: Utah
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);


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Changing the floor base?
PostPosted: Wed Sep 21, 2016 9:24 pm 
Developer
User avatar

Joined: Sun May 04, 2008 6:35 pm
Posts: 1827
Glad you solved it!


Top
Offline Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Theme created StylerBB.net