Difference between revisions of "KMP Editing/Cameras"

From Custom Mario Kart
Jump to navigation Jump to search
m (→‎CAME: grr)
m (tiding up, correcting etc.)
Line 2: Line 2:
  
 
Improperly configured camera settings can cause game crashes during opening pans, replays and post-match winning laps. Back up your KMP before you start editing.<br>
 
Improperly configured camera settings can cause game crashes during opening pans, replays and post-match winning laps. Back up your KMP before you start editing.<br>
Good cameras will make your level look much more professional, but editing them can be difficult to master. It's very difficult to make Cameras with [[SZS Modifier]] by Chadderz, it's easier with [[Wiimms SZS Tools]]. You will note it in this list:
+
Good cameras will make your level look much more professional, but editing them can be difficult to master. It's very difficult to make Cameras. Wiimm's SZS Tools will make the Camera Editting easier because all values that you need are noted here.<br>
 +
In editting Cameras you need some knowledge about calculating in Hex. So if you have no knowledge about it, it will be more difficult to understand. Follow these steps and you will learn how to do it.<br>
 +
Before editting Cameras have a look at this list. You will need to learn some values for making a good Camera faster:
  
 
{{KMP CAME header}}
 
{{KMP CAME header}}
Line 10: Line 12:
 
==Camera Editing/Step by Step guide==
 
==Camera Editing/Step by Step guide==
  
Cameras can be placed like any normal object. The position only matters when using certain camera settings. Cameras are found in the [[CAME]] section of the [[KMP Editing|KMP Editor]].
+
Cameras can be placed like any normal object. The position only matters when using certain camera settings. Cameras are found in the [[CAME]] section of the [[KMP Editing|KMP Editor]].<br>
 
+
Setting a route that belongs to a camera and a objects can often cause a freeze. Be sure that you only use one Routes for a object or the camera.
If you setup a route that belongs to a camera, be sure, that the same route is not used by a global objects. Sharing a route between camera and objects may often cause a freeze.
 
  
 
===Opening Pans===
 
===Opening Pans===
On VS races a sequence of cameras is shown. The u8 value at offset 0x06 in the CAME section header is the index of the first camera. The next cameras are linked by the u8 value at offset 0x01. Normally 3 cameras are used, but any number can be used.
+
On VS races a sequence of cameras is shown. The exact time of the complete Opening Pan is 12,8s. It is splited in 3 sections with 3,6s, 4,3s and 4,9s (values ''220'', ''257'' and ''294'' found in all Nintendo Tracks).<br>
 +
The u8 value at offset 0x06 in the CAME section header is the index of the first camera. The next cameras are linked by the u8 value at offset 0x01. Normally 3 cameras are used, but any number can be used.
  
 
[[File:CAME_LuigiM.png|1000px]]
 
[[File:CAME_LuigiM.png|1000px]]
  
The '''first two digits''' in the '''first settings box''' indicate the type of camera.  Opening pans have the setting ''05''.  The length of time each camera is displayed is set in '''z5'''. Their values will be ''220'', ''257'' and ''294''; this is to synch the camera transitions with the opening music.<br>
+
The '''first two digits''' in the '''first settings box''' indicate the type of camera.  Opening pans have the setting ''05''.  The length of time each camera is displayed is set in '''z5'''. Their values will be ''220'', ''257'' and ''294''; this is to synch the camera transitions with the opening music. You can change it to any other value.<br>
 
If you found these 3 Cameras, we come to editting them.  
 
If you found these 3 Cameras, we come to editting them.  
  
Line 34: Line 36:
 
E=14<br>
 
E=14<br>
 
Finally: The first Opening Route Section is Route Section 14. <br>
 
Finally: The first Opening Route Section is Route Section 14. <br>
It also works for [[Object]].
+
This is the same prinzip like the [[Object]]s choose their Routes.
  
Do it with the other two numbers and you have the Opening Routes for your Opening CAMEs.<br>
+
Do this with the other two values and you know which Routes you have to use for your Opening Pans.<br>
  
