[Mod] Map Fixer [mapfix]

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

[Mod] Map Fixer [mapfix]

by Gael de Sailly » Sun Nov 30, 2014 20:08

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.
Last edited by Gael de Sailly on Wed Apr 18, 2018 12:14, edited 2 times in total.
Contributor of Minetest and OpenStreetMap, on Ubuntu 16.04. ~ ~ ~ Meet me on MinetestForFun, VanessaE's Basic, Capture the Flag and Inside the Box.
 

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

Re: [Mod] Map Fixer [mapfix]

by Krock » Sun Nov 30, 2014 20:16

Nice, it works!

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

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

Re: [Mod] Map Fixer [mapfix]

by Gael de Sailly » Sun Nov 30, 2014 20:51

No dependencies.
Contributor of Minetest and OpenStreetMap, on Ubuntu 16.04. ~ ~ ~ Meet me on MinetestForFun, VanessaE's Basic, Capture the Flag and Inside the Box.
 

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

Re: [Mod] Map Fixer [mapfix]

by Minetestforfun » Sun Nov 30, 2014 22:33

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: 1688
Joined: Fri Jun 14, 2013 01:56
Location: United States
GitHub: philipbenr
IRC: philipbenr
In-game: robinspi
 

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

Re: [Mod] Map Fixer [mapfix]

by Gael de Sailly » Thu Jul 02, 2015 15:18

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

Added minetest.conf settings.
Contributor of Minetest and OpenStreetMap, on Ubuntu 16.04. ~ ~ ~ Meet me on MinetestForFun, VanessaE's Basic, Capture the Flag and Inside the Box.
 

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

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

Re: [Mod] Map Fixer [mapfix]

by trev » Fri Sep 11, 2015 18:27

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: 671
Joined: Sun Jan 26, 2014 17:01
Location: Lyon, France
GitHub: Gael-de-Sailly
IRC: Gael-de-Sailly
In-game: Gael-de-Sailly

Re: [Mod] Map Fixer [mapfix]

by Gael de Sailly » Sun Oct 04, 2015 21:08

UPDATE: Timer problems fixed by using os.time(), and settings are now fully functional.
Contributor of Minetest and OpenStreetMap, on Ubuntu 16.04. ~ ~ ~ Meet me on MinetestForFun, VanessaE's Basic, Capture the Flag and Inside the Box.
 

Betamine
New member
 
Posts: 9
Joined: Tue Jul 07, 2015 10:07
Location: Toulouse

Re: [Mod] Map Fixer [mapfix]

by Betamine » Tue Oct 06, 2015 08:03

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: 248
Joined: Thu May 28, 2015 06:45
Location: Germany
GitHub: tchncs
IRC: Passant
In-game: Milan Passant

Re: [Mod] Map Fixer [mapfix]

by Milan* » Sun Dec 13, 2015 18:38

Sadly doesnt help on all non-shadow lightbugs :(
Last edited by Milan* on Mon Nov 21, 2016 10:41, edited 1 time in total.
Illuna Minetestservers | Mastodon | [ matrix ] | I may host you a Minetestserver, just contact me.
 

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

Re: [Mod] Map Fixer [mapfix]

by Fixer » Sat Nov 19, 2016 22:07

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: 861
Joined: Fri Aug 26, 2016 15:36
Location: Illinois, USA
GitHub: sorcerykid
In-game: Nemo

Re: [Mod] Map Fixer [mapfix]

by sorcerykid » Sun Dec 04, 2016 16:34

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: 34
Joined: Sat Jan 23, 2016 07:41
GitHub: YuGiOhJCJ
IRC: YuGiOhJCJ
In-game: YuGiOhJCJ

Re: [Mod] Map Fixer [mapfix]

by YuGiOhJCJ » Thu Dec 22, 2016 13:37

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

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

Re: [Mod] Map Fixer [mapfix]

by hajo » Mon Jan 02, 2017 16:59

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: 671
Joined: Sun Jan 26, 2014 17:01
Location: Lyon, France
GitHub: Gael-de-Sailly
IRC: Gael-de-Sailly
In-game: Gael-de-Sailly

Re: [Mod] Map Fixer [mapfix]

by Gael de Sailly » Mon Jan 02, 2017 20:08

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.
Contributor of Minetest and OpenStreetMap, on Ubuntu 16.04. ~ ~ ~ Meet me on MinetestForFun, VanessaE's Basic, Capture the Flag and Inside the Box.
 

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

Re: [Mod] Map Fixer [mapfix]

by Sergey » Tue Feb 21, 2017 18:35

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
(146.87 KiB) Not downloaded yet
 

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

Re: [Mod] Map Fixer [mapfix]

by Gael de Sailly » Wed Feb 22, 2017 17:29

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.
Contributor of Minetest and OpenStreetMap, on Ubuntu 16.04. ~ ~ ~ Meet me on MinetestForFun, VanessaE's Basic, Capture the Flag and Inside the Box.
 

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

Re: [Mod] Map Fixer [mapfix]

by Sergey » Thu Feb 23, 2017 12:43

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: 3242
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy

Re: [Mod] Map Fixer [mapfix]

by Wuzzy » Sun May 21, 2017 12:54

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)?
My creations. I gladly take any bitcoins you have lying around: 17fsUywHxeMHKG41UFfu34F1rAxZcrVoqH
 

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

Re: [Mod] Map Fixer [mapfix]

by Sergey » Sun May 21, 2017 14:15

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

User avatar
Punk
Member
 
Posts: 150
Joined: Sun Dec 25, 2016 06:52

Re: [Mod] Map Fixer [mapfix]

by Punk » Fri Jun 09, 2017 12:32

Apparently does not work in 0.4.16.
DON'T STEAL! The government hates competition.
 

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

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

Re: [Mod] Map Fixer [mapfix]

by sorcerykid » Thu Jul 27, 2017 19:27

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.
 


Return to WIP Mods



Who is online

Users browsing this forum: runs and 2 guests