villages [WIP]

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

villages [WIP]

by Sokomine » Post

Do not use on servers yet! Use on a flat map where you have nothing to loose.

Image
Image
Image

Several mods aim more or less at the creation of villages. The old villages mod was first. Towntest allows to help build a house, and deploy nodes places individual buildings on the map. MTcities (part of MM2.6) seems to be no longer available. Structure I/O places random buildings on a map and is the most modern, and my own random_buildings spawns lumberjack- and clay trader houses randomly on the map. The closest all these mods come to a city/village is that they may place houses relatively close together. But that's not yet a city. Even a village has more structure than that. Unfortionately, the terrain in MT is not easy to handle for building. The height differences make it difficult (don't want to open your front door and fall down a cliff). However, most human players do not seem to be capable to integrate the landscape into their buildings either. Only very few builders care about that. And even those sometimes create flat platforms for larger projects. So why care about it at all? Going 2d makes everything much much easier! It will also help a lot if mobs willl roam the village later on (they don't do that yet). Height differences are obstacles and traps for mobs.

Image

Regarding structure: This mod creates villages with a complexity/structure that ought to be ok for villages: One main road of which other roads may branch off, no parallel roads, central structure: village square with church, inn and forge.

Image
Image

Recent developments in the engine allowed to spawn objects like buildings a lot faster - and, what is even more important, more reliable. In older versions, even a small house was difficult to spawn because mapgen would interfere or the area not entirely be loaded - thus resulting in half-spawned houses.

Many thanks to hmmm for adding the Lua voxelmanipulator and the place_schematic function! It speeds village creation up considerably and allows to create pretty large villages reliably. And many thanks to PilzAdam who added the option to exchange materials in the schematics when placing them (i.e. use sandstone instead of cobble). That allows to create villages that look slightly diffrent and are thus more intresting.

Download: https://github.com/Sokomine/villages/archive/master.zip
Browse code: https://github.com/Sokomine/villages
Version: 0.1 alpha test version - not for productive use!
Licence: GPLv3
Depends on: Depends - you need all those mods installed that the buildings of your village will use; for the standard villages, that will be cottages, bells and farming plus.
Further requirements: Use a sufficiently recent built.

Usage:
Go to a free place in your flat world, stand on the ground (don't fly - else your village will fly) and type "/road 0" or "/road 90" (180 and 270 are supported as well), and the village will be placed at your location. Since there's no priv required for that, it ought to be obvious that you won't want to have it on a server in its current development state!

Next (large) steps planned:
Create a flat area so that the village can be spawned on normal maps.
Add fields around the village.
Integrate the flat area somehow into the rest of the map (help welcomed!).
Add inhabitants that live there and sell seeds/fruits/crafted building material.
Allow players to help build a new house (partly done in random_buildings, but needs to be ported to the new system).
Allow players to manage their own villages.
Last edited by Sokomine on Sun Sep 14, 2014 02:50, edited 1 time in total.
A list of my mods can be found here.

User avatar
paramat
Developer
Posts: 3699
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat
IRC: paramat
Location: UK

by paramat » Post

Amazing ... excellent work, look forward to trying this with 0.4.8.
Sokomine wrote:Integrate the flat area somehow into the rest of the map (help welcomed!).
I can modify my landup mod to do that, it already stretches land, it can also compress land into a flat plane smoothly across a distance. I think i can do a round flat area with a circular transition zone. I will contemplate this ...
Last edited by paramat on Sat Aug 17, 2013 21:47, edited 1 time in total.

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

by Sokomine » Post

paramat wrote: I can modify my landup mod to do that, it already stretches land, it can also compress land into a flat plane smoothly across a distance. I think i can do a round flat area with a circular transition zone. I will contemplate this ...
That's great! I was secretly hoping for you to gain intrest :-) Without integration into the rest of the map, the villages would look like artefacts. More than they ought to.
A list of my mods can be found here.

User avatar
Chinchow
Member
Posts: 684
Joined: Tue Sep 18, 2012 21:37

by Chinchow » Post

I know this a village mod but would you be able to make castles for certain villages and maybe walls too so as to show that that village is of a higher status?
Sometimes, it's harder to think up a mod than it is to create it.
Mods: Orichalcum Stonebricks Extra Chests

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

by Sokomine » Post

Chinchow wrote: I know this a village mod but would you be able to make castles for certain villages and maybe walls too so as to show that that village is of a higher status?
A castle might be a good idea. Not the 4-equal-sized-towers-movie-version but a more realistic, simpler one. Walls...they may have had fences and a wooden wall, but anything above that was limited to towns. Perhaps there ought to be a version for them as well eventually? A town is more complex and needs another road structure. It'll be quite some work finishing the villages, so I'll do that first.
A list of my mods can be found here.

User avatar
Chinchow
Member
Posts: 684
Joined: Tue Sep 18, 2012 21:37

by Chinchow » Post

I was just thinking that a village would need some way of protecting itself but its your mod. Also my last post left this out: Nice Work.

EDIT:Also can you make a version using just the default or no
Last edited by Chinchow on Sat Aug 17, 2013 22:41, edited 1 time in total.
Sometimes, it's harder to think up a mod than it is to create it.
Mods: Orichalcum Stonebricks Extra Chests

User avatar
paramat
Developer
Posts: 3699
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat
IRC: paramat
Location: UK

by paramat » Post

Sokomine, is the landscape to be flattened on generated chunk? This will be easier for me, but because there is no way of knowing what the terrain is like before it generates the flat area may end up in an ocean on a circle of reclaimed land, it will be down to chance.
I will try to make the altitude of the flat area chosen by parameter but i am thinking y = 2,3 or 4? just above sea level so that any added rivers will be just below path / road level, so you can have bridges over them.
Finally what is the minimum radius for the circular flat area, such that it contains the village?
Because i use stable releases i can't use the lua voxel manipulator, so i will first write the mod the old way to test it myself.
Last edited by paramat on Sat Aug 17, 2013 23:45, edited 1 time in total.

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

by Sokomine » Post

Chinchow wrote: I was just thinking that a village would need some way of protecting itself but its your mod. Also my last post left this out: Nice Work.
Yes, that's what a castle where good for. IIRC only the towns had the right (and ressources) to construct a real wall.
Chinchow wrote: EDIT:Also can you make a version using just the default or no
It would be easy to add buildings that only use default nodes if there where any. I decided that it looked better if they're more detailled and wrote my cottages-mod for that. The mod also works with the buildings from Taokis Structure I/O mod.
paramat wrote: Sokomine, is the landscape to be flattened on generated chunk? This will be easier for me, but because there is no way of knowing what the terrain is like before it generates the flat area may end up in an ocean on a circle of reclaimed land, it will be down to chance.
If there is a way to figure out if a special area is suitable for spawning the village (i.e. if the ground could be prepared successfully), then that would be no problem at all.
paramat wrote: I will try to make the altitude of the flat area chosen by parameter but i am thinking y = 2,3 or 4? just above sea level so that any added rivers will be just below path / road level, so you can have bridges over them.
Sounds fine. I was planning something not too heigh anyway. Might make the integration into the landscape easier and looks less...strange...than a platform.
paramat wrote: Finally what is the minimum radius for the circular flat area, such that it contains the village?
Because i use stable releases i can't use the lua voxel manipulator, so i will first write the mod the old way to test it myself.
That's configurable. I usually use 130-180m as the length for the main road. Roads may branch off to both sides, and there has to be a margin if the first side is a branch. There also has to be some space on the flat map part for fields and meadows for the animals. A place for the windmill and maybe a clay pit later on plus a lumberjack with a mini-forrest might be further add-ons, so it ought to be not too small. In the end, it ought to use voxelmanip. That has the advantage that it makes sure that the area is generated.
A list of my mods can be found here.

User avatar
paramat
Developer
Posts: 3699
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat
IRC: paramat
Location: UK

by paramat » Post

I'll start with on generated then later will try to make it manual with a flattening chat command. Flat area radius will be configurable, but looking at your screenshots i will choose a starting default radius of roughly 200. Once it's working i'll convert it to LVM form.
Last edited by paramat on Sun Aug 18, 2013 05:24, edited 1 time in total.

User avatar
leo_rockway
Member
Posts: 211
Joined: Tue Jul 31, 2012 20:37

by leo_rockway » Post

Sokomine, this looks really really nice. I hope you and paramat can figure out a way to make these spawn automatically in worlds. I don't know if this can be considered to be included upstream, but it would be amazing if it were part of 0.4.8.
Villages along with friendly mobs in them (I know, I know, too much like MC :S) would be amazing.

Also, I read that somebody mentioned a castle and for some reason I thought that a section of the castle could be heavily guarded (in the distant future, when we have actual mobs) and a nether portal could await inside if you manage to defeat the defenses.
Try Skyblock for MineClone 2
Listen to this sound and music pack!

User avatar
kaeza
Moderator
Posts: 2162
Joined: Thu Oct 18, 2012 05:00
GitHub: kaeza
IRC: kaeza diemartin blaaaaargh
In-game: kaeza
Location: Montevideo, Uruguay
Contact:

by kaeza » Post

I noticed one of the houses has a small fireplace with lava in it, which combined with nearby flammable materials can cause disaster. Other than that, this mod is awesomeness.
Your signature is not the place for a blog post. Please keep it as concise as possible. Thank you!

Check out my stuff! | Donations greatly appreciated! PayPal

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

by Nore » Post

I have code to spawn a flat area too, which blends good with the environment surronding it. See my post there: viewtopic.php?pid=104112#p104112. FYI, I use kernel smoothing, so the kernel can be changed to give different results http://en.wikipedia.org/wiki/Kernel_%28 ... common_use, anything except gaussian kernel will work.
Last edited by Nore on Sun Aug 18, 2013 06:48, edited 1 time in total.

User avatar
paramat
Developer
Posts: 3699
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat
IRC: paramat
Location: UK

by paramat » Post

[image removed by me]
A good nights work.
Last edited by paramat on Wed Aug 28, 2013 22:58, edited 1 time in total.

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

by Nore » Post

paramat, I like it. The only problem I see is the transition at the borders, which isn't always smooth. You could perhaps try to use a kernel smoother, as I did.

User avatar
paramat
Developer
Posts: 3699
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat
IRC: paramat
Location: UK

by paramat » Post

Interesting idea kernel smoothing, but i prefer to not smooth the terrain but to retain it's rough character while compressing it into a plane. The transition looks good to me ... except the trees ... the trees have been cleared for the village :)
Last edited by paramat on Sun Aug 18, 2013 07:15, edited 1 time in total.

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

by Nore » Post

The main problem I see is the on the left-hand side of the map, where there are acute angles that do not look good.Moreover, it looks like you have some bugs on the right-hand side, no?

User avatar
paramat
Developer
Posts: 3699
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat
IRC: paramat
Location: UK

by paramat » Post

Ah you mean the serrated pattern in the sand contour lines? Yeah i like that bug, i prefer simplicity to the extra processing of smoothing. Yes lots of bugs, possibly cavegen doing that, that can be disabled. The few bugs could be cleaned up quickly enough and the village will slice through those :)

Even in non LVM form this mod is fast, just a few seconds per chunk.
Last edited by paramat on Sun Aug 18, 2013 07:28, edited 1 time in total.

User avatar
jojoa1997
Member
Posts: 2890
Joined: Thu Dec 13, 2012 05:11
Location: Earth

by jojoa1997 » Post

A nice feature could be to also have some village shcematics have mountains with it. I will put up some screenshots of examples from the game which must not be named.
Coding;
1X coding
3X debugging
12X tweaking to be just right

User avatar
Linxx
Member
Posts: 406
Joined: Wed May 16, 2012 00:37

by Linxx » Post

hmmmm looks good but buildings are too big imho.

User avatar
jojoa1997
Member
Posts: 2890
Joined: Thu Dec 13, 2012 05:11
Location: Earth

by jojoa1997 » Post

Here is an album. I know it is in minecraft but you can see the way they integrated the terrain.
http://imgur.com/a/zPMWO
Coding;
1X coding
3X debugging
12X tweaking to be just right

User avatar
paramat
Developer
Posts: 3699
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat
IRC: paramat
Location: UK

by paramat » Post

The initial non-LVM terrain flattening mod is released viewtopic.php?id=6959
Last edited by paramat on Mon Aug 19, 2013 01:54, edited 1 time in total.

User avatar
paramat
Developer
Posts: 3699
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat
IRC: paramat
Location: UK

by paramat » Post

Flatten mod version 0.1.1 released.
Is there anything else my mod should do? ... otherwise soon i'll create the LVM version.

User avatar
philipbenr
Member
Posts: 1754
Joined: Fri Jun 14, 2013 01:56
GitHub: philipbenr
IRC: philipbenr
In-game: robinspi
Location: United States

by philipbenr » Post

Code: Select all

10:32:09: ERROR[main]: ServerError: LuaError: error: ...- Copy\bin\..\games\minetest_game\mods\villages\init.lua:289: bad argument #1 to 'byte' (string expected, got nil)
This is an error I got. I'm thinking "What the" :\ help please?
Last edited by philipbenr on Wed Aug 21, 2013 17:37, edited 1 time in total.

User avatar
philipbenr
Member
Posts: 1754
Joined: Fri Jun 14, 2013 01:56
GitHub: philipbenr
IRC: philipbenr
In-game: robinspi
Location: United States

by philipbenr » Post

Code: Select all

    -- thanks to sfan5 for this advanced code that reads the size from schematic files
    local read_s16 = function(fi)
        return string.byte(fi:read(1)) * 256 + string.byte(fi:read(1))
    end
    local function get_schematic_size(f)
apparently this code doesn't work here, or sfan5 messed up

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

by Sokomine » Post

leo_rockway wrote: Villages along with friendly mobs in them (I know, I know, too much like MC :S) would be amazing.
I've planned to add traders to the town. Currently, they'd only stand around and turn to you when you trade with them. For the small cottages, the women would trade the plants, fruits and especially seeds of the type they grow in their garden, and the men would trade what they craft (i.e. doors, chests, fences, roof parts, ..). Adding a couple for each house might result in too many mobs in a too small area. I'll have to check that. Also, it is boring if they just stand araound. Children would also be nice.
leo_rockway wrote: Also, I read that somebody mentioned a castle and for some reason I thought that a section of the castle could be heavily guarded (in the distant future, when we have actual mobs) and a nether portal could await inside if you manage to defeat the defenses.
The mobf mod does have archers and guards. A few could linger around in a castle. I'm afraid nether protals will not be located anywhere near the villages. Building regulations forbit it :-) But if you want a fantasy-like setting with suitable buildings and a nether portal, you can always extend the mod.
kaeza wrote: I noticed one of the houses has a small fireplace with lava in it, which combined with nearby flammable materials can cause disaster. Other than that, this mod is awesomeness.
That's the forge. In order to avoid disaster in case of accidents, it has a well close by. The material the lava is contained in will only be replaced with other solid stone types. Hope this is safe enough?
jojoa1997 wrote: Here is an album. I know it is in minecraft but you can see the way they integrated the terrain.
Intresting how it blends into the terrain. Last time I saw a Minecraft village, it had much more simple buildings. The ones shown in your screenshots are more advanced. They seem to be standalone buildings and not really part of a village/town.
Linxx wrote: hmmmm looks good but buildings are too big imho.
Usually, people complain that my buildings are too small and cramped. The cottages are - as far as possible - realistic. Much smaller houses would be rather simple huts. That can be fine as well for other regions/periods of time. The stoneage mod shows a nice small hut. Some of them arranged in a circle could form another type of village.
philipbenr wrote: apparently this code doesn't work here, or sfan5 messed up
Or there's something wrong with the schematic.

And now to the flattening of the land: I was astonished about the fast replies!

Nore: I had forgotten about your solution. When I tried it out, the area created by your mapgen looked very intresting on its own - much more gentle hills, simpler landscape (only grass). It's a bit odd that it is only one node thick, but you mentioned that already. The world from the underside looks like the ringworld :-) Jungletrees stick their roots through the dirt cover, and vines immediately started to conquer the underside. Perhaps this kind of terrain could be added as a transition area between the flat ground for the city and the rest of the world? About 1-4 chunks wide?

One huge problem I have with Nores solution is that it replaces mapgen entirely. Most of the map ought to remain normal mapgen - only few parts (those around the village) ought to be replaced with the new method. Switching to that new mapgen creates those strange border effects switches in mapgen or seed usually cause. Is there a way to limit a new mapgen function to a specific area only? Doing some sort of transition between "normal" mapgen and the slightly hilly terrain the mod creates would be necessary.
paramat wrote: The initial non-LVM terrain flattening mod is released viewtopic.php?id=6959
The screenshots look very promising! The circular shape is perhaps not ideal - a slightly oval one might look less un-natural. Or simply stick to more or less rectangular. Also, some high cliffs may remain at the side of the flattened area. Most of it may not matter as it is only visible from great height.

When I tested the mod, a quadratic shape was cut out from the map. The huge moretrees trees remained half standing, as did part of a hill. Perhaps the area was not entirely loaded. Using voxelmanip for this operation is extremly important as it eliminates those requirements I cannot meet - like "area generated and loaded, cavegen not interfering".

The central area (that where the village will be spawned) ought to consist of these nodes for the ground: dirt_with_grass on top, dirt below, and on layer 3 water_source (so that fields on top can work without making it look like rice cultivation); below that 2-3 layers of loam. On the bottom: At least one layer of stone. Below that, cavegen can have its fun (or not).
A list of my mods can be found here.

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 4 guests