After we found out the routes of this cameras, go to this Routes and drag them how you like it. You can drag them in the near of special objects or some buildings. The Camera will move how you dragged this route. It is advisable to drag the last Opening Camera Route to the Startline. Also you can change your Routes:<br>
+
After you found, which Routes are used for this cameras, go to these and drag them like you want it. One option is draging them in the near of special objects or some buildings you made in your Custom Track for making a short review. The Camera will move along this route. It is advisable to drag the last Opening Camera Route to the Startline. Also you can change your Routes:<br>
 
Search after the Route Section, where the Camera should move, as example Route Section 18.<br>
 
Search after the Route Section, where the Camera should move, as example Route Section 18.<br>
 
Convert the Decimal number to Hex:
 
Convert the Decimal number to Hex:
Line 46: Line 48:
  
 
And now write down this number in the Route Setting Box where the Route IDs are.<br>
 
And now write down this number in the Route Setting Box where the Route IDs are.<br>
For testing, it is good to link the last opening camera to the first to have an unlimited view. You can make it so:
+
For testing your Opening Pans it is good to link the last Opening Camera to the first to have an unlimited view. It sounds difficult but with one progress you made it. It's pretty simple.
  
 
[[File:CAME5 LuigiM.png]]
 
[[File:CAME5 LuigiM.png]]
Line 53: Line 55:
 
The first Camera is ''CAME 11'' so Convert the 11 to Hex:
 
The first Camera is ''CAME 11'' so Convert the 11 to Hex:
 
11=0B<br>
 
11=0B<br>
So I change the FF to 0B and now the Cameras are looped.<br>
+
So I change the FF to 0B and now the Cameras are looped. You see; it's pretty simple.
 
+
<br>
For [[user:Wiimm|Wimm]]'s analysis go to [[Cameras/Reference#Opening_Pan|Wiimms Opening Pan Analysis]].   
+
<br>
 
+
This was found out by [[user:Wiimm|Wiimm]]. For his analysis go to [[Cameras/Reference#Opening_Pan|Wiimms Opening Pan Analysis]].   
  
 
[[File:CAME4 LuigiM.png]]
 
[[File:CAME4 LuigiM.png]]
  
Now we define the points where the Cameras watch. The ''Start View Point'' shows where the Camera watch at the begin and the ''End View Point'' at the end of the Camera Intros. ''x3'' and ''y3'' controlls the zoom.<br>
+
Now we define the points where the Cameras watch. The ''Start View Point'' shows where the Camera watch at the begin and the ''End View Point'' at the end of the Camera Intros. ''x3'' and ''y3'' controlls the zoom, which is not used in Opening Pans, so you can ignore it.<br>
 
This is how to do:<br>
 
This is how to do:<br>
First you search an object or a place, where the camera should look. Then you take the ''x'', ''y'' and ''z'' values and take it to the ''z3'', ''x4'' and ''y4'' values (''x'' to ''z3''; ''y'' to ''x4''; ''z'' to ''y4''). Make the ''x4'' value about 10000 higher. And then take it to the ''End View Points'', too. Then you can change there the ''y5'' values, that makes the Camera watchs higher while replay, or you change the other 2 values or all 3.
+
First you search an object or a place, where your camera should look. Then you take the ''x'', ''y'' and ''z'' values and take it to the ''z3'', ''x4'' and ''y4'' values (''x'' to ''z3''; ''y'' to ''x4''; ''z'' to ''y4'').
 
 
As example you can watch the Opening Pans of [http://www.youtube.com/watch?v=mzoAG74R5f4 Haunted Woods] and [http://www.youtube.com/watch?v=en0T6pqKiag Kalimari Desert], which Cameras are made by [[User:Wiimm|Wiimm]].
 
  
 
=== Cameras while replays and after Race ===
 
=== Cameras while replays and after Race ===
Now we come to the Cameras after Race. There you need knowledge about CAME Types and AREA.
+
Now we come to the afterrace Cameras. Here you will need knowledge about CAME Types and AREA. It is all explained here what they are and how to use them.
  
 
==== AREA ====
 
==== AREA ====
Line 89: Line 89:
 
(for other AREA infos go to [[KMP_(File_Format)#AREA|AREA]] and [[Cameras/Reference]])
 
(for other AREA infos go to [[KMP_(File_Format)#AREA|AREA]] and [[Cameras/Reference]])
  
AREA with Type ''Camera 00'' are the acctivators for the CAMEs '''after''' the race. If you drive in the near of one AREA after the race, it will acctivate the CAME that is written in the Settings (watch at the pics). The other AREA types are unimportant. Don't change it!<br>
+
Important for the afterrace Cameras are AREA with Type ''Camera 00'' which are the acctivators for the CAMEs '''after''' the race. If you drive in the near of one AREA after the race, it will acctivate the CAME that is written in the Settings (watch at the pics). The other AREA types are unimportant. '''Don't change it!'''<br>
Drag the first AREA to a point in the near of the Stage. And then do it with all other AREAs. Make sure that there are in the right order. It's easier for CAME Editting.
+
Drag the first AREA to a point in the near of the Stage. Do it with all other AREAs. Make sure that there are in the right order. It will be  easier for CAME Editting.
  
 
==== CAME ====
 
==== CAME ====
Line 106: Line 106:
 
Camera Types 00, 01 and 03 can be used without any routes (Route IDs=FF). Camera Type 02 and 06 need Routes. All these have ''x3'' and ''y3''
 
Camera Types 00, 01 and 03 can be used without any routes (Route IDs=FF). Camera Type 02 and 06 need Routes. All these have ''x3'' and ''y3''
 
values. If you drive while a replay or after a race in the near of one AREA it will activates the CAME, which is written in the Settings. The Type defines how the Camera is watching at the person:
 
values. If you drive while a replay or after a race in the near of one AREA it will activates the CAME, which is written in the Settings. The Type defines how the Camera is watching at the person:
*''PathSearch'' activates the Route that is written in the Settings. The Route is the Camera that looks at you.
+
*''PathSearch'' activates the Route that is written in the Settings. The Camera follows the Route and looks at you.
*''OP_PathMoveAt'' activates the Route like ''PathSearch''. But it'll swing around you. Very difficult to controll!
+
*''OP_PathMoveAt'' activates the Route like ''PathSearch''. But it'll swing around you. It is very difficult to edit and controll!
 
*''ObjClip'' stays in one position and looks at you.
 
*''ObjClip'' stays in one position and looks at you.
 
*''KartFollow'' is a Camera that follows you all the time. It needs after the Settings ''x3'' and ''y3'' the values from ''z3'' to ''x5''
 
*''KartFollow'' is a Camera that follows you all the time. It needs after the Settings ''x3'' and ''y3'' the values from ''z3'' to ''x5''
*''Camera immediately after finishing'' is a Camera that follows you all the time. It needs after the Settings ''x3'' and ''y3'' the values from ''z3'' to ''x5''.<br>
+
*''Camera immediately after finishing'' is a Camera that follows you all the time, if you gone through the finishline, until you drove in the near of one AREA. It needs after the Settings ''x3'' and ''y3'' the values from ''z3'' to ''x5''.<br>
Finally, you only have to drag the Cameras with type ''01'', because all other search routes or watch directly to the person.
+
Finally, you only have to drag the Cameras with type ''01'' and the Routes for Cameratypes ''02'' and ''06''.
  
 
{{Camera Links}}
 
{{Camera Links}}

Revision as of 10:55, 23 December 2011

Introduction

Improperly configured camera settings can cause game crashes during opening pans, replays and post-match winning laps. Back up your KMP before you start editing.
Good cameras will make your level look much more professional, but editing them can be difficult to master. It's very difficult to make Cameras. Wiimm's SZS Tools will make the Camera Editting easier because all values that you need are noted here.
In editting Cameras you need some knowledge about calculating in Hex. So if you have no knowledge about it, it will be more difficult to understand. Follow these steps and you will learn how to do it.
Before editting Cameras have a look at this list. You will need to learn some values for making a good Camera faster:

CAME entry data structure (0x48 bytes)
Offset Type Description Box name in
SZS Modifier
Names in
Wiimms Tools
Column name in
KMP Modifier
Box name in
KMP Cloud
0x00 Byte Camera type. Settings
(box 1, first 2 digits)
type Type Type
0x01 Byte Next camera entry index. Value 0xFF means: no next camera. Settings
(box 1, second 2 digits)
next Next Next
0x02 Byte Camshake. Exact meanings unknown (always 0). Settings
(box 1, third 2 digits)
unknown Shake Shake
0x03 Byte Route used by the camera. This is index link into the POTI section. The value 0xFF means "no route". Settings
(box 1, last 2 digits)
route Route Route
0x04 UInt16 Velocity of the camera point in units per 100/60 sec (=distance/1.67 sec). Settings
(box 2, first 4 digits)
v(came) V(Cam) Pointspeed
0x06 UInt16 Velocity of zooming in units per 100/60 sec (=units/1.67 sec) (tested with camera type 5). Settings
(box 2, last 4 digits)
v(zoom) V(Zoom) Zoomspeed
0x08 UInt16 Velocity of the view point in distance per 100/60 sec (=distance/1.67 sec) (tested with camera type 5). Settings
(box 3, first 4 digits)
v(v.pt) V(View) Viewspeed
0x0A Byte Start flag. Exact meanings unknown. Settings
(box 3, third 2 digits)
unknown Flag
(First 2 digits)
Start
0x0B Byte Movie flag. Exact meanings unknown. Settings
(box 3, last 2 digits)
unknown Flag
(Second 2 digits)
Movie
0x0C Float[3] A 3D position vector of the camera. X, Y and Z position (x,y,z) X, Y and Z PositionX, PositionY and PositionZ
0x18 Float[3] A rotation 3D vector. Almost always 0,0,0. X2, Y2 and Z2 rotation (x,y,z) Roll, Yaw and Pitch RotationX, RotationY and RotationZ
0x24 Float Zoom start: The angle of view (field of view). Angles >180 create curious effects. X3 zoom beg Zoom Zoomstart
0x28 Float Zoom end. The camera changes the zoom to this value. Offset 0x06 (Velocity) controls the speed of zooming. Y3 zoom end Zoom2 Zoomend.
0x2C Float[3] Start vector of the view point (camera type 5) or the relative camera position (camera type 3). Z3, X4 and Y4 view point beg (x,y,z) View(x), View(y) and View(z) ViewStartX, ViewStartY and ViewStartZ
0x38 Float[3] (Destination) vector of the view point. Z4, X5 and Y5 view point end (x,y,z) View2(x), View2(y) and View2(z) ViewEndX, ViewEndY and ViewEndZ
0x44 Float The time how long this Camera is active. (in units of 1/60 seconds). Z5 sec*60 Time Time

I advise you to learn editting Cameras with Wiimms SZS Tools and then use SZS Modifier.

Camera Editing/Step by Step guide

Cameras can be placed like any normal object. The position only matters when using certain camera settings. Cameras are found in the CAME section of the KMP Editor.
Setting a route that belongs to a camera and a objects can often cause a freeze. Be sure that you only use one Routes for a object or the camera.

Opening Pans

On VS races a sequence of cameras is shown. The exact time of the complete Opening Pan is 12,8s. It is splited in 3 sections with 3,6s, 4,3s and 4,9s (values 220, 257 and 294 found in all Nintendo Tracks).
The u8 value at offset 0x06 in the CAME section header is the index of the first camera. The next cameras are linked by the u8 value at offset 0x01. Normally 3 cameras are used, but any number can be used.

1000px

The first two digits in the first settings box indicate the type of camera. Opening pans have the setting 05. The length of time each camera is displayed is set in z5. Their values will be 220, 257 and 294; this is to synch the camera transitions with the opening music. You can change it to any other value.
If you found these 3 Cameras, we come to editting them.

File:CAME2 LuigiM.png

The last two numbers in the first settings box control the Route used. A value of FF means the camera does not use a route. You can find the Opening Route Sections so:

As example in the pic I used SNES Ghost Valley 2. Take the first CAME with the z5 as 220, here it is CAME ID 11. Take the Route Settings, here it is "0D", or only D.

And now use Hex Calculator: D+1=E
Now convert it to Decimal: E=14
Finally: The first Opening Route Section is Route Section 14.
This is the same prinzip like the Objects choose their Routes.

Do this with the other two values and you know which Routes you have to use for your Opening Pans.

After you found, which Routes are used for this cameras, go to these and drag them like you want it. One option is draging them in the near of special objects or some buildings you made in your Custom Track for making a short review. The Camera will move along this route. It is advisable to drag the last Opening Camera Route to the Startline. Also you can change your Routes:
Search after the Route Section, where the Camera should move, as example Route Section 18.
Convert the Decimal number to Hex: 18=12
Then subtract it with 1 on Hex Calculator: 12-1=11

And now write down this number in the Route Setting Box where the Route IDs are.
For testing your Opening Pans it is good to link the last Opening Camera to the first to have an unlimited view. It sounds difficult but with one progress you made it. It's pretty simple.

File:CAME5 LuigiM.png

This Settings are the next Camera in Hex, so. CAME 11 has the the next CAME 12 (Convert Hex to Decimal; 0C=12), The CAME 12 has next CAME 13 and CAME 13 has none(=FF). Change the FF to the Hex digit of the first CAME. Example:
The first Camera is CAME 11 so Convert the 11 to Hex: 11=0B
So I change the FF to 0B and now the Cameras are looped. You see; it's pretty simple.

This was found out by Wiimm. For his analysis go to Wiimms Opening Pan Analysis.

File:CAME4 LuigiM.png

Now we define the points where the Cameras watch. The Start View Point shows where the Camera watch at the begin and the End View Point at the end of the Camera Intros. x3 and y3 controlls the zoom, which is not used in Opening Pans, so you can ignore it.
This is how to do:
First you search an object or a place, where your camera should look. Then you take the x, y and z values and take it to the z3, x4 and y4 values (x to z3; y to x4; z to y4).

Cameras while replays and after Race

Now we come to the afterrace Cameras. Here you will need knowledge about CAME Types and AREA. It is all explained here what they are and how to use them.

AREA

First I come to AREA.

File:AREA-LuigiM.png
File:AREA LuigiM 2.png

	menu      AREAtype  7
	item      Camera  0
	item      ObjClip  1
	item      EfControl  2
	item      FogControl  3
	item      PullControl  4
	item      EnemyFall  5
	item      2DmapArea  6

The list of the types can be found in the XML file /Race/Course/koopa_course.szs/course.0
(for other AREA infos go to AREA and Cameras/Reference)

Important for the afterrace Cameras are AREA with Type Camera 00 which are the acctivators for the CAMEs after the race. If you drive in the near of one AREA after the race, it will acctivate the CAME that is written in the Settings (watch at the pics). The other AREA types are unimportant. Don't change it!
Drag the first AREA to a point in the near of the Stage. Do it with all other AREAs. Make sure that there are in the right order. It will be easier for CAME Editting.

CAME

File:CAME3 LuigiM.png

Cameras after Race have some diffrent types:

  • 00 = Camera immediately after finishing (the one that looks at you.)
  • 01 = ObjClip: Stays in one position but always points to the player. Used during replays.
  • 02 = PathSearch
  • 03 = KartFollow
  • 06 = OP_PathMoveAt

(for all other types go to CAME and Cameras/Reference)

Camera Types 00, 01 and 03 can be used without any routes (Route IDs=FF). Camera Type 02 and 06 need Routes. All these have x3 and y3 values. If you drive while a replay or after a race in the near of one AREA it will activates the CAME, which is written in the Settings. The Type defines how the Camera is watching at the person:

  • PathSearch activates the Route that is written in the Settings. The Camera follows the Route and looks at you.
  • OP_PathMoveAt activates the Route like PathSearch. But it'll swing around you. It is very difficult to edit and controll!
  • ObjClip stays in one position and looks at you.
  • KartFollow is a Camera that follows you all the time. It needs after the Settings x3 and y3 the values from z3 to x5
  • Camera immediately after finishing is a Camera that follows you all the time, if you gone through the finishline, until you drove in the near of one AREA. It needs after the Settings x3 and y3 the values from z3 to x5.

Finally, you only have to drag the Cameras with type 01 and the Routes for Cameratypes 02 and 06.

Camera related articles

»Camera«
Technical information, includes an analysis.
»KMP«
File, where the camera setup is hold.
»KMP Editing/Cameras«
A KMP and camera tutorial.
»Wiimms SZS Tools/KMP«
How to edit KMP files using Wiimms SZS Tools.

Links