[Mod] Map Fixer [mapfix]

Post Reply
User avatar
Gael de Sailly
Member
Posts: 845
Joined: Sun Jan 26, 2014 17:01
GitHub: gaelysam
IRC: Gael-de-Sailly
In-game: Gael-de-Sailly gaelysam
Location: Voiron, France

[Mod] Map Fixer [mapfix]

by Gael de Sailly » Post

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.
Last edited by Gael de Sailly on Fri Feb 01, 2019 00:23, edited 3 times in total.
Just realize how bored we would be if the world was perfect.

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

Re: [Mod] Map Fixer [mapfix]

by Krock » Post

Nice, it works!

The dependencies are missing btw.
Last edited by Krock on Sun Nov 20, 2016 08:08, edited 1 time in total.
Look, I programmed a bug for you. >> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>

User avatar
Gael de Sailly
Member
Posts: 845
Joined: Sun Jan 26, 2014 17:01
GitHub: gaelysam
IRC: Gael-de-Sailly
In-game: Gael-de-Sailly gaelysam
Location: Voiron, France

Re: [Mod] Map Fixer [mapfix]

by Gael de Sailly » Post

No dependencies.
Just realize how bored we would be if the world was perfect.

User avatar
Minetestforfun
Member
Posts: 940
Joined: Tue Aug 05, 2014 14:09
GitHub: MinetestForFun
IRC: MinetestForFun
In-game: MinetestForFun
Location: On earth
Contact:

Re: [Mod] Map Fixer [mapfix]

by Minetestforfun » Post

Thank you for this mod Gael, it's now activated in my server, i tried it and it works perfectly :)

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] Map Fixer [mapfix]

by philipbenr » Post

Very nice and handy mod. Thanks Gael.

User avatar
Gael de Sailly
Member
Posts: 845
Joined: Sun Jan 26, 2014 17:01
GitHub: gaelysam
IRC: Gael-de-Sailly
In-game: Gael-de-Sailly gaelysam
Location: Voiron, France

Re: [Mod] Map Fixer [mapfix]

by Gael de Sailly » Post

Updated : rewritten.
There's now a limitation for players, to avoid server freeze.

Added minetest.conf settings.
Just realize how bored we would be if the world was perfect.

User avatar
ExeterDad
Member
Posts: 1717
Joined: Sun Jun 01, 2014 20:00
In-game: ExeterDad
Location: New Hampshire U.S.A

Re: [Mod] Map Fixer [mapfix]

by ExeterDad » Post

This mod is awesome.
Just say'n

User avatar
trev
Member
Posts: 45
Joined: Fri Sep 26, 2014 16:49
In-game: trev

Re: [Mod] Map Fixer [mapfix]

by trev » Post

Thank you so much! My server was broken with pitch black areas. It was terrible. Fixed with a command. Nice!
Do what you love, and you will love what you do! :)

User avatar
Gael de Sailly
Member
Posts: 845
Joined: Sun Jan 26, 2014 17:01
GitHub: gaelysam
IRC: Gael-de-Sailly
In-game: Gael-de-Sailly gaelysam
Location: Voiron, France

Re: [Mod] Map Fixer [mapfix]

by Gael de Sailly » Post

UPDATE: Timer problems fixed by using os.time(), and settings are now fully functional.
Just realize how bored we would be if the world was perfect.

Betamine
Member
Posts: 10
Joined: Tue Jul 07, 2015 10:07
Location: Toulouse

Re: [Mod] Map Fixer [mapfix]

by Betamine » Post

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.

User avatar
Milan*
Member
Posts: 255
Joined: Thu May 28, 2015 06:45
GitHub: tchncs
IRC: Passant
In-game: Milan Passant
Location: Germany
Contact:

Re: [Mod] Map Fixer [mapfix]

by Milan* » Post

