[Mod] Structures [git] [minetest_mods_structures]

JBR
Member
Posts: 76
Joined: Sun May 26, 2013 22:04
Location: United Kingdom, Wales

by JBR » Post

Got this error:
19:33:34: ERROR[main]: ...ocuments\minetest-0.4.7\bin\..\builtin/misc_register.lua:62: Name structures:manager_disabled does not follow naming conventions: "modname:" or ":" prefix required
19:33:34: ERROR[main]: stack traceback:
19:33:34: ERROR[main]: [C]: in function 'error'
19:33:34: ERROR[main]: ...ocuments\minetest-0.4.7\bin\..\builtin/misc_register.lua:62: in function 'check_modname_prefix'
19:33:34: ERROR[main]: ...ocuments\minetest-0.4.7\bin\..\builtin/misc_register.lua:98: in function 'register_item'
19:33:34: ERROR[main]: ...ocuments\minetest-0.4.7\bin\..\builtin/misc_register.lua:158: in function 'register_node'
19:33:34: ERROR[main]: ...ents\minetest-0.4.7\bin\..\mods\mods_structures\init.lua:170: in main chunk

User avatar
thefamilygrog66
Member
Posts: 170
Joined: Mon Jul 09, 2012 19:08
Location: Ontario, Canada

by thefamilygrog66 » Post

JBR wrote:Got this error:
19:33:34: ERROR[main]: ...ocuments\minetest-0.4.7\bin\..\builtin/misc_register.lua:62: Name structures:manager_disabled does not follow naming conventions: "modname:" or ":" prefix required
19:33:34: ERROR[main]: stack traceback:
19:33:34: ERROR[main]: [C]: in function 'error'
19:33:34: ERROR[main]: ...ocuments\minetest-0.4.7\bin\..\builtin/misc_register.lua:62: in function 'check_modname_prefix'
19:33:34: ERROR[main]: ...ocuments\minetest-0.4.7\bin\..\builtin/misc_register.lua:98: in function 'register_item'
19:33:34: ERROR[main]: ...ocuments\minetest-0.4.7\bin\..\builtin/misc_register.lua:158: in function 'register_node'
19:33:34: ERROR[main]: ...ents\minetest-0.4.7\bin\..\mods\mods_structures\init.lua:170: in main chunk
JBR: Try changing the folder name to just structures - that worked for me.

Cool mod - it worked really well except when I tried it in a flat world, in which no structures spawned, for some reason.

User avatar
MirceaKitsune
Member
Posts: 924
Joined: Sat May 21, 2011 22:31
GitHub: MirceaKitsune
IRC: Taoki
In-game: MirceaKitsune
Location: Romania, Bucharest

by MirceaKitsune » Post

JBR: Yes, you must name the mod folder "structures".

thefamilygrog66: That's probably because the default structures are set to only spawn from 5 nodes up (in some cases even higher). They'd spawn too close to water which looked ugly without that. Also note that the default buildings only spawn on grass_with_dirt, so make sure that's what the flat floor is made of.
Last edited by MirceaKitsune on Sun Jun 09, 2013 20:05, edited 1 time in total.

JBR
Member
Posts: 76
Joined: Sun May 26, 2013 22:04
Location: United Kingdom, Wales

by JBR » Post

MirceaKitsune wrote:JBR: Yes, you must name the mod folder "structures".

thefamilygrog66: That's probably because the default structures are set to only spawn from 5 nodes up (in some cases even higher). They'd spawn too close to water which looked ugly without that. Also note that the default buildings only spawn on grass_with_dirt, so make sure that's what the flat floor is made of.
it works! I love the map gen, not really sure how to save a building yet..

Sokomine
Member
Posts: 4276
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine
IRC: Sokomine
In-game: Sokomine

by Sokomine » Post

MirceaKitsune wrote: Anyway, it's been a while. Any news on this? Was hoping more people would put it on their server and could offer more input. Maybe see how it works with their own buildings and ideas. Any server use it yet?
It is not a mod one would like to use on a server that's mostly building-orientated. On servers used for building, the space is needed for structures built by the players themshelves. It might be a good mod for servers who are more survival-orientated, and where players rarely build anything large/lasting.

The mod is very well suited for singleplayer. Last time I tried, the spawned structures seemed a bit too large and a bit too many, but the general idea is very nice (I do something similar in my mod), and the buildings are good.
A list of my mods can be found here.

