Results 1 to 10 of 20

Thread: Procedural world generation - ground and traps seems to not generating.

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #3
    First thing i would do is clarify the program with small change, maybe causing it to speed up in the process. Dynamic array might be reference-based by default, but i don't think it becomes very clear with this:
    Code:
    function TWorldGenerator._genStepGround(Chunk: TChunk): TChunk;
    function TWorldGenerator._genStepTraps(Chunk: TChunk): TChunk;
    You are passing a big array as parameter, and returning one aswell. You could simply refer to it, apply changes to it directly (because that's what already happens, right?), so:
    Code:
    procedure TWorldGenerator._genStepGround(var Chunk: TChunk);
    procedure TWorldGenerator._genStepTraps(var Chunk: TChunk);
    These would change too:
    Code:
    _genStepTerrain(Chunk);
    _genStepCarve(Chunk);
    _genStepGround(Chunk);
    _genStepBlocks(Chunk);
    _genStepTraps(Chunk);
    I'm still pretty "new" to perlin noise, but aren't you supposed to combine many random waves. First ones smooth big ones, then smaller and sharper. From line 99+, you are using same frequency for all of them. Do i just misunderstand the code?
    Could be the PerlinNoise2d() already does the multi-wave math for you.
    Last edited by User137; 01-06-2013 at 01:53 PM.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •