StarCraft II API

Dec 7 Welcome to the StarCraft II API Thanks for joining the discussion around the release of the StarCraft II API! For more information on our announcement, please see the following: Blizzard Announcement blog DeepMind Announcement blog To get started, suggest changes, and report bugs, you can participate in our open source project on GitHub: StarCraft II API Library StarCraft II API Protocol Python Protocol Binding Library PySC2 (DeepMind’s toolset) You can also participate in additional discussion on David Churchill’s Facebook group: StarCraft II Artificial Intelligence Facebook Group We’re excited to see the direction that the AI research community takes this in, and we look forward to your discussion! - The StarCraft II API teamTraysent6 Dec 7
Aug 11 CommandCenter: An SC2 AI Bot Framework The AI community has been conducting research using the original StarCraft for years, and we appreciate all of the scripted AI work that has been done. One of the most popular frameworks for writing bots in the original StarCraft was UAlbertabot, and many of the top competitive bots are based on this framework. It was also designed as an easy-to-use tool to toy around with AI – you could just plug in a build order and watch it go. In addition to our collaboration with DeepMind, we have also been working with the author of UAlbertabot, David Churchill, on porting this framework over to StarCraft II. His initial version, called CommandCenter, is out now: David, a Computer Science faculty member at Memorial University, has been one of the core pillars of the StarCraft AI community for many years, and the feedback he provided to us during the development of the StarCraft II API has been very helpful. Together with the rest of the AI research community, we look forward to making StarCraft II an awesome environment to continue experimenting with AI bots.Traysent8 Aug 11
Oct 24, 2016 Forum Guidelines - Please Read! Welcome to the StarCraft II discussion forums! This forum is here to provide you with a friendly environment where you can discuss all aspects of StarCraft II with your fellow players. Community forums work best when participants treat their fellow posters with respect and courtesy. Therefore, we ask that you take the time to read through the Forum Code of Conduct before posting. Search The new search function at the top of the StarCraft II community site is extremely robust. Please be sure to use it to look for similar topics, blog posts, or web pages that may contain the answer before creating your forum topic. Making a new thread on an existing subject will likely result in your thread being deleted. If you continue to repost it you're likely to have your posting privileges suspended for spamming. Worst of all, you'll be making the other forum goers upset that you didn't take a minute to search before posting. Rating The new rating system can be used to promote positive discussion, and demote unhelpful posts, or even report posts that violate the forum code of conduct. By hovering over a post you'll be presented with a thumbs up, and a thumbs down icon. Clicking the 'thumbs down' icon you can choose from a few options. Dislike will rate the comment down. If enough people dislike a post it will be darkened, or with a lot of dislikes it will be hidden. You can also quickly report a post as trolling or spam, or use the report function to fill out a more comprehensive description of the violation. You can only rate each post once. Use it wisely to help foster a positive and helpful forum community. Guidelines In addition to the Forum Code of Conduct, here are some common courtesy guidelines to follow. While these do technically fall within the bounds of the Code of Conduct, these cover more specific examples of common errors that will lead to thread deletions or posting privileges being revoked. The StarCraft II forums are for discussion of topics directly related to StarCraft II The forums here are specifically to discuss the game and related topics. Any topics not related to StarCraft II, or Blizzard are subject to deletion. Don't post in all capital letters, use a misleading title, excessive punctuation, non-standard symbols, etc. While everyone wants their posts read, we ask you to refrain from using these types of tactics in order to bring more people to your thread. Let your post stand on its own merit. Threads violating this guideline are subject to deletion. Using the words Blizzard, Blue, or any community team members name in a thread topic is frowned upon Everyone would like Blizzard to read and acknowledge his or her post, and we understand that. However, use of such words in the topic does not help that come to pass. Please make your thread title relevant to the post subject. Threads violating this guideline are subject to deletion. Posting "First" or IBTL constitutes as spamming You will be suspended if you create a post that is intended to call out that you achieved a specific reply number in a thread. This is considered spamming. Posting IBTL (in before the lock) is not helpful and if you feel a thread should be moderated please use the rating button to do so. Do not bump posts The act of posting simply to bump a thread is considered spamming. This also includes bumping very old threads for no reason (called 'necro bumping' or 'necroing'). Petition posts are frowned upon These are discussion forums, and as such we ask that you hold discussions. Creating a thread to ask for replies as votes is not a discussion. Threads violating this guideline are subject to deletion. Do not post about locked or deleted threads Posts that are moderated have a reason behind the moderation. It's up to you to read the forum code of conduct and these guidelines to determine what you did wrong, learn from your mistake, and attempt to post again without breaking any rules.Rackle0 Oct 24, 2016
Jan 2 Blacklist API (Export/Add/Clean) ??? My blacklist is full ((( I need save current blacklist and clean it for new "players". How can i make it so ? Can anyone explain. How export my own ingame blacklist ? How to get blacklist in any text format ? How ?lllllllllll8 Jan 2
Dec 25 PySC2 Sparse Reward Agent Tutorial Dec 25
Dec 20 API for automated tournaments Hi there, I have a newly created Tournament Platform. We run automated tournaments for video games of all kinds. We would like to implement SCII as one of the games we host tournaments for. From what I've read there is no sort of tournament API that will generate any type of lobby codes for players or an automated way to have the API call back match results. What would be the best use of the API or other functions of Blizzard/ to facilitate some sort of automated tournament system? Is there a lobby/tournament code system I do not know about? Can you create password protected / certain user only lobbies? Is there an automatic call back for match reports, or would we have to call the API after a player reports a match as being finished? Any other ideas / advice?ForbidenSoul0 Dec 20
Dec 7 Best way to get the entire state of a replay? Real title: What is the best way to get the entire game state of a replay at a specific time? I don't see any straight forward way to do this, so I'm planning on building an API for it, but if someone from blizzard could help me get started, that would be great. I basically want to make this function: GameState getGameState(Replay, Time) Where GameState includes everything, including: All units, and their health and location All structures and their health and location The various scores of both players The visibility of each unit and structure from the perspective of both players The last-seen visibility data for structures, and if it's possible, the last time it was seen* *What I mean by last-seen visibility is how when a structure stops being visible to a player, the player can still view that structure on their map. Also, I don't mind doing the calculations, but if there is a built in way to determine the exact time when a structure went invisible to a player, that would be helpful I see there are a lot of classes in the API that seem to provide the data I need, but there are very few examples that I can find on how to use them. And from what I can tell, when viewing replays, the only way to move through a replay is by stepping rather than just going to a specific time. Do replays have to be calculated from the beginning of time or something? If someone helps me out, I will publish my work publicly so others can make use of it. Thanks in advanceBlix2 Dec 7
Dec 7 No Maps folder in SC2 Directory? I checked my Starcraft II folders (Windows 10) in C: ProgramFiles(x86) and Documents and neither one has a folder called maps. I'm stuck because to get pysc2 up and running there's supposed to be a maps folder in C: ProgramFiles Starcraft II where you extract their maps, but I don't even have this. What can I do?NinjaNight1 Dec 7
Dec 4 Which position should I use for Assimilator ? Hi ! I'm currently trying to make my probes build an assimilator but they're acting like they can't go on the geyser. I used the debug interface to ensure the position is correct but my probe are acting like they can't reach the geyser. How should I do it ? if (structure == UNIT_TYPEID::PROTOSS_ASSIMILATOR) { const Unit* geyser = FindNearestVespeneGeyser(unit_to_build->pos); DebugInterface* debug = Debug(); debug->DebugSphereOut(geyser->pos, 1.0f, Colors::Green); debug->DebugSphereOut(unit_to_build->pos, 1.0f, Colors::Red); debug->SendDebug(); rx = geyser->pos.x; ry = geyser->pos.y; } Actions()->UnitCommand(unit_to_build, ABILITY_ID::BUILD_ASSIMILATOR, Point2D(rx, ry)); const Unit* FindNearestVespeneGeyser(const Point2D& start) { Units units = Observation()->GetUnits(Unit::Alliance::Neutral); float distance = std::numeric_limits<float>::max(); const Unit* target = nullptr; for (const auto& u : units) { if (u->unit_type == UNIT_TYPEID::NEUTRAL_VESPENEGEYSER) { float d = DistanceSquared2D(u->pos, start); if (d < distance) { distance = d; target = u; } } } return target; }MetalKitten2 Dec 4
Dec 1 Selecting Units I know we can see if individual units are selected (unit.is_selected) but I'm failing to find the ability to select units. Can someone point me in the right direction please?MacAttack1 Dec 1
Nov 23 I just drop it here Yo. I don't know whether it is appropriate to write about it here, but I did not find a more suitable section of the forum so... That's what it is, I tried to reassign the hotkey commands on the mouse scroll and found that it was impossible. And nevertheless, it seems to me that using the mouse scroll for example to switch subgroups would be much more convenient. And, in connection with this, I would like to leave this post here, as a suggestion to introduce the ability to use mouse scrolling as hotkeys. I really think it's a good idea. Sorry if this is not the appropriate section of the forum. I'm still not good at this.smellthemgc0 Nov 23
Nov 21 Visualization in Linux Hello there! OK, I've just built all necessary sources in Linux Mint. When I start one of examples (sc2client-api/build/bin/bot_simple, for example) I can see the log of some games. But I can't understand how it really works inside. Is there a way for Linux to visualize what happens there? Thank you in advance.Arcoon3 Nov 21
Nov 21 Bots in separate processes with C++ I would like to have my bot (written in C++) play against another bot in a different process. This is the same question as in, but for C++. Does anyone have an example for how to do this? I am trying to figure it out from the documentation at in the "Play two bots against each other" section along with the answer to the topic above, but I am having trouble converting the code to C++. Here's my latest attempt in case it helps: int main(int argc, char * argv[]) { Coordinator coordinator; coordinator.LoadSettings(argc, argv); Bot bot = Bot(); // Initialize the bot's ControlInterface? coordinator.SetParticipants({ CreateParticipant(Race::Random, &bot) }); // Port configuration from Ports ports; ports.shared_port = 5002; ports.server_ports.game_port = 5003; ports.server_ports.base_port = 5004; PortSet p1; p1.game_port = 5005; p1.base_port = 5006; ports.client_ports.push_back(p1); PortSet p2; p2.game_port = 5007; p2.base_port = 5008; ports.client_ports.push_back(p2); // I am running the game manually from another console. coordinator.Connect(5000); if (!coordinator.CreateGame("Melee\\Flat48.SC2Map")) { return 1; } if (!bot.Control()->RequestJoinGame(CreateParticipant(Race::Random, &bot), InterfaceSettings(), ports)) { return 1; } while (coordinator.Update()) { } return 0; } I think the client should be the same except it wouldn't call CreateGame. When I run this code, it connects to the game and then exits successfully without waiting for the other bot to connect. What am I missing?arlyngelei4 Nov 21
Nov 19 C# - how to use Action class for Training Hello Folks! I tried to use the C# extension of the API found here (, but couldn't really implement any BOT functionality with success. I assume I don't use the main iterating function properly, but without any documentation or source code, I couldn't figure out how to. For starters I'm trying to train an SCV in the Command Center, but nothing is happening. You can find my whole code below in the first comment, please advise me how to fix it. I would be most thankful for a full guide/example similar to the C++ ones (Build SCV, Build Supply Depot, Train Marines, All Combined: Marine Rush). As far as I know, there's none. If I get so far with the help, I'm determined to write those for common use. using Starcraft2; using SC2APIProtocol; using Google.Protobuf.Collections; using Action = SC2APIProtocol.Action; namespace Coop_Mind { public enum BuildingID { CommandCenter = 18, } public enum BuildingTrainingID { SCV = 524, } class Program { static void Main(string[] args) { Sc2SettingsFile.Sc2SettingsFile userSettings = Sc2SettingsFile.settingsFromUserDir(); Instance.StartSettings instanceSettings = Instance.StartSettings.OfUserSettings(userSettings); Func<Instance.Sc2Instance> createInstance = () =>; Sc2Game.Participant[] participants = new Sc2Game.Participant[] { Sc2Game.Participant.CreateParticipant( createInstance(), Race.Terran, MasterAgent_MainLoop), Sc2Game.Participant.CreateComputer(Race.Terran, Difficulty.VeryEasy) }; Sc2Game.GameSettings gameSettings = Sc2Game.GameSettings.OfUserSettings(userSettings) .WithMap(@"Ladder2017Season1\AbyssalReefLE.SC2Map") .WithRealtime(false); // Runs the game to the end with the given bots / map and configuration, participants)); } public static IEnumerable<Action> MasterAgent_MainLoop(GameState gameState) { Action answer = new Action(); Observation newObservation = gameState.NewObservation.Observation; MapState map = newObservation.RawData.MapState; RepeatedField<Unit> allUnits = newObservation.RawData.Units; ulong? unitTag = null; int i = 0; while (unitTag == null && i < allUnits.Count) { if (allUnits[i].UnitType == (int)BuildingID.CommandCenter) { unitTag = allUnits[i].Tag; } i++; } answer.ActionRaw = new ActionRaw(); answer.ActionRaw.ClearAction(); answer.ActionRaw.UnitCommand = new ActionRawUnitCommand(); answer.ActionRaw.UnitCommand.AbilityId = (int)BuildingTrainingID.SCV; answer.ActionRaw.UnitCommand.TargetUnitTag = unitTag.Value; yield return answer; } } }mgherry1 Nov 19
Nov 15 Watching old replays Can you use the API to bypass a glitch in order to watch old replays? When I mean older replays I mean replays that are 5-10 months old.Shaneman1 Nov 15
Nov 14 PySC2 Attacking Agent Tutorial My latest tutorial is available here: You can learn how to use reinforcement learning to enable your agent to attack the enemy.UnciePooh0 Nov 14
Nov 9 Remote SC2 API To Retail SC2 Will I able to have SC2 retail running on mac and use SC2 API on linux (another machine) to connect to this windows / mac client ? Thanks. And how do I start SC2 command in Mac ?CHC0 Nov 9
Nov 9 SC2 Developer Bnet Social Group! Hi all! If you're a SC2 dev, we have a new Bnet Social Group dedicated to SC2 developers. It's a small group of us at the moment, but with a wide range of experience! Come join and help bring the SC2 custom and AI scene together! Let's share and help each other build awesome and innovative content for the community! Also general game devs, artist and enthusiasts welcome! Nov 9
Nov 6 Weapon Cooldown not set for enemy units Quick question: I noticed that the weapon cooldown is always 0 for an enemy unit. But, the c++ documentation says: //! Time remaining for a weapon on cooldown. Not set for snapshots. float weapon_cooldown;Under the heading: // Not populated for snapshots weapon_cooldown is not under the heading: // Not populated for enemies/snapshots Is the documentation incorrect for this or should weapon_cooldown be set for enemies? I was hoping to use weapon_cooldown to know if an enemy army is actively fighting or move-commanding away, as well as when certain important enemies (such as siege tanks) have fired and left an opening to attack.Dalas1 Nov 6
Nov 4 Starcraft2 Pathfinding Logic ModusPwnens1 Nov 4
Oct 31 C++ Tutorials in PySC2 [Help] So far I was able to follow this tutorial here: and the smart pysc2 agent tutorial; To produce two agents using python. These two agents are very limited and cannot do lot other than build supply depots, barracks and marines. I then found the excellent starter tutorials provided in the s2client-api/docs... for C++ I am now attempting to follow the same tutorials but using the PySC2 module, as they seem to produce a more versatile and customisable agent. The basic principles remain the same but of course the PySC2 module has no equivalent OnUnitIdle() event. Not that I can see at least. If anyone knows how this could be called using PySC2, help would be greatly appreciated.Harlow2 Oct 31
Oct 30 Trouble loading replay pack 3.16.1 I'm trying to get the example to work on the ladder replay packs that were referenced in the API documentation. I can replay my own replays using the API so I know how to use the API (for this) I can replay the replay packs in-game, (so I know I have all the referenced maps etc.) I cannot replay the replay packs using the API. The API runs, starts a client, then restarts the correct, older,client, and then times out waiting for a connection. Any Ideas what the problem might be?Zdog6 Oct 30
Oct 30 Unlocking co-op commanders without money. So I've been really frustrated with the locked co-op commanders costing money to unlock. I have been a long time Starcraft player and a long time fan of Blizzard's RTS games and I find it a bit of a slap in the face that I need spend even more money to fully play a game that I've already paid for. I know we live in a time where micro-transactions are a standard feature in the games we play. Game creation is a business and the bottom line of any company is making money (though I'd like to think that at one point Blizzard's first priority was satisfying it's players, but that's another discussion). I also understand that these micro transactions support continued development and support for these games. That's fine. Having them available for people who don't mind paying is all well and good. The issue is that there is no other option. Similar to the many pay-to-win games that are out there, you feel cornered into paying more money to keep going. Thankfully the free commanders for co-op are well done and have a lot of re-playability in them. But there is a limit. After hundreds of "Brutal" victories, even with mutations, and such a compelling storyline and interesting other commanders, the free ones can start to feel dull. So why not have an avenue for players to unlock the other commanders through gameplay? Achievement based. I'm not saying make it easy. Have some extremely challenging achievements required to unlock them. It can be one commander at a time even. Defeat 5 different maps on Brutal without losing X amount of units; complete all mastery achievements in the campaign; reach lvl 50 mastery on all 3 free protoss commanders to unlock just one of the locked ones; are just a few examples off the top of my head. I'm sure the writers at Blizzard can come up with better ones. The possibilities are endless. The achievements could be catered to each locked commander's personality. It would bring depth to the non-multiplayer side of the game. Encourage much more gameplay from the player base Blizzard claims to love and provide a goal to play towards beyond the somewhat unsatisfying cosmetic rewards you get from other achievements. Most importantly it will provide an avenue for people who either can't afford to or have an ethical problem with paying money into a game they've already spent €60 on. I'm all for keeping the locked commanders available to be unlocked by payment. €5 isn't all that bad. I'm sure the majority of people will still pay anyways. But Blizzard, please implement a non-paying, immersive way for those of us that won't/can't do that. You will lose nothing and gain a lot, both in respect and consistent player base. Thank you.Sage1 Oct 30
Oct 29 Zerg Bug: Rally Workers/Units Commands "Rally Hatchery Workers" by friendly name and backend name appears to be mapped to the wrong ability. Specifically, it and "Rally Hatchery Units" have been transposed. Rally Workers is Hotkey "G" in game, but Hotkey "Y" in the API, and vice versa for Rally Units.Goggalor0 Oct 29
Oct 27 Websocket closed with code 1006 I tried maps like ... And set other values of RequestCreateGame Now, it just closed by remote with code 1006. Where could I get some more specific error messages? And also I made RequestPing to server, it returns ResponsePing does not contains any version numbers. SC2 version is Base58400.neoooooooooo2 Oct 27
Oct 25 How to start sc2 in command line in Windows? I installed sc2 in D:, then ,I run "D:\sc2\StarCraft II\Versions\Base58400\SC2.exe" -listen -port 5000 -displayMode 0 In command line console. But it cannot start with error message like: ... What did I miss?neoooooooooo2 Oct 25
Oct 16 map or mod longer available I am able to run replays from the replay pack just fine using: python -m --replay <path/to/replay> But when I try to run the same command on a personal replay from a 1v1 ladder match, I get the following error: SC2APIProtocol.ResponseStartReplay.Error.LaunchError: 'The launch of this game makes reference to mod or map dependencies which are no longer available.' Full console dump: Some more specifics. I'm running the pysc2 command from an Ubuntu 16.04 VM, the replays were generated on using the Windows client. Things I've eliminated: Game version miss-match. This is not it. The version of my personal replay was, and I was able to find and run replays of the same version from the replay pack. Missing map. Also not it. I tried several replays with different maps, again I verified I could find and run a replay with the same map from the replay pack. So, this leaves two things that I can think of right now. Something about attempting to run a replay generated on Windows via the Linux client. But, if this is the case, then how were the replays in the replay pack generated? Obviously those weren't played on Linux, so did they undergo some kind of preprocessing? A flag that must be set when attempting to run a replay that isn't from the replay pack. This will be my next line of investigation. I guess I'd just like to know if running replays generated from other systems is possible, and if not then is it even possible using the open-source tools that have been provided? For context, I'd like to build a strategy analyzer app using supervised learning. To analyze someone's strategy, I'll need to accept their replay regardless of what system it was generated on. If I can't do that, it's a bit of a non-starter. I also opened an issue against the pysc2 project here: Thanks.lobo1 Oct 16
Oct 13 Simple Reinforcement Learning PySC2 Tutorial Oct 13
Oct 10 Calling methods/functions from other classes UnitFinder unitFinder; const Unit* mineral_target = unitFinder.FindNearestMineralPatch(unit->pos); Is there some other way that I am supposed to do this? There is so much clutter when everything is in one file. I would love to be able to stay organized and group similar methods and functions into their own files.winapi2 Oct 10
Oct 5 AchievementId how is it made ? Hey, i need to make a software that convert the AchievemeId into a readable string. For instance, this: AchievementId:91475035554161 -> GameLink ? CategoryId:3211293 -> GameLink Category (Ranked,Unranked,1v1 etc). So the thing is how do i convert them into String/GameLink. On the JSON parse the title of that achievement is "Heart of the Swarm: Hard 20" but what make it interesting is that the official GameLink of this achievement is: <CAchievement id="Swarm10Hard">. I know that lot of SC2 Blizzard developers read the forum, answer me this time lol. Thanks !naruto2 Oct 5
Oct 1 Replay Parsing The available replays are almost 1.2 million entries. It takes roughly 1 second to determine if the replay is one that I'd want to use for training and that means to just walk the list it takes 13.8 days on my machine. I killed my IgnoreReplay() criteria and just return true with a counter console output. edit: I booted into Linux and setup headless, it's not a problem there. Is there some way to fix this for Windows?MacAttack2 Oct 1
Sep 25 SC2 API ontology question I am assuming that this question is hopelessly naïve, so please forgive my ignorance. I am currently developing a distributed, Node.js environment using the C++ API. It is working very well, but I have this nagging doubt that I really should be working with protobufs. The thing that I am confused about is how the three flavors of theAPI are related, the 1) C++ API, 2) Protocol buffers, and 3) image layers. I would very much like a clearer understanding of the relationships among these very different ways of looking at things.Arachnya2 Sep 25
Sep 24 c++ no instance of overloaded function virtual void OnUnitIdle(const Unit& unit) final { switch (unit.unit_type.ToType()) { case UNIT_TYPEID::TERRAN_COMMANDCENTER: { Actions()->UnitCommand(unit, ABILITY_ID::TRAIN_SCV); break; } default: { break; } } } the pointer between Actions() and UnitCommand(unit, ABILITY_ID::TRAIN_SCV); gives me these errors Severity Code Description Project File Line Suppression State Error (active) E0304 no instance of overloaded function "sc2::ActionInterface::UnitCommand" matches the argument list tutorial c:\Users\winapi\sc2api\examples\ 19 Severity Code Description Project File Line Suppression State Error C2664 'void sc2::ActionInterface::UnitCommand(const sc2::Units &,sc2::AbilityID,const sc2::Unit *)': cannot convert argument 1 from 'const sc2::Unit' to 'const sc2::Unit *' tutorial c:\users\orfasanti\sc2api\examples\ 19 which makes no sense because it appears as if the unit type conversion occurs explicitly at the switch creation. am I doing something wrong? if so, what? Visual Studio 15 2017winapi5 Sep 24
Sep 24 Know when an enemy fires weapon/uses ability Is there any way for the AI to figure out when an enemy unit has fired a weapon/casted an ability? As a human I can see a corrosive bile indicator, see a tank sieging up, or see a yamato cannon charging (as some examples), but I can't find a way for the AI to do the same. Using C++ Apologies in advance if this is a stupid questionDalas4 Sep 24
Sep 23 [Help]How Battle.Net HyperLink Id are made of Hello, i would like to understand how the HyperLink ID work, for example this link: battlenet:://starcraft/map/2/196936 battlenet:://<GameCode>/<reference>/<region>/MapID so i know the other reference as well (i also use HyperLink on heroes of the storm), so i'm asking for help because for example the link above, the map ID "196936" is the map: "(2)Abyssal Reef LE" from CustomGame. How is this id created ? is this the string converted to int ? I would like to know because i would be happy to then "save" each map ID's of the actual heroes of the storm brawl, so i can later "play them again" in custom game, since the game automaticaly Stream the needed ressources from Battle.Net. Hope you can help me on this, since there is no public API for heroes, but off course a private API -.- come on it's just for custom map <.< Thanks !naruto1 Sep 23
Sep 21 Basic PySC2 Agent Tutorial I have written a tutorial for building a basic agent that trains units and attacks the enemy with PySC2: Sep 21
Sep 21 Replay Speed I was able to increase SetStepSize in the coordinator to speed up games but I wanted to slow games down and step size 1 is still pretty fast. Can it be slowed down any further or is it just going to run as fast as the computer you're on?MacAttack2 Sep 21
Sep 18 Making a helpfile of available actions I was wondering if there was something like this yet (or a search of some kind to go through each action) otherwise I am planning on making one.TonyP3 Sep 18
Sep 17 Python bot: questions and progress Hello, I have tried to adapt the PySC2 framework in order to make a heuristic bot. Ideally I would like to have something that could play build orders from spawning tool. Is there a file with units and buildings data? In particular: id, cost, build time, requirements. Any option to enable sound through pysc2? I have managed to get a very rudimentary bot working: but progress is quite slow. Having a full time job already and low programming experience doesn't help. Is there any similar python project going that I could join?Asharai5 Sep 17
Sep 17 How this was achieved? I'm very new to C++ so it's likely I've just missed it but how exactly was this achieved? I assume you would need to be able to track either the projectile or the unit the enemy is targeting for this to be achievable? Is that possible with the API? I've tried coming up with ideas through weapon_cooldown and who the enemy is targeting but I'm unsure either are able to be tracked for enemy units. ThanksSleep2 Sep 17
Sep 17 Cant get collect Mineral Shards Map to work Title. Seems to work on most of the other minigames from the ones I tried but for some reason it just gets to the loading screen and crashes after the loading is finished.TonyP2 Sep 17
Sep 16 unit_type_id of 373 In an Observation, one of the units that I see has unit_type_id value of 373, which I don't see listed in enum class UNIT_TYPEID. What kind of unit is it?PinkFreud2 Sep 16
Sep 12 IsPathable(), IsPlacable(), and HasCreep() I have been trying to get these Observation() methods working as described, but there seems to be a problem. In the include files, it implies that at least the first two respond to structure placement, but as far as I can tell, the results are unchanged from the original map at game startup. I have not tested Observation()->HasCreep(), but its correct implementation is critical for creep bridge strategies.Arachnya2 Sep 12
Sep 11 RequestAvailableMaps returns no maps Im having trouble with maps. First, I never see any .SCMap files downloaded, either after playing ladder games or custom games. So I downloaded the maps here: But RequestAvailableMaps keeps returning an empty list. This is Windows, and I start SC2 with: Target: "C:\Program Files (x86)\StarCraft II\Versions\Base56787\SC2_x64.exe" -sso=1 -launch -uid s2_enus -listen -port 999 Start in: "C:\Program Files (x86)\StarCraft II\Support64" I tried putting them in a Maps directory under c:\Program Files (x86)\StarCraft II, and I also tried them in a Maps directory under c:\Program Files (x86)\StarCraft II\Support64. I tried using full paths like "C:\Program Files (x86)\StarCraft II\Maps\ None of these causes RequestAvailableMaps to return anything. Any idea what I might be doing wrong? AndyPinkFreud2 Sep 11
Sep 8 Simple maps for early game development I was wondering if anyone knew where I could find some simple maps for early stages of game development.Arachnya3 Sep 8
Sep 6 Raw interface - building footprints Is there a way to determine what spaces a structures is taking up via the Raw interface? This is pretty trivial for player-constructed structures, which have known sizes, and predictable things like minerals/vespene, but I'm particularly concerned about things like the destructible barriers, which vary widely but are strategically important. The current state of the map, including those barriers, is reflected via the pathing grid, and it appears that it is updated if there are subsequent changes to what structures are on the map, but as far as I can tell I don't have enough information to predict which parts of the pathing grid are subject to change.TinSoldier2 Sep 6
Sep 2 How does it work? Hello, I don't know anything about programming, so I can't understand very well all the stuff on GitHub... I just wanted to know if there is some "ready to play" content that we could download to check this new IA in game? I looked in the "CommandCenter" thing, but when I launch the CommandCenter.exe, it does nothing. I also grabbed the "s2client-api-master" and "s2client-proto-master" folders, put their content in my SC2 folder, but here again, nothing. So if someone could help me understand... It would be appreciated. Thanks :)Test4 Sep 2
Sep 2 first try, first bloo... bug/misunderstanding Tried to run it first time with pySc2, got this bug. Anyone knows that i need to do? (i'm ok with programming, but this look like version conflict or something strange around lib) E:\summer\StarcraftAI2\s2client-api>python -m pysc2.bin.agent --map Simple64 Exception in thread Thread-1: Traceback (most recent call last): File "E:\Anaconda\Python\lib\", line 914, in _bootstrap_inner File "E:\Anaconda\Python\lib\", line 862, in run self._target(*self._args, **self._kwargs) File "E:\Anaconda\Python\lib\site-packages\pysc2\bin\", line 74, in run_thread visualize=visualize) as env: File "E:\Anaconda\Python\lib\site-packages\pysc2\env\", line 154, in __init__ self._run_config = run_configs.get() File "E:\Anaconda\Python\lib\site-packages\pysc2\run_configs\", line 39, in get return max(configs.values(), key=lambda c: c.priority())() File "E:\Anaconda\Python\lib\site-packages\pysc2\run_configs\", line 52, in __init__ "Support64") File "E:\Anaconda\Python\lib\site-packages\pysc2\run_configs\", line 36, in __init__ versions = os.listdir(os.path.join(base_dir, "Versions")) FileNotFoundError: [WinError 3] Системе не удается найти указанный путь: 'C:/Program Files (x86)/StarCraft II\\Versions' Tryed with C++ that i know much better than Python, got -- Configuring incomplete, errors occurred! See also "E:/summer/StarcraftAI2/s2client-api/CMakeFiles/CMakeOutput.log". CMakeOutput.log says everything ok. I'm really love to try it, but now i need some help.DwarfHeretic11 Sep 2
Aug 30 Linux client problems Good day! First of all, I want to thank you for this API. I waited for something like this for a long time. Next. I have loaded all necessary sources (StarCraftII Linux client, s2client-api and s2client-proto) for my system (Linux Mint), replay-files and maps and successfully built sources. Now I don't know what to do and can't find some tutorials. As I understand before I can run your example-bots I should run SCII-client (StarCraftII/Versions/Base55958/SC2_x64). But when I try to do that, I have this in my term: arcoon@arcoon ~ $ StarCraftII/Versions/Base55958/SC2_x64 Version: B55958 (SC2.3.16) Build: Jul 31 2017 13:19:41 Command Line: '"StarCraftII/Versions/Base55958/SC2_x64"' Starting up... Startup Phase 1 complete Startup Phase 2 complete Creating stub renderer... Missing listen/port command line. Fatal error encountered! Backtrace: StarCraftII/Versions/Base55958/SC2_x64[0x653068] StarCraftII/Versions/Base55958/SC2_x64[0x653aa0] StarCraftII/Versions/Base55958/SC2_x64[0x6534f2] StarCraftII/Versions/Base55958/SC2_x64[0xf995ba] StarCraftII/Versions/Base55958/SC2_x64[0x192d269] StarCraftII/Versions/Base55958/SC2_x64[0x1932955] StarCraftII/Versions/Base55958/SC2_x64[0x5ed4b3] /lib/x86_64-linux-gnu/[0x7f66031f0830] StarCraftII/Versions/Base55958/SC2_x64[0x5ed2d9] Error condition code: '9' Error suffix: 'Error' Error preface: 'A fatal error occurred:' Error failure: 'e_errorIdDamaged' Error details: '"AppErrors.txt" Failed to initialize port' Error description: 'AppErrors.txt' Error signal: '11' Backtrace: StarCraftII/Versions/Base55958/SC2_x64[0x652f73] /lib/x86_64-linux-gnu/[0x7f66032054b0] StarCraftII/Versions/Base55958/SC2_x64[0x69bbe3] StarCraftII/Versions/Base55958/SC2_x64[0x654e0f] StarCraftII/Versions/Base55958/SC2_x64[0x654ffd] StarCraftII/Versions/Base55958/SC2_x64[0x654e59] StarCraftII/Versions/Base55958/SC2_x64[0x1298380] /lib/x86_64-linux-gnu/[0x7f6603209ff8] /lib/x86_64-linux-gnu/[0x7f660320a045] StarCraftII/Versions/Base55958/SC2_x64[0x674e3e] StarCraftII/Versions/Base55958/SC2_x64[0x653aaa] StarCraftII/Versions/Base55958/SC2_x64[0x6534f2] StarCraftII/Versions/Base55958/SC2_x64[0xf995ba] StarCraftII/Versions/Base55958/SC2_x64[0x192d269] StarCraftII/Versions/Base55958/SC2_x64[0x1932955] StarCraftII/Versions/Base55958/SC2_x64[0x5ed4b3] /lib/x86_64-linux-gnu/[0x7f66031f0830] StarCraftII/Versions/Base55958/SC2_x64[0x5ed2d9] As I understand, there should be some "listen/port command line", but I have not found some explanations what exactly is this. --help option or command "man SC2_x64" does not give anything. Can you please give some step-by-step Linux start tutorial? Thank you in advance!Arcoon1 Aug 30
Aug 28 Coordinator Update() question I am a little confused by the documentation for the Coordinator Update() method. In the documents, it is implied that in real-time mode, that the bot is supposed to request something called an 'Observation', which is then parsed to generate the various On... events and such for individual units. However, in playing my Node.js bot in the real-time mode through a UDP connection, I do not directly request an 'Observation', nor do I know how to do this in the scripting interface. That said, everything seems to work as I expect - I get the On... events and my commands are processed correctly. Still, because of what I read in the documentation, I feel as though I am missing something important, and was wondering if this is the case.Arachnya2 Aug 28