NoCarrier
NoCarrier

Reputation: 2588

Best Way to Build a Game Map

I'm in the process of writing a small overhead view RPG much in the vein of the classic Ultima series. I need a quick and dirty (more quick than dirty) way of designing large maps - say 1000 tiles x 1000 tiles, and i need some help thinking through how to go about doing this.

I would say there are a good 50-60 different types of tiles - woods, rivers, plains, etc.

So far, the best I could come up with was

So far, i'm thinking there must be an easier way.

Upvotes: 10

Views: 7312

Answers (5)

chaos
chaos

Reputation: 124297

I'd recommend having your position information be the indexing information for your storage data structure, rather than something you're looking up in it. I.E.

int get_terrain_type(int x, int y) {
    return terrain[x][y];
}

(Not entirely sure that isn't what you meant, but I thought I'd put it out there.)

Upvotes: 2

PATRY Guillaume
PATRY Guillaume

Reputation: 4337

Another option would be to generate the (pixel) map or directly the game map. This of course depend on the size of your worl, and if you have a lot of specific resources (a city at this point, a mine at this point...)

There were a lot of article on this subject at site about the game "rogue", that could be quite usable. (try RogueBassin for example)

They also speak about the data structure to allow for more variation (such as having a base image, and randomly add a number of (small) "fringe" images when you define the representaion in your map array. For exemple to add some small rock to the grass ). Others effect as seem in ultima V, where some roof element became transparant when you pass unde them are also based in these structure.

We found that having an image (in our case, a set of image) is easy, since you can make upgrade the look (no more rectangular forest!) when you have the time, and concentrate on the specific quest location.

regards

Guillaume

Upvotes: 1

jw.
jw.

Reputation: 328

Try sourceforge: http://sourceforge.net/search/?type_of_search=soft&words=tile+editor

Several of those editors will save out to some standard format, which you can then pull into your game as you like.

TileStudio will even output header/source files that can be compiled directly into your engine (not sure what your needs are)

Upvotes: 3

ninesided
ninesided

Reputation: 23263

Does it need to be tile based? Take a look at Daniel Cook's site, Lost Garden, not only does he give you some tasty free artwork, but he discusses the advent of arbitrary placement of images in games, rather the tiles:

"Once upon a time, you needed to use little square tiles for everything. Nowadays, there is no real need to make a tile based 2D engine. With arbitrary images with full alpha and lots of fill rate, you can put together a game like a sticker book. Drop down your graphics at arbitrary positions and layer like a madman. Games like Aquaria look great and tiles are nowhere to be seen."

there's also a link in there for step-by-step instructions on making an in-game editor based on IndieLib.

Upvotes: 11

T.E.D.
T.E.D.

Reputation: 44804

Sounds like a pretty good way to me. However, you might find creating a custom map builder to be just about as easy.

Another option might be to write a program that would allow you to just define the location of major features, and a generator program will fill in the rest. (Eg: River running from x1,y1 to x2,y2. "large" forrest centered at x,y, etc). That might let you define a large map just from a smaller file of geographic features. Think of it as sort of like doing vector drawing instead of specifying every last pixel in a raster. :-)

Upvotes: 2

Related Questions