Results 1 to 10 of 23

Thread: mvNoise, Perlin noise - problem

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Quote Originally Posted by Darkhog View Post
    Not infinite, in chunks. The trick is to have x/y offset variables and to waste first x/y random numbers and create actual bitmap.

    I.e. if you want to generate chunk you set x offset (for simplifying, let's assume that chunks are going in straight line) to chunksize*number of chunks already generated. Then, based of value of xoffset you "waste" first several columns. In pseudocode (for simplicity chunks are white noise):
    I certainly wouldn't use your approach. Why? As you say "wasting" random numbers would be wasting CPU time. Are you aware that random number generation is one of the bottlenecks of the Perlin Noise algorithm? And other is mothening the textures.

    If you don't belive me just go and create several thousands of random numbers and see how much time would your computer need to do that. And if you think that 100x100 ofset would mean you would be wasting 10000 random generated numbers. NOT a good idea.

    For solving this problem it would be wiser to use one of custom Random Number generation algorithms which alow takind additional imputs which are then used during random number generation. Problem with most of such algorithm is that when theese inputs numbers becomes large the random number generation becomes more eratic.



    Quote Originally Posted by Darkhog View Post
    And yes, if you can I'd appreciate if you could make it work. All I need is simple Perlin noise.
    OK then I'll get to work as soon as I find some time. Anwhay I still have a gime in mind which will use this.


    Quote Originally Posted by Darkhog View Post
    Simple
    Code:
     if value>255 then value:=255;
    at the end of combining code, but before putting it into byte array should help with that.
    And the result would be flatheaded mountains. So unrealistic.
    At the time I was thinking of finding highest point and then normilize whole texture so that this highest point doesn't exceed the limit.
    Oh now I remembered that I was also planning to do a complete rewite of my algorithm.
    Storing values in 2D array would be a problem for my postprocessing functions as I will require data to be soreted by height for instance. This means storing them in a list as nodes (Height, X and Y position). This will result in need for more memory.
    Gues I should start searching for suitable Random number generator algorithm which supports accepting aditional parameters (X,Y position). This way I would be able to generate my map in chunks.

    But first let my try to get that glscene algorithm working so that you will at lest have some basic random map generation available to work further on your game.

  2. #2
    And the result would be flatheaded mountains. So unrealistic.
    Then apply some Gaussian blur to this.

    Anyway, do however you want, but I'd like to be able to generate chunks of texture (it certainly is possible as Minecraft, Minetest-c55 and other mineclones features semi-infinite world and without making it with chunks it wouldn't work).

    And don't bother with glscene thing. I can wait for proper solution (have other things to do in meantime anyway, like writing state machine and collision system).

  3. #3
    I'm checking GLscene becouse I belive it has implementation of Perlin Noise which can use offset imputs. That is what you need.

  4. #4
    PGDCE Developer Carver413's Avatar
    Join Date
    Jun 2010
    Location
    Spokane,WA,Usa
    Posts
    206
    Paul gave me a perlin noise unit. you can find it in this thread
    http://www.pascalgamedevelopment.com...arver-Explorer
    works great

  5. #5
    I happened to come across simplex-noise, and still unsure how fitting it is for gaming. It claims to be kind of simplified and optimized replacer for Perlin noise. Actually Simplex is made by Perlin himself in 2001.
    http://en.wikipedia.org/wiki/Simplex_noise
    Some Java source
    http://staffwww.itn.liu.se/~stegu/si...plexNoise.java

    Also, now that i think about it, i think this is 4D, where time is 4th dimension:
    http://mrl.nyu.edu/~perlin/homepage2...ise/index.html
    Last edited by User137; 29-06-2013 at 03:56 PM.

  6. #6
    PGDCE Developer Carver413's Avatar
    Join Date
    Jun 2010
    Location
    Spokane,WA,Usa
    Posts
    206
    I would be very interested in a pascal version of simplex as it supports up to 6D and it is needed in order to create seemless textures but I dont know much about java.
    http://www.gamedev.net/blog/33/entry...eamless-noise/
    Last edited by Carver413; 29-06-2013 at 04:22 PM.

  7. #7
    I've translated some 3d simplex noise implementation to pascal : http://laggyluk.com/?p=86

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
  •