Project: shed in the forest
Project: shed in the forest
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.
- Attachments
-
- screenshot_20170214_204107.jpg (136.98 KiB) Viewed 667 times
- D00Med
- Member
- Posts: 949
- Joined: Sat Feb 07, 2015 22:49
- GitHub: D00Med
- Location: Australia...somewhere
Re: Project: shed in the forest
Interesting...how are you going with it?
Look! I have a signature :]
My subgame: viewtopic.php?f=15&t=14051#p207242
My subgame: viewtopic.php?f=15&t=14051#p207242
Re: Project: shed in the forest
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
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
- D00Med
- Member
- Posts: 949
- Joined: Sat Feb 07, 2015 22:49
- GitHub: D00Med
- Location: Australia...somewhere
Re: Project: shed in the forest
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.
Look! I have a signature :]
My subgame: viewtopic.php?f=15&t=14051#p207242
My subgame: viewtopic.php?f=15&t=14051#p207242
Re: Project: shed in the forest
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
Re: Project: shed in the forest
Please have a look to the method in my schemlib-plan mod. Maybe we have the same goals with the mods: https://github.com/bell07/minetest-sche ... n.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.
Code: Select all
propose_anchor(pos)
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.
-
- Member
- Posts: 4290
- Joined: Sun Sep 09, 2012 17:31
- GitHub: Sokomine
- IRC: Sokomine
- In-game: Sokomine
Re: Project: shed in the forest
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.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
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.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.
A list of my mods can be found here.
Re: Project: shed in the forest
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)
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)
Re: Project: shed in the forest
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
I'll take a look at your code, but after a quick overview I think I go another way
I'll take a look at your code, but after a quick overview I think I go another way
That's right, but I want to generate a map automatically and I don't want to modify the map to muchThat's right. And yet - the majority of human players flattens the area before starting a project.
I want to use mgv7 with slightly modified noise parameters because I think the default settings doesn't look that goodMost MT surfaces aren't particulary building-friendly.
- Attachments
-
- screenshot_20170215_084544.jpg (64.87 KiB) Viewed 667 times
-
- screenshot_20170215_073316.jpg (55.5 KiB) Viewed 667 times
Re: Project: shed in the forest
How about counting spaces with air,water / dirt,sand,stone / trees,leaves,flowersburli 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
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 ?
'My' wiki-pages: Build-a-home - basic-robot - basic_robot_csm - basic-machines - digtron - xdecor -
Map-Database
Map-Database
Re: Project: shed in the forest
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: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.
The schematic is not carved in stone. That's why I use lua schematics. They can easily be changedhajo 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 ?
-
- Member
- Posts: 4290
- Joined: Sun Sep 09, 2012 17:31
- GitHub: Sokomine
- IRC: Sokomine
- In-game: Sokomine
Re: Project: shed in the forest
It's a combination of flattening and filling up.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
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.burli wrote: That's right, but I want to generate a map automatically and I don't want to modify the map to much
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.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.
A list of my mods can be found here.
Re: Project: shed in the forest
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
-
- Member
- Posts: 4290
- Joined: Sun Sep 09, 2012 17:31
- GitHub: Sokomine
- IRC: Sokomine
- In-game: Sokomine
Re: Project: shed in the forest
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.
Re: Project: shed in the forest
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
- azekill_DIABLO
- Member
- Posts: 7507
- Joined: Wed Oct 29, 2014 20:05
- GitHub: azekillDIABLO
- In-game: azekill_DIABLO
- Location: OMICRON
- Contact:
Re: Project: shed in the forest
What an awesome work for a shed! however, if it gets enough efficient, creating nature-respectful villages should be far more easy!
Gone, but not dead. Contact me on discord: azekill_DIABLO#6565
DMs are always open if you want to get in touch!
DMs are always open if you want to get in touch!
-
- Member
- Posts: 4290
- Joined: Sun Sep 09, 2012 17:31
- GitHub: Sokomine
- IRC: Sokomine
- In-game: Sokomine
Re: Project: shed in the forest
Those are from neighbouring mapblocks (the outer shell).burli wrote: I have deal with a lot of 'ignore' and I guess that doesn't work
A list of my mods can be found here.
Re: Project: shed in the forest
You are right. I had a bug in my code. Now it works fine.
I need to learn everything about trees now (octree, quadtree...)
I need to learn everything about trees now (octree, quadtree...)
Who is online
Users browsing this forum: No registered users and 61 guests