Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sfall: SpeedPatch, LoadGameHook (LoopFlag) #174

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

Janiczek
Copy link
Contributor

@Janiczek Janiczek commented Oct 15, 2022

What?

This PR adds support ✅ for a subset of the sfall Speed patch:

[Speed]
Enable=1
SpeedMultiInitial=300

It doesn't ❌ deal with the keybinding part:

[Speed]
SpeedMulti0=50
SpeedMulti1=100
SpeedMulti2=200
SpeedMulti3=300
SpeedMulti4=400
SpeedMulti5=500
SpeedMulti6=600
SpeedMulti7=700
SpeedMulti8=800
SpeedMulti9=900

[Input]
SpeedModKey=-1
SpeedToggleKey=0

SpeedKey0=0x52
SpeedKey1=0x4f
SpeedKey2=0x50
SpeedKey3=0x51
SpeedKey4=0x4b
SpeedKey5=0x4c
SpeedKey6=0x4d
SpeedKey7=0x00
SpeedKey8=0x00
SpeedKey9=0x00

It also, out of necessity, implements much of the LoadGameHook flag tracking in a new file loop.c. With this we now have an easy way to check whether eg. an inventory screen is open, etc.

Proof of concept

vid.mp4

Approach taken

  • Reimplemented getTicks() to optionally multiply its result
  • To accomodate for the big condition, I implemented large portion of the LoadGameHook sfall module into loop.c

Related links

Possible problems (maybe they are also problems on main, and not caused by this patch?)

  • From my gameplay it seems like critters (like eg. geckos in Toxic Caves) don't move (as in, walk and wander around) as often as in the original game (from my memory). They almost don't move at all. Maybe their movement runs on the original speed somehow? Maybe this is an issue in original+sfall SpeedPatch as well? Seen on main as well
  • Companions seem to only attack if the enemy is in range, they won't walk to them. (With the distance setting at "Charge!") In the end they do move towards the enemies, it's just not always.
  • Steal odds seem way too good (considering my character has 20% on the skill). It still can fail, but it probably should fail more.

src/input.cc Outdated Show resolved Hide resolved
@Janiczek Janiczek marked this pull request as ready for review October 16, 2022 07:01
@Janiczek Janiczek force-pushed the feature/add-sfall-speed-patch branch from 87222f9 to d23c849 Compare October 16, 2022 14:10
src/animation.cc Outdated Show resolved Hide resolved
@Janiczek Janiczek changed the title sfall: Speed patch sfall: SpeedPatch, LoadGameHook (LoopFlag) Oct 18, 2022
@Janiczek Janiczek force-pushed the feature/add-sfall-speed-patch branch 3 times, most recently from 2df2397 to 64ae27f Compare October 18, 2022 21:13
Comment on lines -2066 to -2071
// 0x48FC48
int _do_options()
{
return showOptionsWithInitialKeyCode(-1);
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

A function with this code already exists, see line 462:

// 0x48FC48
 int showOptions()
 {
     return showOptionsWithInitialKeyCode(-1);
 }

Comment on lines +8 to +13
// True if game was started, false when on the main menu
bool mainIsGameLoaded();
void mainSetIsGameLoaded(bool isGameLoaded);

bool mainIsInEndgameSlideshow();
void mainSetIsInEndgameSlideshow(bool isInEndgameSlideshow);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I suppose these could also live in loop.h as extra flags? Depends how much we want to stay close to sfall, I guess. WDYT?

@Janiczek Janiczek force-pushed the feature/add-sfall-speed-patch branch from 64ae27f to 220c30a Compare October 18, 2022 21:20
@phobos2077
Copy link
Contributor

  • Steal odds seem way too good (considering my character has 20% on the skill). It still can fail, but it probably should fail more.

I'm pretty sure steal odds shouldn't be related to speed patch in any way. I've have researched that code last year when working on steal rebalance. It's just regular math and Fallout's RNG.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants