Page 1 of 1
In-Game Camera Movement Documentation (Server-Sided)
Posted: Tue Sep 06, 2022 10:37 pm
by Woah
WARNING: Playing around with camera values may potentially trigger seizures for people with photosensitive epilepsy. Please use care when discovering camera values.
Hey ya'll,
Have you ever wanted to explore the absolutely wonderful world of the RS camera system? Well today's the day! The camera system is used for many things, such as cutscenes, region viewers (scry/viewing orbs in mini-games), and some item interactions. Below there are drop down menus to find information on that specific camera movement. I will be periodically updating this post with more information/camera types whenever I can.
BASIC INFORMATION
The RS camera system can be manipulated in multiple ways such as:
- Position
- Rotation
- Shake
- Reset
They can even be combined to create custom camera movements!
Reference classes: PlayerCamera.kt, Cutscene.kt, CameraContext.java
POSITION (WIP)
► Show Spoiler
Moves the camera to the given region-local coordinates.
ROTATION (WIP-pics/videos)
► Show Spoiler
Rotates the camera to face the given region-local coordinates.
Client sided values:
Code: Select all
int yaw = inboundBuffer.ig2();
int tracknum = inboundBuffer.g2();
int pitch = inboundBuffer.g2();
yaw = takes values from (0-65535), the yaw rotation of the camera.
tracknum = useless value (interface related)
pitch = takes values from (0-65535), the pitch rotation of the camera.
SHAKE
► Show Spoiler
WARNING: The SHAKE camera values may potentially trigger seizures for people with photosensitive epilepsy. Please use care when experimenting with camera values.
Examples: After looting the barrows chest, some quests, etc...
The shake movement type uses the players current camera to produce fun, and sometimes ill-inducing, effects!
If we take a peak client sided, we can see exactly what values we can use to manipulate this camera:
Code: Select all
int tracknum = inboundBuffer.g2();
int cameraId = inboundBuffer.g1();
int jitter = inboundBuffer.g1();
int amplitude = inboundBuffer.g1();
int frequency = inboundBuffer.g1();
int shake4 = inboundBuffer.g2();
setVerifyId(tracknum);
Camera.customCameraActive[cameraId] = true;
Camera.cameraJitter[cameraId] = jitter;
Camera.cameraAmplitude[cameraId] = amplitude;
Camera.cameraFrequency[cameraId] = frequency;
anIntArray76[cameraId] = shake4;
opcode = -1;
return true;
tracknum = useless value (interface related)
cameraId = takes values from (0-4), which are designated as followed:
Code: Select all
/*
* All camera shake types were found by facing the camera North using
* these values:
* Type [0-4] Jit: 0 Amp: 0 Freq: 128 Speed: 2
*/
enum class CameraShakeTypes {
TRUCK, // (0) camera movement from left to right
PEDESTAL, // (1) camera movement vertically up to down, fixated on one location
DOLLY, // (2) camera movement forwards to backwards
PAN, // (3) camera movement horizontally, fixed on a certain point
TILT // (4) camera movement vertically, fixed on a certain point
}
Imgur gallery containing images/videos about the Camera Shake Types listed above...
*
Credits to Eco-Schools for their awesome power point on camera movements in film.
jitter = takes values from (0-255), the jerkyness of the camera.
amplitude = takes values from (0-255), the vibration/oscillation of the camera.
frequency = takes values from (0-255), the allotted limit of how far the camera can go in a certain direction.
shake4/speed = takes values from (0-65535), the speed at which the camera moves
The shake camera method (will soon be found) can be found in PlayerCamera.kt - method 'shake'
Code: Select all
fun shake(cameraType: Int, jitter: Int, amplitude: Int, frequency: Int, speed: Int){
player ?: return
ctx = CameraContext(player,CameraContext.CameraType.SHAKE,cameraType,jitter,amplitude,frequency,speed)
PacketRepository.send(CameraViewPacket::class.java,ctx)
}
RESET
► Show Spoiler
Resets the camera back to the locked character position.