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

Crash upon call to generateFractalValueNoise() #4142

Open
aco4 opened this issue Nov 22, 2024 · 3 comments
Open

Crash upon call to generateFractalValueNoise() #4142

aco4 opened this issue Nov 22, 2024 · 3 comments
Assignees
Labels

Comments

@aco4
Copy link
Contributor

aco4 commented Nov 22, 2024

I'm making a script generated map. I'm using the built-in noise generator (#2341). It crashes when certain values are passed to the function. For example, the following is fine:

heightmap = generateFractalValueNoise(
    /* map width                       */ 250,
    /* map length                      */ 250,
    /* range of first layer            */ 510,
    /* range decay (crispness)         */ 3,
    /* resolution of 1st layer (scale) */ 21, // 21
    /* normalize to range              */ 510
    /* rigged regions                  */);

But the following crashes the game with no error message:

heightmap = generateFractalValueNoise(
    /* map width                       */ 250,
    /* map length                      */ 250,
    /* range of first layer            */ 510,
    /* range decay (crispness)         */ 3,
    /* resolution of 1st layer (scale) */ 38, // 38
    /* normalize to range              */ 510
    /* rigged regions                  */);

The following also crashes:

heightmap = generateFractalValueNoise(
    /* map width                       */ 250,
    /* map length                      */ 250,
    /* range of first layer            */ 510,
    /* range decay (crispness)         */ 2, // 2
    /* resolution of 1st layer (scale) */ 21, // 21
    /* normalize to range              */ 510
    /* rigged regions                  */);
--- Starting log [[WIN_USER_FOLDER]\Warzone 2100 Portable-4.5.5\Warzone 2100\logs\WZlog-1122_005824.txt]---
info    |00:58:25: [wzChangeFullscreenDisplayMode:2266] Changing fullscreen mode to [0] 1366x768
info    |00:58:25: [createGLContext:185] Requested OpenGL 3.3 context
info    |00:58:25: [initGLContext:3716] OpenGL Vendor: Intel
info    |00:58:25: [initGLContext:3719] OpenGL Renderer: Intel(R) UHD Graphics
info    |00:58:25: [initGLContext:3722] OpenGL Version: 3.3.0 - Build 30.0.101.1692
info    |00:58:25: [initGLContext:3981] Success
info    |00:58:25: [_initialize:3508]   * Instanced rendering support was detected

To Reproduce

Download this script-generated map, which uses crispness=3 and scale=21. It works fine.

10c-Expanse2.zip

Download this script-generated map, which uses crispness=3 and scale=38. It crashes.

10c-Expanse2.zip

Download this script-generated map, which uses crispness=2 and scale=21. It crashes.

10c-Expanse2.zip

Expected behavior

Shouldn't crash

System

  • OS: Windows 11
  • Game version: 4.5.5
@aco4 aco4 added the Bug label Nov 22, 2024
@aco4
Copy link
Contributor Author

aco4 commented Nov 22, 2024

The noise generator seems to suffer from other issues, limiting its usability. The layers tend to shrink each loop for some reason.

@past-due
Copy link
Member

For reference, here is a map that uses it (and some of the original thinking behind it): https://forums.wz2100.net/viewtopic.php?f=49&t=16523

@past-due past-due self-assigned this Nov 22, 2024
@aco4
Copy link
Contributor Author

aco4 commented Nov 22, 2024

Yes I saw that one but it seems to use "safe" values (scale = 20). Anything other than 20 or 21 causes issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants