Random map generation

Pages: 12
I actually haven't thought of that, IdeasMan. That's a pretty good idea.

Though I already started work on my own idea for generating the map. I'm going to wait and see if it looks any good. If I'm not happy with it I'll look into the fractal idea.

Thanks!
Disch wrote:
I actually haven't thought of that, IdeasMan. That's a pretty good idea.

I guess that's why they call him The Ideas Man.
Thanks guys, occasionally I manage to come up with something that may actually have some value :+)

Hopefully: the simplicity, speed & recursive nature of basic fractals (as opposed to fractal imagery) has some suitable merit. I was thinking of starting with a square based pyramid, then altering each of the 4 edges in a somewhat randomised fractal fashion, while storing the details for each of the edges' children in a binary tree. With any luck, you will finish with 4 reasonably random mountain ranges. There is plenty of room to make it simulate some of the tenets of geomorphology, which might provide some sense of reality.

For me this week, it is back to the harsh reality of going to work. We are building a $34bn gas plant in Darwin, Australia. As interesting as the surveying work is, I wish I could spend more time in sorting out the details of buying a rural property in Tasmania. It just seems so much more interesting when doing planning permits and design etcetera , when it is for ones own building / property.

No time for C++ or Play Station, unfortunately !!

Regards
Progress of a sort.

I'm trying to form meshes that will make up the wall boundaries. Most of the code is actually already written, I just have to debug it (I wrote it all in one go without really testing individual components, which is not a great way to do things).

Funtime image:
http://imgur.com/SXU74wl

The area surrounded by white is the open space the player can maneuver.

Green dots and red lines are what will become individual meshes after they are triangulated. Not quite perfect, but it's getting pretty close.



EDIT:

A closeup of another one:

http://imgur.com/UMkdoE1
Last edited on
I don't understand what you're trying to make happen in those screenshots?
Since the world is randomly generated, and since I'm not using a tile based system, I need to create render-able polygons to form the wall graphics.

Each red/write boundary line will form one such polygon.

EDIT:

The Green points also have different Z levels so the walls don't appear so flat.
Last edited on
I'm still confused by your use of the word "wall". A wall I walk up to and touch? A wall I see from a top-down perspective? Some other kind of wall?
Last edited on
??? Not sure what's so confusing about it.

A wall is a boundary between where the player can and cannot move.

The graphics for "inside the wall" (ie: where the player cannot move) will be different from the graphics outside the wall.

In those screenshots, the red/white boundary lines form managable polygons. Those polygons will be given a wall texture and rendered so the user can see in-game which areas he can walk through and which he cannot.
Last edited on
I don't understand the perspective.
The easiest way to explain it is a Top-down view.. where the walls will be coming towards the camera like mountains.
Ok, that's what was confusing me, thanks.
it is awesome. i had this idea once, but it died since i wasn't capable of making it real. Seeing a fellow programmer successed made me happy.

When the game is released acknowdge us, i will go buy one.

By the way, you can take a look at don't starve. it has a map generator.
Good read, nice screenshots. When you say 2.5d I am thinking of how Zelda Link Between Worlds is rendered. I love randomly generated stuff for the same reasons that you said.

What particular method did you use for the initial screenshot (Edit: I mean http://imgur.com/xbK2VEk,s8gwkps,9NU2HEm#0 ) to just have a bunch of randomly-sized boxes crammed together? Maybe it's obvious but I can't think of a elegant way to do that.
Last edited on
Thanks Ceset. Glad I could make you happy. =)

Ganado wrote:
When you say 2.5d I am thinking of how Zelda Link Between Worlds is rendered.


Yeah that's another good example. That game is rendered in 3D, but plays more like a 2D top-down adventure game.

What particular method did you use for the initial screenshot to just have a bunch of randomly-sized boxes crammed together?


It's pretty easy. I just create a random sized box (within specified min/max dims). Then I sort of scan the map in "read like a book order" for the first place that it would fit. Once I find that spot, I put it there. If I don't find a spot, I consider the map "full" and I'm done.

You don't have to do this with a pixel-by-pixel check... that would be ridiculous. Instead... I do collision checks with each existing box, and push the box "right" for each box I collide with. Once I get pushed off the right side, I move back to the left side and push down to the highest point possible (IE, Y= whatever the highest bottom was of all the boxes I collided with).

Rinse, repeat until I get pushed off the bottom (won't fit, done), or don't collide with anything (place the box there).
Topic archived. No new replies allowed.
Pages: 12