World of Banished

Conversations => Suggestions and Mod Ideas => Topic started by: Yandersen on January 21, 2018, 01:53:16 PM

Title: Improved Mine - work in progress
Post by: Yandersen on January 21, 2018, 01:53:16 PM
Want to replace the vanilla Mine with some better model and smaller footprint. Wish it to be just an entrance sticking out of the mountain. Used the Tiny Mine mod and liked it - almost what I want the vanilla' mine to be replaced with, but some improvements are required, IMO. I suggest using the terraform component from the vanilla' Tunnel entrance to form a steep hill entry point. This will minimize the required model size of the tunnel forming an entrance, leading to smaller overall footprint. My semi-successfull attempt is a combo of the IronMine and TunnelStart forming a nice small entry with just a 5x3 footprint (see the attachments).

To make it into a full mod I need help. Requesting a small model for the mine entry (fitting into 3x3 footprint size) with 30 "use" and 4 "build" points for interactions to replace the TunnelStart model I temporary use.
Few things worth noting in the modified IronMine.rsc file attached. Most importantly, the terraform component I modified:
TerraformDescription terraform
{
PathBits _ceilingModifyBits = Faster | Fast | Normal | Obstacle | Walkable | Unusable;
PathBits _floorModifyBits = Faster | Fast | Normal | Obstacle | Walkable | Unusable;
PickingMesh _floorMesh = "Models\Bridges\Tunnel\TunnelFloor.rsc";
PickingMesh _ceilingMesh = "Models\Bridges\Tunnel\TunnelCeiling.rsc";
}

This ensures that terraforming modifies all subjected tiles with no exceptions. My testing shows that on 5x3 footprint the terraformer forms a step edge right at the central tile. Seems like the subjected tiles are those (marked as "X" and unaffected are "0"):
0XXX0
0XXX0 ->tunnel exit
0XXX0

Note that exit is to the right in controversy to most buildings' layouts.
Terraforming ensures that "H" tile is lifted uphigh and "G" is on the ground level with "S" being the transition slope tile:
0XXX0
0HSG0 ->tunnel exit
0XXX0

In the attached image the road tile sticking out corresponds to "G" tile on the map. Note how it is lowered on the Mine that is built.
Therefore for the requested tunnel model (that should decorate central 3x3 area) the work location for miners should be right between "S" and "G" points, and the black curtain plane covering the exit should be placed at the center of the tile "G". This will remove the need of the use of floor component ensuring the working bannies will stand on the low ground level invisible from the outside.
Such a deeply specific request. Can anyone make such a model for the mine tunnel entry?
Title: Re: Replacement for a standard mine - need help from the modellers
Post by: Yandersen on January 24, 2018, 03:19:33 PM
Some progress made, some changes to the initial idea happened.
First, the minimal footprint of 5x3 didn't worked well as expected due to wierd pathing issues, but 7x5 proved to be sufficient. I had to ununiformly rescale the model Kid designed for the initial footprint, so it looks stretched now. But overall, things are working. You can test it yourself.

Technical info:

build points (4) are at locations: {3.0;-1.5}, {3.0;-0.5}, {3.0;0.5}, {3.0;1.5};
create points (4) are at locations: {3;-2}, {3;-1}, {3;1}, {3;2};
use points (30) are all at location: {0.5;0};

Terraformer seem to ensure that terrain vertices located at these coordinates
{-0.5;-0.5}, {-1.5;-0.5}, {-2.5;-0.5},
{-0.5; 0.5}, {-1.5; 0.5}, {-2.5; 0.5},

have height z>2.0 and those vertices
{ 0.5;-0.5}, { 1.5;-0.5},
{ 0.5; 0.5}, { 1.5; 0.5},

are at the ground level (z=0.0) - so the flat tile is this one now:

######.
######.
###_G_.  -> exit (front)
######.
######.

Model was rescaled to push black curtain plane slightly upfront (crossing x axis at at 1.5). This way the curtain is on the front edge of G tile at 1.0 distance away from the work positions it hides (passing through the back edge of the G tile).

