StarCraft Broodwar replay format

314 views
Skip to first unread message

Ogail

unread,
Jun 7, 2012, 12:10:30 PM6/7/12
to bwapi, mhesha...@gmail.com
Hi guys,
We are trying to customize the Replay_Tool project in BWAPI source
code for our AI Engine. We tried to understand
Replay_Tool>Actions.cpp>ParseActions(FileReader &fr) function but we
found it unclear, and we assumed some understandings, but we are
unsure of them. We'd appreciate if you can share with us
Starcraft:Broodwar replay format and how do u recognize the actions
stream correctly.

Cheers,
Ogail

Ben Weber

unread,
Jun 7, 2012, 12:30:03 PM6/7/12
to bw...@googlegroups.com
You can post BWAPI issues here:  http://code.google.com/p/bwapi/issues/list 

Ben

Ogail

unread,
Jun 7, 2012, 12:40:06 PM6/7/12
to bw...@googlegroups.com
Thanks Ben and actually we are asking for info not reporting a bug or an issue. Or you guys receive general questions on issues also?

Cheers,
Ogail

Ogail

unread,
Jun 7, 2012, 12:42:48 PM6/7/12
to bw...@googlegroups.com, mhesha...@gmail.com
I think that this question has been asked before here so if someone has anything else to add that would be great.

Thanks,
Ogail

gabriel synnaeve

unread,
Jun 7, 2012, 1:23:41 PM6/7/12
to bw...@googlegroups.com, mhesha...@gmail.com
Hum, I was not aware of the Replay_Tool of BWAPI, if it can repair (as
I have seen in the commands) broken bots replays it should prove
itself very useful ! As far as I understand (just skimming through the
code) it's like a Lord Martin Replay Ripper with BWAPI notations for
actions ...

