Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Dizzy-like game level representation (format)

Tags:

c++

oop

How would you store game level for a Dizzy-like adventure game? How would you specify walkable areas and graphics? Is it tile-based, pixel-based or walkable surfaces can be described by vectors?

like image 475
topright gamedev Avatar asked May 13 '10 15:05

topright gamedev


2 Answers

Very old adventure games (like Sierra's quests from the 80s) used to actually maintain a separate bitmap of the entire screen that represented z-depth and materials to determine where your character could go and where it would be hidden. They would use pixel sampling to check where their small sprites would go.

Though current machines are faster, long side scrolling levels make this sort of approach impractical, IMHO. You have to go with more sparse representations.

One option is to "reduce" your game into invisible tiles, which are easier to represent. The main problem with this is that it can constrain your design (e.g., difficult to do diagonal platforms), and it can make the animations very shoddy (e.g., your characters' feet not actually touching the platform). This option can work IMHO for zelda-like adventure games, but not for action games.

A second option is to represent the game world via some vector representation and implement some collision detection. I would personally go with the second solution, especially if you can be smart about how you organize your data structures to minimize access time (e.g., have faster access to a subset of world elements close to your characters current position).

I wouldn't be surprised if there are available 2D game engines that provide this sort of capability, as there are definitely 3D engines that do it. In fact, you may find it easier to use an existing 3D game engine and use it to render 2D.

like image 173
Uri Avatar answered Oct 12 '22 07:10

Uri


The Dizzy game is probably using a tile-based system. The game world is made up of a palette of tiles that are repeated throughout the level. Each tile would have three elements - the image drawn to the screen, the z-buffer to allow the main character to walk behind parts of the image and a collision map. The latter two would be implemented as monochrome images such that:

colour |      z map         | collision
-------|--------------------|---------------
black  | draw dizzy infront |  collide
white  | draw dizzy behind  |  don't collide

Storing these are monochrome images save a lot of ram too.

You would have an editor to build level that would display a grid where tiles can be dragged and dropped.

like image 32
Skizz Avatar answered Oct 12 '22 05:10

Skizz