Skip to content

Commit

Permalink
more experiments with slowing down the player during saving
Browse files Browse the repository at this point in the history
the quicksave function unsets the LevelAction in the same frame, so ProcessMove never sees it, so we check for high DeltaTime too
we could make the quicksave se tthe LevelAction along with some bool to signify that it should be cleared, but this works well too
  • Loading branch information
Die4Ever committed Aug 13, 2024
1 parent 069d791 commit d88a9bb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
3 changes: 2 additions & 1 deletion DXRBalance/DeusEx/Classes/BalancePlayer.uc
Original file line number Diff line number Diff line change
Expand Up @@ -764,7 +764,8 @@ state PlayerWalking
newSpeed *= 0.65;

GroundSpeed = FMax(newSpeed, 100);
if(Level.LevelAction != LEVACT_None) GroundSpeed = 0;
if(Level.LevelAction != LEVACT_None) GroundSpeed = 0;// DXRando: don't move during loading/randomization/autosave
else if(DeltaTime > 0.1) GroundSpeed /= 10 * DeltaTime;// DXRando: anyone running the game at 10fps?

// if we are moving or crouching, we can't lean
// uncomment below line to disallow leaning during crouch
Expand Down
11 changes: 7 additions & 4 deletions DXRModules/DeusEx/Classes/DXRAutosave.uc
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ function NeedSave()
}
if(autosave_combat>0 || !PawnIsInCombat(player())) {
autosave_combat = 1;// we're all in on this autosave because of the player rotation
Level.LevelAction = LEVACT_Saving;// save game cleans this up when it finishes
Level.LevelAction = LEVACT_Saving;
if(!set_player_pos) {
set_player_pos = true;
class'DynamicTeleporter'.static.CheckTeleport(player(), coords_mult);
Expand Down Expand Up @@ -115,7 +115,7 @@ function FixPlayer(optional bool pos)
{
local #var(PlayerPawn) p;

if(set_player_pos) {
/*if(set_player_pos) {
p=player();
if(pos) {
p.SetLocation(player_pos - vect(0,0,16));// a foot lower so you don't raise up
Expand All @@ -124,7 +124,7 @@ function FixPlayer(optional bool pos)
p.ViewRotation = player_rot;
p.Velocity = vect(0,0,0);
p.Acceleration = vect(0,0,0);
}
}*/
}

function Tick(float delta)
Expand All @@ -139,8 +139,10 @@ function Tick(float delta)
}
}
else if(save_timer <= 0) {
if(Level.Game.GameSpeed == 1)// TODO: figure out what's wrong with using old_game_speed instead of 1
if(Level.Game.GameSpeed == 1) {// TODO: figure out what's wrong with using old_game_speed instead of 1
Disable('Tick');
Level.LevelAction = LEVACT_None;
}
FixPlayer(Level.Game.GameSpeed == 1);
SetGameSpeed(1);
} else {
Expand Down Expand Up @@ -227,6 +229,7 @@ function doAutosave()
SetGameSpeed(1);// TODO: figure out what's wrong with using old_game_speed instead of 1
class'DXRStats'.static.IncDataStorageStat(p, "DXRStats_autosaves");
p.SaveGame(saveSlot, saveName);
Level.LevelAction = LEVACT_Saving;
SetGameSpeed(0);

if( interruptedDL != None ) {
Expand Down

1 comment on commit d88a9bb

@Die4Ever
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.