[Mod] Generative road, path network [0.3.2] [path]

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

[Mod] Generative road, path network [0.3.2] [path]

by paramat » Post

Image


Download, rename to 'path' https://github.com/paramat/path/archive/master.zip
Code https://github.com/paramat/path

path 0.3.2 by paramat
For latest stable Minetest back to 0.4.8
Depends default
Licenses: code WTFPL

The intersecting road systems and paths climb hills and use halfslabs to create a walkable (no jumping) and drivable slope.
Away from the roads are lakes with beaches, and high hills. This is a single biome mapgen with grassland and variable density forests.
Chunk generation time roughly 1s.
Start a new world with this mod enabled, the mod will automatically set singlenode mapgen.
You will probably spawn underground so disable damage before starting a new world, enable freemove and fly up to find the surface.
After spawning in a new world you may need to travel up to 1kn to find a road.
Last edited by paramat on Sun Feb 15, 2015 23:23, edited 25 times in total.

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

Re: [Mod] Generative road/path experiment [0.1.2] [path]

by paramat » Post

0.1.2
Now using x overgeneration to fix most chunk border bugs.
Desert sand is easier on the eye, added stereotype cacti.
Lane width parameter.
Tuned diagonal road width for a better match.

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

Re: [Mod] Generative road/path experiment [0.1.2] [path]

by philipbenr » Post

Cool... It would be amazing to have--

Great idea:
Image
If you've ever played the game, it is fun, is it not? Anyhow, I was wondering if this could be possible? I know that there are multiple cars mods... Webdesigner97's would be nice because it doesn't run up slopes. Anyhow, you would just have a looping race track with the track in a depression. Then you would have a couple cacti and some other decorative items (cliffs, train tracks, old broken locomotive... maybe more). You would have Mario Kart 64 Kalimari Desert. Just a cool thought... I dunno if you want to though (I think it would be amazing... :)

Edit: Another nice lookin' mod Paramat

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

Re: [Mod] Generative road/path experiment [0.1.2] [path]

by paramat » Post

The road is 'drawn' by a 3D node brush that is a 7x7 node disc with a white centre. White has priority over black which has priority over sand. The brush is triggered by the curves where 2D noise is zero.
Last edited by paramat on Sun Feb 15, 2015 23:25, edited 4 times in total.

4aiman
Member
Posts: 1208
Joined: Mon Jul 30, 2012 05:47

Re: [Mod] Generative road/path experiment [0.1.2] [path]

by 4aiman » Post

Wow!
Is there any way I can be sure that there will be only ONE road on a map?
Why? Because of Roger Zelazny's legacy: http://wiki.roadtoamber.com/black-road

User avatar
Hybrid Dog
Member
Posts: 2835
Joined: Thu Nov 01, 2012 12:46
GitHub: HybridDog

Re: [Mod] Generative road/path experiment [0.1.2] [path]

by Hybrid Dog » Post

You could use pelin3d for the height.

‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪

4aiman
Member
Posts: 1208
Joined: Mon Jul 30, 2012 05:47

Re: [Mod] Generative road/path experiment [0.1.3] [path]

by 4aiman » Post

Thanks!
PS: WHY CAN'T I "LIKE" SOMEONE'S POST USING NEW FORUM SOFTWARE AS WELL AS THE OLD ONE???

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

Re: [Mod] Generative road/path experiment [0.1.3] [path]

by paramat » Post

One road is impossible, but you can move towards vast isolated roads by increasing the 'spread' of the 'np_base' noise, double it perhaps 2-3 times, adding an 'octave' each time you do, until the spread is larger than the area you expect to explore. Then also reduce 'persistence' to 0.4 or 0.33. When you spawn yo umay need to travel the spread distance to find the first road.

User avatar
Hybrid Dog
Member
Posts: 2835
Joined: Thu Nov 01, 2012 12:46
GitHub: HybridDog

Re: [Mod] Generative road/path experiment [0.1.3] [path]

by Hybrid Dog » Post

paramat wrote:One road is impossible, [...]
with the code you use
It's possible if the position of the street would be found out with using the map's seed and pseudorandom.

‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪

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

Re: [Mod] Generative road/path experiment [0.1.3] [path]

by paramat » Post

^ Yep.
Last edited by paramat on Mon May 26, 2014 05:21, edited 1 time in total.

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

Re: [Mod] Generative road/path experiment [0.1.3] [path]

by philipbenr » Post

Amazing...

Edit: @paramat: Could you make a version with a finish line? I would like to generate a racetrack off the bat... If not, then I'll make a map of Kalimari Desert and post it later...

4aiman
Member
Posts: 1208
Joined: Mon Jul 30, 2012 05:47

Re: [Mod] Generative road/path experiment [0.1.3] [path]

by 4aiman » Post

paramat wrote:One road is impossible, but you can move towards vast isolated roads
Well, that's enough for me, 'cause the black road is not continuous.

