Page 1 of 1

[Mod] Map Fixer [mapfix]

Posted: Sun Nov 30, 2014 20:08
by Gael de Sailly
Hello !

This very simple mod can fix some map errors (light and flow problems) simply by typing "/mapfix <radius>". Radius is by default 24. Il you haven't the "server" privilege, you can't exceed 32.

It corrects most of light and flow bug.

Feel free to work on this project. The code is so short that I think it is simpler to copy the lines of the file directly on the forum, instead of making a fork and a pull request.

View on Github
Download

EDIT : there are now 3 settings, in minetest.conf :
  • mapfix_default_size (by default 24) : size used when <radius> is omitted
  • mapfix_max_size (by default 32) : maximum size allowed for players
  • mapfix_delay (by default 15) : minimal delay in seconds between 2 "/mapfix" (to avoid server freezing)
These limits can be exceeded by the admin only.

Note: for recent Minetest versions (as of 0.4.16), there is a builtin command /fixlight that does the exact same job with shadows.

Re: [Mod] Map Fixer [mapfix]

Posted: Sun Nov 30, 2014 20:16
by Krock
Nice, it works!

The dependencies are missing btw.

Re: [Mod] Map Fixer [mapfix]

Posted: Sun Nov 30, 2014 20:51
by Gael de Sailly
No dependencies.

Re: [Mod] Map Fixer [mapfix]

Posted: Sun Nov 30, 2014 22:33
by Minetestforfun
Thank you for this mod Gael, it's now activated in my server, i tried it and it works perfectly :)

Re: [Mod] Map Fixer [mapfix]

Posted: Mon Dec 01, 2014 00:49
by philipbenr
Very nice and handy mod. Thanks Gael.

Re: [Mod] Map Fixer [mapfix]

Posted: Thu Jul 02, 2015 15:18
by Gael de Sailly
Updated : rewritten.
There's now a limitation for players, to avoid server freeze.

Added minetest.conf settings.

Re: [Mod] Map Fixer [mapfix]

Posted: Sun Jul 19, 2015 21:36
by ExeterDad
This mod is awesome.
Just say'n

Re: [Mod] Map Fixer [mapfix]

Posted: Fri Sep 11, 2015 18:27
by trev
Thank you so much! My server was broken with pitch black areas. It was terrible. Fixed with a command. Nice!

Re: [Mod] Map Fixer [mapfix]

Posted: Sun Oct 04, 2015 21:08
by Gael de Sailly
UPDATE: Timer problems fixed by using os.time(), and settings are now fully functional.

Re: [Mod] Map Fixer [mapfix]

Posted: Tue Oct 06, 2015 08:03
by Betamine
It's great, thank you.

Is it possible to fix map around a region define by pos1 ?
I would like to fix a great region and it will be faster if i can excute the command in the chat window without "going" to the place to fix, something like this :
- //fixedpos set1 0 0 0
- //mapfix pos1
- //fixedpos set1 50 0 0
- //mapfix pos1
- //fixedpos set1 100 0 0
- //mapfix pos1
- etc ...

Thank you.

Re: [Mod] Map Fixer [mapfix]

