Skip to content

Commit

Permalink
tr2/input: add TR3+ sidesteps option
Browse files Browse the repository at this point in the history
Resolves #2111.
  • Loading branch information
rr- committed Dec 30, 2024
1 parent bf63297 commit efca8d1
Show file tree
Hide file tree
Showing 9 changed files with 65 additions and 32 deletions.
10 changes: 5 additions & 5 deletions docs/tr1/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,6 @@ Not all options are turned on by default. Refer to `TR1X_ConfigTool.exe` for det
- added ability to look around while running
- added ability to forward and backward jump while looking
- added ability to look up and down while hanging
- added ability to sidestep like in TR3
- added ability to jump-twist and somersault like in TR2+
- added ability to cancel ledge-swinging animation like in TR2+
- added ability to jump at any point while running like in TR2+
Expand All @@ -403,7 +402,7 @@ Not all options are turned on by default. Refer to `TR1X_ConfigTool.exe` for det
- added options to quiet or mute music while underwater
- added a photo mode feature
- added optional automatic key/puzzle inventory item pre-selection
- added the ability for falling pushblocks to kill Lara outright if one lands directly on her
- added ability for falling pushblocks to kill Lara outright if one lands directly on her
- changed weapon pickup behavior when unarmed to set any weapon as the default weapon, not just pistols
- fixed keys and items not working when drawing guns immediately after using them
- fixed counting the secret in The Great Pyramid
Expand Down Expand Up @@ -470,14 +469,15 @@ Not all options are turned on by default. Refer to `TR1X_ConfigTool.exe` for det
- added a cheat to explode Lara like in TR2 and TR3

#### Input
- added ability to sidestep like in TR3
- added ability to hold forward/back to move through menus more quickly
- added ability to move camera around with W,A,S,D
- added ability to unbind unessential keys
- added ability to reset control schemes to default
- added additional custom control schemes
- added the ability to unbind unessential keys
- added the ability to reset control schemes to default
- added customizable controller support
- added an inverted look camera option
- added the ability to move the look camera while targeting an enemy in combat
- added ability to move the look camera while targeting an enemy in combat
- fixed freeze when holding the Action key during end of level
- fixed inability to switch Control keys when shimmying
- fixed setting user keys being very difficult
Expand Down
1 change: 1 addition & 0 deletions docs/tr2/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
- completed decompilation efforts – TR2X.dll is gone, Tomb2.exe no longer needed (#1694)
- added the ability to turn FMVs off (#2110)
- added an option to use PS1 contrast levels, available under F8 (#1646)
- added an option to use TR3+ side steps (#2111)
- added an option to allow disabling the developer console (#2063)
- added an optional fix for the QWOP glitch (#2122)
- added an optional fix for the step glitch, where Lara can be pushed into walls (#2124)
Expand Down
9 changes: 5 additions & 4 deletions docs/tr2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,10 @@ game with new enhancements and features.
- added a cheat to explode Lara like in TR2 and TR3

#### Input
- added ability to sidestep like in TR3
- added ability to hold forward/back to move through menus more quickly
- added additional custom control schemes
- added customizable controller support
- added ability to hold forward/back to move through menus more quickly
- fixed setting user keys being very difficult
- fixed skipping FMVs triggering inventory
- fixed skipping credits working too fast
Expand All @@ -87,9 +88,9 @@ game with new enhancements and features.
- added support for HD FMVs
- added wireframe mode
- added an option for 1-2-3-4× pixel upscaling
- added the ability to use the window border option at all times
- added the ability to toggle between the software/hardware renderer at runtime
- added fade effects to the hardware renderer, and the ability to turn them off
- added ability to use the window border option at all times
- added ability to toggle between the software/hardware renderer at runtime
- added optional fade effects to the hardware renderer
- added text information when changing rendering options at runtime
- changed the hardware renderer to always use 16-bit textures
- changed the software renderer to use the picture's palette for the background pictures
Expand Down
1 change: 1 addition & 0 deletions src/tr2/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ typedef struct {
bool enable_cheats;
bool enable_console;
bool enable_fmv;
bool enable_tr3_sidesteps;
bool enable_auto_item_selection;
int32_t turbo_speed;
} gameplay;
Expand Down
1 change: 1 addition & 0 deletions src/tr2/config_map.def
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ CFG_BOOL(g_Config, gameplay.fix_walk_run_jump, true)
CFG_BOOL(g_Config, gameplay.enable_cheats, false)
CFG_BOOL(g_Config, gameplay.enable_console, true)
CFG_BOOL(g_Config, gameplay.enable_fmv, true)
CFG_BOOL(g_Config, gameplay.enable_tr3_sidesteps, true)
CFG_BOOL(g_Config, gameplay.enable_auto_item_selection, true)
CFG_INT32(g_Config, gameplay.turbo_speed, 0)
CFG_BOOL(g_Config, visuals.enable_3d_pickups, true)
Expand Down
13 changes: 13 additions & 0 deletions src/tr2/game/input.c
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,19 @@ void Input_Update(void)
g_Input.turbo_cheat = 0;
}

if (g_Config.gameplay.enable_tr3_sidesteps) {
if (g_Input.slow && !g_Input.forward && !g_Input.back
&& !g_Input.step_left && !g_Input.step_right) {
if (g_Input.left) {
g_Input.left = 0;
g_Input.step_left = 1;
} else if (g_Input.right) {
g_Input.right = 0;
g_Input.step_right = 1;
}
}
}

g_InputDB = M_GetDebounced(g_Input);

if (Input_IsInListenMode()) {
Expand Down
52 changes: 30 additions & 22 deletions src/tr2/game/lara/state.c
Original file line number Diff line number Diff line change
Expand Up @@ -903,10 +903,12 @@ void Lara_State_SurfSwim(ITEM *item, COLL_INFO *coll)
}

g_Lara.dive_count = 0;
if (g_Input.left) {
item->rot.y -= LARA_SLOW_TURN;
} else if (g_Input.right) {
item->rot.y += LARA_SLOW_TURN;
if (!g_Config.gameplay.enable_tr3_sidesteps || !g_Input.slow) {
if (g_Input.left) {
item->rot.y -= LARA_SLOW_TURN;
} else if (g_Input.right) {
item->rot.y += LARA_SLOW_TURN;
}
}
if (!g_Input.forward || g_Input.jump) {
item->goal_anim_state = LS_SURF_TREAD;
Expand All @@ -923,10 +925,12 @@ void Lara_State_SurfBack(ITEM *item, COLL_INFO *coll)
}

g_Lara.dive_count = 0;
if (g_Input.left) {
item->rot.y -= LARA_SURF_TURN;
} else if (g_Input.right) {
item->rot.y += LARA_SURF_TURN;
if (!g_Config.gameplay.enable_tr3_sidesteps || !g_Input.slow) {
if (g_Input.left) {
item->rot.y -= LARA_SURF_TURN;
} else if (g_Input.right) {
item->rot.y += LARA_SURF_TURN;
}
}
if (!g_Input.back) {
item->goal_anim_state = LS_SURF_TREAD;
Expand All @@ -943,13 +947,15 @@ void Lara_State_SurfLeft(ITEM *item, COLL_INFO *coll)
}

g_Lara.dive_count = 0;
if (g_Input.left) {
item->rot.y -= LARA_SURF_TURN;
} else if (g_Input.right) {
item->rot.y += LARA_SURF_TURN;
}
if (!g_Input.step_left) {
item->goal_anim_state = LS_SURF_TREAD;
if (!g_Config.gameplay.enable_tr3_sidesteps || !g_Input.slow) {
if (g_Input.left) {
item->rot.y -= LARA_SURF_TURN;
} else if (g_Input.right) {
item->rot.y += LARA_SURF_TURN;
}
if (!g_Input.step_left) {
item->goal_anim_state = LS_SURF_TREAD;
}
}
item->fall_speed += 8;
CLAMPG(item->fall_speed, LARA_MAX_SURF_SPEED);
Expand All @@ -963,13 +969,15 @@ void Lara_State_SurfRight(ITEM *item, COLL_INFO *coll)
}

g_Lara.dive_count = 0;
if (g_Input.left) {
item->rot.y -= LARA_SURF_TURN;
} else if (g_Input.right) {
item->rot.y += LARA_SURF_TURN;
}
if (!g_Input.step_right) {
item->goal_anim_state = LS_SURF_TREAD;
if (!g_Config.gameplay.enable_tr3_sidesteps || !g_Input.slow) {
if (g_Input.left) {
item->rot.y -= LARA_SURF_TURN;
} else if (g_Input.right) {
item->rot.y += LARA_SURF_TURN;
}
if (!g_Input.step_right) {
item->goal_anim_state = LS_SURF_TREAD;
}
}
item->fall_speed += 8;
CLAMPG(item->fall_speed, LARA_MAX_SURF_SPEED);
Expand Down
4 changes: 4 additions & 0 deletions tools/tr2/config/TR2X_ConfigTool/Resources/Lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
}
},
"Properties": {
"enable_tr3_sidesteps": {
"Title": "Enhanced sidesteps",
"Description": "Enables TR3+ style sidesteps, e.g. shift+directional arrows. Dedicated sidestep buttons will still work."
},
"enable_3d_pickups": {
"Title": "3D pickups",
"Description": "Enables 3D models to be rendered in place of the sprites for pickup items."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@
"ID": "controls",
"Image": "Graphics/graphic1.jpg",
"Properties": [

{
"Field": "enable_tr3_sidesteps",
"DataType": "Bool",
"DefaultValue": true
}
]
},
{
Expand Down

0 comments on commit efca8d1

Please sign in to comment.