I simply inform you that if what you want to do is to dump game states
(something that can't be done without running the game), you can use a
replay state dumper I wrote http://snippyhollow.github.com/bwrepdump/
(using bwapi). Also here is a dataset of 7708 replays I ran through it
http://emotion.inrialpes.fr/people/synnaeve/TLGGICCUP_gosu_reps.7z
(replays) and http://emotion.inrialpes.fr/people/synnaeve/TLGGICCUP_gosu_data.7z
(states / output).


Cheers,
Gabriel

Heinermann

unread,
Jun 7, 2012, 4:50:25 PM6/7/12
to bwapi
I will re-write the parser in Replay_Tool to be more object oriented
and with comments so that you get a better understanding of what is
going on.


On Jun 7, 1:23 pm, gabriel synnaeve <gabriel.synna...@gmail.com>
wrote:
> Hum, I was not aware of the Replay_Tool of BWAPI, if it can repair (as
> I have seen in the commands) broken bots replays it should prove
> itself very useful ! As far as I understand (just skimming through the
> code) it's like a Lord Martin Replay Ripper with BWAPI notations for
> actions ...
>
> I simply inform you that if what you want to do is to dump game states
> (something that can't be done without running the game), you can use a
> replay state dumper I wrotehttp://snippyhollow.github.com/bwrepdump/
> (using bwapi). Also here is a dataset of 7708 replays I ran through ithttp://emotion.inrialpes.fr/people/synnaeve/TLGGICCUP_gosu_reps.7z
> (replays) andhttp://emotion.inrialpes.fr/people/synnaeve/TLGGICCUP_gosu_data.7z

Ogail

unread,
Jun 7, 2012, 6:06:03 PM6/7/12
to bw...@googlegroups.com
Sounds good! Let us know if we can help on that we already rewriting it in OOP in our AI Engine.

Heinermann

unread,
Jun 7, 2012, 7:59:29 PM6/7/12
to bwapi
I just updated it. I did not test all the functions though.

http://bwapi.googlecode.com/svn/branches/bwapi4/bwapi/Replay_Tool/

I did not finish working on ReplayAction, mainly because Replay_Tool
doesn't need individual derived classes for each command opcode, as
most of the opcodes can be combined or only have one line of code for
logging purposes only.

If you're not sure about something, let me know.
Also for reference (a doc I created):
http://code.google.com/p/vgce/source/browse/trunk/docs/Blizzard/Starcraft/packets2.txt#859

MHesham

unread,
Jun 9, 2012, 1:15:41 PM6/9/12
to bw...@googlegroups.com
Hi Heinermann,

Me and Ogail have looked at your code changes here:  http://bwapi.googlecode.com/svn/branches/bwapi4/bwapi/Replay_Tool/  
We`ve tried to explore your new design from the code changes, and it looks great. We predict that your next step will be replacing the big switch statement inside Actions.cpp with a smart polymorphism on ReplayAction objects deduced from the ActionType.

We`d like to participate in ReplayTool project. We can save your time and continue re-factoring the ReplayTool project. It would be better not to duplicate efforts in our AI Engine and BWAPI.
What do you think?

Regards,
MHesham

Heinermann

unread,
Jun 9, 2012, 9:31:51 PM6/9/12
to bwapi
I think the idea is great. If you post your google account I can add
you to the list of BWAPI committers.

On Jun 9, 1:15 pm, MHesham <mhesham.f...@gmail.com> wrote:
> Hi Heinermann,
>
> Me and Ogail have looked at your code changes here:  http://bwapi.googlecode.com/svn/branches/bwapi4/bwapi/Replay_Tool/
> We`ve tried to explore your new design from the code changes, and it looks
> great. We predict that your next step will be replacing the big *switch*statement inside
> *Actions.cpp *with a smart polymorphism on *ReplayAction *objects deduced
> from the ActionType.
>
> We`d like to participate in ReplayTool project. We can save your time and
> continue re-factoring the ReplayTool project. It would be better not to
> duplicate efforts in our AI Engine and BWAPI.
> What do you think?
>
> Regards,
> MHesham
>
>
>
>
>
>
>
> On Friday, June 8, 2012 1:59:29 AM UTC+2, Heinermann wrote:
>
> > I just updated it. I did not test all the functions though.
>
> >http://bwapi.googlecode.com/svn/branches/bwapi4/bwapi/Replay_Tool/
>
> > I did not finish working on ReplayAction, mainly because Replay_Tool
> > doesn't need individual derived classes for each command opcode, as
> > most of the opcodes can be combined or only have one line of code for
> > logging purposes only.
>
> > If you're not sure about something, let me know.
> > Also for reference (a doc I created):
>
> >http://code.google.com/p/vgce/source/browse/trunk/docs/Blizzard/Starc...

Heinermann

unread,
Jun 9, 2012, 9:33:33 PM6/9/12
to bwapi
Also feel free to enter the IRC chatroom. I am in there for as long as
my computer is turned on.

Heinermann

unread,
Jun 9, 2012, 9:48:06 PM6/9/12
to bwapi
I am thinking about creating some kind of replay library outside of
Replay_Tool (which will also have the ability to write replays, not
just read them).

There are actually several reasons for this library:
1. To be able to share itself with any project.
2. To replace BWAPI's command creation system here:
http://bwapi.googlecode.com/svn/branches/bwapi4/bwapi/BWAPI/Source/BW/OrderTypes.h
3. To replace BWAPI's command reading chaos here(see CommandFilter):
http://bwapi.googlecode.com/svn/branches/bwapi4/bwapi/BWAPI/Source/Detours.cpp
4. To implement a planned feature that will automatically save a
replay if the game crashes, up to the point where the crash occurred
(in BWAPI's Exception Handler).
5. To re-write the replay saving mechanisms in Starcraft to reduce the
Win32 File API hooks/workarounds and fix a bug that causes BWAPI's
interference to save some corrupted replays (the reason Replay_Tool
existed).

Also note that I am primarily focused on the BWAPI4 branch, which uses
MSVC++ 2010 Express (As opposed to the main branch's 2008 Express).
The purpose of the main branch is to maintain compatible code with
modules intended for this year's tournaments while fixing any bugs
that could hinder tournament play, and won't see many updates (so
ignore the Replay_Tool of the main branch).

MHesham

unread,
Jun 12, 2012, 12:54:51 PM6/12/12
to bw...@googlegroups.com
First, here is our gmail account we will use to commit code: rtsair...@gmail.com
Me and Ogail will fork the BWAPI4 branch to our public repository at GitHub: https://github.com/RtsAiResearch to work on it locally, after we finish the code we will commit the code on BWAPI4 SVN using rtsair...@gmail.com.

We want to make sure that you are not working on BWPAI4 branch now (i.e making the rest of Action re-factoring), so we don't duplicate work. After we finish part of the re-factoring we will schedule a discussion with you to make sure that we are working in the right direction. Later after finishing the Action re-factoring we can start discussing the Replay_Tool library.

Thanks,
MHesham

Heinermann

unread,
Jun 12, 2012, 5:38:21 PM6/12/12
to bw...@googlegroups.com
I have added the account to the list of project committers.

Thiago Andrade

unread,
Jul 5, 2012, 8:29:04 PM7/5/12
to bw...@googlegroups.com
Hello guys, 

i'm looking for a way to implement only the buildordder manager to the original AI of Starcraft Broodwar. I saw the project BWSAL. Is that made to do that? and how can I implement (extend) original AI (maybe throw BWAPI) of the game buildorder? 

I do not want to make a bot, I just want to reimplement the build order module of original AI.

Please, help!

Thanks!

--
Thiago Andrade

MSc Candidate in Computer Science, Federal University of Pernambuco (UFPE) – Brazil
BSc in Computer Engineering, University of Pernambuco (UFPE) – Brazil
Software Architect


Reply all
Reply to author
Forward
0 new messages