FinalFantasyTactics style camera. How?

Blitz3D Forums/Blitz3D Programming/FinalFantasyTactics style camera. How?

Canali(Posted 2004) [#1]
Hi guys.
Have been working a bit on finding a good way of handling a FFT-like camera.

Here's a link to how it should look like:

http://www.vgmuseum.com/end/psx/a/fft_2.htm

As you can see I need to see, for instance, a small terrain (8x8) with an isometric point of view.

The camera should be able to point to the main character without turnig and should be able to rotate around the main character keeping always the same distance from him.

How could it be done?
Thx in advance for the code submission(s).

;)


semar(Posted 2004) [#2]
The camera should be able to point to the main character without turnig

What do you mean with 'without turning' ? Please elaborate. Anyway, this will point the camera entity toward your main_char entity:
PointEntity camera, main_char


and should be able to rotate around the main character keeping always the same distance from him.

That means, the camera should move along a circle which has the main character in the center.
Assuming R is the rasius of said circle, you move the camera along the xz plane, its y remaining fixed. Use an angle to keep track of the camera orientation.
R# = 10.0 ;circle radius

;pseudo code: If the player press left key, then angle = angle - 1.
;pseudo code: If the player press right key, then angle = angle + 1.

;avoid negative values
if angle < 0 then
   angle = 359
endif

;normalize the angle to 360
angle = angle mod 360

xcam# = EntityX(main_char) + R * cos(angle)
zcam# = EntityZ(main_char) + R * sin(angle)
positionentity camera,xcam,ycam,zcam
pointentity camera, main_char


I suggest you to have a look in the Code Archives, which contains useful code examples.

Hope this has sense for you,
Sergio.


MSW(Posted 2004) [#3]
another way it to parent some pivots with the characters...

for example Camera_Eye is a pivot parented by the main_character...Camera_Lock is a child pivot of Camera_Eye...so you simply move the camera to Main_character\Camera_eye\Camera_Lock...point the camera at Camera_Eye then make it a child of Main_character\Camera_Eye\Camera_Lock...then to rotate it you only need to rotate Main_character\Camera_Eye (which will rotate Camera_Lock and its child the camera)...


Canali(Posted 2004) [#4]
Thx for the suggestions guys.

I'll try to implement 'em to chose wich is the more suitable...


ronbravo(Posted 2004) [#5]
I played FF Tactics and I know what you're talking about with the camera movement. The best way to do that camera style is as MSW suggest. Just create a Pivot then create a camera as a child to that pivot. After that use the PointEntity command to have the Camera point at the pivot. This way you can move the pivot to the position ofwhat ever character is selected by the player or move the pivot to position of the main focus of the scene. Then when ever you need rotate the camera simply rotate the pivot and the camera will rotate around the scene while staying focused on the selected object/character. Hope that helps.


Do you have any screenshots of the game you're working on because if it's like FF Tactics then it sounds intresting. I wanted to do a game like this but need to finish the current project I'm working on.


Tiggertooth(Posted 2004) [#6]
FFT camera is truly isometric. A 3D camera pointing at a pivot will not be isometic. It won't quite feel the same.

To achieve an isometric view, you need to have equal foreshortening in all dimensions. This is done with an orthographic projection. Fortunately, Blitz supports this.

However, the zoom settings are all whacked out in Ortho mode. You really have to play with it.

If you follow the above suggestions, you'll end up with Dungeon Siege, not FFT. Maybe you won't really care. I'm doing a FFT Iso type title myself, and I started with a Dungeon Siege camera too. It is much easier :) Just be
aware it won't really quite look the same.

Good luck,
Ken