Difference between revisions of "Camera"

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
(Created page with "= Camera = The camera can move around as you wish, as if it were a small copter. It's not as complicated as it seems. with some experience, you should be able to get exactly ...")
 
m
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
= Camera =
+
= {19} {{IE_19}} =
The camera can move around as you wish, as if it were a small copter.
+
{{IE_19_ex}}
  
It's not as complicated as it seems. with some experience, you should be able to get exactly what you want without testing in game.
+
{{IE_19_desc}}
  
All the camera values are absolute; not relative. It will only take into acound current values to determine the shortest way to reach destination.
+
You might want to look into [http://ffhacktics.com/smf/index.php?topic=10018.msg192350#msg192350 Xifanie's Camera Helper] to easily design your camera instructions. (Requires Excel 2007+)
  
Absolute: Based on point zero (0,0,0)
 
  
Relative: Based on last coordinates
+
See Also: [[Event_Instruction_1F|{1F} {{IE_1F}}]] ― [[Event_Instruction_E5|{E5} {{IE_E5}}]](x04,x00)
  
  
All numbers are suggestions and by no means you must use only those. Anything can range from -32768 to 32767.
+
== <div id="X_Axis">X axis : Half-Word (signed)</div> ==
 
+
*+00112 = 28 pixels = 1 tile (center)
 
+
*+00392 = 98 pixels = 3,5 tiles (border between tile 3 and 4)
See Also: [[Event_Instruction_1F|{1F}Focus]]  [[Event_Instruction_E5|{E5}WaitForInstruction]]
 
 
 
 
 
== X axis : Half-Word (signed) ==
 
A tile is 28x28
 
The camera can move 4x more precisely than the tiles' dimension, so moving a tile away would require 28*4=112.
 
If you simply add tiles, it will already be centered, 112 will have 1st tile centered. 168 whoever will be the border between 1st and 2nd tiles.
 
*+00112 = 20 pixels = 1 tile (center)
 
*+00392 = 98 pixels = 3,5 tiles (border 3-4)
 
 
*+00896 = 224 pixels = 8 tiles (center)
 
*+00896 = 224 pixels = 8 tiles (center)
  
  
 
== Z axis : Half-Word (signed) ==
 
== Z axis : Half-Word (signed) ==
Similarly to the X & Y, 1h is 12 pixels high, or 48 units high when using the camera.
 
Centering is the determined by given height +2h (48*2=96), which is technically not correct as most units are 3h high (48*3=144) so if you want "perfect" centering, you have to subtract 1/2h (40/2=24).
 
 
*+00048 = 1h (centers 3h)
 
*+00048 = 1h (centers 3h)
 
*+00192 = 4h (centers 6h)
 
*+00192 = 4h (centers 6h)
Line 35: Line 23:
  
 
== Y axis : Half-Word (signed) ==
 
== Y axis : Half-Word (signed) ==
See Move on X axis.
+
*+00112 = 28 pixels = 1 tile (center)
 +
*+00392 = 98 pixels = 3,5 tiles (border between tile 3 and 4)
 +
*+00896 = 224 pixels = 8 tiles (center)
  
  
Line 43: Line 33:
 
*+00302 = +26,54º (often used in regular game)
 
*+00302 = +26,54º (often used in regular game)
 
*+00341 = +30,00º
 
*+00341 = +30,00º
 +
*+00448 = ??? (upper view for in-battle camera)
 
*+01024 = +90,00º (bird view)
 
*+01024 = +90,00º (bird view)
 
  
 
== Map Rotation : Half-Word (signed) ==
 
== Map Rotation : Half-Word (signed) ==
Line 50: Line 40:
 
The camera will take the shortest way to the new coordinates based on the previous ones.
 
The camera will take the shortest way to the new coordinates based on the previous ones.
 
You should always stay in a range on -180º to 180º to avoid unecessary rotations. I marked -135º, -45º, 0º, 45º and 135º with an asterix (*) to help.
 
You should always stay in a range on -180º to 180º to avoid unecessary rotations. I marked -135º, -45º, 0º, 45º and 135º with an asterix (*) to help.
*-03584 = -315,00º [Map_1]
+
*-03584 = -315,00º [Map_1] (South View)
*-02560 = -225,00º [Map_2]
+
*-02560 = -225,00º [Map_2] (East View)
*-01536 = -135,00º [Map_3]*
+
*-01536 = -135,00º [Map_3]* (North View)
*-00512 = -045,00º [Map_4]*
+
*-00512 = -045,00º [Map_4]* (West View)
 
*+00000 = +000,00º [Map_0]* ((0,0) at bottom left corner)
 
*+00000 = +000,00º [Map_0]* ((0,0) at bottom left corner)
*+00512 = +045,00º [Map_1]*
+
*+00512 = +045,00º [Map_1]* (South View)
*+01536 = +135,00º [Map_2]*
+
*+01536 = +135,00º [Map_2]* (East View)
*+02560 = +225,00º [Map_3]
+
*+02560 = +225,00º [Map_3] (North View)
*+03584 = +315,00º [Map_4]
+
*+03584 = +315,00º [Map_4] (West View)
 
 
  
 
== Camera Rotation : Half-Word (signed) ==
 
== Camera Rotation : Half-Word (signed) ==
Line 73: Line 62:
  
  
== Distance : Half-Word (signed) ==
+
== Zoom : Half-Word (signed) ==
Distance between the camera and target. For simplicity's sake we will convert it to a zoom value. This one is rarely ever used since resizing makes the maps, and mostly units, ugly.
+
Distance between the camera and target.  
 +
 
 +
This one is rarely ever used since resizing makes the maps, and mostly units, ugly.
 
*+02048 = 050%
 
*+02048 = 050%
 
*+04096 = 100%
 
*+04096 = 100%

Latest revision as of 19:40, 12 June 2022

{19} Camera

Camera(+XXXXX,+ZZZZZ,+YYYYY,+ANGLE,+MAPRT,+CAMRT,+ZOOM%,+TIMER)

Moves camera around the map, like a small helicopter.

The coordinates used are the map's absolute coordinates, not relative ones to where the camera currently is.

All entry fields can range from -32768 to 32767. Tiles are 28x28, and Camera motion is 4x more precise, so 112 = 1 Tile. 1h is 12 pixels high, so 48 = 1h, and regular units are 3h tall.

You might want to look into Xifanie's Camera Helper to easily design your camera instructions. (Requires Excel 2007+)


See Also: {1F} Focus{E5} WaitForInstruction(x04,x00)


X axis : Half-Word (signed)

  • +00112 = 28 pixels = 1 tile (center)
  • +00392 = 98 pixels = 3,5 tiles (border between tile 3 and 4)
  • +00896 = 224 pixels = 8 tiles (center)


Z axis : Half-Word (signed)

  • +00048 = 1h (centers 3h)
  • +00192 = 4h (centers 6h)
  • +00384 = 8h (centers 10h)


Y axis : Half-Word (signed)

  • +00112 = 28 pixels = 1 tile (center)
  • +00392 = 98 pixels = 3,5 tiles (border between tile 3 and 4)
  • +00896 = 224 pixels = 8 tiles (center)


Angle : Half-Word (signed)

Note: the base of the map is 0º.

  • +00000 = +00,00º
  • +00302 = +26,54º (often used in regular game)
  • +00341 = +30,00º
  • +00448 = ??? (upper view for in-battle camera)
  • +01024 = +90,00º (bird view)

Map Rotation : Half-Word (signed)

Positive result = Clockwise Rotation The camera will take the shortest way to the new coordinates based on the previous ones. You should always stay in a range on -180º to 180º to avoid unecessary rotations. I marked -135º, -45º, 0º, 45º and 135º with an asterix (*) to help.

  • -03584 = -315,00º [Map_1] (South View)
  • -02560 = -225,00º [Map_2] (East View)
  • -01536 = -135,00º [Map_3]* (North View)
  • -00512 = -045,00º [Map_4]* (West View)
  • +00000 = +000,00º [Map_0]* ((0,0) at bottom left corner)
  • +00512 = +045,00º [Map_1]* (South View)
  • +01536 = +135,00º [Map_2]* (East View)
  • +02560 = +225,00º [Map_3] (North View)
  • +03584 = +315,00º [Map_4] (West View)

Camera Rotation : Half-Word (signed)

Positive result = Clockwise Rotation And no, at 180º your characters won't fall from the map like ants. That's why it's the camera that is rotating, and not the map.

  • -02048 = -180,00º
  • -01024 = -090,00º
  • -00512 = -045,00º
  • +00000 = +000,00º
  • +00512 = +045,00º
  • +01024 = +090,00º
  • +02048 = +180,00º


Zoom : Half-Word (signed)

Distance between the camera and target.

This one is rarely ever used since resizing makes the maps, and mostly units, ugly.

  • +02048 = 050%
  • +04096 = 100%
  • +08192 = 200%


Time : Half-Word (signed)

Time required in frames to perform the whole instruction.

  • +00060 = 1,00 seconds
  • +00120 = 2,00 second
  • +00300 = 5,00 seconds