![]() |
|
![]() |
Tweaking Movement
This tutorial will help you create your own movement system for Aliens versus Predator. Some people think the original Aliens versus Predator was too fast, with lightning fast aliens and marines running faster than the best athlete in the world.
The movement speeds are counted in millimeter per second (mm/s) and are divided into several parts: jumping, strafing, forward/backward and walking/running. Several factors can be made to decrease or increase the movement speed of a species.
Let's begin!
Tutorial written by Eldritch, © 2001
- Open file Pmove.c and locate the line #define ALIEN_MOVESCALE 18000. This line defines the forward/backward/strafing speed of the Alien species. Its default value is 18000 mm/s, which is 18 m/s (pretty fast, but Rebellion's levels are designed for this kind of lightning speed).
Change the #define x_MOVESCALE yy (x is either MARINE, ALIEN or PREDATOR; y is a number) lines to whatever you want, but keep in mind that it is counted in millimeters per second.
Next, the line #define TURNSCALE 2000 defines the speed in which all species turn around. 2000 is the default value and a good one too.
The line #define JUMPVELOCITY 9000 indicates the amount of millimeters one can jump. The faster you're running, the more this value will increase. Jumping with a running start will take you longer than not running.
The other values have no known function, but feel free to tweak them as you please.
- Now that we've set the base speed for all species, we can take a look at the encumburance of weapons. Default, all weapons weigh the same and cause the same amount of movement loss. Some people might want to have their heavy weapons cause serious slowdown while their lighter weapons cause no slowdown at all.
Open the file Equipmnt.c.
Locate any weapon of your choice (search for WEAPON_xx where xx is the name of the weapon). In that weapon, locate the lines for encumburance (almost at the end). The encumburance looks like this:{ /* Encum_Idle */
7*ONE_FIXED/8, /* MovementMultiple */
7*ONE_FIXED/8, /* TurningMultiple */
7*ONE_FIXED/8, /* JumpingMultiple */
1, /* CanCrouch */
1, /* CanRun */
},
{ /* Encum_FirePrime */
2*ONE_FIXED/3, /* MovementMultiple */
7*ONE_FIXED/8, /* TurningMultiple */
2*ONE_FIXED/3, /* JumpingMultiple */
1, /* CanCrouch */
1, /* CanRun */
},
{ /* Encum_FireSec */
ONE_FIXED/2, /* MovementMultiple */
7*ONE_FIXED/8, /* TurningMultiple */
2*ONE_FIXED/3, /* JumpingMultiple */
1, /* CanCrouch */
1, /* CanRun */
},
There are three sections for encumburance: Encum_Idle, Encum_FirePrime and Encum_FireSec. Their functions should be pretty obvious. Each section is divided into five parts: MovementMultiple (change in forward/backward/strafing speed), TurningMultiple (change in turnscale), Jumpingmultiple (change in jumpvelocity), CanCrouch (can players crouch with this weapon?) and CanRun (can players run with this weapon?).
Default, all xMultiple value are set to 7*ONE_FIXED/8, which means 7*65536/8. 65536, or ONE_FIXED, is the 16-bit designation for the number 1. So in theory, the above calculation could be 7*1/8. This value turns out to be 0.875, thus causing all movement speeds for forward/backward/strafing/turning and jumping to be multiplied by 0.875 (80% roughly estimated).
The 1's set at the CanCrouch and CanRun lines indicate that players can crouch and run with this weapon. Changing the 1's to 0 (zero) would indicate that players cannot crouch/run with the weapon.
For example, if I want my Smartgun to cause heavy slowdown and impair running, I would change it as follows:{ /* Encum_Idle */What did I do now? First, I changed the Encum_Idle (when just holding the weapon) to halve my movement (ONE_FIXED/2 = 50%). I then made it impossible to move while firing the Smartgun. Encum_FirePrime -> MovemenMultiple = 0 (1*0 = 0%). I also made jumping while firing impossible. Encum_FirePrime -> JumpingMultiple = 0 (1*0 = 0%). I changed nothing in the Encum_FireSec part (which is the autotracking-toggle for the Smartgun).
ONE_FIXED/2, /* MovementMultiple */
7*ONE_FIXED/8, /* TurningMultiple */
7*ONE_FIXED/8, /* JumpingMultiple */
1, /* CanCrouch */
0, /* CanRun */
},
{ /* Encum_FirePrime */
0, /* MovementMultiple */
7*ONE_FIXED/8, /* TurningMultiple */
0, /* JumpingMultiple */
1, /* CanCrouch */
0, /* CanRun */
},
{ /* Encum_FireSec */
ONE_FIXED/2, /* MovementMultiple */
7*ONE_FIXED/8, /* TurningMultiple */
2*ONE_FIXED/3, /* JumpingMultiple */
1, /* CanCrouch */
0, /* CanRun */
},
Last, I changed all sections to have a 0 (zero) in the CanRun part. This means I can never run with the Smartgun.
- This is pretty easy. Without going into further details, but mentioning it nontheless, I'd like to mention you can tweak the system to include an external file called movement.txt, making it easy to tweak the values as you please without having to compile the code everytime. Look into the file Pmove.c for this special system.
Other factors can be produced to slow down speed. In the file Pmove.c, in the function ExecuteFreeMovement, you can define whatever you like to decrease/increase speed. One thing already there as a default setting is that the Predator's movement speed is halved when he is backpedaling (moving backwards). Another system is walking speed. All speeds are halved when walking.
Examples of new stuff to add here could be wounds (the less health, the slower you move), special equipment (speed boots, jumping boots, heavy armor, light armor), classes (scouts move fastest while heavy-weapon guys move slowest) etc. It's all up to your imagination and knowledge of the sourcecode.
Good luck!