Maybe It'll be good to create some "power fields" that'll slow players who are to cross the road instead of moving along it :)

Great work, paramat!

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

Re: [Mod] Generative road/path experiment [0.1.4] [path]

by paramat » Post

0.1.4
Two intersecting road systems, one passes under hills in tunnels, the white line is luminous.

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

Re: [Mod] Generative road/path experiment [0.1.5] [path]

by paramat » Post

0.1.5
Added yellow tunnel ceiling lights, finally found a good way to spread the light in tunnels by ABM.


Image

Code: Select all

minetest.register_abm({
	nodenames = {"path:lightoff"},
	interval = 7,
	chance = 8,
	action = function(pos, node)
		minetest.add_node(pos, {name="path:lighton"})
		pos.y = pos.y - 1
		minetest.add_node(pos, {name="path:roadblack"})
		minetest.dig_node(pos)
	end,
})

User avatar
Hybrid Dog
Member
Posts: 2835
Joined: Thu Nov 01, 2012 12:46
GitHub: HybridDog

Re: [Mod] Generative road/path experiment [0.1.5] [path]

by Hybrid Dog » Post

paramat wrote:0.1.5
Added yellow tunnel ceiling lights, finally found a good way to spread the light in tunnels by ABM.


Image

Code: Select all

minetest.register_abm({
	nodenames = {"path:lightoff"},
	interval = 7,
	chance = 8,
	action = function(pos, node)
		minetest.add_node(pos, {name="path:lighton"})
		pos.y = pos.y - 1
		minetest.add_node(pos, {name="path:roadblack"})
		minetest.dig_node(pos)
	end,
})
1. you could use update_map() to light a lot of lights at once
2. there's a function called "nodeupdate(pos)"
3. you could also use on_punch and enable/disable the connecting lights at once

‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪

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

Re: [Mod] Generative road/path experiment [0.1.5] [path]

by paramat » Post

Thanks, however it seems 'update_map()' is not for the on-generated version of voxelmanip.
I seemed to remember there was a 'nodeupdate' function but could not find it when searching through the lua-api.txt, i was wondering if i has imagined it. How is it used? 'minetest.node_update(pos)'?

User avatar
Krock
Developer
Posts: 4650
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker
Location: Switzerland
Contact:

Re: [Mod] Generative road/path experiment [0.1.5] [path]

by Krock » Post

paramat wrote:Thanks, however it seems 'update_map()' is not for the on-generated version of voxelmanip.
I seemed to remember there was a 'nodeupdate' function but could not find it when searching through the lua-api.txt, i was wondering if i has imagined it. How is it used? 'minetest.node_update(pos)'?

Code: Select all

nodeupdate(pos)
https://github.com/VanessaE/moretrees/b ... ay.lua#L31
Look, I programmed a bug for you. >> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>

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

Re: [Mod] Generative road/path experiment [0.1.5] [path]

by paramat » Post

Thanks i will try it.
EDIT
It works :}

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

Re: [Mod] Generative road/path experiment [0.2.0] [path]

by paramat » Post

Version 0.2.0
Now tunnels have been moved to noisegrid, this mod is currently an experiment (also an example and a mapgen framework) in roads that climb hills and place halfslabs to create walkable and drivable slopes (gradient is limited though). Map in first post.
Last edited by paramat on Sun Jun 22, 2014 08:00, edited 1 time in total.

User avatar
Krock
Developer
Posts: 4650
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker
Location: Switzerland
Contact:

Re: [Mod] Generative road/path experiment [0.2.0] [path]

by Krock » Post

Error at startup:

Code: Select all

09:21:21: ERROR[main]: ServerError: E:\Programme\minetest\bin\..\mods\path\init.
lua:168: bad argument #1 to 'abs' (number expected, got nil)
09:21:21: ERROR[main]: stack traceback:
09:21:21: ERROR[main]:  [C]: in function 'abs'
09:21:21: ERROR[main]:  E:\Programme\minetest\bin\..\mods\path\init.lua:168: in
function <E:\Programme\minetest\bin\..\mods\path\init.lua:121>
The indexes seem to be correct in the codes

EDIT: Found the bug... the hardcoded sidelen of "81" was the problem.
Look, I programmed a bug for you. >> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>

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

Re: [Mod] Generative road/path experiment [0.2.0] [path]

by paramat » Post

Interesting, you use a chunk size other than 5? I usually assume no-one does but i might use sidelen in future now. It's 81 instead of 80 because of overgeneration, so use sidelen + 1.

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

Re: [Mod] Generative path experiments [0.3.0] [path]

by paramat » Post

Version 0.3.0
Grass, dirt, trees, lakes, mountains, beaches. 2 road systems along ridges and valleys.

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

Re: [Mod] Generative path experiments [0.3.1] [path]

by paramat » Post

Version 0.3.2
Dirt paths with walkable (no jumping) halfslab slopes.

Post Reply

Who is online

Users browsing this forum: No registered users and 35 guests