Allow custom FPS values for each GameSpeed index#2092
Allow custom FPS values for each GameSpeed index#209211EJDE11 wants to merge 4 commits intoPhobos-developers:developfrom
Conversation
|
Nightly build for this pull request:
This comment is automatic and is meant to allow guests to get latest nightly builds for this pull request without registering. It is updated on every successful build. |
|
...did you just make teh game be able to run on any FPS online? |
|
Yeah. I got up to 140fps LAN. |
src/Misc/Hooks.Gamespeed.cpp
Outdated
| struct NFTTimerStruct | ||
| { | ||
| if (Phobos::Misc::CustomGS && SessionClass::IsSingleplayer()) | ||
| FrameTimer.TimeLeft = GameOptionsClass::Instance.GameSpeed; | ||
| return 0; | ||
| } | ||
| DWORD StartTime; | ||
| DWORD CurrentTime; | ||
| int TimeLeft; | ||
| }; | ||
| DEFINE_REFERENCE(NFTTimerStruct, NFTTimer, 0x887328); | ||
|
|
||
| // note: currently vanilla code, doesn't do anything, changing PrecalcDesiredFrameRate doesn't effect anything either | ||
| /* | ||
| void SetNetworkFrameRate() | ||
| struct FrameTimerStruct | ||
| { | ||
| DEFINE_REFERENCE(int, PrecalcDesiredFrameRate, 0xA8B550u) | ||
| switch (GameOptionsClass::Instance.GameSpeed) | ||
| DWORD StartTime; | ||
| DWORD CurrentTime; | ||
| int DelayTime; | ||
| }; | ||
| DEFINE_REFERENCE(FrameTimerStruct, GameFrameTimer, 0x887348); |
There was a problem hiding this comment.
I think those may already exist in YRpp? There's some confusion with them there, maybe @ZivDero could help.
There was a problem hiding this comment.
I'm not seeing them there. There's Timer.h but that looks more like something you'd create rather than use when accessing existing ones?
There was a problem hiding this comment.
I think those may already exist in YRpp? There's some confusion with them there, maybe @ZivDero could help.
Well the structs at least exist at
https://github.com/Phobos-developers/YRpp/blob/7a43c8bc7872d81c27ce470a4f0bf4d1c3a8e224/Timer.h
There was a problem hiding this comment.
The addresses don't seem to show up in YRpp so they're probably not in; Should be added there instead.
Their names are FrameTimer (from RA) and the other one we called NetworkFrameTimer.
CDTimerClass<SystemTimerClass> FrameTimer;
CDTimerClass<MillisecondSystemTimerClass> NetworkFrameTimer;
CDTimerClass is what YRpp calls TimerStruct. SystemTimerClass is just SystemTimer.
MillisecondSystemTimerClass however is not present in YRpp it seems, and it is not the same as SystemTimerClass or MillisecondTimerClass.
I would provide the address but IDA isn't cooperating...
There was a problem hiding this comment.
Starting at 5D5870, ctor, dtor, operator(), operator long
There was a problem hiding this comment.
Thanks, Ziv. Can you please check Phobos-developers/YRpp#59
docs/Miscellanous.md
Outdated
|
|
||
| Results (remember to replace N with your game speed number!): | ||
| - Each of the 7 game speed slider positions (GameSpeed 0-6) can have a custom target FPS set independently. A value of `0` keeps that position at its vanilla FPS. | ||
| - Works in skirmish, campaign, and multiplayer. |
There was a problem hiding this comment.
I think we should spell out explicitly that they will be unified now, so that the modders must disable the different game speed scales in client now.
| In `rulesmd.ini`: | ||
| ```ini | ||
| [General] | ||
| CustomGS=false ; boolean | ||
| CustomGSN.ChangeInterval=-1 ; integer >= 1 | ||
| CustomGSN.ChangeDelay=N ; integer between 0 and 6 | ||
| CustomGSN.DefaultDelay=N ; integer between 0 and 6 | ||
| ; where N = 0, 1, 2, 3, 4, 5, 6 | ||
| ``` |
There was a problem hiding this comment.
should add migration entries to docs and the migration script (see FIXME entries)
There was a problem hiding this comment.
Sorry, not seeing any FIXME?
There was a problem hiding this comment.
Ctrl+F in migration script (see Phobos Supplementaries repo)
There was a problem hiding this comment.
LOL I love it! |
|
I speculate NFT is for NetworkFrameTimer btw |
Update comments Update docs
CustomGS inikeysEnableCustomFPSandCustomGameSpeedFPSAdd to
RulesMD.iniThis PR allows for custom FPS values for each of the
GameSpeedindices. Applies to Campaign, Skirmish, and Multiplayer.For multiplayer we hook into
Queue_AI_Multiplayerto override the hardcoded 60fps cap, and override theGameSpeedindex to fps calculation.For Skirmish and Campaign, we hook in main loop to set up the
NFTTimerthat is used in multiplayer. We then hook intoSyncDelayand force skirmish/campaign down the multiplayer path instead.