Closed GoogleCodeExporter closed 9 years ago
I don't think so. An AI match doesn't require such a feature.
Original comment by AHeinerm
on 11 Dec 2009 at 3:09
If the match is between two AIs, you're right - it does not. But if one or more
players in a match are humans? Or BWAPI made only for AI vs AI?
For example, the default AI tactic in Starcraft is too easy and uninteresting
for me,
so I try to write my own. Sometimes during the long game it's a good point to
save
the game, but I can't even think what will appear for my AI after reloading.
For example, if there are 2 functions in AImodule:
virtual void OnLoadGame(std::string fileName);
virtual void OnSaveGame(std::string fileName);
then the AI can save it's own data in some datafile near the save file and try
to
load this datafile on game load... It will be great! Can't you check for
load/save
events or it's too hard? (i'm not good in hacking :) )
Original comment by bigfatbr...@gmail.com
on 11 Dec 2009 at 6:19
I never used the save feature against anyone in my life. AIs would need to
include
additional code for saving and loading (serializing and deserializing) their
frame
state. Diffent versions of the same AI would not have compatible saves, so AIs
would
have to make some sort of version check. I really don't think the effort of
finding
the right hooks and offset is worth it.
AIs who need to save their state could implement a hot key or a user interface
for
doing so. This way you can just pause the game in starcraft, goto your AI GUI,
save
it's state, save the starcraft game.
Original comment by goo...@teabix.com
on 11 Dec 2009 at 9:15
Well, it's not a serious defect, actually. But it's a little strange that the
power
of BWAPI is such unbalanced yet: it provides methods like pauseGame(), but does
not
handle game saving. Please, don't remove my question, maybe someone agree with
me.
Thank you for listening ;)
Original comment by bigfatbr...@gmail.com
on 11 Dec 2009 at 10:05
Sorry I thought a new hook would be needed but seems like "save game" goes
through
the regular game command queue.
Original comment by goo...@teabix.com
on 11 Dec 2009 at 12:16
And? Should you implement it some day? :)
Original comment by bigfatbr...@gmail.com
on 11 Dec 2009 at 1:59
I think UMS and multi-opponent support is more likely than save game support.
First of all, save/load on a melee match is never used, ever.
Second, it's even less likely than never to use save/load in an AI match.
With this, it's probably best if save/load was supported (more for UMS maps
rather
than melee maps).
Original comment by AHeinerm
on 12 Dec 2009 at 3:08
Yeah, I think we can do onSaveGame and onLoadGame. It wouldn't be much of a
problem
to implement, just that we're lazy.
Original comment by AHeinerm
on 31 Jan 2010 at 4:32
I added an onSaveGame callback. Please check if it works. For onLoad, you'll
just
have to retrieve the map file name for now.
Original comment by AHeinerm
on 9 Feb 2010 at 5:24
Original issue reported on code.google.com by
bigfatbr...@gmail.com
on 10 Dec 2009 at 10:16