If Kid or anyone else is willing to redo the model, please let me know and I will make some sketch pic with detailed description first.
Title: Re: Replacement for a standard mine - need help from the modellers
Post by: Discrepancy on January 24, 2018, 04:25:49 PM
 :) very good.

Question, if you are already using blender to alter the models, why not try to redo or adjust it yourself? you have lots of particular ideas it might be easier.

Also I don't think putting the build, create or use points at different heights make any difference. The citizens will just go to the natural ground height or otherwise use a floor once the building is constructed.
Title: Re: Replacement for a standard mine - need help from the modellers
Post by: RedKetchup on January 24, 2018, 04:45:23 PM
Quote from: Discrepancy on January 24, 2018, 04:25:49 PM

Also I don't think putting the build, create or use points at different heights make any difference. The citizens will just go to the natural ground height or otherwise use a floor once the building is constructed.

they will always follow the natural ground like you said. The floor mesh first, and then the natural ground
Title: Re: Replacement for a standard mine - need help from the modellers
Post by: Yandersen on January 25, 2018, 05:21:01 AM
I know that, no idea why you mention this?.. BTW, about the floor mesh. How exactly does it work and built? What kind of structure is it assumed to have? Is it a grid of points, or surface or it can be any mesh?
Quote from: Discrepancy on January 24, 2018, 04:25:49 PMQuestion, if you are already using blender to alter the models, why not try to redo or adjust it yourself? you have lots of particular ideas it might be easier.
No much time to spare. By the time I will learn how to use the software well enough to draw sweet things the inspiration will be long gone and all ideas forgotten. I am a factory worker, not a designer/modeller, I do not do such things on regular basis, you know, just screwing nuts most of the day.  :)
Title: Re: Replacement for a standard mine - need help from the modellers
Post by: Discrepancy on January 25, 2018, 05:26:57 AM
It can be any mesh for a floor, just a plane normally. The game won't register it until the building is constructed. It remains invisible to the player.
Title: Re: Replacement for a standard mine - need help from the modellers
Post by: RedKetchup on January 25, 2018, 05:55:36 AM
Quote from: Yandersen on January 25, 2018, 05:21:01 AM
No much time to spare. By the time I will learn how to use the software well enough to draw sweet things the inspiration will be long gone and all ideas forgotten. I am a factory worker, not a designer/modeller, I do not do such things on regular basis, you know, just screwing nuts most of the day.  :)

