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

3D map with 2D sprites - ala Final Fantasy Tactics

Started by wolfenstein Jul 30, 2007 at 12:02 PM 5 replies 11.5k views
Original Post
wolfenstein
wolfenstein
Hi everyone, I am in the process of designing a game where the battle engine will be much like FF Tactics where you have a 3D map for the battle field with 2D sprites for the characters. Does anyone happen to know how this engine worked in FFT? I'm guessing that the map is just a plain 3D model and not tile based. My reasoning for this is that some maps have objects that don't appear to be tile based and that you cannot have your character climb on (the Church in the first battle for example). So I created a 3D model of this map and I can display it fine in my game. The problem is finding where on the screen to blit a sprite that is standing on a certain tile position. Would I have to do something like: get the vertices that make up the tile in the 3D model, find their centre position, then transform that to screen space and blit the sprite there or is there a better way? I admit it is possible that the maps are tile based but the non-tile objects (like the church) are just separate 3D models. Thanks for any help that you are able to provide. It is greatly appreciated!! - Wolfenstein
"Segata Sanshiro!!!"
Deleter
Deleter
Well you don't have to make it tile based. Just have some way of marking walkable areas. It should be easy to blit it, just use gluProject and turn the 3d spot where your sprites feet are into 2d screen coords.
popsoftheyear
popsoftheyear
I would say they were tile based. It'd probably be easiest to get a prototype working with a 3d tile based engine, and then incorporate special models (like the church). Notice, like you said, that the non-tile-based parts can't be climbed on by the character.

Cheers
-Scott
wolfenstein
wolfenstein
So what you're saying is store a 3D coordinate somewhere (in model space) that represents where a sprite's feet would go on each walkable space and tranform it to a 2D vector in screen space?

That could work.

Thanks alot!
"Segata Sanshiro!!!"
wolfenstein
wolfenstein
popsoftheyar, thanks for the suggestion as well.

The main reason I wanted to steer clear of doing the tile based way was I envisioned it being difficult to have the tiles and separate models fit together perfectly without showing any seams.

I will also consider the tile based route though. Thanks!
"Segata Sanshiro!!!"
Anthony Serrano
Anthony Serrano
The engine in FFT used an actual 3D model for the level; but as far as determining where to place sprites, it uses a tile-based model that simply stores the height of each corner of each tile (as well as some other information, such as vertical extents and walkability), and interpolates those values to determine the bottom-center point of the sprite.
Zahlman
Zahlman
Quote:
Original post by wolfenstein
So what you're saying is store a 3D coordinate somewhere (in model space) that represents where a sprite's feet would go on each walkable space and tranform it to a 2D vector in screen space?


Yes, but it's simpler than that sounds. :) The "3D model space coordinate" is easily found: X and Z are just n-and-a-half tiles, and Y (up) is just n tiles. Then the screen X and Y are simply a linear combination of those.

For example, consider "blocks" (tiles * 1 tile "high") at a 2:1 ratio, height 10 pixels, width 16 pixels, depth 8 pixels: each tile moved in the X direction adjusts the screen coordinate by (8, 4), in the Y direction by (0, -10), and in Z by (-8, 4).

For things like "the church", you can just mark the appropriate tiles of the map as non-walkable and draw a single sprite that covers them, placing it according to the lowest height of the tiles in the covered region.

Topic Locked

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

Sign in to reply to this topic.