[Mod] simple random houses spawning [basic_houses]

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

[Mod] simple random houses spawning [basic_houses]

by Sokomine » Sat Feb 10, 2018 05:01

Image
Sometimes you may feel lonely in your world but don't want to encounter entire villages. The basic houses this mod places on flat land are well integrated into the landscape and invite you to extend and imporve them. They appear only where flat land is. Each house comes with a door, lamps above the door, windows, floors, a steel ladder and a solid roof. Some houses may contain chests with additional building materials or even a machine used for creating plasterwork.

Image

Don't be surprised if your new home has vegetation inside. The houses where abandoned by their creators some time ago. Trees may have started to grow inside. It is unkown why the builders left. There's some speculation that it was due to the lack of gardens, furniture and streets, but as there are no inhabitants left, there's nobody to ask. You can just take any house you like and turn it into your home.

Image

Houses may appear alone or in small groups. The basic types are logcabin, wooden house and stony houses. The later ones may be skyscrapers with a flat roof and may be colored if either plasterwork, RealTest or MineClone2 is used. The houses are all empty inside. Materials, shape, size and floors are all random.

Download: https://github.com/Sokomine/basic_house ... master.zip
Browse code: https://github.com/Sokomine/basic_houses
Version: 1.0
Licence: GPLv3
Depends on: handle_schematics
Recommends: plasterwork
Supports: Minetest game based games, RealTest, MineClone2
Attachments
basic_houses_9.jpg
(177.04 KiB) Not downloaded yet
basic_houses_13.jpg
(143.23 KiB) Not downloaded yet
basic_houses_11.jpg
(113.97 KiB) Not downloaded yet
A list of my mods can be found here.
 

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

Re: [Mod] simple random houses spawning [basic_houses]

by bell07 » Sat Feb 10, 2018 09:08

Great Work! Thanks for this mod!

One Idea/Feature request I have: Can you please take some parameters like max_per_mapchunk or houses_wanted_per_mapchunk depending on any Perlin-noise (I am not familiar with it)? This way natural villages could appear, and other flat areas stays empty.
 

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

Re: [Mod] simple random houses spawning [basic_houses]

by hajo » Sat Feb 10, 2018 19:35

Sokomine wrote:basic houses this mod places on flat land
Each house comes with a door, lamps above the door, windows, floors, a steel ladder and a solid roof

I sugggest to add a chat-command like '/build_basic_house' that tries to build such a house
at the players location. Maybe with a parameter, eg. for size or number of floors to use.
Might need a priv for using that command.

Also, a house-builder-logfile would be nice.
Last edited by hajo on Sat Feb 10, 2018 22:41, edited 1 time in total.
 

User avatar
Fixer
Member
 
Posts: 890
Joined: Sun Jul 31, 2011 11:23
Location: Ukraine
IRC: Fixer
In-game: Fixer

Re: [Mod] simple random houses spawning [basic_houses]

by Fixer » Sat Feb 10, 2018 22:27

Nice, now connect them with some simple roads and lights in buildings and around ;)
 

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

Re: [Mod] simple random houses spawning [basic_houses]

by bell07 » Tue Jul 31, 2018 21:13

After reading some perlin-noise theory I played around pseudo-random numbers to group buildings in villages using this mod. See my fork: https://github.com/bell07/basic_houses

@Sokomine, if you like the logic, feel free to take over

Removed parameters / counters
- basic_houses.houses_wanted_per_mapchunk
- basic_houses.additional_chance
- basic_houses.mapchunks_processed
- basic_houses.houses_generated
Removed also the showcase-house in first chunk

and added instead
Code: Select all
-- generate count of building each 80x80 mapchunk, if chunk is assigned to village
 -- Note: This amount will likely only spawn if your mapgen is very flat.
 --       Else you will see far less houses.
basic_houses.min_per_mapchunk = 10
basic_houses.max_per_mapchunk = 20
 
-- Villages average distance in nodes (2x80)
basic_houses.village_average = 160
 
-- Villages min/max size in nodes (radius)
basic_houses.village_min_size = 20
basic_houses.village_max_size = 100


The minimum counters are never reached because the counter describes only the attempt to place the house in chunk. The most villages does not appear because no house was able to be placed. But the resuilt is useable. The houses appears in groups on map now.

Image
Image
Attachments
screenshot_20180731_225846.png
(770.02 KiB) Not downloaded yet
screenshot_20180731_223302.png
(341.45 KiB) Not downloaded yet
 

User avatar
Lord_Vlad
Member
 
Posts: 112
Joined: Thu Jul 20, 2017 07:58

Re: [Mod] simple random houses spawning [basic_houses]

by Lord_Vlad » Thu Nov 29, 2018 09:13

Many houses I get don't have a roof : in the chest on the top, though, they have a chest with moretree stairs and slabs that apparently don't exist ? It's just weird.
 

enochwilliams
New member
 
Posts: 6
Joined: Sun Sep 20, 2015 14:25
In-game: enoch enochwilliams

Re: [Mod] simple random houses spawning [basic_houses]

by enochwilliams » Tue Oct 08, 2019 21:30

Lord_Vlad wrote:Many houses I get don't have a roof : in the chest on the top, though, they have a chest with moretree stairs and slabs that apparently don't exist ? It's just weird.


Same. It also crashes my private server saying certain types of stairs are not valid nodes. Any ideas?
 

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

Re: [Mod] simple random houses spawning [basic_houses]

by Sokomine » Wed Oct 09, 2019 14:41

Regarding the stairs and slabs problem with moretrees: You do not seem to have moreblocks installed. You can either install moreblocks (which I'd recommend anyway as it's a very useful mod) or update to the newest version of handle_schematics. Moretrees registers its stairs under diffrent names depending on which stair mod it can find (moreblocks or just stairs from default) - and those names differ. Handle_schematics knows about this now. Thanks for reporting! The problem will also have affected mg_villages.
A list of my mods can be found here.
 

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

Re: [Mod] simple random houses spawning [basic_houses]

by Sokomine » Wed Oct 09, 2019 15:00

bell07 wrote:After reading some perlin-noise theory I played around pseudo-random numbers to group buildings in villages using this mod. See my fork: https://github.com/bell07/basic_houses

I have to admit that I don't really understand how those noise things work. For mg_villages, nore did the work and created all that was necessary. Paramat helped some as well. Your changes look very fine. Please do a PR so that I can merge it :-) And sorry for taking so long. It sometimes takes time before I get around to fix a mod. Reminding me that there's work waiting helps to some degree :-)
A list of my mods can be found here.
 

User avatar
texmex
Member
 
Posts: 1578
Joined: Mon Jul 11, 2016 21:08
GitHub: tacotexmex
In-game: texmex

Re: [Mod] simple random houses spawning [basic_houses]

by texmex » Mon Oct 14, 2019 19:37

As mentioned in the screenshots topic I'm interested in your algorithm for finding reasonably flat areas for schematic placement.

Sokomine wrote:The newest approach just doesn't care about the area that will be covered by the building - it just takes a look at the height differences at the borders of the to-be-building and accepts only a limited overall difference.


This sounds good to me. Looking at the code for basic_houses and the underlying handle_schematics I think I'd like to extract this function and put into a much simpler API mod format. Is it doable or is it all tangled up in dependent code?
 

ShadMOrdre
Member
 
Posts: 523
Joined: Mon Dec 29, 2014 08:07
Location: USA
GitHub: ShadMOrdre
In-game: shadmordre

Re: [Mod] simple random houses spawning [basic_houses]

by ShadMOrdre » Tue Oct 15, 2019 09:24

texmex,

I culled this from the settlements mod, for determining whether an area is "flat" enough. Flat being defined as height difference, and is settable.

+ Spoiler


This was thrown together just now, so as a standalone mod, may be non-functional. The functions contained however, should be enough to get you started.

As a mod, this either depends on intllib, or includes the template intllib.lua.

Hope this helps.


Shad
MY MODS: lib_ecology lib_materials lib_clouds lib_node_shapes ---- Inspired By: Open Source Virtual World Simulator Opensimulator.
 

User avatar
texmex
Member
 
Posts: 1578
Joined: Mon Jul 11, 2016 21:08
GitHub: tacotexmex
In-game: texmex

Re: [Mod] simple random houses spawning [basic_houses]

by texmex » Tue Oct 15, 2019 09:27

Oh, thank you Shad! I’ll have a look. I’ll probably strip the intllib dependency too, eventually.
 

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

Re: [Mod] simple random houses spawning [basic_houses]

by Sokomine » Tue Oct 15, 2019 19:57

texmex wrote:This sounds good to me. Looking at the code for basic_houses and the underlying handle_schematics I think I'd like to extract this function and put into a much simpler API mod format. Is it doable or is it all tangled up in dependent code?

handle_schematics is already intended to be an api eventually for mg_villages and other like mods. That's why the function
Code: Select all
handle_schematics.find_flat_land_get_candidates_fast( heightmap, minp, maxp, sizex, sizez, minheight, maxheight )

sits in it and not somewhere extra (as it mostly could). If you just want the above function, take the file detect_flat_land_fast.lua from handle_schematics, give the function a new prefix so that you can call it, and remove all other functions from that file. What find_flat_land_get_candidates_fast does is give you a list with all the places inside your mapchunk where you could build a house of sizex and sizez in size (or rotated by 90 or 270 degree) without having to flatten the land - becaus it's already flat there. basic_houses chooses some of these spots randomly and puts a house there.

The new approach is diffrent and even more simple. It evaluates how well a place (that you provide as position) is suited for a house of sizex and sizez. That function just looks at the bordes of your potential house area and returns the height the house ought to start at or false if the function deems the place to be too rough for such a house. I havn't uploaded it yet because that entire way of placing a village is very work-in-progress and won't help anybody too much yet. What's difficult is the integration into mg_villages and all the other things that need to be taken into account at mapgen time; not that particular flatness-evaluation-code.

ShadMOrdre wrote:I culled this from the settlements mod, for determining whether an area is "flat" enough. Flat being defined as height difference, and is settable.

If i see that right, your function evaluates the entire mapchunk? The two functions I mentionned above work diffrent. They work inside a mapchunk and help finding flat enough places for structures of a given size there.

ShadMOrdre wrote:-- skip buggy heightmaps, return high value

Well, no, not really buggy. AFAIK those are just places where the surface does not lie in this particular mapchunk. May be a deep hole or a high mountain.

ShadMOrdre wrote:As a mod, this either depends on intllib, or includes the template intllib.lua.

intllib is fine as such, but only if you have any messages for the player. There's no need for that here.
A list of my mods can be found here.
 


Return to Mod Releases



Who is online

Users browsing this forum: Google [Bot] and 10 guests