it is with time and experience you get better :)
Title: Re: Replacement for a standard mine - need help from the modellers
Post by: Yandersen on January 25, 2018, 06:16:41 AM
Quote from: Discrepancy on January 25, 2018, 05:26:57 AM
It can be any mesh for a floor, just a plane normally. The game won't register it until the building is constructed. It remains invisible to the player.
What about the size? Should it cover the whole footprint or not? If not, what is the pathing behavior on edges? When height calculated from floor mesh and terrain tile are different, does banny "jumps"? Or the highest/lowest from either terrain tile "z" or mesh-projection' "z" is taken? See, thing is I can't use the component until I have clear understanding of how it works... :-[
Title: Re: Replacement for a standard mine - need help from the modellers
Post by: RedKetchup on January 25, 2018, 06:48:31 AM
this game has no idea of what is "height" . the game is 3D , yeah, but the pathing is 2D. so yeah they will jump in a wink of the eye even if 1000' in the air.

i usually take my mesh and i delete everything that is not  a top plane and everything that is below it.


edit: an example of floor, my floor of my open sky mine
Title: Re: Replacement for a standard mine - need help from the modellers
Post by: Yandersen on January 25, 2018, 07:31:30 AM
OK, thanks. So {x;y} are projected vertically onto the mesh and "z" is taken. But still it is not clear which of "z" is taken - from the mesh explicitly with no regards to corresponding terrain ground "z" at that location, or the higher between floor's "z" and tile' "z"? Or the lower? Which one? I mean, what if the floor mesh is actually below the ground surface - will bannies fall through the ground? Because this is what I actually may need to achieve - to make them walk in a little bit through the mountain. Plus pathing question: the walkable/unusable tiles flags still have permission/restriction effects when floor is used?
Title: Re: Replacement for a standard mine - need help from the modellers
Post by: RedKetchup on January 25, 2018, 07:55:56 AM
if the ground is higher than your floor they will walk on the ground, unless you use the tunnel terraform and set the floor as the floor

the ____ in the map desc function = they can go
the #### in the map desc = it is a wall.

but the bannies will often send you to hell and do what they want ^^
you should experiment instead of too much thinking and see how they react :D

and also they cut corners very very much ^^
Title: Re: Replacement for a standard mine - need help from the modellers
Post by: Yandersen on January 25, 2018, 08:07:30 AM
Oh, I get it now, thank you, oh guru! So it is exactly opposite from what I need in my case...
Um, what about ceiling component? Does it exists and works exactly opposite to floor component (I mean, overwriting "height" of terrain in case it is below it)?
Quote from: RedKetchup on January 25, 2018, 07:55:56 AMbut the bannies will often send you to hell and do what they want ^^
you should experiment instead of too much thinking and see how they react :D
Those experiments made me guessing that they may ignore a single unwalkable tile if it is located between two walkable ones. It's like at least two of "##" may stop a banny from walking over. May it be true?
Title: Re: Replacement for a standard mine - need help from the modellers
Post by: RedKetchup on January 25, 2018, 08:24:51 AM
the ceilling will put ground back over the mesh depending how high you put your plane, if your plane is under the mountain, the natural ground will be dominent and ontop

Quote from: Yandersen on January 25, 2018, 08:07:30 AM
Those experiments made me guessing that they may ignore a single unwalkable tile if it is located between two walkable ones. It's like at least two of "##" may stop a banny from walking over. May it be true?

they should stop but like i said , they love to laugh in our face ^^

in the screenshot there is a wall of ######### 4 row thick and they still love to laugh at me ^^
Title: Re: Replacement for a standard mine - need help from the modellers
Post by: Tom Sawyer on January 25, 2018, 08:35:40 AM
Actually # marks forbidden tiles to walk. But if there are use or create points at these tiles they ignore it. I could solve such issues in the last version of my cabin workplaces and dairy hut. So if you have clean points then bannies behave and will not cross any #  :)
Title: Re: Replacement for a standard mine - need help from the modellers
Post by: Yandersen on January 25, 2018, 08:59:25 AM
Quote from: Tom Sawyer on January 25, 2018, 08:35:40 AM
Actually # marks forbidden tiles to walk. But if there are use or create points at these tiles they ignore it. I could solve such issues in the last version of my cabin workplaces and dairy hut. So if you have clean points then bannies behave and will not cross any #  :)
Guaranteed? Hm. Simple 3x3 example:

###
#__
###

Let's say I have a use point right at the center {0;0}. Then under no circumstances bannies will walk up, left or down - only to the right, correct? And what if I move the use point half tile to the left {-0.5;}, so it is right between the forbidden and walkable tiles? Then both will be walkable and bannies will move to the left and right with no difference then? But still no way they attempt to escape up or down? Is it like that for sure? Cuz I had this kind of situation where use point was in the middle between forbidden and walkable tiles and bannies stuck in the forbidden tile like they could move there, but not out. From the other hand, I also tried to place use point in the middle of the forbidden tile, adjacent to walkable one, and in that case bannies just refused to go to work at that building.

Anyway, more practical would be to ask if the use/create/build points MUST be placed in the middle of the tiles or can they be in any spot inside or the edge? Any known bugs there?
Aaand few more q about the terraforming... Does it updates the tile "natural" flags when terrain changes (like if a tile on the slope of the mountain flattened to the ground and then building demolished)? Do previous and current "natural" tile flags have any effect on pathing? Like if I place a building over mountain and set it's footprint to "all walkable" - will the mountain slope under the building will actually become walkable?
Title: Re: Replacement for a standard mine - need help from the modellers
Post by: RedKetchup on January 25, 2018, 09:24:34 AM
i suggest to put some pathing in your mesh that would represent your desc map so you can more easily figure out :)
Title: Re: Replacement for a standard mine - need help from the modellers
Post by: Tom Sawyer on January 25, 2018, 09:37:53 AM
Use points are used by workers to stand their while working or to drop raw materials and these locations are used exactly. Create points are the location of spawned resources in production buildings and a resource can only spawn in center of a tile. The game will choose the tile where your create point is closer. If a create point is above a forbidden tile then citizens ignore the #. So you should place create and use points only where bannies are allowed to walk and can reach it.