Sadly doesnt help on all non-shadow lightbugs :(
Last edited by Milan* on Mon Nov 21, 2016 10:41, edited 1 time in total.

User avatar
Fixer
Member
Posts: 904
Joined: Sun Jul 31, 2011 11:23
IRC: Fixer
In-game: Fixer
Location: Ukraine

Re: [Mod] Map Fixer [mapfix]

by Fixer » Post

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

User avatar
sorcerykid
Member
Posts: 1841
Joined: Fri Aug 26, 2016 15:36
GitHub: sorcerykid
In-game: Nemo
Location: Illinois, USA

Re: [Mod] Map Fixer [mapfix]

by sorcerykid » Post

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.

User avatar
YuGiOhJCJ
Member
Posts: 38
Joined: Sat Jan 23, 2016 07:41
GitHub: YuGiOhJCJ
IRC: YuGiOhJCJ
In-game: YuGiOhJCJ
Contact:

Re: [Mod] Map Fixer [mapfix]

by YuGiOhJCJ » Post

Awesome mod! It solved all my shadow problems on my Minetest server. Thank you.

hajo
Member
Posts: 606
Joined: Thu Oct 13, 2016 10:45
Location: DE
Contact:

Re: [Mod] Map Fixer [mapfix]

by hajo » Post

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.

User avatar
Gael de Sailly
Member
Posts: 845
Joined: Sun Jan 26, 2014 17:01
GitHub: gaelysam
IRC: Gael-de-Sailly
In-game: Gael-de-Sailly gaelysam
Location: Voiron, France

Re: [Mod] Map Fixer [mapfix]

by Gael de Sailly » Post

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.
Just realize how bored we would be if the world was perfect.

User avatar
Sergey
Member
Posts: 784
Joined: Wed Jan 11, 2017 13:28
Location: Russia

Re: [Mod] Map Fixer [mapfix]

by Sergey » Post

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
Attachments
screenshot_2017-02-21_21-30-04_1280x1024.2.png
screenshot_2017-02-21_21-30-04_1280x1024.2.png (146.87 KiB) Viewed 2722 times

User avatar
Gael de Sailly
Member
Posts: 845
Joined: Sun Jan 26, 2014 17:01
GitHub: gaelysam
IRC: Gael-de-Sailly
In-game: Gael-de-Sailly gaelysam
Location: Voiron, France

Re: [Mod] Map Fixer [mapfix]

by Gael de Sailly » Post

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.
Just realize how bored we would be if the world was perfect.

User avatar
Sergey
Member
Posts: 784
Joined: Wed Jan 11, 2017 13:28
Location: Russia

Re: [Mod] Map Fixer [mapfix]

by Sergey » Post

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.

User avatar
Wuzzy
Member
Posts: 4778
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy
Contact:

Re: [Mod] Map Fixer [mapfix]

by Wuzzy » Post

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)?

User avatar
Sergey
Member
Posts: 784
Joined: Wed Jan 11, 2017 13:28
Location: Russia

Re: [Mod] Map Fixer [mapfix]

by Sergey » Post

Great and simple mod. Effectively removes light and flow bugs.

Punk
Member
Posts: 158
Joined: Sun Dec 25, 2016 06:52

Re: [Mod] Map Fixer [mapfix]

by Punk » Post

Apparently does not work in 0.4.16.

User avatar
Codesound
Member
Posts: 365
Joined: Thu Jun 09, 2016 14:56

Re: [Mod] Map Fixer [mapfix]

by Codesound » Post

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

User avatar
sorcerykid
Member
Posts: 1841
Joined: Fri Aug 26, 2016 15:36
GitHub: sorcerykid
In-game: Nemo
Location: Illinois, USA

Re: [Mod] Map Fixer [mapfix]

by sorcerykid » Post

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.

User avatar
Gael de Sailly
Member
Posts: 845
Joined: Sun Jan 26, 2014 17:01
GitHub: gaelysam
IRC: Gael-de-Sailly
In-game: Gael-de-Sailly gaelysam
Location: Voiron, France

Re: [Mod] Map Fixer [mapfix]

by Gael de Sailly » Post

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.
Just realize how bored we would be if the world was perfect.

Post Reply

Who is online

Users browsing this forum: No registered users and 11 guests