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

Floatlands terrain discontinuous over chunk boundaries, due to noise index in xzy loop. #989

Closed
paramat opened this issue Nov 8, 2013 · 4 comments
Labels
Bug Issues that were confirmed to be a bug

Comments

@paramat
Copy link
Contributor

paramat commented Nov 8, 2013

flodisc

screenshot_917270609

New comments on original pull here #555
The floatland mapgen code is here https://github.com/minetest/minetest/blob/master/src/mapgen_indev.cpp#L347
More details in IRC logs http://irc.minetest.ru/minetest/2013-11-08#i_3421936 05:19 to 05:40.
From that, suggested solution by hmmmm:
05:38 hmmmm so what I'd suggest is changing the loop order to z, y, x, keeping the increment on the 3d noise index
05:39 hmmmm then for the 2d noise, calculating it by z * scanline_size + x
05:40 hmmmm zstride = node_max.X - node_min.X + 1;
05:40 so int index2d = z * zstride + x

@paramat
Copy link
Contributor Author

paramat commented Nov 8, 2013

In the current code and in my flolands mod version 0.2.1, the [x[z[y]]] loop works column by column, so 'float noise3' and 'float pmidy' only need be to calculated once per column.
In the suggested solution above, the [z[y[x]]] loop means that 'float noise3' and 'float pmidy' need to be calculated once per node, so they need to be moved inside the inner x loop.

@paramat
Copy link
Contributor Author

paramat commented Nov 9, 2013

Here's my attempt at the fixed mapgen code https://forum.minetest.net/viewtopic.php?pid=117500#p117500

@paramat
Copy link
Contributor Author

paramat commented Nov 9, 2013

That code was tested by us^0gb and seems to work, see IRC logs from 06:14 here http://irc.minetest.ru/minetest/2013-11-09#i_3423875

0gb-us added a commit to 0gb-us/minetest that referenced this issue Nov 10, 2013
A mapgen fix authored by paramat, as mentioned here: minetest#989
@proller
Copy link
Contributor

proller commented Nov 10, 2013

0gb-us: please fix spaces->tabs in patch

proller pushed a commit that referenced this issue Nov 10, 2013
A mapgen fix authored by paramat, as mentioned here: #989
proller pushed a commit to proller/minetest that referenced this issue Nov 10, 2013
A mapgen fix authored by paramat, as mentioned here: minetest#989
proller pushed a commit to proller/minetest that referenced this issue Nov 10, 2013
A mapgen fix authored by paramat, as mentioned here: minetest#989
@paramat paramat closed this as completed Nov 18, 2013
proller pushed a commit to proller/minetest that referenced this issue Nov 23, 2013
A mapgen fix authored by paramat, as mentioned here: minetest#989
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Issues that were confirmed to be a bug
Projects
None yet
Development

No branches or pull requests

2 participants