[Mod] Settlements [settlements]

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

Re: [Mod] Settlements [settlements]

by ShadMOrdre » Tue Jul 24, 2018 07:38

Nice mod! Villages blend well with terrain.

Mob NPCs get stuck. Perhaps add options to allow advanced_npcs or working_villagers.

Lava and water do not seem to be appropriately contained, as I have to rush to build walls around those liquids when a village spawns nearby.

Is it possible to add more building schems, without heavily copy/pasting code? It would be nice to simply provide a folder of schems (.mts files), that are available to choose from. Would make using the buildings from Sokomines villages, as well as other custom types, much easier.

I've noticed a conflict with Societies mod, where it appears that your village placement algorithm places settlements at exact location that Sunos Societies villages previously appeared. Given the same map seed, Societies crashes with Settlements mod enabled, and Societies villages cannot spawn and crash server. Since Societies is written in Portuguese or Esperanto, I'll work with you, if you are willing, and Bruno to try to resolve this, as both village types would look great, compliment each other, and could potentially interact.

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

Rochambeau
Member
 
Posts: 116
Joined: Tue Sep 23, 2014 11:37

Re: [Mod] Settlements [settlements]

by Rochambeau » Wed Jul 25, 2018 18:23

ShadMOrdre wrote:Nice mod! Villages blend well with terrain.

Mob NPCs get stuck. Perhaps add options to allow advanced_npcs or working_villagers.

Lava and water do not seem to be appropriately contained, as I have to rush to build walls around those liquids when a village spawns nearby.

Is it possible to add more building schems, without heavily copy/pasting code? It would be nice to simply provide a folder of schems (.mts files), that are available to choose from. Would make using the buildings from Sokomines villages, as well as other custom types, much easier.

I've noticed a conflict with Societies mod, where it appears that your village placement algorithm places settlements at exact location that Sunos Societies villages previously appeared. Given the same map seed, Societies crashes with Settlements mod enabled, and Societies villages cannot spawn and crash server. Since Societies is written in Portuguese or Esperanto, I'll work with you, if you are willing, and Bruno to try to resolve this, as both village types would look great, compliment each other, and could potentially interact.

Shad


NPCs only spawn in buildings and don't have the ability to open doors. Maybe TenPlus1 can help.

The well schematic needs some overhaul as water can drip on some locations. It's on my todo list.
The lava in the blacksmith should stay in the forge. Never had a problem with that.

At the current state, the schematics need some complementing definitions inside the code (size, depth, width, replace material, ...). Maybe I could add a routine to read all schematics in a certain folder and build a table with these informations.
One problem might be, that I'm using small buildings that do not need huge platforms. The bigger the building, the bigger the platform, the uglier the settlements.

The mod also replaces the wall material of the huts. And only of huts. That needs lua code to work and don't "break" other buildings.

I see there are a lot of mods competing for building sites. :-) I wasn't aware of that as I don't use those mods. First I want to finish my mods internal todo list. Then I can try to get along other with mods.

My current priority is the migration to LuaVoxelManip. That needs a complete modification of the mods logic and will take some time due to real life activities.
 

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

Re: [Mod] Settlements [settlements]

by Sokomine » Wed Jul 25, 2018 18:50

Rochambeau wrote:NPCs only spawn in buildings and don't have the ability to open doors. Maybe TenPlus1 can help.

My mob_world_interaction mod has pathfinding (written by burli) modified so that paths through closed doors can be found. The mobs need to know about open/closed doors as well. As the ones spawned here don't seem to be particulary intelligent it might be sufficient to let them try to open doors randomly.

Rochambeau wrote:The lava in the blacksmith should stay in the forge. Never had a problem with that.

If the forge is made out of materials that can be griefed by cavegen (i.e. stone) and is located in the area that can be changed by sourrounding mapchunks (16 nodes in from all sides), then cavegen may eat through the forge and remove the containing stone.

Rochambeau wrote:One problem might be, that I'm using small buildings that do not need huge platforms. The bigger the building, the bigger the platform, the uglier the settlements.

That's true. Your buildings seem to be streched a lot in height. It works quite well when looking at them, and they seem to be functional enough. Yet extending the mechanism to buildings in general may not work.

Rochambeau wrote:I see there are a lot of mods competing for building sites. :-) I wasn't aware of that as I don't use those mods. First I want to finish my mods internal todo list. Then I can try to get along other with mods.

Guess players who like one mod in that direction will likely like other mods that do similar things as well :-) Sadly there isn't really a way to handle interaction. As long as everything's local to one mapchunk, we might get away with an additional api that could tell a mod if the current mapchunk has already been taken over by another mod. Might not be so easy as mapgen can run parallel processes. Storing in a database which mod took over which mapchunk might be a better solution. I'm worrying about that problem as well as I have some mods that change the terrain, and not all can exist simultaneously in the same world yet.

Rochambeau wrote:My current priority is the migration to LuaVoxelManip. That needs a complete modification of the mods logic and will take some time due to real life activities.

Your houses are pretty small. I'm unsure weather they'll really profit from LuaVoxelManip or not. But at least it might make some things easier.

My handle_schematics mod has functions for placing buildings inside voxelmanip volumes and doing the necessary calls for on_constructed. There's also a function for detecting flat land of a given size (used in basic_houses), and there'll soon be a function to flatten hillls that are local to the mapchunk and to similarily fill holes in order to gain more flat land.

Your arrangement of the buildings in a circular pattern is quite intresting. I wonder if it can be combined with my detection of flat land.
A list of my mods can be found here.
 

Rochambeau
Member
 
Posts: 116
Joined: Tue Sep 23, 2014 11:37

Re: [Mod] Settlements [settlements]

by Rochambeau » Thu Jul 26, 2018 06:18

Sokomine wrote:Your houses are pretty small. I'm unsure weather they'll really profit from LuaVoxelManip or not.


The mod doesn't use "set_node" too much, but the function find_surface with its "get_node_or_nil" is called pretty often.

So the main reason for switching to LVM is this:

Every time you call set_node or get_node your mod needs to communicate with the engine, which results in copying. Copying is slow, and will quickly kill the performance of your game.

https://rubenwardy.com/minetest_modding_book/en/map/lvm.html#introduction

and this:

If you run that, you’ll notice that data[vi] is an integer. This is because the engine doesn’t store nodes using their name string, as string comparision is slow.


https://rubenwardy.com/minetest_modding_book/en/map/lvm.html#reading-nodes

Sokomine wrote:Your arrangement of the buildings in a circular pattern is quite intresting. I wonder if it can be combined with my detection of flat land.


I'm glad that you like it. Feel free to play around with it.
 

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

Re: [Mod] Settlements [settlements]

by Sokomine » Thu Jul 26, 2018 14:58

Rochambeau wrote:The mod doesn't use "set_node" too much, but the function find_surface with its "get_node_or_nil" is called pretty often.

What do you need that for? Just use the heightmap! The heightmap is extremly cheap compared to all other methods. There might still be an occasional call to get_node (or equivalent) for getting the terrain type - but your settlements don't adjust to the biome anyway, so there's no need for that either.

LVM is really great for large-scale map manipulation. But it's not free of cost either. Reading and writing back the LVM area does cost a bit. Changing just a few nodes is cheaper with set_node. It's hard to tell which one will be more efficient in your case. Guess you'll have to experiment.
A list of my mods can be found here.
 

Rochambeau
Member
 
Posts: 116
Joined: Tue Sep 23, 2014 11:37

Re: [Mod] Settlements [settlements]

by Rochambeau » Fri Jul 27, 2018 19:38

Sokomine wrote:What do you need that for? Just use the heightmap!


I mostly play with valleys mapgen and heightmap is not really reliable. I suspect this problem is not resolved yet ?
 

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

Re: [Mod] Settlements [settlements]

by Sokomine » Fri Jul 27, 2018 20:25

Rochambeau wrote:I mostly play with valleys mapgen and heightmap is not really reliable. I suspect this problem is not resolved yet ?

Oh :-( In that case...but on other mapgens, heightmap works very well.
A list of my mods can be found here.
 

Rochambeau
Member
 
Posts: 116
Joined: Tue Sep 23, 2014 11:37

Re: [Mod] Settlements [settlements]

by Rochambeau » Sun Jul 29, 2018 19:03

Some bigger changes since last time. Mostly under the hood.

Every function with get/set_node has a corresponding function using LuaVoxelManip. After several tests: not much difference in performance. At least on my system (2014 Intel i7-4510U).
If somebody wants to try both systems, set "settlements.lvm = false" in const.lua to true.

All functions are still in the code, but I think I will abandon LVM. When getting voxelmanip and Voxelarea with minp and maxp of the current chunk, the LVM area sometimes is too small for bigger (> 20 buildings) or stretched settlements. Buildings are cut at the borders or are completely missing. Maybe I could enlarge the LVM to load a bigger area, but that's something I'm not pursuing.
 

User avatar
rubenwardy
Moderator
 
Posts: 5886
Joined: Tue Jun 12, 2012 18:11
Location: United Kingdom
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy

Re: [Mod] Settlements [settlements]

by rubenwardy » Sun Jul 29, 2018 19:21

Sokomine wrote:LVM is really great for large-scale map manipulation. But it's not free of cost either. Reading and writing back the LVM area does cost a bit. Changing just a few nodes is cheaper with set_node. It's hard to tell which one will be more efficient in your case. Guess you'll have to experiment.


Hi, here's the performance cost of setting a cube area with LVM vs set_node. The x axis is the diameter, so 20 is 20x20x20. This is the best case for an LVM though, it's less clear when you have sparse setting of nodes.

For your usecase, it would probably be much better to place the houses as schematics than LVMs. Not sure what you're doing right now

Source: https://github.com/minetest/minetest/pu ... -360564966

Image
Image
 

Rochambeau
Member
 
Posts: 116
Joined: Tue Sep 23, 2014 11:37

Re: [Mod] Settlements [settlements]

by Rochambeau » Mon Jul 30, 2018 19:07

rubenwardy wrote:For your usecase, it would probably be much better to place the houses as schematics than LVMs. Not sure what you're doing right now


Thank you for your explanation. I dropped the migration to LVM and work with get_node/swap_node again. I'm quite pleased with its performance.

Latest bugfixes:
- forceload blocks where the schematics are built. So no more cut/incomplete buildings at mapchunk border
- fixed the well.mts. Water should be contained inside the well
 

Previous

Return to WIP Mods



Who is online

Users browsing this forum: No registered users and 2 guests