# Old SSI-Engine... how to place walls?

## Recommended Posts

damarrion    100
hi community,

i am trying to code a remake of EOB I (Eye of the Beholder, SSI).
[url="http://en.wikipedia.org/wiki/Eye_of_the_Beholder_%28video_game%29"]EOB[/url]

Gameplay:

I *think* this is the complete tileset for walls:

[URL=http://imageshack.us/photo/my-images/199/unled1xp.jpg/][IMG]http://img199.imageshack.us/img199/1166/unled1xp.jpg[/IMG][/URL]

I already have the map-data-generator done and i am now coding the traversal algorithm but i am unsure how the original engine did the drawing of the walls.

Lets assume this is our map, the party is starting on [2,0] and facing to the EAST.

[0,0][0,1][0,2][0,3][0,4][0,5][0,6][0,7][0,8][0,9][0,10]
[1,0][1,1][1,2][1,3][1,4][1,5][1,6][1,7][1,8][1,9][1,10]
[2,0][2,1][2,2][2,3][2,4][2,5][2,6][2,7][2,8][2,9][2,10]
[3,0][3,1][3,2][3,3][3,4][3,5][3,6][3,7][3,8][3,9][3,10]
[4,0][4,1][4,2][4,3][4,4][4,5][4,6][4,7][4,8][4,9][4,10]

How many "rooms" does the orginial EOB engine traverse for scanning what is visible and what not?

My current guess:
[x,x][0,1][0,2][0,3]
[1,0][1,1][1,2][1,3]
[2,0][2,1][2,2][2,3]
[3,0][3,1][3,2][3,3]
[x,x][4,1][4,2][4,3]

[x,x] = ignore

From that viewpoint, i am starting from back to front to draw the (visible) walls.

Is this correct from the viewpoint? Or does it look different in the original engine? If, it would be great if you could draw a little viewmap like i did with the correct view for traversing.

##### Share on other sites
damarrion    100
Hi community,

is the question to unspecific or trivial? If, please drop me a note so i can correct the posting so everybody is able to understand my problem.

##### Share on other sites
deftware    1778
I don't know how this is typically done, but I imagine from looking at the video that you are limited to hallways instead of rooms, at which point all you would have to do is take the players position, and pac-man style increment in the direction they are facing one grid square at a time, checking its surrounding grid squares for solidness so as to determine whether or not to draw a wall, and just keep moving down the hallway until you are sufficiently far for the black fog shading to hide everything else in the distance. you should still be able to do room-like spaces, and it should be sufficiently fast to just check all the surrounding empty areas within the direction the player is facing for walls.

You could traverse this, build a list, and then draw the list from back to front as you stated. Or you could start at the player, move to the furthest block within the 'black fog' range (say 6 blocks for instance) and work your way toward the player, sweeping side to side for solid blocks to draw the sides of. It seems there are many approaches that will all work equally well.

##### Share on other sites
Antheus    2409
[quote name='damarrion' timestamp='1312804765' post='4846138']
From that viewpoint, i am starting from back to front to draw the (visible) walls.

Is this correct from the viewpoint?[/quote]
Yes. Just draw *all* walls.

It's called Painter's algorithm. It also gives you correct rendering of holes and transparent surfaces for free.

Since the map is strictly rectangular, the ordering issues present in painter's algorithm will never be a problem.

[quote]Or does it look different in the original engine?[/quote]Does it matter how it was done 20 years ago? Hardware was a bit different.

There are considerably "faster" ways, but they simply aren't worth spending time or effort on.

##### Share on other sites
damarrion    100
thanks a lot for the answers, i think i have it working now [img]http://public.gamedev.net/public/style_emoticons/default/smile.gif[/img]

##### Share on other sites
EJH    315
Doing EOTB remake in 2D is probably way harder these days than doing it in 3D. A simple 3D Mine-Craft like box engine would be much easier to implement look the same (or likely better?).

##### Share on other sites
laztrezort    1058
I've made several skeleton applications for this type of game over the years. In most cases, the process was similar to what you seem to be indicating. For each player position and facing direction, just traverse your "map" data to build a list of walls and their locations for each 18 (or whatever) visible cells, and draw from back to front. Sketching it all out on a piece of graph paper is very helpful. Unless you are targeting wristwatches, you shouldn't need to do any optimization

The hardest issue (for me) was always getting it to look right, as I am no artist. I agree with EJH in that it is conceivably much easier to just use 3D nowadays, especially if you are artistically challenged (like me). You can still limit rotations to 90 degree turns, and each movement to an entire cell, and you have the added benefit of very easily adding additional 3D effects.