Posted: Sun Dec 13, 2015 18:38
by Milan*
Sadly doesnt help on all non-shadow lightbugs :(

Re: [Mod] Map Fixer [mapfix]

Posted: Sat Nov 19, 2016 22:07
by Fixer
I have suggestion for developing second version of this mod, for fixing on large scale:
I'm thinking about more enhanced version
Imagine you glitched lighting on your map again
now comes improved mapfix 2.0
it works differently
map divided into 50 x 50 x 50 chunks
it checks if players around
if player is in this chunk -> check if it was mapfixed -> do mapfix in that chunk -> write in some file to avoid mapfixing it later
this way you can gradually fix the map

Re: [Mod] Map Fixer [mapfix]

Posted: Sun Dec 04, 2016 16:34
by sorcerykid
I'm curious why nobody has proposed merging this into the official minetest-game? It seems to be one of the most essential mods, particularly for a server.

Re: [Mod] Map Fixer [mapfix]

Posted: Thu Dec 22, 2016 13:37
by YuGiOhJCJ
Awesome mod! It solved all my shadow problems on my Minetest server. Thank you.

Re: [Mod] Map Fixer [mapfix]

Posted: Mon Jan 02, 2017 16:59
by hajo
sorcerykid wrote:I'm curious why nobody has proposed merging this into the official minetest-game?
This mod is still announced as WIP - 'Work-in-Progress'.

Are there any open issues that need fixing ?
Otherwise, request to move thread / announce as regular/finished mod.

Re: [Mod] Map Fixer [mapfix]

Posted: Mon Jan 02, 2017 20:08
by Gael de Sailly
Some things should be changed (smaller radius by default) but yes, it's a very simple code, there is not a lot of issues to fix.
The code is somewhat hacky, in fact it gets a voxelmanip and immediately write it (after recalculating liquid flow) and while writing it, it automatically recalculate the light.
It could be implemented much more cleanly in the core. All needed functions already exist, so it would be a very small addition in terms of quantity of code.

Re: [Mod] Map Fixer [mapfix]

Posted: Tue Feb 21, 2017 18:35
by Sergey
Error occured with automatic exit from gameplay when I typed /mapfix 1000

If this value considired too big, then your script must check it, warn about it, but not crash with errors and breaking the game.

Image

Re: [Mod] Map Fixer [mapfix]

Posted: Wed Feb 22, 2017 17:29
by Gael de Sailly
Sergey wrote:Error occured with automatic exit from gameplay when I typed /mapfix 1000

If this value considired too big, then your script must check it, warn about it, but not crash with errors and breaking the game.
Thank you :)
Done: I've limited the radius to 120 nodes, and changed the max radius for players without server privs to 24. I've noticed some weeks ago that a very large radius (>60?) can sometimes cause black chunks instead of solving them.

Re: [Mod] Map Fixer [mapfix]

Posted: Thu Feb 23, 2017 12:43
by Sergey
I think maximum value should be mentioned in warning in order not to guess it.

Code: Select all

/mapfix 1000
Radius is too big

/mapfix 500
Radius is too big

/mapfix 250
Radius is too big

/mapfix 125
Radius is too big

/mapfix 62
Done
Now maximum radius can be determined only using bisection method.

Please, mention something like this

Code: Select all

Radius is too big. Maximum radius allowed is <max_radius>.
In any software the more detailed output is the better.

Re: [Mod] Map Fixer [mapfix]

Posted: Sun May 21, 2017 12:54
by Wuzzy
Is this kind of annoying light bug fixed in Minetest now (development version)?

If this can not be easily fixed: Why is this command not in builtin (as a workaround)?

Re: [Mod] Map Fixer [mapfix]

Posted: Sun May 21, 2017 14:15
by Sergey
Great and simple mod. Effectively removes light and flow bugs.

Re: [Mod] Map Fixer [mapfix]

Posted: Fri Jun 09, 2017 12:32
by Punk
Apparently does not work in 0.4.16.

Re: [Mod] Map Fixer [mapfix]

Posted: Thu Jul 27, 2017 16:35
by Codesound
Win10_x64, Minetest 0.4.16

Hi,

THIS MOD IS AMAZING!!!!!! MANY AND MANY THANKS FOR THIS!!!!!!!

GREAT!!!!

Image
Image
Image
Image
Image
Image

R

Re: [Mod] Map Fixer [mapfix]

Posted: Thu Jul 27, 2017 19:27
by sorcerykid
Wuzzy wrote:Is this kind of annoying light bug fixed in Minetest now (development version)?

If this can not be easily fixed: Why is this command not in builtin (as a workaround)?
Simple: Because that would actually be useful and helpful.

Re: [Mod] Map Fixer [mapfix]

Posted: Fri Feb 01, 2019 00:19
by Gael de Sailly
Wuzzy wrote:Is this kind of annoying light bug fixed in Minetest now (development version)?

If this can not be easily fixed: Why is this command not in builtin (as a workaround)?
The command has been added in builtin... before Wuzzy wrote this!!
https://github.com/minetest/minetest/commit/f6d1b68

It's /fixlight, already present in Minetest 0.4.16 but seems to have gone totally unnoticed. For my part I just discovered it... today.