views:

1119

answers:

5

I'm looking for articles on tile based games, like the old ultima 6&7, or even puzzle pirates. Specifically:

  1. How they keep track of objects on the map. Objects such as other characters, or trees, or things the character can move.
  2. AI behind the characters. How the game handles character behavior for characters on the map that are off screen. Especially with very large maps and numerous characters.
A: 

The map would be an array of values. It could be divided into discreet parts. Only parts in range of the player would be loaded and the objects & npc in these parts active.

Since the old hardware had very limited memory and cpu, those games would only be able to load and process parts of the maps.

HyperCas
+2  A: 

You could look through back issues of Game Developer magazine to see if something addresses what you're asking in detail.

For (1) the easiest way of dealing with a tile-based map where each tile can contain multiple objects is to just have a big multidimensional array of structs representing each tile. The struct contains a pointer to the head of a linked list representing all the objects in that tile. This is very memory efficient and lets you quickly find everything in a certain tile while also enumerating them along some other axis (eg, owner, allocation arena, etc).

Crashworks
+10  A: 

I remember checking out Amit's Game Development page back when I wrote some games. He has a great sub-section on tiles that has most of what you want.

Gilad Naor
This is an excellent pointer, thanks.
zoul
+1  A: 

Check out Gamasutra. They have loads of articles for all kinds of game development.

idstam
+1  A: 

RogueBasin is devoted to Rogue-like games (e.g. Rogue, NetHack, ). All of those games were based on a simple square grid. The site has an extensive section on developing games like that: http://roguebasin.roguelikedevelopment.org/index.php?title=Articles

You will find both suggestions and code there which could be used to build a game like you describe. After all, the only real difference between Rogue/Larn/NetHack/etc. and Diablo or the Ultima series is using simple text characters to depict the map and gameplay vs. isometric sprites.

In particular you will find information about calculating the area illuminated by a torch or lantern the user is carrying, data structures for storing maps, algorithms for automatic generation of maps, and lots of notes for how different games which have already been written chose to address these problems.

John Munsch