[Mod] Natural slopes [naturalslopeslib]

User avatar
karamel
Member
Posts: 50
Joined: Wed Jul 19, 2017 21:51
Contact:

[Mod] Natural slopes [naturalslopeslib]

by karamel » Post

Library to simply add slopes to regular nodes and include them on map generation and when changing the landscape. Available on ContentDB

Image

Downloads
Licence LGPLv2 or any later
For Minetest 5
Dependencies: none
Optional dependencies:
  • poschangelib to enable update by stepping on nodes
  • twmlib for random update from time to time
Grab the source code:

Code: Select all

git clone https://files.creativekara.fr/git/naturalslopeslib.git

The lib itself doesn't include any change, you may also need a mod for a game that uses naturalslopeslib, check the download files for mods named naturalslopes_<game name>

Description

This mod adds some stair-like nodes from soft ground nodes (sand, dirt, gravel...) that may change shape automatically according to their surroundings.

The aim of this mod is to make a visual improvement on the world with more curves and smooth movement not to jump on every little height. The library adds an API to register all the alternative 4 shapes and the change shape behavior with one line of code, while keeping some flexibility for the new nodes.

Registering a natural slope has the following effects:
  • Four new nodes are registered based upon the original node definition: the straight slope, the inner corner, the outer corner and the "pike" (slab-like)
  • When the map is generated, the blocks are changed to slopes according to the surrounding and the material hardness (defined when registering the slope)
  • When blocks are placed around slopes, they may update their shape to match the new state
  • Nodes that are just placed may also update their shape to match the surroundings
  • If enabled, walking on edges may update the slope shape
  • If enabled, some node may update from time to time
Last edited by karamel on Sun Feb 07, 2021 14:40, edited 13 times in total.

User avatar
ManElevation
Member
Posts: 896
Joined: Tue Aug 02, 2016 22:04
GitHub: ManElevation
IRC: ManElevation
In-game: ManElevation
Location: Madrid,Spain

Re: [Mod] Natural slopes [natural_slopes]

by ManElevation » Post

+1
looks cool, but kinda weird makes minetest not look like minetest
My Public Mods! Discord: Rottweiler Games#3368

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

Re: [Mod] Natural slopes [natural_slopes]

by azekill_DIABLO » Post

spawns naturally? i probably mis-read your post.

User avatar
karamel
Member
Posts: 50
Joined: Wed Jul 19, 2017 21:51
Contact:

Re: [Mod] Natural slopes [natural_slopes]

by karamel » Post

azekill_DIABLO wrote:spawns naturally? i probably mis-read your post.
If you mean spawns like it is created from scratch no. It doesn't pop from scratch. If you means it happens by itself yes.

This is just about nodes changing shapes. A full block can turn into a slope and back to the block shape without direct interaction.

In 0.1 alternative shapes can be crafted by hand or happens with an ABM. If there are empty blocks around the shape can be updated to a slope or corner, if not it can update to a full block. This only for falling blocks (sands and gravel). But there is no movement. No other blocks are spawn nor are deleted in the operation.
ManElevation wrote:kinda weird makes minetest not look like minetest
For the mod to look more blockish, the use-stair-mesh switch is not implemented yet. It will switch from the smooth slope mesh to the cubic stair mesh. Maybe later with a client mod when it's possible because it doesn't affect the gameplay in any way.

