Skip to main content
gamedev.net
🔒 Locked

Big bitmap tile engine help

Started by Programmer16 Jan 23, 2004 at 2:38 PM 6 replies 400+ views
Original Post
Programmer16
Programmer16
I''m going to use the "big bitmap tile engine" (using large tiles (i.e.: 256 x 256) for my maps) like Baldur''s Gate. My problem is how do I do collision detection, and also making the player "move under" stuff like a bridge. Thanks in advance. /* I use DirectX 8.1 and C++ (Microsoft Visual C++ 6.0 Professional edition) */
ms291052
ms291052
I believe the way it works in those actually 2D but seemingly 3D games is that the tiles are actually just rendered images of 3D worlds and then they use extremely simplified meshes for the z-buffer handling (moving under bridges) and collision detection. Sorry, but I don''t think there''s any nice or pretty solution. If you want a better explanation, I''d recommend Jim Adam''s Programming Role Playing Games With DirectX. It has an entire section on doing just this.
Programmer16
Programmer16
Thats the book where I got this information. Its in the "Big Bitmap Engine" section.
SelethD
SelethD
I would do this...

use bounding boxes for collision around objects and certain scenery on your bitmap

and use overlays for areas that you can go under (behind)


render loop...

draw large bitmap (background)
draw player
draw overlays (bridge)

check for collision with bounding boxes

end render loop

also if you have a bounding box in the same position as the object like the bridge, then you can not display the bridge when the player enters the bounding box. This will allow you to see inside of houses when the player enters them, but not when he is outside.

hope this helps
Programmer16
Programmer16
I have another question. If I make the maps like this, then I''m going to have 16 textures for each map. That''ll make each map to be about 3 MB. Is there any way I can change this?
SelethD
SelethD
Thats the one problem with big bitmap games, is that you get nice picture background, but have to deal with large size images.

I would only load the backgrounds for the area that im in, and surrounding areas, then as the player moves to another area, load surrounding areas for his new position, freeing the old ones up.

So that way you only have 9 areas in memory loaded at any one time

1 2 3
4 5 6
7 8 9

player is located at position 5

I have heard that you can save the pictures in a .jpeg format and load from that. But I cant find any links for source for a loader from .jepg pictures. But that would help dramatically with hard drive space.

Programmer16
Programmer16
Alright, I''ll try that. Thanks again!

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.