Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tile based game theory

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.
like image 374
Jeremy Avatar asked Mar 01 '09 05:03

Jeremy


Video Answer


2 Answers

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.

like image 158
Gilad Naor Avatar answered Nov 11 '22 05:11

Gilad Naor


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).

like image 21
Crashworks Avatar answered Nov 11 '22 04:11

Crashworks