Cameras
This page is in progress and may contain incomplete information or editor's notes. |
---|
The Galaxy games use cameras to create a good view of the game's 3D scene. There are many different types to fulfill this purpose, all of which are detailed on this page. Each stage (galaxies, zones, ...) comes with a file that specifies all the camera setups to be used. The format of these files is specified below.
Contents
Contexts
Cameras are used in a lot of different contexts and may be triggered through various means, including:
- Camera areas (CameraArea, CubeCameraBox, etc.) once they are entered. More information below.
- Spawn points (Mario entries in a zone's StartInfo file) once the player respawns there. More information below.
- Warp Pipes once they are entered or left.
- When the player rides Launch Stars or Sling Stars.
- When the player swims underwater or on the water's surface.
- When the player uses the Flying Power-Up.
- While talking to an NPC.
- Various objects and enemies use special cameras, such as SimpleDemoExecutor, JumpBeamer, Poihana and BegomanSpring.
- Cutscenes use various cameras to change the view.
BCAM Format
All camera parameters for a zone (and some objects) are stored in a special BCSV file called CameraParam.bcam. For zones, the file is located in Stage/camera of a Map archive. Not all files will contain all known camera fields in order to save some space. These optional fields are only added when necessary. The following table lists all fields, their default values, data type and whether they are always present or not.
Field | Type | Default value | Required? |
---|---|---|---|
version | LONG | 196630 (SMG1) 196631 (SMG2) |
✓ |
camtype | STRING_OFFSET | (empty string) | ✓ |
id | STRING_OFFSET | (empty string) | ✓ |
angleB | FLOAT | 0.0 | ✓ |
angleA | FLOAT | 0.0 | ✓ |
dist | FLOAT | 0.0 | ✓ |
vpanaxis.X | FLOAT | 0.0 | ✓ |
vpanaxis.Y | FLOAT | 1.0 | ✓ |
vpanaxis.Z | FLOAT | 0.0 | ✓ |
vpanuse | LONG | 1 | ✓ |
udown | LONG | 120 | ✓ |
pushdelaylow | LONG | 120 | ✓ |
pushdelay | LONG | 120 | ✓ |
lplay | FLOAT | 800.0 | ✓ |
uplay | FLOAT | 300.0 | ✓ |
gndint | LONG | 160 | ✓ |
lower | FLOAT | 0.1 | ✓ |
upper | FLOAT | 0.3 | ✓ |
camint | LONG | 120 | ✓ |
fovy | FLOAT | 45.0 | ✓ |
roll | FLOAT | 0.0 | ✓ |
loffsetv | FLOAT | 0.0 | ✓ |
loffset | FLOAT | 0.0 | ✓ |
woffset.X | FLOAT | 0.0 | ✓ |
woffset.Y | FLOAT | 300.0 | ✓ |
woffset.Z | FLOAT | 0.0 | ✓ |
num1 | LONG | 0 | ✗ |
num2 | LONG | 0 | ✗ |
string | STRING_OFFSET | (empty string) | ✗ |
axis.X | FLOAT | 0.0 | ✗ |
axis.Y | FLOAT | 0.0 | ✗ |
axis.Z | FLOAT | 0.0 | ✗ |
up.X | FLOAT | 0.0 | ✗ |
up.Y | FLOAT | 1.0 | ✗ |
up.Z | FLOAT | 0.0 | ✗ |
wpoint.X | FLOAT | 0.0 | ✗ |
wpoint.Y | FLOAT | 0.0 | ✗ |
wpoint.Z | FLOAT | 0.0 | ✗ |
flag.noreset | LONG | 0 | ✗ |
flag.nofovy | LONG | 0 | ✗ |
flag.lofserpoff | LONG | 0 | ✗ |
flag.antibluroff | LONG | 0 | ✗ |
flag.collisionoff | LONG | 0 | ✗ |
flag.subjectiveoff | LONG | 0 | ✗ |
gflag.thru | LONG | 0 | ✓ |
gflag.enableEndErpFrame | LONG | 0 | ✗ |
gflag.camendint | LONG | 0 | ✗ |
eflag.enableErpFrame | LONG | 0 | ✗ |
eflag.enableEndErpFrame | LONG | 0 | ✗ |
camendint | LONG | 0 | ✗ |
evfrm | LONG | 0 | ✗ |
evpriority | LONG | 0 | ✗ |
Camera ID Names
The id field of a camera parameter entry is a special ID name that specifies the camera's usage context. Every entry should have a unique ID name.
Default Cameras
ID Name | Description |
---|---|
o:デフォルトカメラ | Default camera to be used if no other camera is active or available. |
o:デフォルト水中カメラ | Default camera to be used when the player is swimming underwater. |
o:デフォルト水面カメラ | Default camera to be used when the player is swimming on water surface. |
o:デフォルトフーファイターカメラ | Camera to be used when the player is using the Flying Power-Up. |
o:ズームカメラ | The first person's view camera. |
Camera Areas
As the name suggests, camera areas (CameraArea, CubeCameraBox, ...) activate a camera once the player stays inside the area. If multiple camera areas interesect, the area with the highest priority (Obj_arg2) will be selected. The camera area's Obj_arg0 value specifies the ID number of the camera to be used. Using this value, the game generates an identifier string using the printf format string c:%04x. For example, if your camera area has an Obj_arg2 of 15, the corresponding camera ID name would be c:000f. The hexadecimal digits have to be lowercase!
Starting Cameras
Every player spawn point (Mario entries in a zone's StartInfo) can activate a camera once the player respawns there. Just like camera areas, the game constructs an identifier string from the spawn point's CameraSetId which will be used to locate the parameters for the camera. The printf format string is s:%04x. For example, if your Mario entry has a CameraSetId of 60, the corresponding camera ID name would be s:003c. The hexadecimal digits have to be lowercase! If the CameraSetId is negative, no camera will be used.
Event Cameras
Group Cameras
Camera Classes
There are many fine-tuned camera classes to choose from. The camtype field of a camera entry specifies what class to use. The available classes in the Galaxy games are:
Identifier | Japanese Name | Class Name | Used in SMG1? | Used in SMG2? | Description | Parameters |
---|---|---|---|---|---|---|
CAM_TYPE_XZ_PARA | 並行 | CameraParallel | ✓ | ✓ | This camera moves parallel to Mario's position using fixed angles and distance. |
|
CAM_TYPE_WONDER_PLANET | プラネット | CameraWonderPlanet | ✓ | ✓ |
| |
CAM_TYPE_TOWER | 塔 | CameraTower | ✓ | ✓ | This camera is focused at a set coordinate and rotates around this point based on Mario's position. |
|
CAM_TYPE_TOWER_POS | 塔(サブターゲット付き) | CameraTowerPos | ✓ | ✓ |
| |
CAM_TYPE_INWARD_TOWER | 塔内部 | CameraInwardTower | ✓ | ✗ |
| |
CAM_TYPE_INWARD_SPHERE | 球内部 | CameraInwardSphere | ✓ | ✗ |
| |
CAM_TYPE_POINT_FIX | 完全固定 | CameraFix | ✓ | ✓ |
| |
CAM_TYPE_EYEPOS_FIX | 定点 | CameraFixedPoint | ✓ | ✓ |
| |
CAM_TYPE_EYEPOS_FIX_THERE | その場定点 | CameraFixedThere | ✓ | ✓ | Stops the camera in the position of the last camera used and focuses on Mario. Mostly used for the landing sequence of flying stars. |
|
CAM_TYPE_TRUNDLE | トランドル | CameraTrundle | ✓ | ✓ |
| |
CAM_TYPE_SPHERE_TRUNDLE | 球トランドル | CameraSphereTrundle | n/a | ✓ | ? | |
CAM_TYPE_INNER_CYLINDER | 円筒内部 | CameraInnerCylinder | ✓ | ✗ |
| |
CAM_TYPE_CUBE_PLANET | キューブ惑星 | CameraCubePlanet | ✓ | ✓ | Variant of camera type follow in which the camera rotates along based on Mario's current gravitational frame. |
|
CAM_TYPE_CHARMED_FIX | サンボ | CameraCharmedFix | ✓ | ✓ |
| |
CAM_TYPE_CHARMED_VECREG | ベクトルレジスタ注目 | CameraCharmedVecReg | ✓ | ✓ |
| |
CAM_TYPE_CHARMED_VECREG_TOWER | VecReg角度補正塔カメラ | CameraCharmedVecRegTower | ✓ | ✓ |
| |
CAM_TYPE_MEDIAN_PLANET | 中点注目プラネット | CameraMedianPlanet | ✓ | ✓ |
| |
CAM_TYPE_MEDIAN_TOWER | 中点塔カメラ | CameraMedianTower | ✓ | ✓ |
| |
CAM_TYPE_FOLLOW | フォロー | CameraFollow | ✓ | ✓ |
| |
CAM_TYPE_RACE_FOLLOW | レース用フォロー | CameraRaceFollow | ✓ | ✓ |
| |
CAM_TYPE_WATER_FOLLOW | 水中フォロー | CameraWaterFollow | ✓ | ✓ |
| |
CAM_TYPE_WATER_PLANET | 水中プラネット | CameraWaterPlanet | ✓ | ✓ |
| |
CAM_TYPE_WATER_PLANET_BOSS | 水中プラネットボス | CameraWaterPlanetBoss | ✓ | ✗ |
| |
CAM_TYPE_TRIPOD_PLANET | 三脚惑星 | CameraTripodPlanet | ✓ | ✓ |
| |
CAM_TYPE_TRIPOD_BOSS | 三脚ボス | CameraTripodBoss | ✗ | n/a |
| |
CAM_TYPE_TRIPOD_BOSS_JOINT | 三脚ボスジョイント | CameraTripodBossJoint | ✓ | n/a |
| |
CAM_TYPE_CHARMED_TRIPOD_BOSS | 三脚ボスジョイント注視 | CameraCharmedTripodBoss | ✓ | n/a |
| |
CAM_TYPE_FOO_FIGHTER | フーファイター | CameraFooFighter | ✓ | ✗ |
| |
CAM_TYPE_FOO_FIGHTER_PLANET | フーファイタープラネット | CameraFooFighterPlanet | ✓ | ✗ |
| |
CAM_TYPE_RAIL_WATCH | レール注目 | CameraRailWatch | ✓ | ✓ |
| |
CAM_TYPE_RAIL_DEMO | レールデモ | CameraRailDemo | ✗ | ✗ |
| |
CAM_TYPE_RAIL_FOLLOW | レールフォロー | CameraRailFollow | ✓ | ✗ |
| |
CAM_TYPE_OBJ_PARALLEL | オブジェ並行 | CameraObjParallel | ✓ | ✓ |
| |
CAM_TYPE_MTXREG_PARALLEL | マトリクスレジスタ並行 | CameraMtxRegParallel | ✓ | ✓ |
| |
CAM_TYPE_SLIDER | スライダー | CameraBehind | ✗ | ✗ |
| |
CAM_TYPE_2D_SLIDE | 2Dスライド | CameraSlide | ✓ | ✓ |
| |
CAM_TYPE_GROUND | 地面 | CameraGround | ✓ | ✗ |
| |
CAM_TYPE_SPIRAL_DEMO | 螺旋デモ | CameraSpiral | ✓ | ✓ |
| |
CAM_TYPE_TWISTED_PASSAGE | ねじれ回廊 | CameraTwistedPassage | ✓ | ✗ |
| |
CAM_TYPE_FRONT_AND_BACK | 表裏カメラ | CameraFrontAndBack | ✓ | ✓ |
| |
CAM_TYPE_FREEZE | その場完全固定 | CameraFreeze | n/a | ✓ | Stops and freezes the camera completely based on the last camera position and rotation. | ? |
CAM_TYPE_TALK | 会話 | CameraTalk | ✗ | ✗ |
| |
CAM_TYPE_ANIM | アニメ | CameraAnim | ✗ | ✗ |
| |
CAM_TYPE_DEAD | 通常死亡 | CameraDead | ✗ | ✗ |
| |
CAM_TYPE_BLACK_HOLE | ブラックホール | CameraBlackHole | ✗ | ✗ |
| |
CAM_TYPE_DPD | DPD | CameraDPD | ✗ | ✗ |
| |
CAM_TYPE_SUBJECTIVE | 主観 | CameraSubjective | ✗ | ✗ | n/a |
Aliases
Likely for the purpose of preserving compatibility with test camera files, the developers added aliases for some camera classes. These exist in both Galaxy games. However, these aliases only apply if the camera version is greater or equal to the required version. Interestingly, it also contains an alias for CAM_TYPE_BOSS_DONKETSU, a camera class that has been removed from the actual game.
Alias Name | Actual Name | Required Version |
---|---|---|
CAM_TYPE_DONKETSU_TEST | CAM_TYPE_BOSS_DONKETSU | 196612 |
CAM_TYPE_BEHIND_DEBUG | CAM_TYPE_SLIDER | 196614 |
CAM_TYPE_INWARD_TOWER_TEST | CAM_TYPE_INWARD_TOWER | 196614 |
CAM_TYPE_EYE_FIXED_THERE_TEST | CAM_TYPE_EYEPOS_FIX_THERE | 196614 |
CAM_TYPE_ICECUBE_PLANET | CAM_TYPE_CUBE_PLANET | 196617 |
Common Properties
Property | Description |
---|---|
General | |
version | Camera engine version. Usually 196630 in Super Mario Galaxy 1 and 196631 in Super Mario Galaxy 2. |
camtype | Class identifier name. See the tables above for possible values. |
id | The camera's identifier name. See the respective section for more details. |
woffset.X woffset.Y woffset.Z |
|
loffset | |
loffsetv | |
roll | |
fovy | The field of view angle in degrees. |
camint | |
upper | |
lower | |
gndint | |
uplay | |
lplay | |
pushdelay | |
pushdelaylow | |
udown | |
vpanuse | |
vpanaxis.X vpanaxis.Y vpanaxis.Z |
|
flag.noreset | |
flag.nofovy | |
flag.lofserpoff | |
flag.antibluroff | |
flag.collisionoff | Disables collision with map geometry if enabled. This means that the camera will move through collision if necessary. |
flag.subjectiveoff | Disables the first-person camera if enabled. |
Game | |
gflag.thru | |
gflag.enableEndErpFrame | |
gflag.camendint | |
Event | |
eflag.enableErpFrame | |
eflag.enableEndErpFrame | |
camendint | |
evfrm | |
evpriority |
Trivia
- The oldest available camera version is 196617 and can be found in HellLavaFloatingZone.
- The function CameraParamChunk::load references a removed camera class labeled as CAM_TYPE_PLANET.
- Intro cameras dynamically create a CAM_TYPE_ANIM camera with the ID o:スタートアニメカメラ. It is not possible to overwrite this in a BCAM file.