Better Random World Gen?

0 favourites
  • 9 posts
From the Asset Store
Random Maze Generator with Door & Key System - tutorial capx
  • Hi Guys! For the last couple of days, I've been working on creating a better random generation system for my survival game "Bevar in the Wild". I've been trying to make the game generate some islands with trees and grass and stuff on them, and then add collisions to make sure the player doesn't walk into the ocean.

    However, I did make a system (using tiled backgrounds) that did that, but the islands were square shaped, and overlapping islands looks odd, and it just looked dumb, and I couldn't add collisions to the ocean! So, next I tried tile gen. Well it worked sort of well, and it caused a LOT of lag (64x64 tiles and a 12480x12480 layout @, over 30,000 tiles!) I tried to use R0J0hounds scrolling tile thing, but it kind of jacked it up >__< it didnt really work. Plus I wanted a finite map, not an infinite. So my question is, anyone know a better way to randomly generate a world with islands?

  • That sounds interesting, I've been thinking about designing something like this myself, but if R0j0 has already done one it will probably be awesome. Do you have a link to it? I'll have a look into it as well.

  • EyeHawk Here is the link to R0J0's tile thingymalingy CAPX:

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I tried something like this not a while ago

    I can't share it because my implementation isn't finished yet

    But the diamond-square generation algorithm seems like a plausible solution !

  • Cool thanks for the link. Wow and the capx is only a few lines for doing something so complicated! Rojo made another capx a while back which may help which was like the legend of zelda type games - would that help?

    I was going to think about a continuously scrolling type game, rather than a "flick to the next" screen sort of game. I have an idea on how to do it, but was hoping someone would have made it already <img src="smileys/smiley1.gif" border="0" align="middle" />

    To answer your other question about making it a finite island, you could always just keep track of your distance from your origin, so that when you get to the maximum distance, the screen will no longer scroll and no more map would be generated.

  • EyeHawk I guess that makes sense, but the thing is, how would I get it to generate islands properly, and spawn the trees and junk? Squiddster's seems to generate some good island type things, but I cant get it to work with R0J0hound's scrolling.

  • Off the top of my head, you for all of the new parts of the map that get generated (assuming each one is a big sprite), you could create image points on it.

    Then use the OnCreate condition to then populate those areas with trees and stuff.

    You wouldn't have to create an image point per tree, you could just do a for loop and randomly dot them around each image point.

  • EyeHawk Woah! That's a great idea!Though, I need to homehow create tiles in the Player window ONLY, so it doesnt generate a lot of lag, and I can do the scrolling thingy

  • There's 2 things you can do:

    1. Move the world and not the player (this is what I do in my latest win8 comp submission

    2. Create the layout so it's about double the window size - whenever your player gets to a certain distance on the current 'tile', a new one is created on the edge prepopulated with the trees and other assets

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