The walking rules of natural terrain can be overwritten by a building. So you can force workers to walk in water by a building with allowed tiles and use points there. That's the way of the crayfishing tool in the North mod and it's also used by mines.

In your example they will only walk from the right into your building. The only thing you will notice is that they like to use forbidden tiles to make round walkways. So thy will walk over the right tiles above and below. I also suggest to play around with these things in game to understand how it works. :)
Title: Re: Replacement for a standard mine - need help from the modellers
Post by: Yandersen on January 26, 2018, 07:54:14 PM
Thank you very much guys for the detailed explanations. Will work with this info and see what I can achieve. Will try to make my own models of the floors for terraformer instead of using the standard ones from tunnel and minimize the footprint by this. Then try it all without building model to clearly see how bannies behave and then will think about the model...
Title: Re: Replacement for a standard mine - need help from the modellers
Post by: RedKetchup on January 26, 2018, 10:12:31 PM
Quote from: Yandersen on January 26, 2018, 07:54:14 PM
Will try to make my own models of the floors for terraformer instead of using the standard ones from tunnel and minimize the footprint by this.

dont try to minimize too much :P a 3x3 mine is a bit unrealistic in this game :P
Title: Re: Replacement for a standard mine - need help from the modellers
Post by: Yandersen on January 26, 2018, 10:49:24 PM
Not 3x3, RK, of course, but 6x3 seem to be sufficient:

PathBits _placeBitArray
[
Normal | Obstacle | Fast | Faster,
Normal | Obstacle | Unusable | Walkable, 
Unusable | Walkable,
Unusable,
]
String _placeBitmap =
"322220
321110
322220";

String _pathBitmap =
"#####.
##___.
#####.";


With this I decided to move working points at {-0.9;0.0} and the black curtain plane will hide them 0.9 units away (crossing x axis at 0.0).

Therefore a floor model for the terraforming component needs to lower those three tiles to the ground level ("G"):

#####.
##GGG.
#####.


In other words, eight of the terrain tile' vertices located at the corners of these tiles need to be forced to have z=0. And here I encountered problem not sure how to interpret... I made a plane in Blender, being 3.2x1.2 in size (added extra 0.1 width to ensure the tile vertices projected inside the plane' area, not on edges). But the result in game turned to be quite odd: looks like only 4 vertices were actually affected - those which seem to correspond to the corners of the floor plane. So my guess is that the terrain tile' vertices affected are kinda matched to the closest vertices on the floor mesh, and since a simple plane has only 4 vertices, then only matching ones on terrain were affected. Am I guessing right? If so, then the floor model must be tesselated to have at least 8 vertices in my case...
Title: Re: Replacement for a standard mine - need help from the modellers
Post by: RedKetchup on January 26, 2018, 10:59:23 PM
you cannot terraform outside your footprint, maybe you should solve it by making your footprint larger even if there is no mesh there
Title: Re: Replacement for a standard mine - need help from the modellers
Post by: Yandersen on January 27, 2018, 01:36:57 AM
Why do you think I am trying to terraform outside the footprint?..

Anyway, I figured out how terraforming works with grid mesh as a floor object. Unlike the plane, grid worked fine. I made the grid mesh subdivided to ensure it's vertices correspond to the vertices of the terrain. Seems like I was right - terraformer doesn't project the terrain into the mesh to determine z of the vertices - instead, for each terrain vertex it finds closest vertex from the mesh and uses it's z. Therefore if we take a simple quad (4 vertices) and stretch it over the size of the whole footprint, only 4 terrain vertices at the corners of the footprint will be affected. To ensure proper terraforming one needs to split the floor quad inserting intermediate vertices corresponding in x&y locations to the terrain vertices at those locations.
Title: Re: Replacement for a standard mine - need help from the modellers
Post by: RedKetchup on January 27, 2018, 01:50:32 AM
Quote from: Yandersen on January 27, 2018, 01:36:57 AM
Why do you think I am trying to terraform outside the footprint?..



i am talking about it because in the past, for my own experience, i lost a couple of hours on this :S i've got to find out that isnt working properly in my brain ^^
Title: Re: Replacement for a standard mine - need help from the modellers
Post by: Yandersen on January 27, 2018, 09:31:04 AM
Hey, pipulz, some progress here! The alpha-version is up for a test and discussion now. Mod attached.

Seems like the footprint of 6x3 is the best option I will stuck with because it allows to restrict the mine placement with a very good consistency over the mountain slope: simply saying, the placement map requires 3 unusable tiles on one end and 3 normal/road tiles on the other.

There are 3 floored tiles now ("G"):

#####.
#GGG_.
#####.

The floor shifted to be at 0.5 now instead of ground level (0.0). Model lifted up by dz=0.5 units as well and moved further into mountain (dx=-1.5). Use points shifted to the left by 1.0 unit (now those are at {-1.95;0.0}).

I also get some XP in blender - I can move vertices now! ;D So I worked over the model Kid did for me before - pushed the black curtain deeper and moved the decorative bucket slightly away from the slope. Also I shrunk+doubled&flipped the wood texture so that planks do not look so stretched.

Bad thing is that I had to use the tiled decal texture from the stockpile. If anyone could make one for me, I would greatly appreciate. Assuming it shall cover 6x3 footprint I wish it to be like that ("T"=transparent, "W"=walking road, "R"=rocky):

TRRRRT
TWWWWT
TRRRRT
Title: Re: Replacement for a standard mine - need help from the modellers
Post by: Yandersen on January 27, 2018, 11:28:44 AM
Um, guys, Kid got busy with his own mod and I am not good with the modelling... But I know for sure there r plenty of amazing talented modellers lurking around here. Why don't we try to work together on this? Didn't I inspired anyone for some art work? Would be so awesome to hook up with somebody to turn the model of the mine into smg like this:

(https://c2.staticflickr.com/4/3371/3450937290_b2bc99fe84_z.jpg?zz=1)

or this:

(https://i.imgur.com/aMZfcs5.jpg)

Here is the link to the project source if anyone would like to join the developement:
https://drive.google.com/drive/folders/1x6qM3UZp2XJezKQ986FNpJwckb2xYJUl
Title: Re: Replacement for a standard mine - need help from the modellers
Post by: Discrepancy on January 27, 2018, 07:56:15 PM
I'll make something to look like the last picture.
Title: Re: Replacement for a standard mine - need help from the modellers
Post by: Discrepancy on January 27, 2018, 10:52:26 PM
(http://worldofbanished.com/gallery/4163_27_01_18_10_49_41.jpeg)
@Yandersen,
on the left is the new mine I have made.
on the right is the mine @kid1293 made for the mod, i just added another as f variant.
I also made a footprint.

I will send you the files shortly.
Title: Re: Replacement for a standard mine - need help from the modellers
Post by: kid1293 on January 28, 2018, 12:53:54 AM
 :)
Title: Re: Replacement for a standard mine - need help from the modellers
Post by: Yandersen on January 28, 2018, 04:29:01 AM
Wow, that looks SOOOOOO AMAZING!!! Can't wait to get it into the complete mod version! Thank you so much! This will be the best mining mod ever! I still have some ideas of improvement for future, but let's hold on to this for now... Just hold on...
Title: Re: Replacement for a standard mine - need help from the modellers
Post by: RedKetchup on January 28, 2018, 04:52:28 AM
Quote from: Yandersen on January 28, 2018, 04:29:01 AM
Wow, that looks SOOOOOO AMAZING!!! Can't wait to get it into the complete mod version! Thank you so much! This will be the best mining mod ever! I still have some ideas of improvement for future, but let's hold on to this for now... Just hold on...

Congratulations @Yandersen  !

i personally think that 3x3 (+3 in mountains that count for nothing) is way too small to compare the original 12x12 tiles and is alot OP, but it is my personal thoughts. Please don't see any bad intentions in that from me, everyone knows my thoughts about this^^)

again Congrats !!!!  :)
Title: Re: Replacement for a standard mine - need help from the modellers
Post by: Nilla on January 28, 2018, 05:03:09 AM
I like the Nordic mine from @Tom Sawyer. The perfect combination of good/small looking and size of the footprint. It last very long (eternal?) but need some wood to produce. This means no useless ugly ruins.
Title: Re: Replacement for a standard mine - need help from the modellers
Post by: galensgranny on January 28, 2018, 05:28:33 AM
As far as mines are concerned, both versions are good.   :)   The style Kid made makes me feel more confident that the owners keep things in good repair, if I was the one who had to go in there.
Title: Re: Replacement for a standard mine - need help from the modellers
Post by: Yandersen on January 28, 2018, 06:21:34 AM
Quote from: RedKetchup on January 28, 2018, 04:52:28 AMI personally think that 3x3 (+3 in mountains that count for nothing) is way too small to compare the original 12x12 tiles and is alot OP, but it is my personal thoughts. Please don't see any bad intentions in that from me, everyone knows my thoughts about this^^)
Mountains are nothing right now, because I didn't get into the mountain quarries and burial caves yet.  ;)  But small footprint allows more flexibility in placement - my version requires just 3 mountain tiles in a straight row to make the mine placeable. Remember the PITA from placing the standard mine on a diagonal mountain.  ;)  A small fragement of 3 strait blocks could be located on that with very high probability I think. I even think of an easier placement restriction with just 1 mountain tile restriction... Not sure yet. There is still a lot to do.

