Island Generation

0 favourites
From the Asset Store
Elevate your game with the Floating Islands Platform Pack.
  • I posted some of this over in the "How Do I..." section, but I thought I'd keep some updates here too for anyone interested

    .

    I've been working for the last couple of days on a random island generator that I want to maybe use for a project in the future. I used the Zelda 2 overworld sprites and tiles modified them to work with a BitWise algorithm (thanks to R0J0hound), and I'm more or less using the method described here for my island generation: http://dxprog.com/files/randmaps.html (also similar to what Ethan described in a post somewhere, probably this one turn-based-strategy-like-advance-wars-devlog_t87666?&start=10&hilit=random+island).

    Here's the first build I did, using zelda 2 graphics. I really wanted to achieve a sandy border around my islands, maybe I can still figure out a way to achieve that at some point... even if it's just creating an algorithm that raises everything on a land mass except for what's on the edge:

    I just changed some graphics. Still wanting to figure out how to get some more natural landscapes, but for now I think I can still build on this engine. Any help would be great! I noticed that when I was trying to average out each cell based on the surrounding cells, if I didn't use int() I was getting some insane values.

    I abandoned the sandy edges to my islands (for now) until I can figure out how to fix my algorithm. In terms of graphics, I put in an optional animated tiles option for things like water and coasts.

    Here's the latest build:

    http://threesevenhosting.com/builds/rover/6-14-2016

    arrow keys, press space to regenerate the island, you can zoom in and out with the mouse wheel, and you can raise and lower terrain using the left and right mouse clicks.

    June 9th Update

    July 1st Update

    Fleshed out the side scrolling a bit, and ran a pass through the array to fill in some of those bitwise gaps. Included some particles and the ocean as well. Really enjoying working on this! the grass is generated at random based on some variables I plug in, as well as the particles.

    July 17

    Creeping on some bull elk

    working on a day/night system (pretty much completed, just needs some better visuals), ducking, crawling, and running for the player, etc. next I'm hoping to get some basic AI for NPCs going.

    july stuff

    the hunt is on. sort of.

    August something

    Slowly but surely plugging away. This has been a really neat project to work on, and I've learned a ton. In this example, I randomly generated a mountain, in part using the bitwise method and TMX files, as well as using the spelunky style of level generation. You only see the peak of the mountain here and some hastily drawn mountain peaks in the background, but the whole mountain is huge!

    Next I'll be adding in more variation in the different parts of the mountain, as well as some enemy interactions. I'm planning on adding in some caves, too. We'll see how long that takes... this literally took like 3 weeks to figure out!

  • This is looking pretty cool already. I've done a bit of work in the past (mostly with construct classic) doing some procedural generation with cellular automata. Maybe to get your sandy shores working you could use some of the methods found in cellular automata to pick where the shore is. From memory I think I did a simple tile type comparion (overlap at offset) to figure out where edges were.

    Let me know if you need any examples... I'm sure I still have my old files around in my dropbox somewhere.

    ~Sol

  • You've done a really good job with this so far! I've noticed a few issues with the way the tiles display (some shore tiles are get reversed), but it looks really promising.

    It's also refreshing to see random generation used for something besides caves.

  • You could do a sandy shore with another pass of your array.

    If 0 is water and 1 is sand in your array you can make the shore with:

    +----------------------------------------------+
    | array: for each xy                           |
    | array: value at (self.curx, self.cury)<>0    |
    +----------------------------------------------+
      +--------------------------------------------+
      | array: value at (self.curx-1, self.cury)=0 |array: set value at (self.curx, self.cury) to 1
      | or                                         |
      | array: value at (self.curx+1, self.cury)=0 |
      | or                                         |
      | array: value at (self.curx, self.cury-1)=0 |
      | or                                         |
      | array: value at (self.curx, self.cury+1)=0 |
      +--------------------------------------------+[/code:1t6b4dac]
  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • SoldjahBoy - thanks man! That makes a lot of sense actually, but I'm using the tilemap instead of sprites for my tiles. But that gives me a good idea of how to parse the array. I'm thinking I might select every cell that's not a 0 (ocean), and if those cells aren't near a 0 (like an overlap) at either of the 4 sides, leave it be - otherwise raise the cell by 1. I think that should give me a beach effect... do you think that would work? what kind of method did you use originally? like I mentioned, my algorithm is kind of wack right now. it almost seems like it shouldn't work <img src="{SMILIES_PATH}/icon_e_biggrin.gif" alt=":D" title="Very Happy">

    ryanrybot - haha oh, there will be caves... but it might be more like the spelunky style of generation (http://tinysubversions.com/spelunkyGen2/ which I did a long time ago with Galaxias, but it wasn't very efficient because I didn't know what I was doing). I feel like that gives me maybe some more control over some different elements. I did notice some of those things you mentioned, I think that's because my bitwise is checking for just specific numbers on the array that coresponds to the tilemap. like the normal grass is only looking for tall grass and water, and if some forest happens to be up against the tall grass, it ignores it (if that makes sense). in R0J0hounds example he just searched to see if the neighboring tile wasn't empty. I might have to figure that out a bit more. right now it seems to only be happening with the coastlines for the most part.

    Here's an update with some character art, pretty basic right now for the overworld, using spriter.

  • R0J0hound - ah that's kind of what I was thinking. Thanks so much, a few things you've posted in other threads have really helped me thus far!

  • mudmask

    I used the exact method that R0J0hound posted up... check for overlap at offset on 4 vectors to determine which sides had water on them, or in my case I was checking for open "air" since my generator was a side view platform thing - but it's the same idea and method

    ~Sol

  • SoldjahBoy - actually I did that and got it working! But I started to think that I liked the look of things the way they were, so I reverted back... haha

    are you some kind of array master? mind if I ping you from time to time with more questions?

    here's a quick update:

  • I'm a mastermind of confusing myself at times... that's about it.

    I've just done a fair bit of work with this kind of stuff, since it's really interesting to me - so hit me up whenever and I'll see what I can do. I may also contact you as well, since I'm just about to start working on a map generation thing myself and could probably use a refresher on how some of this stuff works.

    Cheers!

    ~Sol

  • That looks epic! I'm looking forward to how will you progress with it, really inspiring thing there sir

  • Yeah i just noticed the clouds in that last screen-cap animation... looking really suave now

    ~Sol

  • SoldjahBoy - haha man message me any time, maybe two confused guys is better than one I'm pretty pumped on the clouds, too... it's funny how something simple like that, a small amount of detail, can really add a whole lot to a project.

    Games thanks man! it's going to take some interesting turns here in a bit... really trying to see how far I can push exploration in a simpler kind of presentation.

  • Very NICE, keep going !

  • katzin - thank you!

    So speaking of Zelda 2, I've always really thought that the Zelda 2 style of gameplay was really unique. I know it for sure is one of the least popular games in the series, but it's still a classic and it definitely influenced the series in some good ways. A lot of people have expanded a bit on that style of gameplay too (like Finding Teddy 2 / Chronicles of Teddy, for example). With this project I want to experiment a bit with some aspects of that game, building a bit on some other stuff I'm working on as well.

    Here's an animation sample from what would be the side scrolling aspect of this game, featuring some randomly generated areas as well:

    Really enjoying experimenting with Spriter lately too. I've found that you can achieve some great retro style animation sequences using instant frame tweening, and by planing your body parts out better. Once again, props to those guys.

  • Using some bitwise + terrain generation combo:

    Thinking about those empty corners, though..

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)