Project: shed in the forest

User avatar
burli
Member
 
Posts: 1641
Joined: Fri Apr 10, 2015 13:18

Project: shed in the forest

by burli » Tue Feb 14, 2017 19:53

My new project is called "shed in the forest". The target of this project is to find a way to place this shed in a forest without damaging the environment and on a flat place, not at a slope.


Image
Attachments
screenshot_20170214_204107.jpg
(136.98 KiB) Not downloaded yet
 

User avatar
D00Med
Member
 
Posts: 941
Joined: Sat Feb 07, 2015 22:49
Location: Australia...somewhere
GitHub: D00Med

Re: Project: shed in the forest

by D00Med » Tue Feb 14, 2017 21:49

Interesting...how are you going with it?
 

User avatar
burli
Member
 
Posts: 1641
Joined: Fri Apr 10, 2015 13:18

Re: Project: shed in the forest

by burli » Tue Feb 14, 2017 23:28

First I want to find a flat spot. This is the difficult but part. I have two ideas. Both use the height map

Then I need to check if there is enough space. Could be difficult too

I will accept a little error tolerance in both cases. If the shed is placed on a slight hill (one node) the door should face downhill. An the area in front of the door should be free
 

User avatar
D00Med
Member
 
Posts: 941
Joined: Sat Feb 07, 2015 22:49
Location: Australia...somewhere
GitHub: D00Med

Re: Project: shed in the forest

by D00Med » Wed Feb 15, 2017 00:59

Ok. Seems to be a lot of effort for a shed, but I'm going to assume that it's not really about the shed itself.
 

User avatar
burli
Member
 
Posts: 1641
Joined: Fri Apr 10, 2015 13:18

Re: Project: shed in the forest

by burli » Wed Feb 15, 2017 05:47

Well, it is about the shed, and of course about other schematics. Think about a villages mod. They currently only work on a plane, but Minetest has no plains
 

bell07
Member
 
Posts: 572
Joined: Sun Sep 04, 2016 15:15
GitHub: bell07

Re: Project: shed in the forest

by bell07 » Wed Feb 15, 2017 06:22

Please have a look to the method
Code: Select all
propose_anchor(pos)
in my schemlib-plan mod. Maybe we have the same goals with the mods: https://github.com/bell07/minetest-schemlib/blob/master/plan.lua#L368
One difference, I do not search for a flat place because I flat the place byself before build the building. So the method checks if a building at a given position is buildable and propose the best "y" value in this case. So your mod needs to check in random places. I am working currently (ok stopped since some weeks) on a builder-npc that runs in the world, check the places and build if possible.
 

Sokomine
Member
 
Posts: 3874
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine

Re: Project: shed in the forest

by Sokomine » Wed Feb 15, 2017 06:35

burli wrote:Well, it is about the shed, and of course about other schematics. Think about a villages mod. They currently only work on a plane, but Minetest has no plains

That's right. And yet - the majority of human players flattens the area before starting a project. Only few manage to adjust their structures to the terrain. And even those usually adjust the terrain in places. Most MT surfaces aren't particulary building-friendly.

bell07 wrote:I do not search for a flat place because I flat the place byself before build the building. So the method checks if a building at a given position is buildable and propose the best "y" value in this case. So your mod needs to check in random places. I am working currently (ok stopped since some weeks) on a builder-npc that runs in the world, check the places and build if possible.

Sounds intresting. And it's not too far from the way mg_villages does it (check for a fitting height and adjust the terrain to that height). I'm not quite satisfied with some aspects yet and considering doing some changes regarding the embedding of the villages into the world. The streets may need ramps in some cases, and the terrain blending area could be larger.
A list of my mods can be found here.
 

bell07
Member
 
Posts: 572
Joined: Sun Sep 04, 2016 15:15
GitHub: bell07

Re: Project: shed in the forest

by bell07 » Wed Feb 15, 2017 07:51

Heavy unfinished, but I uploaded my sample mod that utilizes the propose_anchor to github: https://github.com/bell07/minetest-sche ... ilder_npcf
The mod builds node by node, but it is possible to place the plan at once using do_add_chunk() in a loop.

@Sokomine, did you tried already to utilize the minetest.find_path() for streets? Just calculate a path from door to door and replace all nodes bellow to the street-nodes. (untested idea)
 

User avatar
burli
Member
 
Posts: 1641
Joined: Fri Apr 10, 2015 13:18

Re: Project: shed in the forest

by burli » Wed Feb 15, 2017 08:02

I want to search for flat spots because I don't want to place schematics on places like this. Even flatten and filling wouldn't help there

Image

Image

I'll take a look at your code, but after a quick overview I think I go another way

That's right. And yet - the majority of human players flattens the area before starting a project.


That's right, but I want to generate a map automatically and I don't want to modify the map to much

Most MT surfaces aren't particulary building-friendly.


I want to use mgv7 with slightly modified noise parameters because I think the default settings doesn't look that good
Attachments
screenshot_20170215_084544.jpg
(64.87 KiB) Not downloaded yet
screenshot_20170215_073316.jpg
(55.5 KiB) Not downloaded yet
 

hajo
Member
 
Posts: 596
Joined: Thu Oct 13, 2016 10:45
Location: DE

