Author Topic: Digging in the ground help  (Read 827 times)

0 Members and 1 Guest are viewing this topic.

Offline embx61

  • Modders
  • Banished Expert
  • *****
  • Posts: 1275
  • You are always on my mind, Forever in my heart
Digging in the ground help
« on: May 06, 2017, 04:45:51 AM »
Can someone explain how to dig in the ground?

I have a mesh in 3ds max, just a simple textured hollow walled box (1x1x1 Meter) for testing and set it below the Z axis so only a little part is higher then the groundlevel (0) and use the quarryfloor from Luke's Quarry building in my code.

In max I copied the box and named it floor and pushed it aside.

I made the FloorMesh file in the Model directory and set the quarry object in the building template file to -1 and -1 depths. ( I take it -1 is 1 game tile?)

The building (box) is placed but the terrain is still seen in the game it won't make a hole.

It is probably something simple  I overlook or my shovels just suck so they can't dig LOL
My beloved Kathy
As you were you will always be
Treasured forever in my memory

Offline Bartender

  • Coding Magician
  • Modders
  • Trader
  • *****
  • Posts: 176
Re: Digging in the ground help
« Reply #1 on: May 06, 2017, 05:17:02 AM »
I've only done some testing with the quarry type of floor, but there's two possibilities I thought of when I read what you tried.
- I would suspect that the floor mesh needs to be a horizontal plane rather than a box. As it uses the z-levels of the mesh to determine the depth, it probably gets confused if there are multiple z levels on the same xy coordinates.
- I've noticed that for proper behaviour, you need a mesh with a sufficient amount of vertices per tile. I'm not sure how this works, perhaps it just needs at least one vertice in a tile, but subdividing my planes generally solved problems if the hole I created was not exactly following my floor mesh.

Offline embx61

  • Modders
  • Banished Expert
  • *****
  • Posts: 1275
  • You are always on my mind, Forever in my heart
Re: Digging in the ground help
« Reply #2 on: May 06, 2017, 05:22:23 AM »
Thanks @Bartender

I make the floor mesh just a plane and see if that works. :)
My beloved Kathy
As you were you will always be
Treasured forever in my memory

Offline embx61

  • Modders
  • Banished Expert
  • *****
  • Posts: 1275
  • You are always on my mind, Forever in my heart
Re: Digging in the ground help
« Reply #3 on: May 06, 2017, 05:38:22 AM »
No dice.

It does do something to the terrain as I see it moving a bit when I put the mesh down
bool flatten set to false. A picture is sometimes better the words.

The square two walls with a plane under the ground level but the green ground level is still seen.
There is a dark patch in the middle what is not a texture as the floor is your water material mesh :)

I try to make irrigation channels as many players requested this.

http://worldofbanished.com/gallery/474_06_05_17_5_32_25.jpeg
Digging in the ground help


And this is what I have in Max.
The plane is a water mesh.

http://worldofbanished.com/gallery/474_06_05_17_5_40_53.jpeg
Digging in the ground help
« Last Edit: May 06, 2017, 05:42:23 AM by embx61 »
My beloved Kathy
As you were you will always be
Treasured forever in my memory

Offline tanypredator

  • Modders
  • Trader
  • *****
  • Posts: 301
Re: Digging in the ground help
« Reply #4 on: May 06, 2017, 06:13:53 AM »
Ohhh, quarries... So much time digged into them...

If you want just to make a hole (or channel), you don't need quarry mechanics. With that many modders can help you (not me - I managed to achieve that once, but after a long struggle, and the result was bad) - RedKetchup, Kid. You need quarry mechanics only to make gradual digging, but I have never seen this done by any modder.

Offline embx61

  • Modders
  • Banished Expert
  • *****
  • Posts: 1275
  • You are always on my mind, Forever in my heart
Re: Digging in the ground help
« Reply #5 on: May 06, 2017, 06:27:57 AM »
@tanypredator

Thanks, Red is using the quarry floor in his claypit mesh.

I am making some progress and jus keep churning at it till I get it.
My beloved Kathy
As you were you will always be
Treasured forever in my memory

Offline Tom Sawyer

  • Modders
  • Architect
  • *****
  • Posts: 580
Re: Digging in the ground help
« Reply #6 on: May 06, 2017, 06:42:25 AM »
You need quarry mechanics only to make gradual digging, but I have never seen this done by any modder.

I see. Tany never played a nordic round .. digging a clay pit in the ground. ;)

For gradual digging you have to make a simple mesh like on this picture to define the ground level for each tile after 100% digging. The rest comes by float _maxDepth = -3.0; float _initialDepth = -0.5; in this case to start at -0.5 tiles and end at -3 tiles depth when 100% of maximum production is reached.
« Last Edit: May 06, 2017, 06:55:10 AM by Tom Sawyer »

Offline embx61

  • Modders
  • Banished Expert
  • *****
  • Posts: 1275
  • You are always on my mind, Forever in my heart
Re: Digging in the ground help
« Reply #7 on: May 06, 2017, 06:55:22 AM »
Thanks @Tom Sawyer

Picture is very helpful.

I don't need gradual digging though and the channel will only be about 1 tile square and about 1/2 tile deep.

I keep playing with it till I figure it out or Red send me a sample of his Medieval channel mesh. The smallest one will do.
My beloved Kathy
As you were you will always be
Treasured forever in my memory

Online RedKetchup

  • Champion
  • Banished Expert
  • *****
  • Posts: 7486
Re: Digging in the ground help
« Reply #8 on: May 06, 2017, 07:56:13 AM »
hello

sorry not have been there :S


if i check your .max screenshot ....
the plane you have selected, to the right, what is its height ? z=-1 ? (is it the lowest plane of your mesh that you made a copy and put to the right ?
or it is the highest one of your mesh ? (it need to be the lowest if i check your design)

here 1 of my canal so you can check
« Last Edit: May 06, 2017, 07:59:24 AM by RedKetchup »
> > > Support Mods Creation developments with Paypal Donations < < <
Click here to PayPal Donate.

Offline embx61

  • Modders
  • Banished Expert
  • *****
  • Posts: 1275
  • You are always on my mind, Forever in my heart
Re: Digging in the ground help
« Reply #9 on: May 06, 2017, 08:00:54 AM »
Thanks Red

The lowest plane is the floor. I deleted the rest.

I making some progress and see a hole. The hole need some work though as it looks a bit strange in the game but it is a improvement :)
I will check the Medieval channel file :)
My beloved Kathy
As you were you will always be
Treasured forever in my memory

Offline tanypredator

  • Modders
  • Trader
  • *****
  • Posts: 301
Re: Digging in the ground help
« Reply #10 on: May 06, 2017, 08:03:11 AM »
You need quarry mechanics only to make gradual digging, but I have never seen this done by any modder.

I see. Tany never played a nordic round .. digging a clay pit in the ground. ;)

For gradual digging you have to make a simple mesh like on this picture to define the ground level for each tile after 100% digging. The rest comes by float _maxDepth = -3.0; float _initialDepth = -0.5; in this case to start at -0.5 tiles and end at -3 tiles depth when 100% of maximum production is reached.

I hadn't, sorry  :-[

I tried to make similiar model, definitely not so smooth (just a rough draft), and it worked very bad (as it got digged to final condition quickly and that condition was not right). Thank you for this information, maybe once I'll get back to my idea of small square quarry.

Online RedKetchup

  • Champion
  • Banished Expert
  • *****
  • Posts: 7486
Re: Digging in the ground help
« Reply #11 on: May 06, 2017, 08:12:24 AM »
I tried to make similiar model, definitely not so smooth (just a rough draft), and it worked very bad (as it got digged to final condition quickly and that condition was not right). Thank you for this information, maybe once I'll get back to my idea of small square quarry.


yeah i always found the process very ... iffy ^^

the way i found it work best and most constant is working with 1x1 tiles pieces placed at x=0 y=0 z=asIwant
like if i need to make 1 of 2x2 , i go for 4 pieces of 1x1 placed at (0,5 0,5 ; 0,5 -0,5 ; -0,5 -0,5 ; -0,5 0,5 )
it works better when there isnt a single pixel going further inside the next tile. sometime, the game react weirdly if a pixel go further
> > > Support Mods Creation developments with Paypal Donations < < <
Click here to PayPal Donate.

Offline Bartender

  • Coding Magician
  • Modders
  • Trader
  • *****
  • Posts: 176
Re: Digging in the ground help
« Reply #12 on: May 06, 2017, 12:12:43 PM »
I noticed that determining the depth is a bit weird. Since there are a max and min depth in the quarry code, I first assumed that those would be the only thing determining the actual depth. It turns out that the z value of your mesh is actually more important. If your plane is at z=-2 for example, then no matter what min and max depths you put, it will never go lower than -2. From what I can tell it seems that the min-max depth are only there to assign cutoff points, so that it doesnt go above or below that regardless of what the z values are.

Offline embx61

  • Modders
  • Banished Expert
  • *****
  • Posts: 1275
  • You are always on my mind, Forever in my heart
Re: Digging in the ground help
« Reply #13 on: May 06, 2017, 12:55:39 PM »
The quarry code is for the stonecutters. They go deeper as the game progresses and more stone is mined.

But I found out that the irrigation channels are hard to do because of the scale.

A 1x1 tile will create a hole far outside the bounderies of my mesh seen from the top and bigger irrigation channels are just meh.
That is why redKetchup's channels have very thick blocks on each side to keep the slopes of the hole inside those blocks.
My beloved Kathy
As you were you will always be
Treasured forever in my memory

Offline QueryEverything

  • Advisor
  • Banished Expert
  • *****
  • Posts: 1064
Re: Digging in the ground help
« Reply #14 on: May 06, 2017, 06:55:52 PM »
@embx61 is it worth possibly looking at how Kralyerg made his terraform tool?  Or is that not what's needed?
(I'm not sure on the specifics for you, nor for the tool ;) )
~ QE, I query because I like learning new things. 

Banished pinterest & Banished mod ideas
(Gently) Please: if you download mods please rate them, this helps & encourages the modders. :)