Finally, I don't expect it to be selected into Minetest Game at all nor already established games. If that's what you mean by looking like minetest (because I don't see how an engine should look). But I'll probably use it for the gameplay I'm trying to build for my servers.

I'm still trying to make things activated or not and with separated mods to fit more uses, if someone like some parts of it but not other ones.

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

Re: [Mod] Natural slopes [natural_slopes]

by azekill_DIABLO » Post

karamel wrote:
azekill_DIABLO wrote:spawns naturally? i probably mis-read your post.
If you mean spawns like it is created from scratch no. It doesn't pop from scratch. If you means it happens by itself yes.

This is just about nodes changing shapes. A full block can turn into a slope and back to the block shape without direct interaction.

In 0.1 alternative shapes can be crafted by hand or happens with an ABM. If there are empty blocks around the shape can be updated to a slope or corner, if not it can update to a full block. This only for falling blocks (sands and gravel). But there is no movement. No other blocks are spawn nor are deleted in the operation.
looks nice!

User avatar
karamel
Member
Posts: 50
Joined: Wed Jul 19, 2017 21:51
Contact:

Re: [Mod] Natural slopes [natural_slopes]

by karamel » Post

Version 0.2 is out.

The new features are the cubic rendering (see updated screenshot), some configuration in advanced settings and the inclusion of poschangelib to make the sand sliding when you walk on it (well, in fact it just create a slope where it could).

User avatar
ManElevation
Member
Posts: 896
Joined: Tue Aug 02, 2016 22:04
GitHub: ManElevation
IRC: ManElevation
In-game: ManElevation
Location: Madrid,Spain

Re: [Mod] Natural slopes [natural_slopes]

by ManElevation » Post

karamel wrote:Version 0.2 is out.

The new features are the cubic rendering (see updated screenshot), some configuration in advanced settings and the inclusion of poschangelib to make the sand sliding when you walk on it (well, in fact it just create a slope where it could).
awesome!
My Public Mods! Discord: Rottweiler Games#3368

User avatar
Lord_Vlad
Member
Posts: 112
Joined: Thu Jul 20, 2017 07:58

Re: [Mod] Natural slopes [natural_slopes]

by Lord_Vlad » Post

There should be an option, at least, so that minig the slopes don't give you the slode node, but the normal node in your inventory.

Also, the desert sand is called silver and vice-versa.

User avatar
karamel
Member
Posts: 50
Joined: Wed Jul 19, 2017 21:51
Contact:

Re: [Mod] Natural slopes [natural_slopes]

by karamel » Post

Version 0.3 is out.

The main new feature is the update on map generation with VoxelManip. There was also some bugfixes, and probably new ones because I had to change a lot of things (thanks for the feedback for sand names).

I've changed how to register slopes and I now have some strange light issues. Probably something related to paramType…

Image

Regarding crafting and digging I'll probably have to detatch from Minetest Game (which is already possible) and think more about it.

It doesn't really make sense in creative mode not to control what is happening and not being able to create slopes manually. On the contrary if the full node is always dug, should it update itself automatically on place? Otherwise if you want to make a slope you'll have to place a full node and stomp it. If it's about something very hard like stone it may take ages (but ages are already there on map generation)
Attachments
natural_slopes-light_issue.jpg
(16.6 KiB) Not downloaded yet

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

Re: [Mod] Natural slopes [natural_slopes]

by azekill_DIABLO » Post

it might be a problem with nodebox or update of blocks.

User avatar
Stix
Member
Posts: 1385
Joined: Fri Aug 04, 2017 14:19
IRC: nil
In-game: Stix [+alts]
Location: USA

Re: [Mod] Natural slopes [natural_slopes]

by Stix » Post

this mod looks promising, ill have to try it out sometime soon.
Hey, what can i say? I'm the bad guy.

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

Re: [Mod] Natural slopes [natural_slopes]

by azekill_DIABLO » Post

How many time it takes to have slopes ? cause I am not patient.

User avatar
karamel
Member
Posts: 50
Joined: Wed Jul 19, 2017 21:51
Contact:

Re: [Mod] Natural slopes [natural_slopes]

by karamel » Post

Since 0.3 they are made upon generation. At that time the nodes have 100 time more chance to be updated than with regular update (time flies and it doesn't have waited for you to come). It is ridiculous right now because most nodes have 1/10th to 1/50th chance of update.

Then there is a chance they are made sometime. By default an ABM is run every 30 seconds. This will change later, because with what I'm planning with other mods almost everything would have an ABM…

And you can make them simply by walking on edges with poschangelib. It will do the same as the ABM but only on the nodes you stepped on.

If you are willing to update massively an existing map, you can set natural_slopes.update_shape_abm_interval in minetest.conf or in advanced settings to 1. Withing a few seconds, your surroundings will be completely updated.

Also, check known issues in first post, in 0.3 there is a bug which make the option to activate default nodes not enabled by default (even if it says so in advanced settings, you must force it).

[edit]Grammar[/edit]
Last edited by karamel on Sun Aug 06, 2017 10:12, edited 1 time in total.

User avatar
karamel
Member
Posts: 50
Joined: Wed Jul 19, 2017 21:51
Contact:

Re: [Mod] Natural slopes [natural_slopes]

by karamel » Post

For those who had the time to install version 0.3, bugs were fixed and 0.4 is there. Sorry for the inconvenience, it only adds some advanced settings for world generation.
+ Spoiler
It looks much much much much better now. I indeed have messed with paramType for the light. I've added some screenshots in the first post.

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

Re: [Mod] Natural slopes [natural_slopes]

by azekill_DIABLO » Post

cool, i'll test it soon!

User avatar
Otter
Member
Posts: 148
Joined: Fri May 12, 2017 21:17

Re: [Mod] Natural slopes [natural_slopes]

by Otter » Post

I tested it and I love it. It starts out kind of slow but then more and more becomes properly sloped.

User avatar
Otter
Member
Posts: 148
Joined: Fri May 12, 2017 21:17

Re: [Mod] Natural slopes [natural_slopes]

by Otter » Post

This mod is a huge improvement. It looks more natural and I don't have to bunny hop up a hill side.
A couple of suggestions. Since you are remaining static on volume, when a material is dug, the soil, or sand should revert to a normal block and lose the grass or whatever it had as a covering when it goes into inventory.

It is also possible to make or find a mysterious glow under certain circumstances. When the shapes are in the right situation, they glow at night.
Image
Image
Attachments
glowing2.jpg
(25.32 KiB) Not downloaded yet
glowing1.jpg
(38.59 KiB) Not downloaded yet

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

Re: [Mod] Natural slopes [natural_slopes]

by azekill_DIABLO » Post

that a light bug, probably decause he played with param2. adding "paramtype = light" should be fine. Or just make light go trough this node!!

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

Re: [Mod] Natural slopes [natural_slopes]

by azekill_DIABLO » Post

You must make light pass trough nodes... because this happens:
Image
Attachments
screenshot_20170807_110020.jpeg
(896.91 KiB) Not downloaded yet

User avatar
Otter
Member
Posts: 148
Joined: Fri May 12, 2017 21:17

I Love the Natural slopes Mod

by Otter » Post

Despite the glow this seriously improves the base game behavior and look.
Here is the result of a rainy day with the Snowdrift Mod and Natural Slopes.
Image
Image
When you go up a hill, you are no longer bunny hopping unless you need to climb rough terrain.
This is more fun, and it looks a lot more real. :)
This reminds me of an overcast and rainy summer day in Virginia.
PS. for the Snowdrift weather mod, go here, viewtopic.php?f=11&t=6854
Attachments
Slopes in the Rain.jpg
(92.82 KiB) Not downloaded yet
Slopes in the Rain 2.jpg
(83.75 KiB) Not downloaded yet

User avatar
Stix
Member
Posts: 1385
Joined: Fri Aug 04, 2017 14:19
IRC: nil
In-game: Stix [+alts]
Location: USA

Re: [Mod] Natural slopes [natural_slopes]

by Stix » Post

better to use the miniclime weather mod as it isnt laggy and has more features, here is the link: viewtopic.php?f=9&t=17579
Hey, what can i say? I'm the bad guy.

User avatar
karamel
Member
Posts: 50
Joined: Wed Jul 19, 2017 21:51
Contact:

Re: [Mod] Natural slopes [natural_slopes]

by karamel » Post

Version 0.5!

I've messed with paramType in nodes and fixlight in voxel manip more that expected. Like all bugs, they are more than expected. The lighting issues should have been solved now. The strange shades are out, the nodes don't glow at night anymore.

azerkill_DIABLO: I haven't reproduced your bug but if it works with stairs, it should work without sunlight_propagates. Tell me if you are still getting your issue on a fresh world.

You may have to refresh your world if you have generated it with version 0.3 or 0.4 to fix the light issues (delete/create your world or dig and replace buggy nodes). That's the magic of pre-alpha releases :)

And now, digging always gives the full block and slopes cannot be created by recipes. But digging can trigger the update of the neighbors nodes as well as placing anything somewhere.

And off-topic but anyway: miniclime is not better than snowdrift. They do not aims for the same things. Snowdrift is under refactoring (by a friend of mine, with performance enhancements in mind) and uses climate data like temperature and humitidy to pick likely to happen weathers at a place. Once mature (or extended that much it may not be snowdrift in the end) it could become a weather engine. Miniclime is way lighter and picks hardcoded weathers for immediate results (but far less flexible). Both are completely valid, but have two completely different goals.

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

Re: [Mod] Natural slopes [natural_slopes]

by azekill_DIABLO » Post

Stix wrote:better to use the miniclime weather mod as it isnt laggy and has more features, here is the link: viewtopic.php?f=9&t=17579
thanks for making my mods famous! you're my commercial agent!
karamel wrote:Version 0.5!

I've messed with paramType in nodes and fixlight in voxel manip more that expected. Like all bugs, they are more than expected. The lighting issues should have been solved now. The strange shades are out, the nodes don't glow at night anymore.

azerkill_DIABLO: I haven't reproduced your bug but if it works with stairs, it should work without sunlight_propagates. Tell me if you are still getting your issue on a fresh world.

You may have to refresh your world if you have generated it with version 0.3 or 0.4 to fix the light issues (delete/create your world or dig and replace buggy nodes). That's the magic of pre-alpha releases :)
i'll try that then, and you haven't seen the result of the last verion of miniclime!

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

Re: [Mod] Natural slopes [natural_slopes]

by azekill_DIABLO » Post

No more problems!

User avatar
Otter
Member
Posts: 148
Joined: Fri May 12, 2017 21:17

Re: [Mod] Natural slopes [natural_slopes]

by Otter » Post

I am not finding any issues either.

Post Reply

Who is online

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