Dolphin, the GameCube and Wii emulator - Forums

Full Version: Major speed-up in some games (Watchdog config patch V3)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
(07-23-2009, 02:58 PM)jedikevin20 Wrote: [ -> ]Some of us are rockin 13 hrs of college credit hours this summer to graduate in 4 weeks. Big Grin

On a totally unrelated note to the above quoted comment, your PSU has beastly efficiency. Smile

EDIT: My my, we are getting VERY Offtopic aren't we? Tongue
(07-23-2009, 02:33 AM)CacoFFF Wrote: [ -> ]On a second thought, it wouldn't be possible the way it is now, let me explain.

The fps counter isn't accurate, SMG for example, remains the same yet the fps counter goes up, until we don't fix the fps counter, or add one counter for each core to see how both cores behave, there is no chance for auto-adjust.
I thought the fps counter was measuring Emulated CPU instead of GPU cycles, but after getting results from other users in games like SMG or Zelda, I really have little idea of what's going on with it.


i had my holidays last weeks so i dont know what happened in the meantime.

so framecounter still not fixed ... we can use cpu cycle counter instead.

that would be even better because it defines the real gamespeed instead of just the fps output.


very nice that you found out how to change watchdog during running game. that was my biggest doubt about making that auto-config working.


i still have to work for my study-project but i think i can spend a few hours for a first implementation this weekend.

but i cant say if it will work good on those build-in-frameskipping-games.
(07-23-2009, 02:09 PM)manaurys Wrote: [ -> ]i cant believe that something like this big was think by someone out of dolphin staff

i think the devs could have easily implemented this but chose not to due to the fact that n00bs ask too many questions because they dont know what they are doing Tongue
(07-23-2009, 04:33 PM)Iulius Wrote: [ -> ]
(07-23-2009, 02:33 AM)CacoFFF Wrote: [ -> ]On a second thought, it wouldn't be possible the way it is now, let me explain.

The fps counter isn't accurate, SMG for example, remains the same yet the fps counter goes up, until we don't fix the fps counter, or add one counter for each core to see how both cores behave, there is no chance for auto-adjust.
I thought the fps counter was measuring Emulated CPU instead of GPU cycles, but after getting results from other users in games like SMG or Zelda, I really have little idea of what's going on with it.


i had my holidays last weeks so i dont know what happened in the meantime.

so framecounter still not fixed ... we can use cpu cycle counter instead.

that would be even better because it defines the real gamespeed instead of just the fps output.


very nice that you found out how to change watchdog during running game. that was my biggest doubt about making that auto-config working.


i still have to work for my study-project but i think i can spend a few hours for a first implementation this weekend.

but i cant say if it will work good on those build-in-frameskipping-games.

For future reference, In SystemTimers.cpp, along with the Watchdog hack, there are other timed functions like device updaters, dsp updaters, etc.
I added an include to ConfigManager for obvious reasons and used the function that executes every frame to update devices, in that same function i found the Action Replay patcher Idea.
I made it check for config change every 60 calls to that function (frames), it will read the config and if only a change is detected, it will reapply the WD timer value.


I have two ideas on how to go on that I would really like to discuss here:
1) We lay our hands on ISOProperties, where the specifig game options are stored, and add an optional WD recommended value, which will be invisible and only set in the ini files, it won't be written from the emulator as well, just to make it remain optional.
I add an extra option in the Main WD config, next to 60, named Reccomended (or something like that).
It will read from the game specific settings and apply that value, if there is no custom WD for that game, it will automatically choose 60.

2) We take a look at where the FPS counters are processed (both overlay and window title ARE DIFFERENT!), and see if we can add a Dual counter for both cores or something like that.
Then we work as Iulius said, making the emulator choose the WD by itself, it has its risks since some games can hang while doing the autoconfig (gotta find a way to make them recover from the hang).

Of course if we follow way one, we can still fix the fps counters.
caco, u should look into becoming a dev
(07-24-2009, 03:39 AM)CacoFFF Wrote: [ -> ]
(07-23-2009, 04:33 PM)Iulius Wrote: [ -> ]
(07-23-2009, 02:33 AM)CacoFFF Wrote: [ -> ]On a second thought, it wouldn't be possible the way it is now, let me explain.

The fps counter isn't accurate, SMG for example, remains the same yet the fps counter goes up, until we don't fix the fps counter, or add one counter for each core to see how both cores behave, there is no chance for auto-adjust.
I thought the fps counter was measuring Emulated CPU instead of GPU cycles, but after getting results from other users in games like SMG or Zelda, I really have little idea of what's going on with it.


i had my holidays last weeks so i dont know what happened in the meantime.

so framecounter still not fixed ... we can use cpu cycle counter instead.

that would be even better because it defines the real gamespeed instead of just the fps output.


very nice that you found out how to change watchdog during running game. that was my biggest doubt about making that auto-config working.


i still have to work for my study-project but i think i can spend a few hours for a first implementation this weekend.

but i cant say if it will work good on those build-in-frameskipping-games.

For future reference, In SystemTimers.cpp, along with the Watchdog hack, there are other timed functions like device updaters, dsp updaters, etc.
I added an include to ConfigManager for obvious reasons and used the function that executes every frame to update devices, in that same function i found the Action Replay patcher Idea.
I made it check for config change every 60 calls to that function (frames), it will read the config and if only a change is detected, it will reapply the WD timer value.