User avatar
thefamilygrog66
Member
Posts: 170
Joined: Mon Jul 09, 2012 19:08
Location: Ontario, Canada

by thefamilygrog66 » Post

MirceaKitsune wrote:thefamilygrog66: That's probably because the default structures are set to only spawn from 5 nodes up (in some cases even higher). They'd spawn too close to water which looked ugly without that. Also note that the default buildings only spawn on grass_with_dirt, so make sure that's what the flat floor is made of.
Ah, that makes sense. I wonder if the mod can check to see if "flat" is indicated in the map generation attributes in the minetest.conf file, and if so, lower the minimum height at which to spawn.

Anyway, which line of code is that specified, so I can try it out in the flatlands? Thanks!

User avatar
MirceaKitsune
Member
Posts: 924
Joined: Sat May 21, 2011 22:31
GitHub: MirceaKitsune
IRC: Taoki
In-game: MirceaKitsune
Location: Romania, Bucharest

by MirceaKitsune » Post

thefamilygrog66 wrote: Ah, that makes sense. I wonder if the mod can check to see if "flat" is indicated in the map generation attributes in the minetest.conf file, and if so, lower the minimum height at which to spawn.

Anyway, which line of code is that specified, so I can try it out in the flatlands? Thanks!
Doubt I can do that, and I like the current implementation as it is (code's already complex enough).

I don't suggest editing the script either. Instead, edit the minimum spawn height of structures in mapgen.txt. I think that's the third parameter counting from the end to left (5 for most buildings and 25 for the tower). Setting it to 0 should do the trick.

User avatar
thefamilygrog66
Member
Posts: 170
Joined: Mon Jul 09, 2012 19:08
Location: Ontario, Canada

by thefamilygrog66 » Post

MirceaKitsune wrote:
thefamilygrog66 wrote: Ah, that makes sense. I wonder if the mod can check to see if "flat" is indicated in the map generation attributes in the minetest.conf file, and if so, lower the minimum height at which to spawn.

Anyway, which line of code is that specified, so I can try it out in the flatlands? Thanks!
Doubt I can do that, and I like the current implementation as it is (code's already complex enough).

I don't suggest editing the script either. Instead, edit the minimum spawn height of structures in mapgen.txt. I think that's the third parameter counting from the end to left (5 for most buildings and 25 for the tower). Setting it to 0 should do the trick.
Great, thanks! I'll try it out.

User avatar
Mossmanikin
Member
Posts: 599
Joined: Sun May 19, 2013 16:26
Location: where we don't speak english.

by Mossmanikin » Post

Find this mod very useful for exporting and importing buildings from one map to another.
I use it together with WorldEdit.
Although I'm not using it yet, I like the possibility to let custom villages spawn.

Noob 4 life!
My stuff

User avatar
MirceaKitsune
Member
Posts: 924
Joined: Sat May 21, 2011 22:31
GitHub: MirceaKitsune
IRC: Taoki
In-game: MirceaKitsune
Location: Romania, Bucharest

by MirceaKitsune » Post

Added a load of small but important fixes and improvements today. Also added farms now that Minetest has a default farming system at last.

Image

Image

User avatar
MirceaKitsune
Member
Posts: 924
Joined: Sat May 21, 2011 22:31
GitHub: MirceaKitsune
IRC: Taoki
In-game: MirceaKitsune
Location: Romania, Bucharest

by MirceaKitsune » Post

Yesterday I tackled the issue of structures spawning on extreme terrain, causing holes in cliff walls and tall floors over large peaks. The surface is checked at each corner and structures only spawn if the difference is at most 20 by default.

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

by Inocudom » Post

This is a nice mod. It could be used alongside peaceful_npc to spawn villages in maps.

Sokomine
Member
Posts: 4276
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine
IRC: Sokomine
In-game: Sokomine

by Sokomine » Post

Spawning entire villages is pretty difficult. Even a 80x80 map of a village proved problematic. I hope it will get better with the new mapgen. MirceaKitsune wrote a function to improve spawning, but other developers where apparently working on something similar. I hope the needed function to set multiple nodes at a time will be available soon.
A list of my mods can be found here.

User avatar
MirceaKitsune
Member
Posts: 924
Joined: Sat May 21, 2011 22:31
GitHub: MirceaKitsune
IRC: Taoki
In-game: MirceaKitsune
Location: Romania, Bucharest

by MirceaKitsune » Post

Sokomine wrote:Spawning entire villages is pretty difficult. Even a 80x80 map of a village proved problematic. I hope it will get better with the new mapgen. MirceaKitsune wrote a function to improve spawning, but other developers where apparently working on something similar. I hope the needed function to set multiple nodes at a time will be available soon.
Spawning whole villages (pretty large ones too) works surprisingly well with the latest mod. Partly because I optimize the loops and actions so nothing is wasted. It still takes a lot until all buildings are spawned however (I'd estimate over 30 seconds per group instance) and there are still incomplete / malformed spawns occasionally. Still, it can safely work and do its thing... especially for normal sized houses and the like.

My biggest issue with the mod at this moment is the spawning pattern. Randomly searching for origins and avoiding buildings is both slower and uglier. I'm hoping to figure out a matrix system which can analyze building sizes and distances and calculate all origins in an uniform grid before spawning begins. I shall get around to that too soon enough.

Other improvements done yesterday include fixing buildings that were supported by leafs or water. Only nodes with drawtype "normal" are calculated for ground roughness, and if they aren't found the building doesn't spawn.

User avatar
MirceaKitsune
Member
Posts: 924
Joined: Sat May 21, 2011 22:31
GitHub: MirceaKitsune
IRC: Taoki
In-game: MirceaKitsune
Location: Romania, Bucharest

by MirceaKitsune » Post

I'm happy to announce the biggest improvement since the creation of this mod. I've been working on a new spawn pattern, together with a major rewrite of the mapgen system. The latest code has a much more optimal and cheap architecture and results in a way better spawn pattern.

Previously, a radius was given and buildings would randomly choose a location within it, doing expensive checks to avoid other buildings. The new system arranges buildings into columns and rows, then jigsaws them into place under an uniform pattern. There are no more avoidance checks, and each building knows exactly where it goes before the system begins spawning anything. Buildings are now placed in line and as little space as possible is wasted between them, resulting dense and nice looking cities.

The new architecture also moves the hard work (position checks, trigger node search, terrain roughness checks) to a new function which simply returns the structure list and parameters. Spawning only begins after this list is received and we know where everything goes. Previously the dirty work was done per-building, resulting in laggy checks each time and resource intensive spawns. Performance improvement with the current architecture is visibly noticeable.

Here are some screenshots of how towns look with the new code:

Image

Image

Image

Thanks to the better density, I was able to generate the largest town so far during one of the tests. Although it might seem scary when you think of all the nodes being spawned, it actually worked pretty quickly on my machine (single player). When the voxel manipulator will be ready, spawning of large and numerous structures will be a ton faster. This is the big town I got so far:

Image

Image

User avatar
Topywo
Member
Posts: 1721
Joined: Fri May 18, 2012 20:27

by Topywo » Post

Great work!

Temperest
Member
Posts: 651
Joined: Tue Nov 15, 2011 23:13
GitHub: Uberi

by Temperest » Post

Wow, is this using the new schematics stuff? Those look really well placed, blends right into the landscape.

I bet it would look a bit better if it set the lower nodes to dirt with grass instead of leaving the stone visible.
WorldEdit 1.0 released

The Mesecons Laboratory - the art of Mesecons circuitry
Latest article: Mesecons Basics.

User avatar
MirceaKitsune
Member
Posts: 924
Joined: Sat May 21, 2011 22:31
GitHub: MirceaKitsune
IRC: Taoki
In-game: MirceaKitsune
Location: Romania, Bucharest

by MirceaKitsune » Post

Temperest wrote:Wow, is this using the new schematics stuff? Those look really well placed, blends right into the landscape.

I bet it would look a bit better if it set the lower nodes to dirt with grass instead of leaving the stone visible.
No, it uses its own original system to spawn stuff. I'm not sure if schematics would be most appropriate here. I might consider using that though... if it wouldn't be too painful to switch the I/O system to their format.

Anyway, I fixed and adapted more things during the last days. Merged the ground level detection and terrain roughness checks into one formula, which yields in better centered buildings. Also made group radius be detected automatically, and now groups can spawn very close to each other if they don't collide. Here's screenshots of two neighboring towns:

Image

Image

Nore
Developer
Posts: 501
Joined: Wed Nov 28, 2012 11:35
GitHub: Ekdohibs

by Nore » Post

I have a little suggestion: add some way to smooth the terrain around the places where you place buildings, so it is not visible that you are adding dirt_with_grass around it...

Sokomine
Member
Posts: 4276
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine
IRC: Sokomine
In-game: Sokomine

by Sokomine » Post

The spawning of towns/villages, or, as you call it, group spawning, looks already quite well. I hope the *schematic functions will get extended with rotation (that's planned according to hmmm) and a way to easily replace nodes. In that case, much of the work could be done with those schematics.
A list of my mods can be found here.

User avatar
MirceaKitsune
Member
Posts: 924
Joined: Sat May 21, 2011 22:31
GitHub: MirceaKitsune
IRC: Taoki
In-game: MirceaKitsune
Location: Romania, Bucharest

by MirceaKitsune » Post

Sokomine wrote:The spawning of towns/villages, or, as you call it, group spawning, looks already quite well. I hope the *schematic functions will get extended with rotation (that's planned according to hmmm) and a way to easily replace nodes. In that case, much of the work could be done with those schematics.
I already added support for schematics today. Initially it works, and it's sure a lot faster. But of course it's disabled by default for now because:

- As you said, you can only spawn at one rotation. Nothing can be done until the function supports 0 / 90 / 180 / 270 rotations too.

- Inability to measure the area which the schematic would take up. I need a safety check to assure that importing a structure doesn't go out of the bounds specified with markers. If anyone knows of a way tell me... all I'd need is to know the X Y and Z size of the schematic before creating it.

- Waiting for the furnace crash to be fixed. Currently importing a schematic which contains a furnace crashes Minetest due to the fuel parameter.
Last edited by MirceaKitsune on Wed Jun 26, 2013 17:07, edited 1 time in total.

sweetbomber
New member
Posts: 4
Joined: Tue Jul 03, 2012 16:38

by sweetbomber » Post

Hi MirceaKitsune,

I suggest you to focus on the spawning of structures by the user, as the natural spawning of structures by mapgen is currently being taken care by me, which shall have much higher performance in core rather than lua.

What im doing is aimed at very large structures, such as towns, or very big structures in general, like floating spaceships, boats, etc...
I encourage people to use your format, and build such type of structures, since im using your format for schematic import.
People can even design structures from other games, such as command and conquer :) that would be nice :)

sweetbomber
New member
Posts: 4
Joined: Tue Jul 03, 2012 16:38

by sweetbomber » Post

Btw, nodes with meta require the call to on_create, such as furnaces, chests, etc...

User avatar
MirceaKitsune
Member
Posts: 924
Joined: Sat May 21, 2011 22:31
GitHub: MirceaKitsune
IRC: Taoki
In-game: MirceaKitsune
Location: Romania, Bucharest

by MirceaKitsune » Post

sweetbomber wrote:Hi MirceaKitsune,

I suggest you to focus on the spawning of structures by the user, as the natural spawning of structures by mapgen is currently being taken care by me, which shall have much higher performance in core rather than lua.

What im doing is aimed at very large structures, such as towns, or very big structures in general, like floating spaceships, boats, etc...
I encourage people to use your format, and build such type of structures, since im using your format for schematic import.
People can even design structures from other games, such as command and conquer :) that would be nice :)
I don't think anything better than the schematics system can be done for spawning buildings. With that, the Lua code for this mod only handles detecting ground level, terrain nodes and level, and generating the structure pattern (considering I later plan on adding roads too... someday somehow). Doubt a system that specific would get accepted in the code upstream. But good luck with that idea, it could be very useful :)

User avatar
MirceaKitsune
Member
Posts: 924
Joined: Sat May 21, 2011 22:31
GitHub: MirceaKitsune
IRC: Taoki
In-game: MirceaKitsune
Location: Romania, Bucharest

by MirceaKitsune » Post

hmmm fixed the facedir rotations for schematics, while PilzAdam explained how to fix the furnace crash. As a result, the I/O system has been defaulted to schematics and the default buildings converted from txt to mts. The clear function as well as the function to generate structure floors were switched to use the voxel manipulator instead.

Spawning structures is a lot less resource intensive and more fast now! It's also safer as there are no more incomplete spawns caused by the Lua <-> C++ lag. There are some minor issues left which I'll hopefully figure out in time... mostly floors being built incorrectly.

The text-file system will still exist for a while for compatibility. It will eventually be removed, so if you have any txt structures convert them to mts.

Post Reply

Who is online

Users browsing this forum: No registered users and 27 guests