|
Physician
United States4146 Posts
http://ossguy.com/starcraft_power_saver/ by ossguy
I haven't tried it yet. I don't think many will be using it but who knows, someone out there might find it useful.
Basically it's a tool that patches StarCraft so it uses less CPU time while a game is being played, which reduces power consumption on your computer.
Performance results StarCraft Power Saver reduces StarCraft's CPU usage from 100% to the following percentages:
* 1-4% on a 2.8 GHz Pentium 4 running Windows XP SP2 * 2-10% on a 1.3 GHz Pentium M running Windows XP SP2 * 25-75% on a 1.3 GHz Pentium M running Wine 0.9.58 on Ubuntu 7.10 + Show Spoiler +StarCraft Power Saver What you should know about StarCraft Power Saver:
* It's a tool that patches StarCraft so it uses less CPU time while a game is being played, which reduces power consumption on your computer. * It modifies the StarCraft executable. As a result, you should not use Battle.net once the patch is applied (you can revert to a backup if you like). * It's designed for StarCraft 1.15.2. If you have an older version, please update to 1.15.2 before using it. * It's run from the command line. To use it, open a Command Prompt and navigate to the folder it's in. Then type starcraft_power_saver "C:\Program Files\Starcraft\StarCraft.exe" to apply the patch. A backup of the executable will be created. * It wasn't created by and is not supported by Blizzard Entertainment. * It's only available for Windows (and, by extension, Wine) for now. If there is enough interest, I will consider adding a Mac version. * The tool and source code are linked below. They can also be browsed using this link. * Bug reports and feature requests are welcome. Please submit these using the contact information below.
Before you judge it too fast (like I did) read the Problem summary.
|
Physician
United States4146 Posts
|
how to use it @@ i tried, didint work
|
'E:\Starcraft\Starcraft.exe' is not a StarCraft: Brood War 1.15.2 executable; th e expected MD5 checksum is 8f35e0719fa15e56b6605e67b19ba97c
|
Osaka27089 Posts
If it worked on battle.net it would be worthwhile for me, but I dont spend any time in single player. Rich's is much less circumspect, as it doen't actually modify bw.
|
Yeah, I'd say Rich's is a lot better (and is a BWL plugin so its even easier to turn on/off )
|
On March 31 2008 18:57 syplovessy wrote: 'E:\Starcraft\Starcraft.exe' is not a StarCraft: Brood War 1.15.2 executable; th e expected MD5 checksum is 8f35e0719fa15e56b6605e67b19ba97c
Thanks for reporting that. Are you using an English version of StarCraft 1.15.2? If not, it's quite likely that the patch won't apply properly. I'll consider adding support for other languages if there is enough interest.
|
On March 31 2008 19:52 Manifesto7 wrote: If it worked on battle.net it would be worthwhile for me, but I dont spend any time in single player. Rich's is much less circumspect, as it doen't actually modify bw.
Fair enough. I didn't know about CPU Savior before I started making StarCraft Power Saver and I wasn't aware of other ways of making a similar patch. I will look into CPU Savior a bit more to see how it works so I can determine how StarCraft Power Saver compares to it. If they are sufficiently similar, then StarCraft Power Saver may be redundant.
To clarify, StarCraft Power Supply does not limit you to single player. You can also play LAN games with it, just not Battle.net. Mainfesto7 probably knows this, but it might be unclear to other users reading this thread.
|
Physician
United States4146 Posts
On April 01 2008 01:41 ossguy wrote:Show nested quote +On March 31 2008 19:52 Manifesto7 wrote: If it worked on battle.net it would be worthwhile for me, but I dont spend any time in single player. Rich's is much less circumspect, as it doen't actually modify bw. Fair enough. I didn't know about CPU Savior before I started making StarCraft Power Saver and I wasn't aware of other ways of making a similar patch. I will look into CPU Savior a bit more to see how it works so I can determine how StarCraft Power Saver compares to it. If they are sufficiently similar, then StarCraft Power Saver may be redundant. To clarify, StarCraft Power Supply does not limit you to single player. You can also play LAN games with it, just not Battle.net. Mainfesto7 probably knows this, but it might be unclear to other users reading this thread.
we are happy just by the mere fact you're around here and made the effort for our game : )
|
Man I was hoping for a SC screen saver with customizable replays to play and auto screen scroll for hottest actions...
|
I wish Blizz would somehow implement this.
|
I'm curious if ossguy has written other bw software. Have you?
|
Your technique looks better - just sleeping once per loop (CPU Savior sleeps on every GetTickCount call), but Sleeping at all is a problematic method since it stalls the message loop, meaning high Hz mice might suffer from input latency. You can reduce the 10-15ms granularity with a timeBeginPeriod call as CPU Savior does. CPU Savior patches the IAT to avoid modifying BW code, but modifying BW code after connecting to bnet should be fairly safe unless Warden decides to go after you, meaning this would work well as a BWL plugin - no injection needed, just Read/WriteProcessMemory.
|
On April 01 2008 11:14 comabreaded wrote: I wish Blizz would somehow implement this.
So do I. It would require a bit of a redesign of their game loop, but it is still a manageable fix. In my opinion, a proper redesign of the game loop would look like the following:
setTimer(...); while (gameNotOver()) { GetMessage(lpMsg, ...); switch (lpMsg.message) { case KEYBOARD_EVENT: ... case MOUSE_EVENT: ... case TIMER_EVENT: redrawScreen(); computeAI(); resetTimer(); ... case ... } }
StarCraft would use the timer to tell it when to redraw the screen. The timer frequency would specify how many frames per second StarCraft would run at. This could be configurable in the game or hardcoded to a particular value that runs well on most systems.
I'd be happy to talk about this proposal further, especially with people from Blizzard.
|
On April 01 2008 11:22 thunk wrote: I'm curious if ossguy has written other bw software. Have you?
The other StarCraft-specific software I've written was made primarily for testing and benchmarking to see how effective the patch was. I did write a patch for Wine that allows users to specify a refresh rate since Wine sometimes picks a low refresh rate when games like StarCraft change the resolution. More information about the patch, including how to use it, are available on my blog. If you just want to use it, you can skip the first two paragraphs.
The benchmarking tools I made let me know how many times StarCraft is going through the game loop in a given amount of time. I did this by inserting a counter in the game loop and then using ReadProcessMemory from another application to see the value of the counter as it changed while StarCraft was running. Making ReadProcessMemory work required disabling some of StarCraft's security features. Because of that and because I used the same method of modifying StarCraft (changing the StarCraft executable directly), these changes also would not work with Battle.net.
In general, I try to stay away from making fixes to closed source software such as StarCraft because it is much more time-consuming than making fixes to open source software and it is much harder to fix things "the right way" since I have to guess what the assembly code is trying to do. It would be much easier for me to make changes to StarCraft if it were open source, but the model that Blizzard Entertainment chooses to sell its products doesn't permit that.
|
seriously, everytime i run broodwars my cpu temperature spikes, even though it's a 10 year old game... =(
|
On April 01 2008 12:20 R1CH wrote: Your technique looks better - just sleeping once per loop (CPU Savior sleeps on every GetTickCount call), but Sleeping at all is a problematic method since it stalls the message loop, meaning high Hz mice might suffer from input latency.
Certainly. If I had more time, I would try to modify StarCraft using an event-based game loop as I described above, but it's just not feasible without the source code as I would have to spend many hours just figuring out how to refactor the code to make the event-based system work. It's unfortunate we have to rely on Sleep when there are much better ways of doing it.
You can reduce the 10-15ms granularity with a timeBeginPeriod call as CPU Savior does.
I considered doing this, but I wasn't sure if it would work because I couldn't find any references to other functions in the winmm library, suggesting that it wasn't linked into the StarCraft executable so I wouldn't be able to use timeBeginPeriod. Furthermore, it appeared that StarCraft worked fine even with the 10-15ms granularity so I didn't see a need to fix it further. However, if there are reports that StarCraft Power Saver is slow without timeBeginPeriod, then I would consider implementing it.
I couldn't find the place where you call timeBeginPeriod in your code; can you point out where in the code that's done?
CPU Savior patches the IAT to avoid modifying BW code, but modifying BW code after connecting to bnet should be fairly safe unless Warden decides to go after you, meaning this would work well as a BWL plugin - no injection needed, just Read/WriteProcessMemory.
That's an interesting mechanism for patching the game. I wish such hackery weren't required. It's things like this that really make me want to switch to open source RTSes like Bos Wars, Globulation 2, or Dark Oberon. If I have a problem with any of these, I can just fix the source code the right way. Unlike with StarCraft, no reverse engineering or protection-circumventing hacks are required.
|
On April 02 2008 13:07 Gokey wrote: seriously, everytime i run broodwars my cpu temperature spikes, even though it's a 10 year old game... =(
It's partly because StarCraft is 10 years old that it uses the CPU the way it does. 10 years ago, people didn't care that much about saving power because the average computer wasn't that power-hungry and laptops were not nearly as ubiquitous as they are today.
I would encourage you to try StarCraft Power Saver and CPU Saver to see if they help with your CPU temperature issues. Ideally Blizzard would fix this the right way, but until then, all we can do is work around it.
|
Baltimore, USA22245 Posts
On April 01 2008 12:20 R1CH wrote: Your technique looks better - just sleeping once per loop (CPU Savior sleeps on every GetTickCount call), but Sleeping at all is a problematic method since it stalls the message loop, meaning high Hz mice might suffer from input latency. You can reduce the 10-15ms granularity with a timeBeginPeriod call as CPU Savior does. CPU Savior patches the IAT to avoid modifying BW code, but modifying BW code after connecting to bnet should be fairly safe unless Warden decides to go after you, meaning this would work well as a BWL plugin - no injection needed, just Read/WriteProcessMemory.
I'm ashamed to say I understood virtually none of that.
How did both of you guys get into coding, if you don't mind me asking?
|
On April 02 2008 13:26 EvilTeletubby wrote:Show nested quote +On April 01 2008 12:20 R1CH wrote: Your technique looks better - just sleeping once per loop (CPU Savior sleeps on every GetTickCount call), but Sleeping at all is a problematic method since it stalls the message loop, meaning high Hz mice might suffer from input latency. You can reduce the 10-15ms granularity with a timeBeginPeriod call as CPU Savior does. CPU Savior patches the IAT to avoid modifying BW code, but modifying BW code after connecting to bnet should be fairly safe unless Warden decides to go after you, meaning this would work well as a BWL plugin - no injection needed, just Read/WriteProcessMemory. I'm ashamed to say I understood virtually none of that. How did both of you guys get into coding, if you don't mind me asking? Me too T.T After using chaos launcher it got me interested but i have no idea what they're talking about;;
|
|
|
|