World gen complex problem with noise generation

Discussion in 'Plugin Development' started by snap64, Sep 20, 2012.

Thread Status:
Not open for further replies.
  1. Offline

    snap64

    I have a plugin that uses a 2d noise generator to generate floating islands by basically taking the tops of the 'hills' and using that for the island. This seems to be fairly efficient and can produce a nice, natural-looking result. The problem is that I don't know how to make it distinguish between the individual islands. So, I can't make different types, such as each one having a different sort of biome or style/features.

    I was thinking that maybe if I could find the nearest high point of the noise gen then I could use that point to determine the attributes, but I'm not sure if that's possible. I'm using a SimplexOctaveGenerator for the base by the way. Or perhaps if there's a way to take a generator and make an outline between the points and each section is given a different value, but I think the nearest high point thing would be easier.

    A previous method I had tried was to loop through each column of blocks and checking for connected ones, but when it was a working method it was very slow, and when I improved the performance it became half-glitchy, so that didn't seem like a plausible solution.

    Any help would be greatly appreciated, thanks! :)
     
  2. Offline

    jtjj222

    I can think of two possible solutions for this.
    1) You can use a separate noise generator (voronoi cell noise would work best) to determine the "types," then generate the islands like you normally would, and have the value the other noise generator outputs determine the block types and whatnot, although there will be some islands that have more than one type.

    2) You can use the noise generator that you are getting the 'tops' from to determine the types. It will output a double, so even if the 'tops' are the same height, the decimal portion will be different, that way all the islands aren't the same type even though they are about the same height.

    If I think of anything else, I'll let you know.
     
  3. Offline

    snap64

    I had thought about the first one, and it would work, but I would rather have each one separate and not multiple types. As for the second one, that wouldn't exactly work, because I'm making it like each one with a value above 0.5 is part of an island, and each block would have a different decimal. If I could find the nearest high point of the generator then it would be easy to just use the position of that to determine the type of island. I was thinking maybe I could make my own noise gen class with an extra method to find the nearest high point. I'm sure this could be possible, but I have no idea how to make a noise gen, or how I would make the method.

    Thanks, if you know how I could do this, that would be awesome :)
     
  4. Offline

    jtjj222

    I see what you mean, I thought you were using one generator to find the locations of the islands, and another to build them. What about if you had a separate noise generator for the types, then after you find one of the tops, use the other noise generator to determine the type of the entire island? Would that work?
     
  5. Offline

    snap64

    hmm, well it certainly would be much easier for this part to use one to determine whether an island should be created there, and another to determine the entire shape and everything, but I'm not sure how I could do this without loosing the natural-looking, awesome shape of them. I was reading up on noise generation, and I think it would be the least buggy/work-aroundish to make my own noise generator, as shown here, but this seems very complicated.

    If I did make my own noise gen, making the graph droop to the ground between each point would yield the best results in terms of the separate biomes, but that would negate the possibility of the cool shapes that I get with the current version, as you can see here.

    Now that I think about it, with that model of a noise gen there would be many high points generated by the random number generator that would account for the creation of one island, so finding the high point isn't plausible. Perhaps I should just go back to my original design.

    Would it be possible to generate an outline of the noise map around a certain height, and give each section in that a definite value?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 28, 2016
  6. Offline

    jtjj222

    http://en.wikipedia.org/wiki/Worley_noise
    Is that what you mean?
    Also, I was suggesting that you just add an extra noise generator to your original design, that determines the block types inside an island after a high point was found. If you give me the source code for your had originally, I can show you what I mean.
     
Thread Status:
Not open for further replies.

Share This Page