Advertisement

BG

Started by April 12, 2000 12:51 PM
7 comments, last by Mr_Shankly 24 years, 6 months ago
There is one thing I''ve been been bothering me. How they solved the problem with objects(player,NPC) partially behind a house, if the world is one giant bitmap?.. Perhaps one way to solve the problem is to render the ground and buildings separate in an 3d program and then in the game-engine sort the buildings and objects, and blit them in the right order. I haven''t tried this my self yet, and I have no idea if this is the method used in BG...
Opps! Sorry, it should have been a post under the Baldur''s Gate topic...
Advertisement
The world is one giant bitmap, but conceptually you can lay out the bitmap into three types of regions. Type 1 is a region where a player can stand and the player will show in the foreground. Type 2 is a region where a player can stand, but the bitmap will be drawn on the player. Type 3 is a region where a player can''t stand.

So let''s say you have a house. The house image will be mostly Type 3 regions. However, there will be a strip of the bitmap at the back of the house that is Type 2. And in front of the house is Type 1.

So if you''re doing an interior scene where you want overhanging beams, you can draw in the beams and desginate those pixels as Type 2 regions. A player standing in that spot is allowed to be there, but the bitmap will be blitted over him. But the Type 1 regions on either side of the beam will be blitted behind the player.

Probably the easiest way to implement this is a z-buffer, with the two extreme values for the Type 1 and Type 2 regions. Type 3 regions would have the same z order as Type 1 regions.
wouldn''t it be easier to make seperate bitmaps for each thing? suppose the player was behind a building. that building bitmap would draw over the player.

if you don''t want to do that, couldn''t you define the player limits for each region (kind of like mentioned above). just define an area of the bitmap region 1. in that region, the player is always visible. define the area of region 2. that area the player is not visible. define area 3. this area is where the player can''t get to.

i can see a problem with that is that the player could be half way between regions and the player wouldnt be drawn. that would (in theory) make things look real wierd. all of a sudden the player appears out of no-where, but really he was just behind a building.

see what i mean?
thus, you dither the portions of the character in those regions, or do some sort of alpha blend.

Get off my lawn!

Why not have an alpha mask of the whole world so you can clip the players against it when they walk behind things?
Advertisement
quote: Original post by Sphet

Why not have an alpha mask of the whole world so you can clip the players against it when they walk behind things?


Cos you may want to be able to walk in front of them too
many games dont permit you to go behind buildings - you have to go "above" them (i''m being very literal now).

i would use an ascii diagram to explain but the board always makes a right hash of it

MENTAL

PS: how do i get that cheesy green (the one for my reply) into the body of the text?
I think very few modern games restrict you in the way that some of the older tilebased games do. Ultima VII allowed you to go behind buildings as well as in front of them, and that''s hardly new these days. But you could probably get away with it if your tiles were at such an angle that it doesn''t look too bad.

This topic is closed to new replies.

Advertisement