Skip to main content
GameDev.net gamedev.net
🔒 Locked

Infinity Engine ie Baldur's Gate Graphics Style?

Started by kal_jez Jul 4, 2009 at 12:12 AM 8 replies 7.8k views
Original Post
kal_jez
kal_jez
I've been trawling around looking at various engine types for pre-rendered 2D based engines. The infinity engine from Baldar's Gate 2 etc uses large pre-rendered backgrounds and sprites for charactors in an isometric mode. My problem is I'm having a lot of trouble finding a good explaination of how the engine actually performs both its rendering and in more particular the way it masks areas and does valid pathing areas and charactor world heights etc. I've spent a lot of time with google (and even bing) most of the modding sites are more aimed at story and scripting rather than graphics. I'm not interested in actually modding the infinty engine but useing some of it's technigues in a concept I'm working on. So I'm wondering if any has or knows of a good explanation of how it all works.
dbaumgart
dbaumgart
I did a lot of planning for an engine of the same kind about a year ago, but haven't found the time to actually build anything...

I'd recommend defining walkable areas with polygons defined in the map-space. You could use a bitmap with black/white as on/off, or something, but it'd take a lot of space and give an unnecessary level of detail for the size of maps you'd expect to see in a BG-like game. Maybe. (But then I had a plan to use a bitmap to define sprite size, special scripts to run, lighting, and all kinds of nonsense -- you can store a lot of data in RGBA values if you think beyond color.)

If you recall, traps and doors and certain script activation points were definitely defined as polygons.

As for rendering, the entire map is flat -- any elevation you think you are seeing is just visual trickery. To make it look like the player can walk behind buildings and trees and stuff, you would probably just store such environmental objects as separate images that are drawn over the map at defined positions, then just compare the screen Y position of the player versus that of a point defined for the environment object to see which to draw in front of the other. For large env objects that sit across a diagonal space, you could define a line as the visual 'foot' of the object, and just compare the player's Y with the Y at the X position along the baseline. This baseline need not even be anywhere near the object, in the case of roof beams or something; It'd just designate the 'front' of wherever the object should be above.

At least, that's how I thought to do it all. Expand those ideas and I think you can take care of everything BG does.
kal_jez
kal_jez
Thanx for that, that is kind of what i was thinking it was doing, the levels I'm looking at won't be that large but I'm going for a visual style that i think will work better with that method.
Perost
Perost
Have you seen GemRB, an open-source implementation of the Infinity Engine? I'm not at all familiar with GemRB, but it might be of some help to you if you're interested in how the engine works.
Edge Damodred
Edge Damodred
Essentially from what I remember reading from an article long long ago in a classroom far away was that essentially for rendering they used large tiles for backgrounds. They would draw the entire area to one image file and then break it down into roughly screen or quarter screen sized tiles for actual blitting. There would be some over-draw but I guess you could still break it down into smaller tiles to get a tighter camera fit. Then for collision they would mark non-walkable areas with convex polygons. For pathfinding I think they had high navigational point meshes as I remember a slider control allowing you to specify the number or navigation points in the game's options.
-----------------------Or, as I put it, MMORPG's are currently about attaining two primary things: strength and a shovel. The rest is you just shoveling sh** endlessly trying to get stronger to shovel more sh** so you can look for the next new shovel to shovel more sh** with. Once you are done, you can stand on top of a large pile of sh**, raise your golden sh** shoveler up high into the air and boast how proud you are to be the best sh** shoveler of them all. -
kal_jez
kal_jez
Probably the main info I was after was regarding the visibilty of characters on the map and how that masking works considering the map is just one big picture.
Edge Damodred
Edge Damodred
Describe what exactly you mean by masking, do you mean hiding areas that haven't been seen or objects that are not within a character's view?

If so essentially the map is drawn in 3 layers. Lowest or first layer drawn is the background image itself.

The second is sometimes called the Fog of War layer and it is simply a layer of nothing but alpha values, the difference being pixels that fall within a character's sight radius are completely transparent, so these images are dynamically changing as characters move through them. You can choose to draw npc's in one of two ways, you can either test to see if the npc is within a character's sight radius or test it against the alpha map it is within and if there's a value that's not completely transparent then the npc is not drawn. If you only have have one partial alpha value you can represent the map elements as a single bit, 0 for transparent, 1 for the pre-determined alpha value. Essentially you blend the background pixel with a color such as blue and then use the alpha value to modulate it and end up with the final color. A cool day/night effect can be done by drawing another single color layer on top and changing the color from white to some dark blue color over time and blending it with the background.

The last layer is essentially the undiscovered area. It works similar to the second layer except it's either completely transparent or it's completely opaque(usually signaled by the color black). These maps are dynamically changed like the alpha maps except once a pixel is uncovered its value never goes back to opaque. Since you only need to store two different values each pixel in the map can be stored as a single bit. These maps should be included individual saves unless your game design calls for revealing the area each time the player enters it.

Then again I could be completely misunderstanding exactly what you want.

[Edited by - Edge Damodred on July 5, 2009 3:26:51 AM]
-----------------------Or, as I put it, MMORPG's are currently about attaining two primary things: strength and a shovel. The rest is you just shoveling sh** endlessly trying to get stronger to shovel more sh** so you can look for the next new shovel to shovel more sh** with. Once you are done, you can stand on top of a large pile of sh**, raise your golden sh** shoveler up high into the air and boast how proud you are to be the best sh** shoveler of them all. -
kal_jez
kal_jez
Ok need to be a bit clearer, if the infinity engine is based on one large image as opposed to may tiles, how is it determined if a players charactor is hiddem behind a piece of the landscape and thus draw as an outline or somthing (not important). I was wondering how that depth information is used eg in this image
Baldars Gate 2
The characters down the front appear behind the spike and a charactor in the door is partially hidden by the balcony. If the bakcground is a static image how is this achieved?
newman204
newman204
Okay lets see how I go about answering this. The infinity engine maps are made up of a number of elements. The base background map is comprised of a number of tiles (It appears they paint up the whole area and then split up the large map into tiles which get placed into a AREA####.TIS file) which looks like the below

tileset

To determine what parts of the map are walkable and I think the specific noises that are made on specific surfaces and what areas you will walk behind, they use a search map which is made up of different colours, each colour determines a different property

search_map

The other maps that are created that may or may not have an influence are the shadow map and the height map

shadow_map
height map

I would recommend that you go to "Sorcerer's Place" which has Infinity Engine Modding tools which will allow you to pull apart the ARE files and look for yourself how the maps are made.

If you have any other questions I am happy to try and answer.
kal_jez
kal_jez
Sweet, thanx.

Topic Locked

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

Sign in to reply to this topic.