[Mod] Random Home [random_home]

Post Reply
Maurus_adam
Member
Posts: 12
Joined: Sat Jan 20, 2018 15:16

[Mod] Random Home [random_home]

by Maurus_adam » Post

An algoritm to produce random generated houses for Mine Clone 2 subgame.
Does not put houses by itself. Must be implemented in the map generator.

Version: 0.2
License: LGPL 2.1 or later

For Mine Clone 2 subgame only.

Report bugs or request help on the forum topic.

Download V 0.2: https://doc-14-3g-docs.googleuserconten ... e=download

Download V 0.1: https://doc-14-3g-docs.googleuserconten ... e=download

Installation

Unzip the archive and place it in minetest/mods/minetest/

( GNU/Linux: If you use a system-wide installation place
it in ~/.minetest/mods/minetest/. )

( If you only want this to be used in a single world, place
the folder in worldmods/ in your worlddirectory. )

For further information or help see:
http://wiki.minetest.com/wiki/Installing_Mods


Image
Image
Image
Image
Image
Image
Image

The mod has commands used for tests.
make_house <size_x> <size_z> Where size_x and size_z are the size of the house.
make_dungeon <size_x><size_z><type_entrance> Where size_x and size_z are the size of the dungeon and type_entrance is the type of entrance for the dungeon.
This is for demonstration only. To know how to use the mod please check the help.txt file already included with the rest of the mod files.
Also, english is not my primary language, so I apologize in advanced for any spelling mistake I made.
The mod it is not yet finished but it is already pretty usable.
It's somewhat useless for smaller houses but it's very good to bigger ones.
Some of the rooms only have a chance to appear in big houses with multiple floors.
I have noticed that it is pretty slow. Bigger houses (50 * 50 or so) can take a couple of seconds to appear.
Last edited by Maurus_adam on Tue Feb 20, 2018 18:40, edited 5 times in total.

Maurus_adam
Member
Posts: 12
Joined: Sat Jan 20, 2018 15:16

Re: [Mod] Make House [make_house]

by Maurus_adam » Post

When I use fences there is no problem, but when I use cobblestone walls or moss cobblestone walls they don't conect with one another. I already try to use the 'nodeupdate' function but it did nothing. Can someone help me?

User avatar
Wuzzy
Member
Posts: 4128
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy

Re: [Mod] Random Home [random_home]

by Wuzzy » Post

Crashes when I enter /faza_casa (or whatever).

---

Well, walls are a bit messy in MCL2. There's a separate node for each wall segment. I'm afraid you need to set those manually. Check out mods/ITEMS/mcl_walls.

I'm waiting for disconnected nodes to become available in Minetest, then I would be able to simplify the walls.
My creations. I gladly accept bitcoins: 17fsUywHxeMHKG41UFfu34F1rAxZcrVoqH

Maurus_adam
Member
Posts: 12
Joined: Sat Jan 20, 2018 15:16

Re: [Mod] Random Home [random_home]

by Maurus_adam » Post

Wuzzy wrote:Crashes when I enter /faza_casa (or whatever).

---

Well, walls are a bit messy in MCL2. There's a separate node for each wall segment. I'm afraid you need to set those manually. Check out mods/ITEMS/mcl_walls.

I'm waiting for disconnected nodes to become available in Minetest, then I would be able to simplify the walls.
I presume that you are talking about the 'fazer_casa' command. It was my mistake. That command isn't used. I forget to delete it. The test command is 'make_house'. It has two numeric parameters. (The sizes of the house)

In the new 0.34 version the only error I get is a CONTENT_IGNORE that I presume is because you have taken out the paintings. Also, the redstone trapdoor windows works even worse. I think I will take of that from the next version until the levers are in it's final form, or else I will have to rewrite the code whenever a new version comes out.

I am not an expert but why did you not make the walls as a fence? I presume this would force it to have always a pillar kind of shape. but it would alowed you to save some work.

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

Re: [Mod] Random Home [random_home]

by azekill_DIABLO » Post

it looks impressive, i've never seen such big houses generated properly!

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

Re: [Mod] Random Home [random_home]

by Sokomine » Post

The mod looks very intresting. I'm currently working on something similar but arrived there from a diffrent direction and will not create houses of the complexity shown in this mod. My approach was to find flat land and drop a simple, algorithmicly generated house on it. plasterworks is a helper mod for adding more diversity to the materials.

I'd love to take a closer look at your mod but can't. The download link does not work (maybe hidden somewhere behind all that javascript?).
Maurus_adam wrote: Some of the rooms only have a chance to appear in big houses with multiple floors.
Very nice to have diffrent rooms. They look very good on the screenshot. Are they generated procedurally? Or are they saved schematics?
Maurus_adam wrote: I have noticed that it is pretty slow. Bigger houses (50 * 50 or so) can take a couple of seconds to appear.
50x50 is pretty big. Mapgen usually works at 80x80x80 nodes at a time. Still, spawning ought to be relatively fast. It might just be impractical due to the time it takes to actually see the house ingame. How do you plan to place the houses?

Your mod does not have to be restricted to MineClone2 alone. With a few changes it might be adjusted to normal minetest_game.
A list of my mods can be found here.

