public static BuildChoices GetZergBuildChoices(DefaultSharkyBot defaultSharkyBot) { var zerglingRush = new BasicZerglingRush(defaultSharkyBot.BuildOptions, defaultSharkyBot.MacroData, defaultSharkyBot.ActiveUnitData, defaultSharkyBot.AttackData, defaultSharkyBot.ChatService, defaultSharkyBot.MicroTaskData, defaultSharkyBot.UnitCountService); var mutaliskRush = new MutaliskRush(defaultSharkyBot.BuildOptions, defaultSharkyBot.MacroData, defaultSharkyBot.ActiveUnitData, defaultSharkyBot.AttackData, defaultSharkyBot.ChatService, defaultSharkyBot.UnitCountService); var zergBuilds = new Dictionary <string, ISharkyBuild> { [zerglingRush.Name()] = zerglingRush, [mutaliskRush.Name()] = mutaliskRush }; var defaultSequences = new List <List <string> > { new List <string> { zerglingRush.Name(), mutaliskRush.Name() }, new List <string> { mutaliskRush.Name() }, }; var buildSequences = new Dictionary <string, List <List <string> > > { [Race.Terran.ToString()] = defaultSequences, [Race.Zerg.ToString()] = defaultSequences, [Race.Protoss.ToString()] = defaultSequences, [Race.Random.ToString()] = defaultSequences, ["Transition"] = defaultSequences }; return(new BuildChoices { Builds = zergBuilds, BuildSequences = buildSequences }); }
public FourGate(DefaultSharkyBot defaultSharkyBot, ICounterTransitioner counterTransitioner) : base(defaultSharkyBot, counterTransitioner) { SharkyUnitData = defaultSharkyBot.SharkyUnitData; OpeningAttackChatSent = false; }
public static void Main(string[] args) { Console.WriteLine("starting"); // first we need to create a game connection for the SC2 api. The bot uses this to communicate with the game var gameConnection = new GameConnection(); // We get a default bot that has everything setup. You can manually create one instead if you want to more heavily customize it. var defaultSharkyBot = new DefaultSharkyBot(gameConnection); // we configure the bot with our own builds defaultSharkyBot.BuildChoices[Race.Protoss] = MyBuildChoices.GetProtossBuildChoices(defaultSharkyBot); defaultSharkyBot.BuildChoices[Race.Zerg] = MyBuildChoices.GetZergBuildChoices(defaultSharkyBot); defaultSharkyBot.BuildChoices[Race.Terran] = MyBuildChoices.GetTerranBuildChoices(defaultSharkyBot); // we create a bot with the modified default bot we made var sharkyExampleBot = defaultSharkyBot.CreateBot(defaultSharkyBot.Managers, defaultSharkyBot.DebugService); var myRace = Race.Random; if (args.Length == 0) { // if there are no arguments passed we play against a comptuer opponent gameConnection.RunSinglePlayer(sharkyExampleBot, @"AutomatonLE.SC2Map", myRace, Race.Random, Difficulty.VeryHard, AIBuild.RandomBuild).Wait(); } else { // when a bot runs on the ladder it will pass arguments for a specific map, enemy, etc. gameConnection.RunLadder(sharkyExampleBot, myRace, args).Wait(); } }
public static BuildChoices GetZergBuildChoices(DefaultSharkyBot defaultSharkyBot) { var zerglingRush = new BasicZerglingRush(defaultSharkyBot); var mutaliskRush = new MutaliskRush(defaultSharkyBot); var zergBuilds = new Dictionary <string, ISharkyBuild> { [zerglingRush.Name()] = zerglingRush, [mutaliskRush.Name()] = mutaliskRush }; var defaultSequences = new List <List <string> > { new List <string> { zerglingRush.Name(), mutaliskRush.Name() }, new List <string> { mutaliskRush.Name() }, }; var buildSequences = new Dictionary <string, List <List <string> > > { [Race.Terran.ToString()] = defaultSequences, [Race.Zerg.ToString()] = defaultSequences, [Race.Protoss.ToString()] = defaultSequences, [Race.Random.ToString()] = defaultSequences, ["Transition"] = defaultSequences }; return(new BuildChoices { Builds = zergBuilds, BuildSequences = buildSequences }); }
public ReaperCheese(DefaultSharkyBot defaultSharkyBot, IIndividualMicroController scvMicroController) : base(defaultSharkyBot) { ProxyLocationService = defaultSharkyBot.ProxyLocationService; OpeningAttackChatSent = false; ProxyTask = new ProxyTask(defaultSharkyBot.SharkyUnitData, false, 0.9f, MacroData, string.Empty, MicroTaskData, defaultSharkyBot.DebugService, scvMicroController); ProxyTask.ProxyName = GetType().Name; }
public BuildManager(DefaultSharkyBot defaultSharkyBot) { BuildChoices = defaultSharkyBot.BuildChoices; DebugService = defaultSharkyBot.DebugService; MacroBalancer = defaultSharkyBot.MacroBalancer; BuildDecisionService = defaultSharkyBot.BuildDecisionService; EnemyPlayerService = defaultSharkyBot.EnemyPlayerService; ChatHistory = defaultSharkyBot.ChatHistory; EnemyStrategyHistory = defaultSharkyBot.EnemyStrategyHistory; }
public SharkyBuild(DefaultSharkyBot defaultSharkyBot) { BuildOptions = defaultSharkyBot.BuildOptions; MacroData = defaultSharkyBot.MacroData; ActiveUnitData = defaultSharkyBot.ActiveUnitData; AttackData = defaultSharkyBot.AttackData; ChatService = defaultSharkyBot.ChatService; UnitCountService = defaultSharkyBot.UnitCountService; MicroTaskData = defaultSharkyBot.MicroTaskData; }
public ProxyVoidRay(DefaultSharkyBot defaultSharkyBot, ICounterTransitioner counterTransitioner, IIndividualMicroController probeMicroController) : base(defaultSharkyBot, counterTransitioner) { SharkyOptions = defaultSharkyBot.SharkyOptions; SharkyUnitData = defaultSharkyBot.SharkyUnitData; ProxyLocationService = defaultSharkyBot.ProxyLocationService; OpeningAttackChatSent = false; CancelledProxyChatSent = false; ProxyTask = new ProxyTask(SharkyUnitData, false, 0.9f, MacroData, string.Empty, MicroTaskData, defaultSharkyBot.DebugService, probeMicroController); ProxyTask.ProxyName = GetType().Name; }
static void Main(string[] args) { Console.WriteLine("Hello World!"); // first we need to create a game connection for the SC2 api. The bot uses this to communicate with the game var gameConnection = new GameConnection(); // We get a default bot that has everything setup. You can create one from scratch instead if you want to more heavily customize it. var defaultSharkyBot = new DefaultSharkyBot(gameConnection); var debug = false; #if DEBUG debug = true; // if you run in debug mode you can see useful information on the game screen #endif defaultSharkyBot.SharkyOptions.Debug = debug; // we configure the bot with our own builds defaultSharkyBot.BuildChoices[Race.Protoss] = MyBuildChoices.GetProtossBuildChoices(defaultSharkyBot); defaultSharkyBot.BuildChoices[Race.Zerg] = MyBuildChoices.GetZergBuildChoices(defaultSharkyBot); defaultSharkyBot.BuildChoices[Race.Terran] = MyBuildChoices.GetTerranBuildChoices(defaultSharkyBot); // we add custom micro defaultSharkyBot.MicroData.IndividualMicroControllers[UnitTypes.TERRAN_MARINE] = new MyMarineMicroController(defaultSharkyBot.MapDataService, defaultSharkyBot.SharkyUnitData, defaultSharkyBot.ActiveUnitData, defaultSharkyBot.DebugService, defaultSharkyBot.SharkySimplePathFinder, defaultSharkyBot.BaseData, defaultSharkyBot.SharkyOptions, defaultSharkyBot.DamageService, defaultSharkyBot.UnitDataService, MicroPriority.LiveAndAttack, false); defaultSharkyBot.MicroData.IndividualMicroControllers[UnitTypes.TERRAN_BANSHEE] = new MyBansheeMicroController(defaultSharkyBot.MapDataService, defaultSharkyBot.SharkyUnitData, defaultSharkyBot.ActiveUnitData, defaultSharkyBot.DebugService, defaultSharkyBot.SharkySimplePathFinder, defaultSharkyBot.BaseData, defaultSharkyBot.SharkyOptions, defaultSharkyBot.DamageService, defaultSharkyBot.UnitDataService, MicroPriority.LiveAndAttack, false); // we add custom tasks var bansheeHarassController = new MyBansheeMicroController(defaultSharkyBot.MapDataService, defaultSharkyBot.SharkyUnitData, defaultSharkyBot.ActiveUnitData, defaultSharkyBot.DebugService, defaultSharkyBot.SharkyPathFinder, defaultSharkyBot.BaseData, defaultSharkyBot.SharkyOptions, defaultSharkyBot.DamageService, defaultSharkyBot.UnitDataService, MicroPriority.LiveAndAttack, false); // we use SharkyPathFinder for the harass micro, a more resource intensive pathing controller that should be used only for a few units at once defaultSharkyBot.MicroTaskData.MicroTasks["MyBansheeHarassTask"] = new MyBansheeHarassTask(defaultSharkyBot.BaseData, defaultSharkyBot.TargetingData, defaultSharkyBot.MapDataService, bansheeHarassController); // we add our custom enemy strategies var zealotRush = new EnemyStrategies.ZealotRush(defaultSharkyBot.EnemyStrategyHistory, defaultSharkyBot.ChatService, defaultSharkyBot.UnitCountService, defaultSharkyBot.SharkyOptions); defaultSharkyBot.EnemyData.EnemyStrategies[zealotRush.Name()] = zealotRush; // we create a bot with the modified default bot we made var sharkyExampleBot = defaultSharkyBot.CreateBot(defaultSharkyBot.Managers, defaultSharkyBot.DebugService); var myRace = Race.Terran; // if you change your bot's race make sure you also update ladderbots.json if you're using it on the ladder if (args.Length == 0) { // if we just run the program without arguments we'll play against a random built in AI gameConnection.RunSinglePlayer(sharkyExampleBot, @"AutomatonLE.SC2Map", myRace, Race.Random, Difficulty.VeryHard, AIBuild.RandomBuild).Wait(); } else { // when a bot runs on the ladder it will pass arguments for a specific map, enemy, etc. gameConnection.RunLadder(sharkyExampleBot, myRace, args).Wait(); } }
public static BuildChoices GetTerranBuildChoices(DefaultSharkyBot defaultSharkyBot) { var scveMicroController = new IndividualMicroController(defaultSharkyBot.MapDataService, defaultSharkyBot.SharkyUnitData, defaultSharkyBot.ActiveUnitData, defaultSharkyBot.DebugService, defaultSharkyBot.SharkyPathFinder, defaultSharkyBot.BaseData, defaultSharkyBot.SharkyOptions, defaultSharkyBot.DamageService, defaultSharkyBot.UnitDataService, MicroPriority.JustLive, false); var massMarines = new MassMarines(defaultSharkyBot.BuildOptions, defaultSharkyBot.MacroData, defaultSharkyBot.ActiveUnitData, defaultSharkyBot.AttackData, defaultSharkyBot.ChatService, defaultSharkyBot.UnitCountService); var bansheesAndMarines = new BansheesAndMarines(defaultSharkyBot.BuildOptions, defaultSharkyBot.MacroData, defaultSharkyBot.ActiveUnitData, defaultSharkyBot.AttackData, defaultSharkyBot.ChatService, defaultSharkyBot.MicroTaskData, defaultSharkyBot.UnitCountService); var reaperCheese = new ReaperCheese(defaultSharkyBot.BuildOptions, defaultSharkyBot.MacroData, defaultSharkyBot.ActiveUnitData, defaultSharkyBot.AttackData, defaultSharkyBot.ChatService, defaultSharkyBot.MicroTaskData, defaultSharkyBot.UnitCountService, defaultSharkyBot.SharkyUnitData, defaultSharkyBot.ProxyLocationService, defaultSharkyBot.DebugService, scveMicroController); var builds = new Dictionary <string, ISharkyBuild> { [reaperCheese.Name()] = reaperCheese, [massMarines.Name()] = massMarines, [bansheesAndMarines.Name()] = bansheesAndMarines }; var defaultSequences = new List <List <string> > { new List <string> { reaperCheese.Name(), bansheesAndMarines.Name() }, new List <string> { massMarines.Name(), bansheesAndMarines.Name() }, new List <string> { bansheesAndMarines.Name() } }; var buildSequences = new Dictionary <string, List <List <string> > > { [Race.Terran.ToString()] = defaultSequences, [Race.Zerg.ToString()] = defaultSequences, [Race.Protoss.ToString()] = defaultSequences, [Race.Random.ToString()] = defaultSequences, ["Transition"] = defaultSequences }; return(new BuildChoices { Builds = builds, BuildSequences = buildSequences }); }
public static BuildChoices GetTerranBuildChoices(DefaultSharkyBot defaultSharkyBot) { var scveMicroController = new IndividualMicroController(defaultSharkyBot, MicroPriority.JustLive, false); var massMarines = new MassMarines(defaultSharkyBot); var bansheesAndMarines = new BansheesAndMarines(defaultSharkyBot); var reaperCheese = new ReaperCheese(defaultSharkyBot, scveMicroController); var builds = new Dictionary <string, ISharkyBuild> { [reaperCheese.Name()] = reaperCheese, [massMarines.Name()] = massMarines, [bansheesAndMarines.Name()] = bansheesAndMarines }; var defaultSequences = new List <List <string> > { new List <string> { reaperCheese.Name(), bansheesAndMarines.Name() }, new List <string> { massMarines.Name(), bansheesAndMarines.Name() }, new List <string> { bansheesAndMarines.Name() } }; var buildSequences = new Dictionary <string, List <List <string> > > { [Race.Terran.ToString()] = defaultSequences, [Race.Zerg.ToString()] = defaultSequences, [Race.Protoss.ToString()] = defaultSequences, [Race.Random.ToString()] = defaultSequences, ["Transition"] = defaultSequences }; return(new BuildChoices { Builds = builds, BuildSequences = buildSequences }); }
public ProtossCounterTransitioner(DefaultSharkyBot defaultSharkyBot) { EnemyData = defaultSharkyBot.EnemyData; SharkyOptions = defaultSharkyBot.SharkyOptions; }
public BuildNothing(DefaultSharkyBot defaultSharkyBot) : base(defaultSharkyBot) { }
public EveryProtossUnit(DefaultSharkyBot defaultSharkyBot, ICounterTransitioner counterTransitioner) : base(defaultSharkyBot, counterTransitioner) { }
public static BuildChoices GetProtossBuildChoices(DefaultSharkyBot defaultSharkyBot) { // we can use this to switch builds mid-game if we detect certain strategies (it can also be handled specificly for each build) var protossCounterTransitioner = new ProtossCounterTransitioner(defaultSharkyBot); // a probe microcontroller for our proxy builds var probeMicroController = new IndividualMicroController(defaultSharkyBot, MicroPriority.JustLive, false); // We create all of our builds var proxyVoidRay = new ProxyVoidRay(defaultSharkyBot, protossCounterTransitioner, probeMicroController); var zealotRush = new ZealotRush(defaultSharkyBot, protossCounterTransitioner); var robo = new Robo(defaultSharkyBot, protossCounterTransitioner); var nexusFirst = new NexusFirst(defaultSharkyBot, protossCounterTransitioner); var protossRobo = new ProtossRobo(defaultSharkyBot, protossCounterTransitioner); // We add all the builds to a build dictionary which we will later pass to the BuildChoices. var protossBuilds = new Dictionary <string, ISharkyBuild> { [proxyVoidRay.Name()] = proxyVoidRay, [zealotRush.Name()] = zealotRush, [robo.Name()] = robo, [nexusFirst.Name()] = nexusFirst, [protossRobo.Name()] = protossRobo, }; // we create build sequences to be used by each matchup var defaultSequences = new List <List <string> > { new List <string> { proxyVoidRay.Name() }, new List <string> { nexusFirst.Name(), robo.Name(), protossRobo.Name() }, new List <string> { zealotRush.Name() } }; var zergSequences = new List <List <string> > { new List <string> { zealotRush.Name() }, new List <string> { proxyVoidRay.Name() }, new List <string> { nexusFirst.Name(), robo.Name(), protossRobo.Name() } }; var transitionSequences = new List <List <string> > { new List <string> { robo.Name(), protossRobo.Name() } }; var protossBuildSequences = new Dictionary <string, List <List <string> > > { [Race.Terran.ToString()] = defaultSequences, [Race.Zerg.ToString()] = zergSequences, [Race.Protoss.ToString()] = defaultSequences, [Race.Random.ToString()] = defaultSequences, ["Transition"] = transitionSequences }; return(new BuildChoices { Builds = protossBuilds, BuildSequences = protossBuildSequences }); }
public ZealotRush(DefaultSharkyBot defaultSharkyBot, ICounterTransitioner counterTransitioner) : base(defaultSharkyBot, counterTransitioner) { OpeningAttackChatSent = false; }
public ProtossRobo(DefaultSharkyBot defaultSharkyBot, ICounterTransitioner counterTransitioner) : base(defaultSharkyBot, counterTransitioner) { SharkyOptions = defaultSharkyBot.SharkyOptions; EnemyData = defaultSharkyBot.EnemyData; }
public MutaliskRush(DefaultSharkyBot defaultSharkyBot) : base(defaultSharkyBot) { }
public EveryZergUnit(DefaultSharkyBot defaultSharkyBot) : base(defaultSharkyBot) { }
public ZergSharkyBuild(DefaultSharkyBot defaultSharkyBot) : base(defaultSharkyBot) { }
public AntiMassMarine(DefaultSharkyBot defaultSharkyBot, ICounterTransitioner counterTransitioner) : base(defaultSharkyBot, counterTransitioner) { }
public Twilight(DefaultSharkyBot defaultSharkyBot, ICounterTransitioner counterTransitioner) : base(defaultSharkyBot, counterTransitioner) { }
public TerranSharkyBuild(DefaultSharkyBot defaultSharkyBot) : base(defaultSharkyBot) { }
public NexusFirstWithForge(DefaultSharkyBot defaultSharkyBot, ICounterTransitioner counterTransitioner) : base(defaultSharkyBot, counterTransitioner) { }
public BansheesAndMarines(DefaultSharkyBot defaultSharkyBot) : base(defaultSharkyBot) { }
public BasicZerglingRush(DefaultSharkyBot defaultSharkyBot) : base(defaultSharkyBot) { }
public Stargate(DefaultSharkyBot defaultSharkyBot, ICounterTransitioner counterTransitioner) : base(defaultSharkyBot, counterTransitioner) { }
public Robo(DefaultSharkyBot defaultSharkyBot, ICounterTransitioner counterTransitioner) : base(defaultSharkyBot, counterTransitioner) { EnemyData = defaultSharkyBot.EnemyData; }
public ProtossSharkyBuild(DefaultSharkyBot defaultSharkyBot, ICounterTransitioner counterTransitioner) : base(defaultSharkyBot) { ChronoData = defaultSharkyBot.ChronoData; CounterTransitioner = counterTransitioner; }
public MassMarines(DefaultSharkyBot defaultSharkyBot) : base(defaultSharkyBot) { }