Archived

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

Seriema

Baldurs Gate engine question

Recommended Posts

Hi! I''m thinking strongly about making a Isometric engine. Spend alot of time in the "Isometric land" forum But I have one question that I thought I post here. What kind of engine does Baldurs Gate use? It''s kinda isometric... Is it tile based? I''m heasatating since it doesn''t look like the same tiles all over the place. IF it is tiles based, are they using hex tiles? Was something changed with Baldurs Gate 2? Hope you can answer! }+TITANIUM+{

Share this post


Link to post
Share on other sites
quote:
From the Interplay website:
Every location is unique since our backgrounds are rendered rather than tiled



hehe... wooops! Thanx for the answer!

How different is it to code an isometric engine compared to making it like BG? How does one set up the collision detecting for a prerendered map?

}+TITANIUM+{

Share this post


Link to post
Share on other sites
hehe... woops again!

quote:
From the Interplay website
Isometric, top-down view gives a birds eye view of the action



OK, let me explain my question better then!

I was thinking of making an RPG with my friend. I''ve ordered TANSTAAFL''s book "Isometric Game Programming" (I don''t have to book yet), it''s on how to make an Isometric game engine using tiles. For me (the programmer) it''s easier to make it tile based *I think* But my friend (the artist) wants to use a pre-rendered map. Like in BG.

How different is that? Since you can set tiles to collision or not, like wall/water/etc. But how do you do that with a pre-rendered map??

Is there some good tutorial for this?

}+TITANIUM+{

Share this post


Link to post
Share on other sites
What''s stopping you from having a pre-rendered map for the visuals and a virtual tile-based map for your collision detection. Your tile map can be something as simple as an array containing different values indicating the different obstacles on your map.

e.g.

0,0,0,0,0,0,0,0,0,1,1
0,1,1,0,0,0,2,0,0,1,0
0,1,1,1,0,0,0,0,0,1,0
0,1,1,1,0,0,9,0,0,0,0
0,0,0,1,0,0,0,0,0,0,0

Where:
0 - Empty travel space
1 - Tree
2 - Monster
9 - Player

Hope this helps.

borngamer

Share this post


Link to post
Share on other sites
yes, that was exactly as I was thinking. Until I thought of my artist friend...

He will still have to make an tile based _first_ and _then_ render a "better looking one". For example, there has to be a special distance between two trees to have the proper collision detecting. By rendering the tree a little offset, the character will go through half the tree and "bump into it" halfway to it.

How does one create a map like that? Thinking both on the artist (that''s gonna use the tool) and the programmer (that''s gonna make the tool).

thanx for all your help! keep it comming!

}+TITANIUM+{

Share this post


Link to post
Share on other sites
IIRC Baldur''s Gate is using a "search map" for this. That is, your character will never go out of a path. I think they''re also using vectors for some items (like tables etc).

Finally, and I''m still not sure about anything, I believe they''re using a virtual tile map (64x64 squares) for collision with NPCs etc.

Hope this helps.

Share this post


Link to post
Share on other sites
I think I''m slow in the head

Is there somewhere where I could learn more about this? The only book I know about isometric engines is the one I''ve ordered, the one written by TANSTAAFL. Are there some tutorials or other info on the net?

What is this type of map engine called?

I can imagine the virtual tile-map below/ontop of the rendered map, but how does the designer draw the map? With a papper with big squares?

thanx for all the help, I''m feeling that I''m close to an answer. Just not quite yet :D

}+TITANIUM+{

Share this post


Link to post
Share on other sites
Well I''m making a similar type of engine, well not really, it uses tiles to make different layers, then puts then all together to blend tiles together, apply lightmaps, etc. Anyway, from this point is where the engines become similar. Basically what I have is one big bitmap is memory. To render it with the best speed what I have to do is place pieces of the map in video memory as the player travels along the map. Then I render these pieces the same way you would render a tile based game. The only difference for you would be that you already have this big bitmap, drawn by your friend, in a file, and you just load it into system memory.

For collision, and limiting where characters can go they could have used virtual rectangles (virtual b/c you don''t actually see them, you only have coordinates) at places on the map that limit the character''s movement. What I mean by this is that the map contains rectangle structures (top, left, bottom, right) with coordinates on the map. You can then check if the character''s coordinates are inside the rectangle coordinates, if they are then you perform some action on the character - kill them, block them, etc. They could have also used tiles to do this, but it seems harder because the tiles would have to match specific locations on the map.

Also, remember isometric has to do with how the map is viewed. If you want your game to be isometric you friend will have to draw the map with an isometric perspective.

Well that''s my ideas, I really have no idea what the game looks like, how it''s made, or even played it - either gonna buy it or play the demo soon. I don''t think there is any official name for this type of engine, you could call it a big bitmap engine. I have never found any kind of tutorial.

Digital Radiation

Share this post


Link to post
Share on other sites
Hey! I think it''s starting to sink in!

My friend is gonna draw the map isometric, or he''s gonna get smacked! *joking*

I think I know what has to be done now. Just gonna read that book first!

THANK YOU ALL FOR YOUR HELP!

PS. If you know of a tutorial, please post it

}+TITANIUM+{

Share this post


Link to post
Share on other sites
basically u have a big bitmap like in bg and you outline buildings and objects that the player cannot walk through. there was an article in game development magazine about this for commandos. once u define with polygons where u cant walk u can walk anywhere

Share this post


Link to post
Share on other sites
Just have your artist friend make black and white bitmaps that match the rendered ones, with white as passable and black as impassible (or the other way around). Then have him scale them down by a factor of, say, 1/4. In your code, divide the character''s position on the screen by 4 to get his position on the collision map (or better, multiply by 0.25). Then, assuming your backgrounds are loaded into memory as 32 bit bitmaps, then (assuming you use bits of bytes (use bitshifting), not bools[which take up a whole byte])your collision maps will be only 0.0078125 the size of the original bitmaps - hardly anything.

Now how do you store individual bits? Make an unsigned char array with dimensions of 1/8 those of your bitmap. Then, each char holds 8 bits. You can use bitshifting to extract a single bit.

Or, you could, as others have suggested, use vectors and polygons. But I really think a simple collision bitmap stored as a *.BMP file and edited in any image editing program would be the easiest way to go.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
As the previous poster said, using a b/w bitmap that outlines where you can go and where you can''t would be ideal, and very easy to imlement. That b/w picture is called an alpha channel, similar to using an alpha channel in paint programs.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster

To extend that idea, you could even use a 16-color bitmap as the virtual collision map. That way, you can have more than just walk/can''t walk. You could do like:

  

// #defines are evil, I''m just making a point here


#define ATTR_CANT_WALK 0x01;
#define ATTR_WATER 0x02;
#define ATTR_POISON 0x04;
#define ATTR_SPECIAL 0x08;



You know, you can make your values mean whatever you want.

-OR-

You could even have multiple 2-color bitmaps, one for each attribute. Like you could have a walk bitmap, and a water bitmap (you could also use this one to know where to draw reflections!) etc ...

The possibilities are endless, and by using a 1/4 or 1/8 scale low-color bitmap(s) as an attribute layer(s) your memory requirements are pretty low.

Share this post


Link to post
Share on other sites
WOOW!!

THANX!!! I think I get it! I _was_ thinking of making the whole map hex tiles
*sound of flushing toilet*
not anymore!

I''m gonna make the game using the method you guys described, a tile based virtual collision map!
Using vectors like in BG, that seems pretty complicated :/

}+TITANIUM+{

Share this post


Link to post
Share on other sites