News:

Welcome to World of Banished!

Main Menu

Digging in the ground help

Started by embx61, May 06, 2017, 04:45:51 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

embx61

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
[size=8pt][color=teal]My beloved Kathy
As you were you will always be
Treasured forever in my memory[/color][/size]

[size=10pt]For my list of Mods with download links go here[/size]

Bartender

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.

embx61

Thanks @Bartender

I make the floor mesh just a plane and see if that works. :)
[size=8pt][color=teal]My beloved Kathy
As you were you will always be
Treasured forever in my memory[/color][/size]

[size=10pt]For my list of Mods with download links go here[/size]

embx61

#3
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.



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

[size=8pt][color=teal]My beloved Kathy
As you were you will always be
Treasured forever in my memory[/color][/size]

[size=10pt]For my list of Mods with download links go here[/size]

tanypredator

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.

embx61

@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.
[size=8pt][color=teal]My beloved Kathy
As you were you will always be
Treasured forever in my memory[/color][/size]

[size=10pt]For my list of Mods with download links go here[/size]

Tom Sawyer

#6
Quote from: tanypredator on May 06, 2017, 06:13:53 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.

embx61

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.
[size=8pt][color=teal]My beloved Kathy
As you were you will always be
Treasured forever in my memory[/color][/size]

[size=10pt]For my list of Mods with download links go here[/size]

RedKetchup

#8
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
> > > Support Mods Creation developments with Donations by Paypal  < < <
Click here to Donate by PayPal .

embx61

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 :)
[size=8pt][color=teal]My beloved Kathy
As you were you will always be
Treasured forever in my memory[/color][/size]

[size=10pt]For my list of Mods with download links go here[/size]

tanypredator

Quote from: Tom Sawyer on May 06, 2017, 06:42:25 AM
Quote from: tanypredator on May 06, 2017, 06:13:53 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.

RedKetchup

Quote from: tanypredator on May 06, 2017, 08:03:11 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 Donations by Paypal  < < <
Click here to Donate by PayPal .

Bartender

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.

embx61

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.
[size=8pt][color=teal]My beloved Kathy
As you were you will always be
Treasured forever in my memory[/color][/size]

[size=10pt]For my list of Mods with download links go here[/size]

QueryEverything

@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 ;) )
[color=purple]~ QE, I query because I like learning new things.  [/color]

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