Maurus_adam
Member
Posts: 12
Joined: Sat Jan 20, 2018 15:16

Re: [Mod] Random Home [random_home]

by Maurus_adam » Post

Sokomine wrote:I'd love to take a closer look at your mod but can't. The download link does not work (maybe hidden somewhere behind all that javascript?).
This mod is posted in my google drive. The link was suposed to take you there and you could make the download almost directly. I post the link again here.
https://doc-14-3g-docs.googleuserconten ... e=download
Sokomine wrote:Very nice to have diffrent rooms. They look very good on the screenshot. Are they generated procedurally? Or are they saved schematics?
The rooms are randomly generated.
Sokomine wrote:How do you plan to place the houses?
I am not planing to make it place the houses by itself. I don't know how to work with the map generator. It was planed from the begining to be used by other peoples/mods. Also it is kind of versatile and a single mod would either be very complex or just use a small potencial of the generator. It's better leave any developer do what they want with it.
Sokomine wrote:Your mod does not have to be restricted to MineClone2 alone. With a few changes it might be adjusted to normal minetest_game.
True. All the blocks used are listed in a single function. It should be possible to change them for other equivalent blocks quite easy. The problem comes up when it is added more blocks than are listed, because it would be necessary to browse the whole code for the places that use the blocks and change them to extend the value of indexes to use. For the structure of the house it is simple. The code has variables that are easly used. (Consult the help.txt file that comes with the mod.) But for the rooms generator, presently is a mess and it is necessary to alter the algoritm directly.
Unfortunely, my code is horrible and english is not my main language. Play with my algoritm at your own risk :(

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

Re: [Mod] Random Home [random_home]

by Sokomine » Post

Maurus_adam wrote: This mod is posted in my google drive. The link was suposed to take you there and you could make the download almost directly. I post the link again here.
Thanks to Megaf I've now been able to take a look at your mod. Are you willing to host it on Github?
Maurus_adam wrote: I am not planing to make it place the houses by itself. I don't know how to work with the map generator. It was planed from the begining to be used by other peoples/mods. Also it is kind of versatile and a single mod would either be very complex or just use a small potencial of the generator. It's better leave any developer do what they want with it.
There has to be a way to get the houses ingame. Spawning them automaticly would be better than to have a command. The question is: How many of these houses will be good for the game? How common shall they be? The rooms contain many useful items and farmland with plants. There are mob spawners with perches for the mobs. There are rooms devoted to staircases and cellars. I think it would be best to have one of these houses right there when you start a new world. It could be the base your character lived up until now.

The code for placing the houses on the map is rather simple and easy to understand. There are some factors that need to be taken into consideration (terrain, hight, avoiding overlapping with other mapchunks, cavegen griefing, mudflow). I've removed the chat command and and added some minimal code so that one house per mapchunk will spawn in my test world.
Maurus_adam wrote: True. All the blocks used are listed in a single function. It should be possible to change them for other equivalent blocks quite easy. The problem comes up when it is added more blocks than are listed, because it would be necessary to browse the whole code for the places that use the blocks and change them to extend the value of indexes to use.
After I've seen your rooms I understand the trouble with porting it to other subgames. Some rooms are very specific. There's no point in having a mob farm with a mob spawner and perches set up in a subgame that has no mobs or mob spawners. The picture gallery rooms depend on a suitable mod as well.

It will be up to Wuzzy to decide if and how he wants to integrate this mod into MineClone2. MC as such does not seem to have such a feature with such intresting houses. Yet a lot of players would certainly love to explore them.

Some bedrooms with villagers spawning would also be very nice to have.

The houses are very diffrent from the style I prefer but do look very good inside. The algorithm does an excellent job at creating diverse and intresting rooms. I'd just prefer the rooms to be in seperate houses. Have the chicken in one house, the pigs and cows in another, do farming in your glass house or under the sky, and have the staircase, kitchen, living room, gallery, library etc. in your main house.
A list of my mods can be found here.

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

Re: [Mod] Random Home [random_home]

by hajo » Post

Sokomine wrote:Are you willing to host it on Github?
There has to be a way to get the houses ingame.
How about a 'seed' that players need to set somewhere, like a build-chest ?

There should also be a way to remove that stuff, if it doesn't fit somehow.

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

Re: [Mod] Random Home [random_home]

by Sokomine » Post

hajo wrote: How about a 'seed' that players need to set somewhere, like a build-chest ?
That's one possibility. The houses can be rather big...
hajo wrote: There should also be a way to remove that stuff, if it doesn't fit somehow.
My handle_schematics mod is able to provide a build chest and a way to restore the landscape. It ought to be possible to extend it to algorithmicly created structures as long as the dimensions of the structure are known. Width and length have to be passed on to the function that spawns the houses here, but height seems to be rather random.

And there's still the question of how the player ought to come into posession of such a specific spawn chest. They ought to be rare.
A list of my mods can be found here.

Maurus_adam
Member
Posts: 12
Joined: Sat Jan 20, 2018 15:16

Re: [Mod] Random Home [random_home]

by Maurus_adam » Post

This mod could be used to create villages. I know that there are some mods that add villages, but they seem to use schematics for the houses. Substituing the schematic buildings for my mod would create a more diverse village.
It could also be used to create a kind of woodland mansion. (That was my intention when I decided to start this mod.) For what I know, the woodland mansion still isn't implemented. At least I never found anyone.
It could also be used to construct an underground dungeon. The code for that is already almost done and it will be implemented in the next update.
Sokomine wrote: Width and length have to be passed on to the function that spawns the houses here, but height seems to be rather random..
The height is actually very predictable. The total height is ((BASEMENT + 1 + FLOOR) * 4) + 1 + HEIGHT_OF_ROOF.
Notice that the coordinates for the origin of the house point at the base of the ground floor, so if you are counting from there, discount BASEMENT from the equation.
The height of the roof is based on the smallest side of the house. You can force which type of roof will be generated by using the MODIFY parameter and the Random_home.modificar_1(modi) function to alter the Random_home.plano_1.qual_telhado variable.
1 -> Slab roof. 1/4 of the smallest side.
2 -> Stair roof. 1/2 of the smallest side.
3 -> Balcony roof. Always 3 provided that it has generated a stair. Else is 1.
Any other number will create no roof.

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

Re: [Mod] Random Home [random_home]

by Sokomine » Post

Maurus_adam wrote: This mod could be used to create villages. I know that there are some mods that add villages, but they seem to use schematics for the houses. Substituing the schematic buildings for my mod would create a more diverse village.
Yes, that certainly comes to mind. My mg_villages mod is probably the most versatile in that regard. Changing it so that structures would be generated instead of taken from a file is not such a big issue. The real trouble lies elsewhere. When mapgen throws a mapchunk at a mod, the mod has to act on that mapchunk without knowng much about its neighbours.

Cavegen eating through the houses is one of the biggest problem. It can be avoided if all blocks the house is made out of have is_ground_content = false set in their node definition. My basic_houses mod (only on github so far) takes that approach.

If a house ends up beeing part of two mapchunks, it is important to be able to reproduce its generation. You'll have to replace all calls to math.random with a pseudo random function. See PseudoRandom in lua_api.txt for that. You might want to pass the VoxelManip object on to your functions as well. It's faster than set_node in this context.
Maurus_adam wrote: It could also be used to create a kind of woodland mansion. (That was my intention when I decided to start this mod.) For what I know, the woodland mansion still isn't implemented. At least I never found anyone.
What is a "woodland mansion" in this context?
Maurus_adam wrote: It could also be used to construct an underground dungeon. The code for that is already almost done and it will be implemented in the next update.
Good idea. The rooms could fit well into a dungeon.
Maurus_adam wrote: The height is actually very predictable. The total height is ((BASEMENT + 1 + FLOOR) * 4) + 1 + HEIGHT_OF_ROOF.
Ah, I see the floor parameter now. That makes it indeed easy. There can even be enough vertical room added for the highest roof without generating problems. The place needs to be cleared of leaves etc. anyway.
A list of my mods can be found here.

Maurus_adam
Member
Posts: 12
Joined: Sat Jan 20, 2018 15:16

Re: [Mod] Random Home [random_home]

by Maurus_adam » Post

Sokomine wrote: Cavegen eating through the houses is one of the biggest problem.
I have taken a quick look at the code for some of the blocks and I have found that most of then have the "is_ground_content" set to false. You can use the "Random_home.modificar_1(modi)" function to personalize the range of the blocks that are used to make the house.
Sokomine wrote: What is a "woodland mansion" in this context?
A big random generated building that is full of enemies and loot and is fun to explore. Any minecraft like game is never going to have to much of them. They can always be avoided and if the player is boring of mining and building, he can have some fun exploring a non natural construction and fighting some monsters.

User avatar
Inocudom
Member
Posts: 3098
Joined: Sat Sep 29, 2012 01:14
IRC: Inocudom
In-game: Inocudom

Re: [Mod] Random Home [random_home]

by Inocudom » Post

I would not spam these like crazy across the overworld, but having them here and there is very nice. Maybe they can be used as dungeons with treasure and monsters in some way?

Be sure to have these appear in various biomes, in the air, underground, and even in other dimensions.
You can now find my videos at BitChute: https://www.bitchute.com/channel/some_cheeky_jinuskian/

Maurus_adam
Member
Posts: 12
Joined: Sat Jan 20, 2018 15:16

Re: [Mod] Random Home [random_home]

by Maurus_adam » Post

Version 0.2 is avaliable.
It has a dungeon generator.

Also, the redstone circuit for the windows is weird for the new version of Mine Clone 2. It propagate the signal to nearby windows. I taked it off for this version. Do you think that I should waste time trying to make it work or should i forget it completly?

Maurus_adam
Member
Posts: 12
Joined: Sat Jan 20, 2018 15:16

Re: [Mod] Random Home [random_home]

by Maurus_adam » Post

Link to the V 0.2 was unusable. My mistake.
I already corrected it.

Post Reply

Who is online

Users browsing this forum: Google [Bot], Minix and 8 guests