Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

This topic is 6610 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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...

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
Opps! Sorry, it should have been a post under the Baldur''s Gate topic...

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
Why not have an alpha mask of the whole world so you can clip the players against it when they walk behind things?

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!