#168751 - Ruben - Wed May 20, 2009 3:35 am
So DekuTree and I were trying to work out how the original Final Fantasy games moved the camera when starting up an airship.. I had tried simply changing the pitch and moving back, but that doesn't exactly leave the center where it was... Then Deku suggested rotating around the position of the airship.. but I don't think it's that simple. Has anyone else done something like this..? If so, can you give me any hinters?
#168752 - sgeos - Wed May 20, 2009 3:51 am
If we say that north and south are the Y axis, and east and west are the X axis in game space, then does not the airship move on the Z axis while the camera pitch changes? The shadow of the airship should not move along the game space Z axis. I think you could center on either the airship or the shadow depending on how you do your math. If you plan to move the shadow when you fly over mountians, you could center on the airship or the ground below it.
#168753 - Ruben - Wed May 20, 2009 3:54 am
What I wanted to do was center on the shadow, with the airship slightly above the ground when "flying." But the thing is, that I need to keep the center of the map before mode 7-ing in the center of the screen even after mode 7-ing.. I dunno if you get what I mean.
#168756 - DiscoStew - Wed May 20, 2009 5:47 pm
I know in Final Fantasy I for the GBA, they sorta cheated on the airship mode7 trick by having the "camera" at a fixed distance away from the center of what it was pointing at, and then would rotate around that point on a single axis when the airship takes off and lands.
In a game like the original Final Fantasy IV for the SNES, however, I want to think that the takeoff and landing of the airship is done by updating the positioning and orientation of the "camera" with static values in an array, which is incremented every given number of frames. I believe this might be the way they did it because if you take a look at the opening scene, when the Red Wings land in Baron Castle, you can tell that it isn't smooth (I'm unsure if FFIVGBA does the same thing). I could be wrong though, since at that time, the scene is also fading to black, and the choppy "updating" may have been a performance issue with mixing the two. Even if this may not be how they really did it, it's an option in case you can't find a good alternative method.
_________________
DS - It's all about DiscoStew
#168757 - Kyoufu Kawa - Wed May 20, 2009 6:17 pm
DiscoStew wrote: |
In a game like the original Final Fantasy IV for the SNES...
...I could be wrong though, since at that time, the scene is also fading to black, and the choppy "updating" may have been a performance issue with mixing the two. |
Fading to black on the SNES is easy. The screen display register has four bits for simple fades to black. I don't see how combining an easy palette effect with a Mode7 trick could be a performance issue.
Unless it's the palette that's choppy, since it's only sixteen steps. If it's slow enough...
#168758 - Ruben - Wed May 20, 2009 6:18 pm
Hm, I haven't seen the airship thing on FFIA... I've seen it on FFII, but not FFI.. Maybe it's the same?
Well, either way, I think that what I needed to do was something like, rotating the camera pitch and moving back.. hm.. it's hard to explain, lol.. The thing is, that the middle scanline of the screen *before* going into mode 7 must *still* be at the center of the screen.. kinda like rotating the camera around completely.. hm.. Any ideas what that is, other than just rotating?
#168759 - Ruben - Wed May 20, 2009 6:22 pm
Kyoufu Kawa wrote: |
Unless it's the palette that's choppy, since it's only sixteen steps. If it's slow enough... |
Heh, you should see what happens on FFIVA when boarding an airship xD
It literally uses more than 100% CPU and takes ~2 frames and a half for it to complete (I think they used software divisions, rather than SWI or even better, a LUT. From what I saw, it takes 147% CPU to finish)
#168769 - DiscoStew - Thu May 21, 2009 2:29 am
Kyoufu Kawa wrote: |
Fading to black on the SNES is easy. The screen display register has four bits for simple fades to black. I don't see how combining an easy palette effect with a Mode7 trick could be a performance issue. |
I wasn't sure how the SNES dealt with that kinda of stuff, though I should have assumed as much after having worked on the GBA for some time.
Ruben wrote: |
Heh, you should see what happens on FFIVA when boarding an airship xD
It literally uses more than 100% CPU and takes ~2 frames and a half for it to complete (I think they used software divisions, rather than SWI or even better, a LUT. From what I saw, it takes 147% CPU to finish) |
I decided to take a short gander at what FFIV Adv did for it. From the look of it, it almost does the same as FFI Adv does, except it seems to make the Mode7 plane curved than being completely straight (kinda like how FFVI on the SNES works with the Mode7 when "curving" the world map area). The calculations they used at the time to make that effect must not have been really optimized, which is probably why it isn't smooth (flying in the airship itself is laggy).
_________________
DS - It's all about DiscoStew
#168782 - sgeos - Sat May 23, 2009 12:38 pm
Ruben wrote: |
The thing is, that the middle scanline of the screen *before* going into mode 7 must *still* be at the center of the screen. |
Conceptually the problem is simple. You rotate on the scanline you want at the center of the screen. I'm sure there are many ways to do this. Have you worked out your math on paper?
#168783 - Ruben - Sat May 23, 2009 1:02 pm
Yeah, I've tried drawing it on paper but, since I'm only in year 10, I haven't learnt 3D stuffs, much less 3D rotations around points.. most of what I know is self-taught stuff..