Advertisement

Entering buildings

Started by February 24, 2000 09:20 AM
11 comments, last by Gefilus 24 years, 9 months ago
I''m working on a tile engine. I''d like to have tiles that represent buildings, and have sprites able to enter the buildings. This naturally involves a doorway, and issues about which parts of the building tile the sprite is drawn over and which not. The buildings are composed of one bitmap, not constructed of smaller tiles. One solution would be to split the building into several bitmaps. I want to avoid this because it makes creating tiles more tedious and becomes problematic if there are several sprites in the ''area'' of one building. Another solution is to use a depth buffer of some sort for every bitmap. How would you go about creating this buffer? I need pixel level accuracy. This means that a corner of a building can be in the middle of a tile, and a character in the upper portion of the tile is drawn behind the house, and one in the lower part is drawn over the house. I want to point this out because my problem is not actually one of the traditional visibility problems involved in the order in which tiles should be drawn, but rather the way in which several items in the same tile coordinates are handled.
There are three ways to handle this, as I see it:

1. Divide the building into several pieces

2. Add depth information to each pixel. This would require you to create your own rendering functions

3. Make the build as a 3D object, with polygons
Advertisement
Well, you pointed out the things I already mentioned, and I won''t using 3d APIs. Do you have some ideas how to create the depth info? The objects will be pre-rendered rather than hand drawn, so any ideas to create the depth info in a smart way would be welcome. The point of view is a 3/4 isometric view, so a simple z-buffer (distance from camera) won''t do.
one way to do it might be to have a trigger right outside the door, and invidible sprite that, when the player character is on, allows the player to enter a door-entering-sequence. If the character is hitting this trigger sprite, test to see if it''s walking towards the door, if both conditions are met, script a door entering sequence.
If you like to see my implementation you can check it out at
http://www.geocities.com/SiliconValley/Modem/2514

If you look at the bitmaps, or view them in the map editor you can see how I construct my buildings.
I know you want to stay away from tile constructed buildings but believe me it''s far easier to implement.


Feel free to contact me for any questions.

Here''s a tip darrell, don''t link pictures to your hard drive. It makes it hard for other people to see them
Advertisement
fixed

The thumbs always appear for me so I never noticed they were messed up. Thanks for pointing it out.

I''m not trying to make it easy, I''m trying to make it look good . And, Darrell, your houses are about 2-3 times the size I''m aiming for. I don''t want to get the blockiness and visual indistinctiveness of buildings constructed of tiles. The player does not need to see the inside of the building, so there''s no need to alter the appearance of the building itself at any point.

To get my point, think about Baldur''s Gate. They have a static background all the time, yet still the charaters are able to walk into doorways, behind lamp posts etc. This is what I''m trying to achieve.
http://www.lupinegames.com/desdiary.html

Check out the February 22nd entry in my design diary where I show what it looks like when you enter a house in my fire fighters game.

Basically I used totally separate level maps for the different stories of a house (you can go on multiple floors), and all the non-inside-house tiles were blank. Then I checked to see if an active unit was on a floor other than 0 (the ground), and whenever they were I checked to see whether that level of tiles had an image for the tile I was drawing. If it did, then I drew the level N instead of level 0 background tile so that I would see the inside of the building.

For obstacle collision I also had levels of different obstacles too.

-Geoff
Your fire fighter game is looking good, but do you draw the interior as tiles or as a static bitmap? If it''s tiles, this still doesn''t address my question . If it''s static, how do you draw the sprite among the walls and furniture? And if you''re using a mask buffer of some sort, how are you creating it?

(P.S. I knew I shouldn''t have mentioned the word ''tile'' in the original post... My problem has nothing to do with tiles, really)

This topic is closed to new replies.

Advertisement