MinetestForFun / server-minetestforfun

Repository of the subgame and mods of "MinetestForFun" server
https://www.xorhub.com
The Unlicense
27 stars 10 forks source link

Update [watershed] mod #489

Closed BetterToAutomateTheWorld closed 8 years ago

BetterToAutomateTheWorld commented 8 years ago

https://github.com/paramat/watershed/commits/master

2 commits needed and keep our tweaks

@Gael-de-Sailly maybe you can help us ? :)

gaelysam commented 8 years ago

Many things have been modified on our side. Merging will not work. So that needs a lot of work. I have the time this week, until Friday. @paramat: Has the mapgen changed or is it just an optimization?

ghost commented 8 years ago

@Gael-de-Sailly dans le notre il y a des sources de lave/acide/eau dans les fissures, on passes notre temps à les boucher sinon c'est impraticable et ça provoque du lag, si tu peut aussi les enlever des fissures ce serait génial, parce que tous les 100 nodes il y a plusieurs sources.

paramat commented 8 years ago

@Gael-de-Sailly The changes will not break worlds in any way. The important change is the noise buffer optimisation:

+-- Localise noise buffers
+
+local nbuf_terrain
+local nbuf_fissure
+local nbuf_temp
+local nbuf_humid
+local nbuf_seam
+local nbuf_strata
+   
+local nbuf_mid
+local nbuf_base
+local nbuf_xlscale
+local nbuf_magma

    -- 3D and 2D perlinmaps created per mapchunk
-   local nvals_terrain = nobj_terrain:get3dMap_flat(minposxyz)
-   local nvals_fissure = nobj_fissure:get3dMap_flat(minposxyz)
-   local nvals_temp    = nobj_temp:get3dMap_flat(minposxyz)
-   local nvals_humid   = nobj_humid:get3dMap_flat(minposxyz)
-   local nvals_seam    = nobj_seam:get3dMap_flat(minposxyz)
-   local nvals_strata  = nobj_strata:get3dMap_flat(minposxyz)
+   local nvals_terrain = nobj_terrain:get3dMap_flat(minposxyz, nbuf_terrain)
+   local nvals_fissure = nobj_fissure:get3dMap_flat(minposxyz, nbuf_fissure)
+   local nvals_temp    = nobj_temp   :get3dMap_flat(minposxyz, nbuf_temp)
+   local nvals_humid   = nobj_humid  :get3dMap_flat(minposxyz, nbuf_humid)
+   local nvals_seam    = nobj_seam   :get3dMap_flat(minposxyz, nbuf_seam)
+   local nvals_strata  = nobj_strata :get3dMap_flat(minposxyz, nbuf_strata)

-   local nvals_mid     = nobj_mid:get2dMap_flat(minposxz)
-   local nvals_base    = nobj_base:get2dMap_flat(minposxz)
-   local nvals_xlscale = nobj_xlscale:get2dMap_flat(minposxz)
-   local nvals_magma   = nobj_magma:get2dMap_flat(minposxz)
+   local nvals_mid     = nobj_mid    :get2dMap_flat(minposxz, nbuf_mid)
+   local nvals_base    = nobj_base   :get2dMap_flat(minposxz, nbuf_base)
+   local nvals_xlscale = nobj_xlscale:get2dMap_flat(minposxz, nbuf_xlscale)
+   local nvals_magma   = nobj_magma  :get2dMap_flat(minposxz, nbuf_magma)

The code cleanups and re-arranging are not essential, the only other changes i recommend are removing the now deleted inventorycube from all liquids and making cloud/fog floodable. Easily done manually.

-   inventory_image = minetest.inventorycube("watershed_freshwater.png"),

+   floodable = true,

Alll this can be done quickly.

paramat commented 8 years ago

I didn't realise you were using watershed, thanks so much. How well are you coping with lua lag from mapgen?

gaelysam commented 8 years ago

Clouds have already been removed, and the nodes from watershed have also been removed and replaced by the nodes from default, by aliases. @crabman77 Liquids underground are ores (here and here) and that can't be modified in watershed. But the fissures are defined by a noise. I'll try to add noise params for the ores matching the noise params of the fissures (see here) @paramat The lag was a big problem before. We have reduced the chunksize to 48x48 nodes (#380) and now that's much better.

ghost commented 8 years ago

@Gael-de-Sailly avec l'original il n'y a pas de source dans les fissures, j'ai généré pendant plusieurs minutes pour voir, ce sont nos changements qui les ont ajoutés.

gaelysam commented 8 years ago

I've translated

@Gael-de-Sailly with the original mod there isn't any source in the fissures, I've generated during several minutes to see, that's our changes that added them.

I know, that's why I say that there isn't anything to change on watershed, that's on default. But that may be possible to avoid liquids in fissures by reproducing the noise params of the fissures in the noise_params of the ores.

gaelysam commented 8 years ago

252f09a Most of the changes were about the features we have removed. What I did is mainly the syntax improvements, and cleaning, removing some parts of code that I forgot (I've removed the code for clouds instead of just transforming clouds into air, this may speed up the mapgen a little bit)

EDIT: for liquids in fissures, see #490.

BetterToAutomateTheWorld commented 8 years ago

Thank you for your amazing work @Gael-de-Sailly :)

ghost commented 8 years ago

Je viens de générer avec les changements et il y a toujours des sources dans les fissures, on dirait même qu'il y en a +, et même + grosses, avant c'était une seule source par 2 ou 3 espacés, maintenant c'est 4 ou + au même endroit.

EDIT la lave est en plus grande quantité qu'avant. mapgen

gaelysam commented 8 years ago

I've not seen that. Have you the latest MFF version? (I've merged the changes this afternoon). I just generated a map and followed a fissure on 1100 nodes down, no source. Could someone else test it this evening? I won't be online for 15 days.

BetterToAutomateTheWorld commented 8 years ago

Up, is the issue always here or can we close this issue ?

BetterToAutomateTheWorld commented 8 years ago

Up, is the issue always here or can we close this issue ?

gaelysam commented 8 years ago

For me, all works, but I was waiting for @crabman77's answer.