User:Scruffy/Pikmin 2 in First Person Tutorial

From Pikmin Technical Knowledge Base
Jump to navigation Jump to search


This is a tutorial for modding Pikmin 2 into a first person view! If you want to understand what each parameter does, CameraParms is a bit more in-depth. But this will provide values that I used to create a first-person perspective.

You will need a copy of Pikmin 2's files; I use Dolphin to run them. I cannot tell you where to acquire a copy, but if you have Pikmin 2 in Dolphin, right-click its icon and select "Properties." This will bring up an internal menu for the game. Head to the "Files" tab to see a directory of all Pikmin 2's files. Right click and select "Extract All Files," and select a location to extract them. Dolphin should include in that extraction a "boot.dol" or "start.dol" file which can be use to run this edited copy of Pikmin 2.

DISCLAIMER: I have only confirmed this mod and custom textures to work on the GameCube, US version of Pikmin 2. Also, this mod is not for newcomers to the Pikmin series: it is very challenging!

For my video introduction to the concept, look here.

Angle

In your extracted files, go to user > Nishimura > Camera, and you will find 6 camera parameter files. For story and Challenge modes, edit the "caveCameraParms.txt" and "groundCameraParms.txt" files. In each file, there are two identical sets of parameters for the camera angle (in caves or above ground), and then a set of parameters for camera vibration. Only edit the first set of camera parameters and then one value in the vibration settings, that's all you need. The following is an explanation of what to change.

You'll notice as you open the files that values are categorized by camera angle. For example, in groundCameraParms.txt, the first group of parameters is for the Near(Low) angle. That's a near zoom at a low angle. There are eight parameters for each angle, and they're all in the same order. So I'll follow this same order for explaining what to change:

  1. The first parameter (ends in "d") is distance from the leader! This can be negative and the camera will peer out in front of the leader. I found the value -12 to be appropriate.
  2. The second parameter (ends in "a") is the angle of the camera above the horizontal. For most camera settings I kept this at 0°, so the camera looks straight out from the leader. But feel free to try positive or negative angles with different camera settings to adjust your view. Negative numbers cause the camera to look up; positive numbers cause it to look down.
  3. The third parameter (ends in "f") is field of view, or how much of 360° your camera can take in at once. Try a value between 60-65° for normal-looking vision.
  4. The fourth parameter (ends in "o") is vertical offset from the camera's defined position. In order to keep the camera above the ground, try setting this to 20 to offset it slightly above its position.
  5. The fifth parameter (ends in "w") appears to be weighted distribution for the cameras. Don't mess with this value.
  6. The sixth parameter (should end in "t") is how much the camera tries to include all Pikmin in the frame. Since this is first-person, set this to 0.
  7. The seventh parameter (should end in "nc") is the minimum distance from the camera at which objects are drawn. Leave this at 1.
  8. The eighth parameter (should end in "fc") is the maximum distance from the camera at which objects are drawn. You can afford to set this higher than its value; I have gotten away with a draw distance of 6800, but the higher it is, the harder the game will have to work to render everything in the distance.

And repeat for each angle in the block of parameters. The seventh angle, called "ZOOM," has three parameters that are, from top to bottom: distance, angle, and field of view.

Rotation and Vibration

Below all the angles is a group of parameters regarding collision and rotation speed. Collision should be turned off, so that the camera does not move to try to frame the active leader. {clcr}, {clms}, {clmh}, and {clnh} all control collision and can be set to 0 to turn collision off. The other six parameters control rotation speeds for different camera states.

  • {cpmd} Camera acceleration when moving or changing angles: I changed this from from 0.10 to 0.75
  • {cmmt} Rotation speed when the L button is pressed: I kept this at 0.15
  • {cmft} Time L button must be held for the camera to start continuously following the cursor: I changed this from 0.6 to 0.5
  • {cmta} Acceleration while following the cursor: I changed this from 0.005 to 0.5
  • {cmtm} Rotation speed while following the cursor: I changed this from 0.9 to 2.5
  • {cmtb} Deceleration when the L button is released: I changed this from 0.85 to 0.15

Feel free to adjust any of these parameters to fine-tune the first-person angle and rotation. Just always remember to save the changes.

Finally, the very last parameter at the end of file, "Vib Max Distance" in the vibration parameters, should be set to something smaller, like 100. This is to make the camera vibration less violent when a leader gets hurt or something causes the screen to shake.

Textures

If you were to play the game in first-person now, you'd find that the whistle and leader beacons are extremely close to the camera and create distracting or even jarring obstructions on-screen. Fortunately, these are all a collection of textures that can be dimmed using Dolphin's custom texture feature.

Dolphin can extract textures from the game as it loads them, and dump them into a folder in its directory called "Dump." To enable this, look in Dolphin's menu: Graphics>Advanced, and select "Dump Textures." Dolphin dumps textures as it sees them, so expect a lot of textures to show up. Viewing a whistle and a beacon light will dump those textures in the folder "Dump," allowing you to change them. Whatever you do, make sure the names of the images stay the same. This is how Dolphin identifies customized textures. Once you're finished dumping textures, make sure to deselect "Dump Textures."

The textures I had to change were labeled as follows, so look for these names:

  • tex1_8x16_e5f372504d4db646_0
  • tex1_32x64_4d21d8d22dd6e60c_1
  • tex1_64x64_3bdd263d72dd391a_1
  • tex1_64x64_200d5fd506288c26_1
  • tex1_64x64_548fa93e9040d16d_3
  • tex1_64x64_759f88c54c42e3b7_1
  • tex1_64x64_4824f110426f2fdf_1
  • tex1_64x64_134614a492c288a9_1
  • tex1_64x64_ce209901ebb723a8_1

To create custom textures, take these images into an image editing application and decrease their opacity: I went with 10-15% opacity. Then, save the edited textures to a folder called "GPVE01" in the folder "Load" in Dolphin's directory (the same directory that contains the "Dump" folder). If these folders do not exist, create "Load" and create "GPVE01" and save the textures in there. Then in Dolphin's Graphics>Advanced, select "Load Custom Textures." Once you run the game, the whistle and beacon should be greatly dimmed to the point that they aren't distracting, but the radius of the whistle will still be visible so you can see the Pikmin you are whistling!

An alternate idea is to copy the texture names listed above, create a bunch of transparent images with the dimensions listed in the texture names (such as 8x16 pixels, 32x64 pixels, etc.), give them their respective names, and save those in "GPVE01." This saves you having to dump textures, but if you leave them transparent these textures will be completely invisible in game. Not too much of a burden if you don't mind not seeing leader beacons at all.

Issues

Some caveats to consider:

  • The rotation values were determined through trial and error, so feel free to improve upon them.
  • If the camera looks up more than around 6°, the cursor disappears from view. It's still there, but it's very difficult to judge where Pikmin will be thrown when looking up.
  • Audio in the game is very different. Noises behind you are almost inaudible above ground, and below ground they are distorted by the game's reverb. So always check behind you and check your Pikmin counter to make sure your Pikmin are safe!

Version 1.1 I hope to improve this tutorial as I find more information about camera parameters in Pikmin 2.