Island Generation

Show us your works in progress and request feedback

Post » Tue Jun 14, 2016 8:28 pm

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:
Image

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:
Image
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
Image

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.

Image

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.

Image

july stuff

Image
the hunt is on. sort of.

August something

Image

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!
Last edited by mudmask on Tue Aug 09, 2016 2:24 am, edited 5 times in total.
B
74
S
19
G
9
Posts: 377
Reputation: 9,258

Post » Wed Jun 15, 2016 7:08 am

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
Tired of crappy file hosts that are crappy? Get DROPBOX - https://db.tt/uwjysXJF
Moderator
B
84
S
34
G
40
Posts: 3,032
Reputation: 30,499

Post » Wed Jun 15, 2016 2:27 pm

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. :P
Be sure to check out my Metroidvania game, A Hole in the Earth
B
59
S
24
G
3
Posts: 359
Reputation: 5,683

Post » Wed Jun 15, 2016 5:49 pm

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:
Code: Select all
+----------------------------------------------+
| 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 |
  +--------------------------------------------+
B
94
S
33
G
113
Posts: 5,356
Reputation: 73,273

Post » Wed Jun 15, 2016 5:55 pm

@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 :D

@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.

Image
B
74
S
19
G
9
Posts: 377
Reputation: 9,258

Post » Wed Jun 15, 2016 5:56 pm

@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!
B
74
S
19
G
9
Posts: 377
Reputation: 9,258

Post » Thu Jun 16, 2016 2:28 am

@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
Tired of crappy file hosts that are crappy? Get DROPBOX - https://db.tt/uwjysXJF
Moderator
B
84
S
34
G
40
Posts: 3,032
Reputation: 30,499

Post » Sun Jun 19, 2016 2:44 am

@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:
Image
B
74
S
19
G
9
Posts: 377
Reputation: 9,258

Post » Sun Jun 19, 2016 5:26 am

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
Tired of crappy file hosts that are crappy? Get DROPBOX - https://db.tt/uwjysXJF
Moderator
B
84
S
34
G
40
Posts: 3,032
Reputation: 30,499

Post » Sun Jun 19, 2016 1:19 pm

That looks epic! I'm looking forward to how will you progress with it, really inspiring thing there sir :)
B
29
S
16
G
2
Posts: 109
Reputation: 3,380

Next

Return to Works in Progress/Feedback Requests

Who is online

Users browsing this forum: No registered users and 4 guests