I have two ideas on how to go on that I would really like to discuss here:
1) We lay our hands on ISOProperties, where the specifig game options are stored, and add an optional WD recommended value, which will be invisible and only set in the ini files, it won't be written from the emulator as well, just to make it remain optional.
I add an extra option in the Main WD config, next to 60, named Reccomended (or something like that).
It will read from the game specific settings and apply that value, if there is no custom WD for that game, it will automatically choose 60.

2) We take a look at where the FPS counters are processed (both overlay and window title ARE DIFFERENT!), and see if we can add a Dual counter for both cores or something like that.
Then we work as Iulius said, making the emulator choose the WD by itself, it has its risks since some games can hang while doing the autoconfig (gotta find a way to make them recover from the hang).

Of course if we follow way one, we can still fix the fps counters.

thats a very good idea man your doing great things
Quote:We take a look at where the FPS counters are processed (both overlay and window title ARE DIFFERENT!), and see if we can add a Dual counter for both cores or something like that.

gamespeed = cpu thread, so only one core.

we can use the "cyclesExecuted" from coretiming.cpp


count the cycles for 1 second, lower watchdog, count again.

if they increased (game runs faster) -> new watchdog value found
else -> reset to former value


with fix limits for watchdog at like 5 and 60 there should be no crash at all, at least i dont got any for the games i have.



i prefer this way because the best watchdog value depends on the machine each one is using.

the better the gpu is, the higher the watchdog should be in most case to achieve best speed, cause many games (6 out of the 7 i got) still wait for the gpu to finish and if you check not frequently enough they go in idle.
Finally someone told me where to find the damn functions in the source, now ontopic.

It's a good idea, we shouldn't ever let the watchdog fall from values like 5 or 10, I'll look into that when the time comes.

I see new pros and cons here.

Pros:
· A new and improved fps counter can be made out of it.
· No need for individual config

Cons:
· Game emulation constantly changes, the emu can make a mistake when trying to determine best fps for WD.


I think that instead of choosing one specific mode, these should be individually placed under the main Watchdog options, something like:
...
55
60
Preset
Auto
...

Preset shouldn't take much effort to implement (hope so), but there is a problem, it wouldn't go with the devs' style.
Their game config is the one that overrides the main config if specified to do so, while the Main WD config would be the one that overrides specific games config (if Preset not set). I'll get yelled for sure, but i'll still try it.

For Auto mode, I'd make this one the only option that can't be changed in real-time for a start.
That means if you start game with Auto, you can't unset it, and the same the other way around.
The reason for this is that Auto mode should choose the best fps at the very start of the game, if possible, in the first 1/2 of second. Quick checks before the logos are displayed, that's the only place of invariant emulation all games have in common.
(07-24-2009, 05:58 AM)CacoFFF Wrote: [ -> ]Finally someone told me where to find the damn functions in the source, now ontopic.

It's a good idea, we shouldn't ever let the watchdog fall from values like 5 or 10, I'll look into that when the time comes.

I see new pros and cons here.

Pros:
· A new and improved fps counter can be made out of it.
· No need for individual config

Cons:
· Game emulation constantly changes, the emu can make a mistake when trying to determine best fps for WD.


I think that instead of choosing one specific mode, these should be individually placed under the main Watchdog options, something like:
...
55
60
Preset
Auto
...

Preset shouldn't take much effort to implement (hope so), but there is a problem, it wouldn't go with the devs' style.
Their game config is the one that overrides the main config if specified to do so, while the Main WD config would be the one that overrides specific games config (if Preset not set). I'll get yelled for sure, but i'll still try it.

For Auto mode, I'd make this one the only option that can't be changed in real-time for a start.
That means if you start game with Auto, you can't unset it, and the same the other way around.
The reason for this is that Auto mode should choose the best fps at the very start of the game, if possible, in the first 1/2 of second. Quick checks before the logos are displayed, that's the only place of invariant emulation all games have in common.

Why not having the Watchdog-Auto running the whole time and keep adjusting. Different areas in games may need different settings.
BRAINSTORMING TIME!

Way 2, allow switching in all modes and making one and/or unlimited checks.

A proper way to make auto handle different games would be to make the able to tell first what games can use the WD and which games can't, then proceed to insanely adjust the WD.

General check, every 30 seconds:
WD: 60 > xx cpu cycles, yy gpu cycles.
WD: 30 > xx cpu cycles, yy gpu cycles.
Compare the xx/yy ratio in both tests.

This one determines if Watchdog modifications are useful or not.

If it isn't, then wait for other 10 - 30 seconds (probably the game uses it but is rendering nothing which confuses the emulator)

If it is, the we allow dynamic watchdog changes ALL the time every 1 - 2 seconds, up to 10- 30 seconds and do the general check again.

This lets us switch modes from the Main config.

EDIT: sskkiipp BRAINSTORMED TOO! The community is working, I like what I'm seeing.
On a second thought, first, we fix that horrible fps counter, maybe that way it will stop reporting wrong fps with altered watchdog. Might save us some work.
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22