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: https://github.com/davechurchill/CommandCenter 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, Battle.net 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
4h combat mini-games I've been looking for somebody that's created a bunch of maps that will aid an AI to learn how to do combat. pysc2's marines vs. roaches is one thing, but it's extremely limiting compared to the real game. What really seems to be needed is a bunch of different combat scenarios involving many different units across various map situations such that two players (built-in bot or agent) can mash them against each other repeatedly to learn what seems to work best. Hasn't anybody done this yet? If not, is anybody willing to collaborate and create such a repository of combat maps/scenarios?fatz3 4h
2d Question about accurate unit statistics Sorry if this is the wrong place to post this, if my post is in the correct location please let me know and I'll repost in the proper place. I am trying to make an ai that accurately micros terran reapers, but to do this I need to be able to encode the precise stats about the unit eg. max speed, acceleration, turn speed, etc. I am currently getting these numbers from reapers created in the map editor - the data source for these reapers is 'Void.SC2Mod'. My question is how accurately the unit stats found in the map editor correspond to the unit stats found in a multiplayer game of StarCraft2 played today. I noticed that some of the numbers found in the editor do not match some of the numbers I have found online. For example, liquipedia lists reaper health regen as 2.8hp/second under combat drugs (https://liquipedia.net/starcraft2/Reaper_(Legacy_of_the_Void)), but reaper life regen in the editor is listed as a flat 2. Which number is more current, and what would be the best source for finding accurate unit statistics?ppfishstick2 2d
6d How to hook an agent to a custom game lobby? If you want to start a custom melee game and have an AI play in it how do you do that?NinjaNight1 6d
May 11 Parse replays without relaunching the client Hello, I'm creating a program that extracts build orders from replays. I'm only interested in the first 5 minutes of the game, so I call the update function (22*5*60) times. To move on to the next replay, I currently recreate the coordinator and the replay_observer, which quits the game and launches the client again. This process is naturally very slow, and a bottle neck in the system. I was wondering if there is anyway to quit a replay early and start a new replay with the same client. If so, could you please point me to an example or methods I need to use? Thank you!FiNDoL1 May 11
May 11 Accepting surrender I am playing around with the SC2 API both in C++ and in Python. The Python version regrettably has no action that allows you to accept when an AI want to surrender so I am trying to figure out if there is something along those lines available in the C++ version of the library. Can someone point me in the right direction? Kind regards.DrkNess1 May 11
May 11 Your Development Update - April 16, 2018 Following up on the post from a few weeks ago, it seemed like a good time to check in with everyone to see what's going on in StarCraft community dev. Reply with what you have been working on or any issue you have run into recently! My Update I got co-op support working for sc2reader https://github.com/ggtracker/sc2reader/pull/44 and have got it working with the spawningtool library as well. Unfortunately, there are a lot of special cases with co-op to handle. There are a ton of new units and upgrades to label and map, and different commanders have talents that change build times, so I have to account for that, too. I have been mostly mining for these by hand, but if anyone knows an easier way to automate that process, that would be helpful.StoicLoofah6 May 11
May 7 SC2 AI Framework for C#, F# and Python Hi StarCraft II community! We are developing a Framework for writing AIs for StarCraft II in C#, F# and Python as part of our bachelor thesis at the IT University of Copenhagen. It is meant to remove some of the hassles of working with the official C++ API, while still allowing developers full control and direct access to all commands available in the official API. Another key design feature is modularity - enabling developers to write a very small module and easily have it up and running with other already implemented modules. We are going to launch the first version of the framework in just over a month and will gather feedback to improve and evaluate the project. If you are interested in hearing more and maybe help test our framework (or would like to help us understand the SC2 community better) please fill out this short survey: https://www.surveymonkey.com/r/J8L8XZF We will provide documentation and 'get started' tutorials before launch! Sincerely Jens Schmidt & Mikkel Lamhauge BSc Students - Software DevelopmentSchmidt3 May 7
Apr 30 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 127.0.0.1 -port 5000 -displayMode 0 In command line console. But it cannot start with error message like: ... What did I miss?neoooooooooo4 Apr 30
Mar 29 Your Development Update - March 26, 2018 Having not been particularly active in this community, I thought it would be fun to have a semi-regular (maybe biweekly thread) where everyone can reply with what they are currently building with the StarCraft 2 API or other related projects. Maybe it will surface some common issues that we're running into. At a minimum, I'm just curious what interesting things you guys are doing! Here's my update: Currently, the spawningtool replay parsing library does a decent job with normal ladder replays, but it doesn't give useful results on co-op games. The first step is recognizing co-op replays, which is an open issue in s2protocol https://github.com/Blizzard/s2protocol/issues/69 . After that, I need to address some issues with sc2reader, then add a lot more unit types and upgrades as recognized types. What are you guys working on?StoicLoofah1 Mar 29
Mar 20 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?NinjaNight2 Mar 20
Feb 28 blizzard should upgrade the engine there is periodic graphical updates of StarCraft 2. blizzard should boost multicore performance. they could for example run the internet Connection separately from the rendering(on separate cores). for example Connection on 2 cores and rendering on 2 cores. is you have suggestion to how the engine can be further upgraded please post them here.andreasasp0 Feb 28
Feb 22 Possible? - An AI that plays on the ladder? Or is there no way to connect the AI to the ladder? If I were to create one I would want to test it against real players and see what rank it can achieve. I have no clue how this could be done though.NinjaNight3 Feb 22
Feb 18 gameloop travel time between map points Is anybody willing to share code that calculates actual in-game travel time for a given unit to a target (global/raw) destination? I don’t know exactly what Blizzard’s implementation is to solve this in-game automatic pathing problem. I suspect it’s some variation of A* search algorithm, be it Dijkstra’s algorithm or something else. I haven’t implemented this before (my current solution is very crude) and I have so many other AI problems to solve too. Yet, it appears that my AI’s decision making is much better if also being able to account for predicted movement time. But I do know my crude solution isn’t adequate; better accuracy is needed. I figure this problem is sufficiently common that others may have already solved it and perchance somebody might be willing to share the code! Perhaps being a bit naive, I included some outlined requirements below for what this function would need to do. Your contributions are greatly appreciated! General requirements: Even if there’s somehow a more efficient/faster solution, I need the reported answer to match actual game time. A general algorithm isn’t helpful unless it’s been proven to ~accurately mirro Blizzard’s. The algorithm must be obtained wholly within the agent/client process. I must assume I cannot query the sc2 game process even if this algorithm is available externally from there. (It’s too slow to make this query with inter-process communication.) Map obstacles must be taken into account, including dynamic obstacles (such as whether rocks are destroyed or not, where impassable buildings are placed, whether mineral nodes are depleted, etc.) In other words, do not assume the map is static. The map state is dynamic. Handle air units differently from ground units; their pathing rules are different. A solution in any programming language is okay, though compatibility with the provided SC2 API is preferred (i.e. python or C++). Inputs: moveable_unit: A unit definition (which also defines its source location, unit type, which also dictates speed, acceleration, turning rate, air/ground movement type, etc.) target_destination: a world map location: (x,y,z) -- although z is optional as we’re clicking on a 2-d screen. map_creep: a worldmap grid defining whether creep is present or not. NOTE: I’m using a worldmap grip as represented by SC2’s observation response, one point for each (x,y) whole value, restricted by actual map dimensions. Example: a 240x180 map would be represented as an array containing 240*180 = 43,200 points. Also, it is unclear to me whether further resolution is needed to truly resolve this problem. map_state: a worldmap grid defining whether the each grid point is ‘passable’ or not. …. Additional input you require is okay. Outputs: The number of gameloops (integer) required for a given unit to reach the intended destination. NOTE: a value that can be converted into a gameloop is also okay (such as milliseconds). Exception-handling: Desired destinations which are non-pathable must reflect an appropriate value (infinite gameloop value, a generated exception, etc.). Bonus points: (not required for general application, but for an optimal algorithm, these requirements would also be handled) Account for altered pathing rules when loaded into a transport (or a non-moveable transport, such as a bunker). I.e. an overlord transport may move at a different speed than a Zergling. Account for alternative map shortcuts, such as Zerg nydus canal or abilities such as Battlecruiser hyperspace or Protoss recall. Account for temporary speed modifers such as creep for select Zerg units, movements impairments such as stasis or fungal growth, or boosts such as medivac boost. Make no assumptions about specific game unit definitions. Alternative game versions may define units differently (different speeds, different abilities, etc.). These should be pre-determined by provided game unit definition(s). Handle exotic movement types such as reaper cliff jumping and colossus walking. This may also necessitate knowing whether a cliff is jumpable or not, but it is unclear to me how to retrieve this information in-game. Identify whether movement is additionally impaired (or impeded entirely) by other units blocking the way. NOTE: workers with gathering orders appear to ignore these movement restrictions.fatz6 Feb 18
Feb 15 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.TonyP4 Feb 15
Feb 15 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?PinkFreud3 Feb 15
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 https://medium.com/@skjb/build-a-sparse-reward-pysc2-agent-a44e94ba5255UnciePooh0 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/Battle.net 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 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 https://us.battle.net/forums/en/sc2/topic/20758617484, but for C++. Does anyone have an example for how to do this? I am trying to figure it out from the documentation at https://github.com/Blizzard/s2client-proto/blob/master/docs/protocol.md 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 https://gist.github.com/KevinCalderone/29c8e20feb05146aae9c97e018313ee0 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 (https://github.com/matthid/s2client-dotnet), 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 = () => Runner.run(Instance.start(instanceSettings)); 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 Runner.run(Sc2Game.runGame(gameSettings, 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: https://medium.com/@skjb/add-smart-attacking-to-your-pysc2-agent-17fd5caad578 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! https://blizzard.com/invite/DLdEETVJmDevinScott2 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: https://chatbotslife.com/building-a-basic-pysc2-agent-b109cde1477c 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 replay.cc to work on the ladder replay packs that were referenced in the API documentation. https://github.com/Blizzard/s2client-proto#downloads 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 16 map or mod dependencies...no longer available I am able to run replays from the replay pack just fine using: python -m pysc2.bin.play --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: https://gist.github.com/loganjhennessy/c831cb5428c449d60f9be047bd68e82b Some more specifics. I'm running the pysc2 command from an Ubuntu 16.04 VM, the replays were generated on Battle.net using the Windows client. Things I've eliminated: Game version miss-match. This is not it. The version of my personal replay was 3.16.1.55958, 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: https://github.com/deepmind/pysc2/issues/94 Thanks.lobo1 Oct 16
Oct 13 Simple Reinforcement Learning PySC2 Tutorial https://medium.com/@skjb/building-a-smart-pysc2-agent-cdc269cb095dUnciePooh1 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\tutorial.cc 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\tutorial.cc 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: https://medium.com/@skjb/building-a-basic-pysc2-agent-b109cde1477cUnciePooh4 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