[Abandoned] [Mod] Landscape Redo [0.1.1] [landscape]

Post Reply
User avatar
Hamlet
Member
Posts: 766
Joined: Sat Jul 29, 2017 21:09
IRC: H4mlet
In-game: Hamlet
Location: Lombardy, Italy

[Abandoned] [Mod] Landscape Redo [0.1.1] [landscape]

by Hamlet » Post

Image

Image

Turns dirt with grass' sides into full grass sides.
BlockMen had released a beta version: viewtopic.php?f=11&t=5190

Settings used for the map' screenshots:
mgv7_spflags = nomountains, noridges, nofloatlands, caverns
seed = 2614029718620983620

Version: 0.1.1
Source code's license: GPLv3

Dependencies: default (found in Minetest Game)

Usage
Settings -> Advanced Settings -> Mod -> Landscape

LBM (active by default) = Changes the actually loaded map chunk's nodes.
NOTE: deactivate it if you're using a test map: nodes get already changed on map blocks' generation, leave it active if you're using a preexisting map.
ABM (active by default) = If daytime, changes the active map blocks' nodes that might need it (e.g. former dirt nodes which have turned to dirt_with_grass).
Landscape profiler = Shows on console the required computation times (every 5mins).
Landscape remover = Reverts the changed nodes to their original state.

