#Starcraft 2 game code code#
All I did to pick up the game enough was just code basic bots, run them in real-time, and then make various changes in real-time to see what worked next well, then I would code that in, and repeat. I wont spend too much time explaining the game from here, since I am not an expert. Despite looking like a fairly simple game on the exterior, it's actually an extremely complex and competitive game. Are they rushing you? Are they leaving you alone and amassing an army? What race are they? Are they researching upgrades? How much expansion have they done?. Some maps are more open, while others have far fewer paths you could take across it, you need to determine which areas to safely expand your base to.etc.įinally, the enemy player is an obviously large factor too. Even just considering your chosen path to the types of buildings, upgrades, and units, things are already getting fairly complex, but then we also engage in battles on a large variety of maps with different topologies. From here, you build a Gateway, then a Cybernetics Core, then a Twilight Council, THEN Templar Archives.īuildings, workers, and fighters all cost you resources and, arguably the most important element: Time. So, to build a "High Templar," you first must have a Nexus (you start with this, it's like your "command center"). The source for this image is Protoss Units, and is a fairly useful resource if you have no idea what you are doing in the actual game, like me.Īs you can see, this is a tree-diagram, where one thing leads often to another. It only seems fitting since we're coding an AI here.įor the Protoss, the following diagram breaks down all of the buildings and units that you can create: The Protoss are more technology/robotics-based, so that's the race that I am going to at least start out playing with. In StarCraft II, there are 3 "races:" Terran, Protoss, and Zerg. Eventually, your objective is to amass an army to take out your opponent(s). From here, you can build more buildings that unlock new units, like combat units, and then you can do things like purchase/research upgrades for units or for even better units. The point of the games are to put you against other players, or computers, where you start with a "base," which allows you to build basic units that collect resources. Prior to this point, I had never actually played StarCraft II myself, but I have played many similar games like Command and Conquer and Age of Empires. Around mid 2017, DeepMind and Blizzard (the creators of StarCraft II) announced a partnership and API for interacting with the strategy game.
#Starcraft 2 game code series#
Welcome to a tutorial series where we will be creating Python bots and AI for the game: StarCraft II.