Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Randomwalk cave liquids: Remove deprecated 'lava depth' parameter #9105

Merged
merged 1 commit into from
Nov 18, 2019
Merged

Randomwalk cave liquids: Remove deprecated 'lava depth' parameter #9105

merged 1 commit into from
Nov 18, 2019

Conversation

paramat
Copy link
Contributor

@paramat paramat commented Nov 10, 2019

Randomwalk cave liquids: Remove deprecated 'lava depth' parameters

Low-disruption first step towards removing the hardcoded cave liquid
code. Since MT 5.0.0 cave liquids can be defined and located by
biome definitions instead.
In games that do not yet use biome definitions to define and locate
cave liquids (MTGame does), lava will now appear below
y = water_level - 256 instead of below 'lava depth' (usually y = -256).
Therefore no change in most mapgens if using the default 'lava depth'.
////////////////////////////////////////////////////

From MT 5.0.0 it has been possible to define and locate cave liquids using biome definitions, and this is the intended method for the future. The hardcoded cave liquid code will eventually be removed.

The 'lava depth' parameter has been deprecated since MT 5.0.0, this PR removes it as a first low-disruption step towards the removal of the hardcoded cave liquid code. This will also encourage users to use biome definitions to locate lava.

If cave liquids are not defined and located using biome definitions (games other than MTGame):

  • In MT master, lava appears only below 'lava depth', which by default is y = -256 for most mapgens, y = 1 in mgvalleys.
  • With this PR, lava appears only below y = water_level - 256, so no change for most mapgens using the default 'lava depth'.

Note that MTGame already uses biome definitions to define and locate cave liquids, so there will be no changes for anyone using MTGame.

If merged, i will make a detailed post in the news subforum to warn of the change in case anyone will be significantly affected.
If anyone has to alter code, this will just be bringing forward the inevitable, as everyone will have to define and locate cave liquids in biome definitions when the horrible hardcoded cave liquid code is completely removed in future.

@paramat paramat added @ Mapgen Maintenance Tasks to keep the codebase and related parts in order, including architectural improvements WIP labels Nov 10, 2019
@paramat paramat changed the title Randomwalk cave liquids: Remove 'lava depth' parameter Randomwalk cave liquids: Remove deprecated 'lava depth' parameters Nov 14, 2019
@paramat paramat removed the WIP label Nov 14, 2019
@paramat
Copy link
Contributor Author

paramat commented Nov 14, 2019

Now complete, tested and ready.
PR may look big but changes are simple and duplicated across 6 mapgens.

@paramat
Copy link
Contributor Author

paramat commented Nov 15, 2019

The 'lava depth' parameter was added in June 2017 in 2652d8d
I see in that commit that lava depth used to be hardcoded to y = -256, so alternatively i could change the new upper limit for lava to 'water level - 256'. This would mean no change for most users and would be consistent with classic behaviour.
EDIT: Will do this.
EDIT: Done.

@paramat paramat added the WIP label Nov 15, 2019
Low-disruption first step towards removing the hardcoded cave liquid
code. Since MT 5.0.0 cave liquids can be defined and located by
biome definitions instead.
In games that do not yet use biome definitions to define and locate
cave liquids (MTGame does), lava will now appear below
y = water_level - 256 instead of below 'lava depth' (usually y = -256).
Therefore no change in most mapgens if using the default 'lava depth'.
@paramat paramat added Trivial The change is a trivial bug fix, documentation or maintenance change, as per the Git Guidelines and removed WIP labels Nov 15, 2019
@paramat paramat changed the title Randomwalk cave liquids: Remove deprecated 'lava depth' parameters Randomwalk cave liquids: Remove deprecated 'lava depth' parameter Nov 18, 2019
@paramat
Copy link
Contributor Author

paramat commented Nov 18, 2019

This parameter is very young, it was added after release of 0.4.16, not present in 0.4.17, released into stable in 5.0.0, so has only been present in 1 stable release, it will not be in much use. This even further reduces the chance of disruption.

@paramat paramat merged commit 9776460 into minetest:master Nov 18, 2019
@paramat
Copy link
Contributor Author

paramat commented Nov 19, 2019

Huh ... just realised something ... the 'lava depth' parameter was released into MT 5.0.0, but in MT 5.0.0 the harcoded cave liquid code was already deprecated. So the 'lava depth' parameter should never have been released into MT 5.0.0., it should have been removed before release.
My mistake, sorry for that. Even more good reason to remove this parameter as soon as possible.

@paramat paramat deleted the remlavadepth branch November 19, 2019 20:34
aldum pushed a commit to banyamesterseg/minetest that referenced this pull request Apr 16, 2020
…netest#9105)

Low-disruption first step towards removing the hardcoded cave liquid
code. Since MT 5.0.0 cave liquids can be defined and located by
biome definitions instead.
In games that do not yet use biome definitions to define and locate
cave liquids (MTGame does), lava will now appear below
y = water_level - 256 instead of below 'lava depth' (usually y = -256).
Therefore no change in most mapgens if using the default 'lava depth'.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Maintenance Tasks to keep the codebase and related parts in order, including architectural improvements @ Mapgen Trivial The change is a trivial bug fix, documentation or maintenance change, as per the Git Guidelines
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant