Difference between revisions of "Third dimension in an ASCII-based roguelike"

From RogueBasin
Jump to navigation Jump to search
m
Line 83: Line 83:
# roofs -- there is a difference wether a tile is just empty, or non-existent -- that is a floor on level two seperates the levels, an air tile doesn't
# roofs -- there is a difference wether a tile is just empty, or non-existent -- that is a floor on level two seperates the levels, an air tile doesn't
# and more...
# and more...
== 3D Roguelikes ==
*[[Wish]], available at the [[http://www.graveyard.uni.cc/ Roguelike Graveyard]].


[[Category:Articles|Third dimension in an ASCII-based roguelike]]
[[Category:Articles|Third dimension in an ASCII-based roguelike]]

Revision as of 17:07, 18 July 2006

Third dimension in an ASCII-based roguelike

by Kornel Kisielewicz

Sounds crazy, eh? Well our world is apparently three dimensional. So why should a roguelike map be only 2D? Of course this article considers only the serious reality-based roguelike games - Crawl is 2D and it is fine.

So what do I mean "ASCII-3D-roguelike"? No, I don't want to add 3D-models and do a QuakeTT style game. What I'm thinking about is a 3D map, that also has a "z" component. Why the hell, you might think?

Advantages

  1. the possibility of realy flying enemies (you can be overflown) without hack's.
  2. a truly 3D system of dungeons, where you can fall from a gallery, or climb up a ladder, or swim underwater... possibilities are endless.
  3. underwater action - cities, caves
  4. Thief-style game, where you sneak on top of the town's roofs, trying to sneak past the townguards. Moreover, a assassin on the roof... at last jumping and climbing comes in handy.
  5. a real ability to fly
  6. complicated interconnected Castle buildings, where you can actually walk around the roofs. A lot inspiration for political/assassin games.
  7. a truly mountainous landscape, hiding behind hills, charging downhill
  8. patrolling the city walls at night, trying to sight an enemy
  9. a real siege scenario
  10. and more...

Ok, so 3D is a NiceThing(tm). So why don't we plug it in?

Problems and Solutions

  1. a extended map object (space consumption, more coordinates)
  2. monster AI that takes into account the third dimension
  3. a new raytracer or light engine for three dimensions
  4. a way to represent elevation on the map
  5. and more...

Point number 1 is quite easy -- space isn't so much restricted (if you do level compression), the additional coordinate can be implemented easy (if you're doing it from the beginning, that is). Calculating distance may be done easy with the formula:

  3D Distance = Max(D,H) + Min(D,H)/2
    D = 2D Distance (x,y)
    H = Difference in height

Point 2 would still be possible, although you would have to remember to alter the spotting chance depending on the difference in elevation. Flying creatures are a little more tricky though. It is wise to change the cost of moving up and moving down for flying creatures and for walking ones as well (it's easier to run downhill then uphill).

It's point number 3 will cause trouble, light has to be treated as a sphere and not a circle, and standing on the middle of a roof, you wont see what is just by the building's wall.

But the real killer is point 4. It still isn't a problem if you use graphics or more than 16 colors. But if you're trying to mage a hardcore 16 color ASCII-based game -- then you're in trouble.

A way to do it is just to show the current elevation -- but then many possibilities are closed (you can't see from a roof where the guards on the bottom are). So we need some kind of representation for the lower levels (we ougth to have a representation for higher levels, but as far as I can think of it, it's pure science-fiction...). Another idea, taken from the UFO game is to have a key, to cycle through the levels -- seems good, but it's quite inconvienient to do that every time when you wan't to see what's happening below.

Of course you can treat higher elevation as seperate levels, but that seriously impairs on their interaction capabilities.

IMHO the best way to resolve this problem is to make all the sqares below the player DarkGray... but then, how will we see the light on them? I need more shades of Gray! There is a problem still with creatures flying high -- maybe a shadow on the ground (that is a gray tile?).

Things to remember about

  1. gravity -- items dropped in air will fall, so will corpses of killed flying creatures. So will the player if his "Fly" spell ends...
  2. targeting -- here keys like PgUp PgDown for switching between levels would come in handy.
  3. hurling grenades over walls -- just think about it...
  4. explosions (e.g.fireball) -- do they affect creatures over you?
  5. jumping -- how to implement it?
  6. roofs -- there is a difference wether a tile is just empty, or non-existent -- that is a floor on level two seperates the levels, an air tile doesn't
  7. and more...

3D Roguelikes