Brood War speed hack?

https://github.com/bwapi/bwapi
zcxvbn
Posts: 4
Joined: Thu Dec 31, 2009 10:46 pm

Brood War speed hack?

Postby zcxvbn » Thu Dec 31, 2009 10:52 pm

I noticed on the front page of BWAPI that a 'recent speed hack' was developed. I did a quick search on this forum and only found a mention, that some in-game transitions had been sped up. Is there an actual speed hack available for Brood War, that someone could link me to? It would make running AI's a lot easier :P

(I am aware of programs like Speed Gear, but I was wondering if there was one specifically for BW)
User avatar
lowerlogic
Posts: 92
Joined: Sat Jun 21, 2008 11:50 pm

Postby lowerlogic » Fri Jan 01, 2010 12:47 am

The command you're looking for is Game::setLocalSpeed. To enable the speed hack, you can type the following in AIModule::onStart:

Code: Select all

BWAPI::Broodwar->setLocalSpeed(0);


I believe it only works in single player games and replays, but it might also work in multiplayer games if both players call the command.
Heinermann
Posts: 362
Joined: Thu Apr 26, 2007 12:42 am

Postby Heinermann » Fri Jan 01, 2010 6:22 am

There should be a command in BWAPI that lets you set the speed using /speed. If that was taken out, then someone messed up.
TheBlueGnu
Posts: 27
Joined: Fri May 20, 2011 12:34 pm

Postby TheBlueGnu » Tue Jul 12, 2011 3:03 am

[quote name='Heinermann' date='01 January 2010 - 02:22 PM' timestamp='1262326936' post='8794']
There should be a command in BWAPI that lets you set the speed using /speed. If that was taken out, then someone messed up.
[/quote]

Sorry to reply to such an old post, but thought it wouldn't make sense to make a basically duplicate thread.

Anyway, these commands "BWAPI::Broodwar->setLocalSpeed(0);" and "/speed", how fast do they make the game run roughly?
Heinermann
Posts: 362
Joined: Thu Apr 26, 2007 12:42 am

Postby Heinermann » Wed Jul 20, 2011 5:02 pm

It depends on your processor. A lot of changes have been made since the opening post and first speed hack. We've gotten even better performance. For info on how to get the game to run even faster, see this article.

/speed 0 sets the delay between game frames to 0.
/nogui will disable drawing to the screen, but if you want to see what's going on then /fs would be what you want (it is set to 2 in 16x replay speed). /fs will play the # of game frames before drawing anything to the screen. 1 means it will draw a frame to the screen every game frame.

Everything else is explained in the article.
TheBlueGnu
Posts: 27
Joined: Fri May 20, 2011 12:34 pm

Postby TheBlueGnu » Mon Jul 25, 2011 5:21 am

[quote name='Heinermann' date='21 July 2011 - 01:02 AM' timestamp='1311181343' post='10298']
It depends on your processor. A lot of changes have been made since the opening post and first speed hack. We've gotten even better performance. For info on how to get the game to run even faster, see this article.

/speed 0 sets the delay between game frames to 0.
/nogui will disable drawing to the screen, but if you want to see what's going on then /fs would be what you want (it is set to 2 in 16x replay speed). /fs will play the # of game frames before drawing anything to the screen. 1 means it will draw a frame to the screen every game frame.

Everything else is explained in the article.
[/quote]

Thanks very much! I'll take a look. I'm going to be making an evolutionary algorithm to improve the decisions of a simple hard coded AI I've almost finished (just need to convince it to build command centers at OTHER bases, not the starting one :P probably just a logic error) so I want it to run 1000+ games as fast as possible. These speed improvements you mention sound good to me.

For anyone else reading this;
I did a simple test with an AI that can only harvest resources (terran) vs terran and saw how long it would take to die with set local speed 0 on my laptop. The normal game was 10:12 I think with the speeded game as 00:35 (so 35 seconds or around 17.5 times faster).

Return to “BWAPI (wrappers in other languages / questions and announcements related to BWAPI itself)”

Who is online

Users browsing this forum: No registered users and 1 guest