Closed FormelLMS closed 3 years ago
Hmmmm, what a good idea. I should be able to add it to the start programs or the 'application' based executable processes because we create them directly. Its a bit trickier for setting the games that we start through the game launcher as we have to match the process, and alter it.
But as you've shown above, it is possible to do it with WMIC, and that means I should be able to do it programmatically through DisplayMagician. I'll add that to the DM v2.0.0 roadmap as I don't think it will be a lot of work. I already track the game exe for the monitoring process, so it should be as simple as adding the process priority functionality into the ShortcutRepository.RunShortcut function...
That said, this could be one of the things where something simple turns out to be darn complex :D
Lets see what happens.
Terry
Oh one thing I just thought of.... some games start with a launcher app which then runs the main game application before closing itself. The logic above wouldn't work in that instance. I do have some logic in there for monitoring a different executable, so I think I'll use that if its set. Then we'll always be sure of prioritising the right thing.
This come out to be better than expected 🙂 I usually tabbed out of the sims and searched the correct processes in task manager. Made a wait function before so it was able to change the priority in the right manner.
But this was my thing without knowledge of anything in coding and very cheap two lines 🙂
@FormelLMS you'll be pleased to know I managed to build in some sweet process priority logic into the DisplayMagician codebase this weekend.
You can choose process priority for the start programs, as well as the main game or application. DisplayMagician tries it's best to figure out how to change the process priority, but there are some caveats around this function:
The display logic updates are taking so long that I've decided to release an interim v1.1.5 in the next couple of weeks, as there are a few annoying bugs I'd really like to get fixed before I release DisplayMagician v2.0.0. This new feature will be part of that release.
I'm going to close this issue now, as the code is ready to go in a couple of weeks (once I fix a few other bugs)
Hope that suits ;D
Terry
This would be awesome. I am really looking forward to this version. Much appreciated.
@FormelLMS Yet another change of plans. I've squashed a few easy but important bugs, so I'd like to release the v1.2.0 shortly to get rid of those bugs, and give me more time to work on the serious business of v2.0.0 :).
So I've included a test version of v1.2.0, and I'd be honoured if you could do some testing for me. Please unzip the attached file, and install the included DisplayMagician-v1.2.0-test over your existing DisplayMagician install. It should automatically upgrade the previous install, and should hopefully work.
Please test out the game priority logic, and please update me on the results of that in this issue. If you find any other bugs, please log a new issue so that I can work through them individually.
And I've been meaning to say thank you for your previous donation. It really means a lot!
Thanks Terry
Hey Terry,
thanks for this update. Tried it now many times. But, it seems to do the trick sometimes, but mostly not. Could be the problem of the App.
Raceroom seems to work iRacing seems to work sometimes ACC doesn't work Euro Truck Simulator doesn't workk American Truck Simulator doesn't work Microsoft Flight Simulator... I can't add it to the games list. It says, I don't have the rights to do so. Fernbus and The Bus I didn't try because I can't apply my triples on it
Sorry to say, I hoped, it would work an all titles well, but something is strange there. Could be a problem of those titles?
Hmmmm. I think it's likely that those games need another executable to monitor. As I mentioned in an earlier post there are some pretty strict caveats around the usage:
To double check this, I've tested ACC as I have that game. I noticed that when we start ACC through Steam, ACC.exe is started, but ACC.exe then runs the actual game exe, which is AC2-Win64-Shipping.exe... You can tell that this is happening because if I set the game shortcut to run 'Above Normal', then I start the game through DisplayMagician, and then view the list of running processes in Task Manager, I see the following:
As you can see, the ACC.exe is set to 'Above Normal'. By default DisplayMagician applies the game priority to the exe that steam tells DisplayMagician to run. I know therefore, that DisplayMagician started the ACC game by running ACC.exe as it is the one set to 'Above Normal'. Unfortunately, this default game priority setting behaviour won't work for ACC, as the main ACC game executable is actually AC2-Win64-Shipping.exe. We can tell that because in that Task Manager screenshot AC2-Win64-Shipping.exe is using a TON of memory up, and a game like ACC needs a lot of resources. So it's highly likely that AC2-Win64-Shipping.exe is the main game executable.
So, to help tell DisplayMagician pick the right game executable to set the game priority on, we need to tell DisplayMagician which file is the main game executable. We do this using the 'Monitor different executable' setting. Checking the 'Monitor different executable' checkbox, then selecting AC2-Win64-Shipping.exe' in the game shortcut will tell DisplayMagician that it should monitor a different game executable, and also it will make DisplayMagician apply the 'Above Normal' priority setting to that monitored process instead.
So, I edited the ACC game shortcut in DisplayMagician, and checked the 'Monitor different executable' checkbox, and then chose the 'C:\Program Files (x86)\Steam\steamapps\common\Assetto Corsa Competizione\AC2\Binaries\Win64\AC2-Win64-Shipping.exe' to monitor instead. I then saved the updated Game Shortcut, and ran it again.
As you can see, when I checked the Task Manager again, 'AC2-Win64-Shipping.exe' is now set to 'Above Normal', meaning that the actual main game executable is correctly set! DIsplayMagician now knows the main game executable, and is applying the game priority correctly.
After writing this process, I realised I need to update the documentation on the DisplayMagician wiki, and to also add another wiki page that lists all the Games, and the correct settings for each one. I think this would make it far easier for new users to set up each game correctly.
What do you think? Sound like a good idea?
I'd love if you could do some analysis of those other games that aren't working to see if you can find the main game executables in Task Manager, and tell me if they are different. I'll probably put the new wiki page up in the next week or so, and I'll add a help button from the edit shortcut page to jump straight to the page. That should help people find out how to use it better.
Hope that helps!
Terry
Yes, thats a good idea. After trying many times and failing in the automatic *.exe, I search all I had and tried it on the manual way. Here are my findings:
For Raceroom it's RRRE64.exe: Reverting back to normal after a few seconds ACC is AC2-Win64-Shipping.exe. Seems to work at the start, but reverts back to normal after a few seconds, when you click on prcess priority in task manager For Automobilista2 its AMS2AVX.exe.Seems to work at the start, but reverts back to normal after a few seconds, when you click on prcess priority in task manager iRacing is iRacingSim64DX11.exe. Seems to work at the start, but reverts back to normal after a few seconds, when you click on prcess priority in task manager American Truck Simulator is amtrucks.exe Seems to work at the start, but reverts back to normal after a few seconds, when you click on prcess priority in task manager Euro Truck Simulator is eurotrucks2.exe Seems to work at the start, but reverts back to normal after a few seconds, when you click on prcess priority in task manager
So everywhere the same. Seems to overwrite the process priority as a name, but isn't changed properly.
Great news! DisplayMagician v2.0.1 has been released, and it should fix this very issue. Please test it out, and if you still have any issues please log a new issue. You can get DisplayMagician v2.0.1 from here: https://github.com/terrymacdonald/DisplayMagician/releases/tag/v2.0.1
I'm closing this issue as the fix is in DisplayMagician v2.0.1, and I need to clear out the completed issues so I am able to work on the new issues that come in.
Thanks Terry
Before using this genius app I've made Batch files. To get best performance, I've added a task priority after launching the app.
Is this posible to add here?
It looks like that: wmic process where name="RRRE64.exe" CALL setpriority "above normal"