As for the alpha, here is it in the attachment. And a sweet screenshot.  :)  Discrepancy made an amazing model, can't believe it looks so close to the real one from the picture! I just had to adjust the black curtain position since it was overpushed by 1 unit so I could see the bannies mining.

Anyway, check this out:
Title: Re: Replacement for a standard mine - need help from the modellers
Post by: Yandersen on January 28, 2018, 09:01:06 AM
Funny that I didn't mentioned that intermediate construction models are swapped. Fixed.

Well, I dug into the ceiling component for the terraformer to check how it interacts with the floor component. Turned out that floor takes priority - like ceiling lifts the terrain first, then floor lowers it. Simply sayng, I mean. That means using both ceiling and the floor on the same area makes possible to shift the terrain vertices to the exact positions we want. So I did (see the floor and ceiling models used in the attachment). Works perfect. Now I have that area of the terrain under the footprint perfectly defined (tiles marked as "X"):

XXXX???
XXXX??? -> mine exit
XXXX???


I made the floor and ceiling models as close as possible to the natural terrain shape under the typical mine placement area, so that when mine is built it is hard to mention the caused disturbance of the shape of the mountain slope around the building.

This precise landscape shape' definition opens the possibility of adding a fake part of the mountain slope over the mine entrance, further hiding the entrance, covering it with a landslided rocks on top and sides making a perfect blending into the mountain.
Title: Re: Replacement for a standard mine - need help from the modellers
Post by: Yandersen on January 31, 2018, 09:16:11 AM
Just a heads up for the WIP on this mod. Not abandoned, no-no-no!

The final size of the footprint (yes, it kept growing since the initial upload, but seem to stop at this point) is 7x5 tiles (including the road tiles). The same amount of workers as in vanilla. No stone for building - just wood (as suggested by model' design).

We work with Discrepancy to add the most beautiful and perfectly well-done mine mod to the game (well, mostly him working tbh, considering the major part of the mod is the model, and I don't have enough skills to contribute to this part significantly). It is time-consuming process, and Discrepancy doesn't have too much of it, of course, but there can't be hustle with perfectionism, would you agree?

So I postpone releasing the mod publicly until all little things settled. Currently it seems like only non-critical graphical improvements left. Everything is working already as expected and you can test it. Please do so and tell us what you think about our new version which is to replace the vanilla mine!