Some profiling stats:
Spoiler
landscape redo's abm = interval 45, chance 50
(default:dirt's abm = interval 6, chance 50)

--FIRST RUN WHILE ON MAP LOADING

Landscape Redo [v0.1.0] - TIMES:
Average ABM time: 0.03ms
Slowest ABM time: 1.53ms

Average LBM time: 0.03ms
Slowest LBM time: 4.60ms

Average VM time: 30.36ms
Slowest VM time: 4.60ms

Average function time: 0.01ms
Slowest function time: 4.55ms


--SECOND RUN WHILE STANDING

Landscape Redo [v0.1.0] - TIMES:
Average ABM time: 0.03ms
Slowest ABM time: 0.08ms

Average LBM time: 0.00ms
Slowest LBM time: 0.00ms

Average VM time: 0.00ms
Slowest VM time: 0.00ms

Average function time: 0.02ms
Slowest function time: 0.07ms


--THIRD RUN, AFTER RELOGGING

Landscape Redo [v0.1.0] - TIMES:
Average ABM time: 0.03ms
Slowest ABM time: 0.59ms

Average LBM time: 0.00ms
Slowest LBM time: 0.00ms

Average VM time: 0.00ms
Slowest VM time: 0.00ms

Average function time: 0.03ms
Slowest function time: 0.58ms


--FOURTH RUN, WHILE STANDING

Landscape Redo [v0.1.0] - TIMES:
Average ABM time: 0.03ms
Slowest ABM time: 0.17ms

Average LBM time: 0.00ms
Slowest LBM time: 0.00ms

Average VM time: 0.00ms
Slowest VM time: 0.00ms

Average function time: 0.03ms
Slowest function time: 0.16ms

Downloads:
Archives: .zip .tar.gz
Source code: Codeberg



Installation

Unzip the archive, place the folder in
../minetest/mods/

If you only want this to be used in a single world, place it in
../minetest/worlds/WORLD_NAME/worldmods/

GNU+Linux - If you use a system-wide installation place it in
~/.minetest/mods/

For further information or help see:
https://wiki.minetest.net/Help:Installing_Mods
Last edited by Hamlet on Fri Oct 02, 2020 17:32, edited 7 times in total.
My repositories: Codeberg.org | My ContentDB's page

Astrobe
Member
Posts: 577
Joined: Sun Apr 01, 2018 10:46

Re: [Mod preview] Landscape Redo [0.1.0] [landscape]

by Astrobe » Post

It looks really nice, but having default nodes replaced with custom nodes (landscape:dirt_with_grass etc.) looks scary, because it seems it could break some mods.
My game? It's Minefall.

User avatar
TumeniNodes
Member
Posts: 2943
Joined: Fri Feb 26, 2016 19:49
GitHub: TumeniNodes
IRC: tumeninodes
In-game: TumeniNodes
Location: in the dark recesses of the mind
Contact:

Re: [Mod preview] Landscape Redo [0.1.0] [landscape]

by TumeniNodes » Post

Looks nice Hamlet, I recall the original.
Astrobe wrote:It looks really nice, but having default nodes replaced with custom nodes (landscape:dirt_with_grass etc.) looks scary, because it seems it could break some mods.
I don't think you have anything to worry about.
A Wonderful World

User avatar
Hamlet
Member
Posts: 766
Joined: Sat Jul 29, 2017 21:09
IRC: H4mlet
In-game: Hamlet
Location: Lombardy, Italy

Re: [Mod preview] Landscape Redo [0.1.0] [landscape]

by Hamlet » Post

Astrobe wrote:It looks really nice, but having default nodes replaced with custom nodes (landscape:dirt_with_grass etc.) looks scary, because it seems it could break some mods.
Legit concern, however consider that it doesn't replace every dirt node, just some of them; I've taken this screenshot to show which ones:

Image
TumeniNodes wrote: Looks nice Hamlet, I recall the original.
Thank you, just a "proof of concept" so far, I'm working to trim the code and improve compatibility with as many nodes as possible.
Attachments
replaced_nodes.png
replaced_nodes.png (475.86 KiB) Viewed 822 times
My repositories: Codeberg.org | My ContentDB's page

User avatar
Hamlet
Member
Posts: 766
Joined: Sat Jul 29, 2017 21:09
IRC: H4mlet
In-game: Hamlet
Location: Lombardy, Italy

Re: [Mod preview] Landscape Redo [0.1.1] [landscape]

by Hamlet » Post

Released v.0.1.1

- Added ABM, improved the profiling ability, minor tweaks.

Check the first post for more informations.
My repositories: Codeberg.org | My ContentDB's page

Astrobe
Member
Posts: 577
Joined: Sun Apr 01, 2018 10:46

Re: [Mod preview] Landscape Redo [0.1.1] [landscape]

by Astrobe » Post

Landscape has generated a lot of "Lua OOM" crashes today while I was flying around to test other things. This error usually happens once when I do that kind of thing (even before I installed Landscape), but today I had repeated crashes. The ABM was disabled.

User avatar
Hamlet
Member
Posts: 766
Joined: Sat Jul 29, 2017 21:09
IRC: H4mlet
In-game: Hamlet
Location: Lombardy, Italy

Re: [Mod preview] Landscape Redo [0.1.1] [landscape]

by Hamlet » Post

Astrobe wrote:Landscape has generated a lot of "Lua OOM" crashes today while I was flying around to test other things. This error usually happens once when I do that kind of thing (even before I installed Landscape), but today I had repeated crashes. The ABM was disabled.
Landscape only uses memory in four cases:
- map generation (voxel manipulator) [ran just once]
- preexistent map loaded block (lbm) [ran just once]
- preexistent active map block (abm) [ran every X secs]
- calculating the elapsed times of the above operations, storing/parsing them and printing them.

So, excluding the ABM which you said it was turned off, the worst possible case I can think of is:
- Voxel Manipulator active
- LBM active
- profiler active
- the above when map is being generated

That is:
map generation +
voxel manipulator +
loaded block manipulator (useless, since the VoxelManip has already been ran) +
profiler collecting and elaborating elapsed times

If this is the case then I am not surprised that you get Out Of Memory crashes, at least deactivate the LBM; and given that you already had OOM crashes without Landscape running, I would suggest to turn off the profiler as well.

This would leave active the VoxelManip only, drastically reducing the chance of OOM crashes.
EDIT ^^^^^ Last famous words! See the next post.
Last edited by Hamlet on Thu Aug 02, 2018 12:50, edited 1 time in total.
My repositories: Codeberg.org | My ContentDB's page

User avatar
Hamlet
Member
Posts: 766
Joined: Sat Jul 29, 2017 21:09
IRC: H4mlet
In-game: Hamlet
Location: Lombardy, Italy

Re: [Mod preview] Landscape Redo [0.1.1] [landscape]

by Hamlet » Post

Astrobe wrote:Landscape has generated a lot of "Lua OOM" crashes today while I was flying around to test other things. This error usually happens once when I do that kind of thing (even before I installed Landscape), but today I had repeated crashes. The ABM was disabled.
I believe that I've found the cause of the OOMs.
Quickly: multiple huge voxelmanip tables.

Thoroughly:
Spoiler
Accordingly to this post, the solution should be the #3 in this other post.
I'm not using the bundled LuaJIT, perhaps that explains why I'm not having OOMs, but I wouldn't bet on it.
However, while working on my other mods I've learned better ways to achieve the same things with less code (e.g. "for" cycles).
Moreover I plan to remove the custom nodes (i.e. "landscape:dirt_with_*") and to redefine the default nodes; the idea is to change "default:dirt_with_*" 's textures depending on neighbors, instead of replacing the node itself.

Underlying idea:
Spoiler
We have six faces per node; discarding the top one and the bottom one we have four faces to work on - if one of those faces is near to another dirt node we'll leave it as it is, else if it is near to an "air" node we apply on it the top-face texture, i.e. default_grass.png...
The above should drastically cut the code's lenght and the number of required computations, while ensuring compatibility with other mods.

I don't have an ETA, but this mod isn't dead nor abandoned.
Sidenote: I'll probably switch to the MIT license, because I want my code to be "CC-BY-SA" without forcing people to document which changes they've done.
My repositories: Codeberg.org | My ContentDB's page

Astrobe
Member
Posts: 577
Joined: Sun Apr 01, 2018 10:46

Re: [Mod preview] Landscape Redo [0.1.1] [landscape]

by Astrobe » Post

I actually ended up redefining dirt_with... nodes so that there's the same texture on all faces, which achieves mostly the same thing. I didn't mention it because I assumed that Minecraft/Minetest started up like that, but people found it bad and the side textures were introduced, so doing that would be a regression to most people.

It has drawbacks though, like you can't tell the difference between dirt_with_snow and snow blocks and the bottom face should be dirt (that one is just my laziness).

If I understand it correctly, your new method should look nicer with stacks of dirt hanging on cliffs - you'll get a stack of green dirt_with_grass nodes instead of one grass on top and N dirt nodes below it. TBH as far as I'm concerned I'm not sure it's worth the extra calculations though.

One thing I'm not sure about your new method is that if you keep the default node, then the ABM that converts grass nodes that are covered into dirt nodes might get in your way.

User avatar
Hamlet
Member
Posts: 766
Joined: Sat Jul 29, 2017 21:09
IRC: H4mlet
In-game: Hamlet
Location: Lombardy, Italy

Re: [Mod preview] Landscape Redo [0.1.1] [landscape]

by Hamlet » Post

Astrobe wrote:One thing I'm not sure about your new method is that if you keep the default node, then the ABM that converts grass nodes that are covered into dirt nodes might get in your way.
You are right, that is surely going to happen; the outcome would look weird.
I'll have to figure how to get the two abms get along.
Perhaps I could simply turn off the abm that converts covered dirt_with_grass nodes into dirt nodes, if possible - and make my abm handle that duty as well.
My repositories: Codeberg.org | My ContentDB's page

User avatar
Hamlet
Member
Posts: 766
Joined: Sat Jul 29, 2017 21:09
IRC: H4mlet
In-game: Hamlet
Location: Lombardy, Italy

Re: [Mod] Landscape Redo [0.1.1] [landscape]

by Hamlet » Post

Notice: now on git repository.
My repositories: Codeberg.org | My ContentDB's page

Post Reply

Who is online

Users browsing this forum: No registered users and 37 guests