Re: Project: shed in the forest

by hajo » Wed Feb 15, 2017 11:05

burli wrote:search for flat spots because I don't want to place schematics on places like this.
Even flatten and filling wouldn't help there

How about counting spaces with air,water / dirt,sand,stone / trees,leaves,flowers
at the intended place the size of you schematic, as well as at lower height of that.

If air is found at lower height, adjust the intended position downward
--> that should take care of that half-floating hut.

Allow a certain amount of stone,sand etc. to be removed/replaced,
and plants to be replaced completely.

And maybe have the bottom layer of your shed 'optional',
i.e. is allowed to merge with the current terrain --> automatic fill up/levelling.

Also, how about optional blocks of stairs/slabs, that only get placed
when the terrain on the next block is higher/lower ?
 

User avatar
burli
Member
 
Posts: 1641
Joined: Fri Apr 10, 2015 13:18

Re: Project: shed in the forest

by burli » Wed Feb 15, 2017 11:46

hajo wrote:How about counting spaces with air,water / dirt,sand,stone / trees,leaves,flowers
at the intended place the size of you schematic, as well as at lower height of that.


Something like that. I will try different strategies, e.g. octrees over air and everything that can be replaced (group:flora for example)

hajo wrote:And maybe have the bottom layer of your shed 'optional',
i.e. is allowed to merge with the current terrain --> automatic fill up/levelling.

Also, how about optional blocks of stairs/slabs, that only get placed
when the terrain on the next block is higher/lower ?


The schematic is not carved in stone. That's why I use lua schematics. They can easily be changed
 

Sokomine
Member
 
Posts: 3874
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine

Re: Project: shed in the forest

by Sokomine » Wed Feb 15, 2017 15:54

burli wrote:I want to search for flat spots because I don't want to place schematics on places like this. Even flatten and filling wouldn't help there

It's a combination of flattening and filling up.

burli wrote:That's right, but I want to generate a map automatically and I don't want to modify the map to much

That was my intention as well. Villages inside the mg mapgen work fine as the placement of villages is a direct part of the mapgen. Other mapgens are diffrent and unkown to the villages placement code. I want to be able to place villages and huts in any world, no matter which mapgen was used. It may still fail if the mountains are too high. If you stick to one particular mapgen, life can be a lot easier. It's also easier if you're placing just one small hut and not a big building for which there won't be any sufficiently flat area anywhere in the world. MT mapgens are usually incredibly small-scale with a very rough terrain.

hajo wrote:If air is found at lower height, adjust the intended position downward
--> that should take care of that half-floating hut.

Allow a certain amount of stone,sand etc. to be removed/replaced,
and plants to be replaced completely.

Both is done in some way inside mg_villages. The area the mapgen presents is scanned for its height, an optional height for the village is calculated, and the height of the terrain is adjusted accordingly. There's no guarantee that this will produce a good result. The terrain is really rough. If about half of the sourrounding nodes have a high elevation and belong to a mountain/plateau, while the other half is at sea level, which height will be appropriate? It would take a lot more height information and scanning in order to make a better decision.
A list of my mods can be found here.
 

User avatar
burli
Member
 
Posts: 1641
Joined: Fri Apr 10, 2015 13:18

Re: Project: shed in the forest

by burli » Wed Feb 15, 2017 17:27

My targets are not only villages. I want to be able to place larger schematics in general. Not only buildings, but any kind of structure or plants or whatever
 

Sokomine
Member
 
Posts: 3874
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine

Re: Project: shed in the forest

by Sokomine » Wed Feb 15, 2017 22:10

Sounds fine. Hope you'll find a good solution! At least there's a chance as long as you stick to a defined mapgen.
A list of my mods can be found here.
 

User avatar
burli
Member
 
Posts: 1641
Joined: Fri Apr 10, 2015 13:18

Re: Project: shed in the forest

by burli » Fri Feb 17, 2017 13:45

This get's more difficult than I thought. I just loop over a chunk and count the air nodes, but even in pure air I don't get the expected 512000. I have deal with a lot of 'ignore' and I guess that doesn't work
 

User avatar
azekill_DIABLO
Member
 
Posts: 7489
Joined: Wed Oct 29, 2014 20:05
Location: OMICRON
GitHub: azekillDIABLO
In-game: azekill_DIABLO

Re: Project: shed in the forest

by azekill_DIABLO » Fri Feb 17, 2017 16:15

What an awesome work for a shed! however, if it gets enough efficient, creating nature-respectful villages should be far more easy!
 

Sokomine
Member
 
Posts: 3874
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine

Re: Project: shed in the forest

by Sokomine » Fri Feb 17, 2017 23:46

burli wrote: I have deal with a lot of 'ignore' and I guess that doesn't work

Those are from neighbouring mapblocks (the outer shell).
A list of my mods can be found here.
 

User avatar
burli
Member
 
Posts: 1641
Joined: Fri Apr 10, 2015 13:18

Re: Project: shed in the forest

by burli » Sat Feb 18, 2017 09:58

You are right. I had a bug in my code. Now it works fine.

I need to learn everything about trees now (octree, quadtree...)
 


Return to WIP Mods



Who is online

Users browsing this forum: runs and 4 guests