The importance of random maps

Started by
15 comments, last by Fonz 21 years, 5 months ago
A neat trick for a random map generator would be to have something like resource symmetry, so if a gold mine is on one end of the map, it''ll show up at the other end too.

Or, another really cool (but entirely useless) online trick would be to have a democratic map generator, where the map is generated and people vote on it (or suggest changes and vote on those).

Resist everyone
Advertisement
An interesting idea is using fractal clouds to generate maps.

You can probably find some examples of fractal clouds in the eye-candy section

A fractal cloud basically generates a semi-realistic heightfield which is excellent for overworld-type maps: mountains, water, plains, etc.. The only problem is that maps are plain, ie, there are no rivers, no forests, no towns, etc.. Those can be added at random though (ie, choose x points on the map, make sure they are at least y units apart, and place towns there; select points and randomly scatter trees around those points for forests, etc..)

How'd those damn BBCodes work... I think this was the proper way to display a picture...

[img]http://www.geocities.com/NekoLancer/Landscape.txt[/img]

Edit: Oooooook, so that DIDN't work. ^^;

[edited by - RuneLancer on November 4, 2002 2:27:52 PM]
RuneLancer, try HTML instead.

I''m moving this to Game Design as it''s not really about programming as such.

[ MSVC Fixes | STL | SDL | Game AI | Sockets | C++ Faq Lite | Boost | Asking Questions | Organising code files | My stuff ]
Maps should never be completely random. For your RTS, the bases should be non-random - their positions and layout (resources on the base itself, such as WC3''s starting mine and nearby trees) should be a constant part of the level, created in the level editor. Then the rest of the map can be random. Otherwise, as you said, you get into the problem of some players starting off with an unfair disadvantage.

~CGameProgrammer( );
~CGameProgrammer( );Developer Image Exchange -- New Features: Upload screenshots of your games (size is unlimited) and upload the game itself (up to 10MB). Free. No registration needed.
quote:Original post by Kylotan
RuneLancer, try HTML instead.

I''m moving this to Game Design as it''s not really about programming as such.


Well darn, I missed this thread being moved. Thanks for the HTML tip, I''ll try that.



Hopefully this works. If the algorithm to this interest you I can probably put up a link to the program I coded to do the effect. With a bit of tweaking, I''m sure it would be easy to make it tile-based or whichever format you want for your game.
That looks really neat, RuneLancer. How did the algorithm go? (in general terms - I don''t really want to look at the full source for the thing )

If I had my way, I''d have all of you shot!

codeka.com - Just click it.
Well, to be honest, I just copied the algorithm from some QBasic program that did relatively the same thing, converted it to C++, and did some optimization here and there to take advantage of some things QB doesn't have that C++ does. But it's a universal algorithm used in many programs like this one.

Start by drawing a pixel in all four corners at random.
Draw the central pixel a color that is the average of the 4 corner pixels and perturbate that a little (by, say, ±2%).
This leaves you with 4 "boxes" of pixels. Move to the center of the first one and calculate the pixel's color the same way you did for the previous one, using the 4 corners of the new "box".
Repeat until the resulting box's corners are less than a pixel apart.
Move to the next box.

It's a bit hard to explain and uses a LOT of recursivity. Here's an example of how it'd be drawn...

_______ _______ _______ _______ _______ _______ _______|.   .| |.   .| |. . .| |. . .| |... .| |... .| |... .||     | |     | |     | | .   | |..   | |...  | |.... ||     | |  .  | |. .  | |. .  | |. .  | |...  | |...  ||     | |     | |     | |     | |     | |     | |     ||.   .| |.   .| |.   .| |.   .| |.   .| |.   .| |.   .|¯¯¯¯¯¯¯ ¯¯¯¯¯¯¯ ¯¯¯¯¯¯¯ ¯¯¯¯¯¯¯ ¯¯¯¯¯¯¯ ¯¯¯¯¯¯¯ ¯¯¯¯¯¯¯ 
So forth... When I get back from college later today I'll post some pseudocode to do it. It might be more understandable...

[edited by - RuneLancer on November 8, 2002 12:13:30 PM]

This topic is closed to new replies.

Advertisement