def Update(self, gameState: TekkenGameState): BotBehaviors.Basic(gameState, self.botCommands) if self.botCommands.IsAvailable(): BotBehaviors.BlockAllAttacks(gameState, self.botCommands) if gameState.IsBotBlocking() or gameState.IsBotGettingHit(): self.botCommands.AddCommand(self.response)
def Update(self, gameState: TekkenGameState): super().Update(gameState) if self.LastMoveName != self.BotMove: self.LastMoveName = self.BotMove #print(self.BotMove) if self.botCommands.IsAvailable(): BotBehaviors.BlockAllAttacks(gameState, self.botCommands) #Check to see if the bot is standing if gameState.stateLog[-1].bot.simple_state != ( SimpleMoveStates.STANDING): self.FrameLastAction = self.frameCounter else: if self.distance > 1500: self.botCommands.AddCommand( self.botCommands.ForwarddashSmall()) elif self.DetermineIfAction(): if self.Command is not None: if (isinstance(self.Command, list)): Command = self.Command.pop(0) else: Command = self.Command print(Command) self.overlay.WriteToOverlay(Command) self.botCommands.AddCommand(ParseMoveList(Command))
def Update(self, gameState: TekkenGameState): super().Update(gameState) if self.botCommands.IsAvailable() and gameState.IsForegroundPID(): # BotMove = gameState.GetCurrentBotMoveName() # if BotMove != self.LastBotMoveName: # self.LastBotMoveName = BotMove # print("Bot Move:" + BotMove) #if gameState.DidBotStartGettingPunishedXFramesAgo(30): #print(gameState.stateLog[-1].bot.hit_outcome) #if gameState.GetFramesSinceBotTookDamage() < 15: if gameState.stateLog[-1].bot.hit_outcome in self.HitList(): if self.lastMove: print("Punished") # self.NumCorrectPunished = self.NumCorrectPunished + 1 # self.Movelist.removeMoveFromGameplan(self.lastMove) self.lastMove = None # if not self.Movelist.gameplan: # self.exit = True # print("Percentage of punishes: " + str((float(self.NumCorrectPunished) / float(self.CountOfAttempts)) * 100) + "%") # print("Total Punished: " + str(self.NumCorrectPunished)) # print("Total Attempts: " + str(self.CountOfAttempts)) BotBehaviors.BlockAllAttacks(gameState, self.botCommands) #Check to see if the bot is standing if gameState.stateLog[-1].bot.simple_state != (SimpleMoveStates.STANDING): self.FrameLastAction = self.frameCounter #print(gameState.stateLog[-1].bot.simple_state) else: if self.distance > 1500: self.botCommands.AddCommand(self.botCommands.ForwarddashSmall()) elif self.DetermineIfAction(): #print(self.distance) #self.botCommands.AddCommand(random.choice(self.punishableMoves)) #print(random.choice(self.punishableMoves)) if len(self.queue) == 0: self.lastMove = self.Movelist.getNextGameplanMove() if(self.overlay != None): self.overlay.WriteToOverlay(self.Movelist.getMoveName(self.lastMove) + "\t" + self.Movelist.getMoveOnBlock(self.lastMove)) self.FrameLastAction = self.frameCounter self.queue.append(self.lastMove) self.queue.append(self.lastMove) self.queue.append(self.lastMove) else: self.lastMove = self.queue.pop(0) #move = self.Movelist[-1] #command = move.getMoveCommand command = self.Movelist.getMoveCommand(self.lastMove) print("Move: " + self.Movelist.getMoveName(self.lastMove) + "\nID: " + self.Movelist.getMoveId(self.lastMove) + "\n") #print(ParseMoveList(command)) if command is not None: self.botCommands.AddCommand(ParseMoveList(command)) self.CountOfAttempts = self.CountOfAttempts + 1
def Update(self, gameState: TekkenGameState): self.enemyCyclopedia.Update(gameState) if gameState.WasFightReset(): self.botCommands.ClearCommands() self.gameplan = None if self.gameplan == None: char_id = gameState.GetBotCharId() if char_id != None: self.gameplan = GetGameplan(char_id) if self.gameplan != None: BotBehaviors.Basic(gameState, self.botCommands) if self.botCommands.IsAvailable(): BotBehaviors.BlockAllAttacks(gameState, self.botCommands) frameAdvantage = None if gameState.IsBotBlocking(): frameAdvantage = self.enemyCyclopedia.GetFrameAdvantage( gameState.GetOppMoveId()) elif gameState.IsBotGettingHit(): frameAdvantage = self.enemyCyclopedia.GetFrameAdvantage( gameState.GetOppMoveId(), isOnBlock=False) try: frameAdvantage = int(frameAdvantage) * -1 except: frameAdvantage = None if frameAdvantage != None: if frameAdvantage >= 10: if gameState.IsBotWhileStanding(): punish = self.gameplan.GetMoveByFrame( ResponseTypes.ws_punishes, frameAdvantage) else: punish = self.gameplan.GetMoveByFrame( ResponseTypes.st_punishes, frameAdvantage) if punish != None: self.botCommands.AddCommand(punish)
def Update(self, gameState: TekkenGameState): super().Update(gameState) #self.cyclopedia_p1.Update(gameState) #self.cyclopedia_p2.Update(gameState) currentPlayerMoveName = gameState.GetCurrentOppMoveName() if(currentPlayerMoveName != self.LastPlayerMoveName): self.LastPlayerMoveName = currentPlayerMoveName #print(self.LastPlayerMoveName) ###Testing #test = self.OppMovelist.getMoveById(5) #print(self.OppMovelist.DidMoveJustHappen(self.BotMoveHistory, test)) ###End Testing if self.botCommands.IsAvailable() and gameState.IsForegroundPID(): if gameState.stateLog[-1].bot.hit_outcome in self.HitList(): if self.lastMove: print("Punished") #get player character's correct punishes #if player used correct punish count as punished self.lastMove = None BotBehaviors.BlockAllAttacks(gameState, self.botCommands) #Check to see if the bot is standing if gameState.stateLog[-1].bot.simple_state != (SimpleMoveStates.STANDING): self.FrameLastAction = self.frameCounter else: if self.distance > 1500: self.botCommands.AddCommand(self.botCommands.ForwarddashSmall()) elif self.DetermineIfAction(): if len(self.queue) == 0: self.lastMove = self.Movelist.getNextGameplanMove() if(self.overlay != None): self.overlay.WriteToOverlay(self.Movelist.getMoveName(self.lastMove) + "\t" + self.Movelist.getMoveOnBlock(self.lastMove)) self.FrameLastAction = self.frameCounter self.queue.append(self.lastMove) self.queue.append(self.lastMove) self.queue.append(self.lastMove) else: self.lastMove = self.queue.pop(0) command = self.Movelist.getMoveCommand(self.lastMove) print("Move: " + self.Movelist.getMoveName(self.lastMove) + "\nID: " + self.Movelist.getMoveId(self.lastMove) + "\n") if command is not None: self.botCommands.AddCommand(ParseMoveList(command)) self.CountOfAttempts = self.CountOfAttempts + 1
def Update(self, gameState: TekkenGameState): successfulUpdate = gameState.Update() if gameState.IsGameHappening(): #debugging # if(self.botSimpleState != gameState.stateLog[-1].bot.simple_state.name): # self.botSimpleState = gameState.stateLog[-1].bot.simple_state.name #print("Bot Simple State: " + gameState.stateLog[-1].bot.simple_state.name) self.overlay.WriteToOverlay("Bot Simple State: " + gameState.stateLog[-1].bot.simple_state.name) BotBehaviors.Basic(gameState, self.botCommands) if gameState.WasFightReset(): self.botCommands.ClearCommands() self.gameplan = None if self.gameplan == None : char_id = gameState.GetBotCharId() if char_id != None: self.gameplan = GetGameplan(char_id) if self.botCommands.IsAvailable(): BotBehaviors.BlockAllAttacks(gameState, self.botCommands)
def Update(self, gameState: TekkenGameState): super().Update(gameState) self.Movelist.shuffleGameplan() if self.botCommands.IsAvailable(): if gameState.stateLog[-1].bot.hit_outcome in self.HitList(): if self.lastMove: print("Punished") self.NumCorrectPunished = self.NumCorrectPunished + 1 self.Movelist.removeMoveFromGameplan(self.lastMove) self.lastMove = None if not self.Movelist.gameplan: self.exit = True print("Percentage of punishes: " + str((float(self.NumCorrectPunished) / float(self.CountOfAttempts)) * 100) + "%") print("Total Punished: " + str(self.NumCorrectPunished)) print("Total Attempts: " + str(self.CountOfAttempts)) BotBehaviors.BlockAllAttacks(gameState, self.botCommands) #Check to see if the bot is standing if gameState.stateLog[-1].bot.simple_state != ( SimpleMoveStates.STANDING): self.FrameLastAction = self.frameCounter else: if self.distance > 1500: self.botCommands.AddCommand( self.botCommands.ForwarddashSmall()) elif self.DetermineIfAction(): if len(self.queue) == 0: self.lastMove = self.Movelist.getNextGameplanMove() else: self.lastMove = self.queue.pop(0) command = self.Movelist.getMoveCommand(self.lastMove, 0) print("Move: " + self.Movelist.getMoveName(self.lastMove) + "\nID: " + self.Movelist.getMoveId(self.lastMove) + "\n") if command is not None: self.botCommands.AddCommand(ParseMoveList(command)) self.CountOfAttempts = self.CountOfAttempts + 1
def Update(self, gameState: TekkenGameState): successfulUpdate = gameState.Update() #if successfulUpdate: # self.cyclopedia_p1.Update(self.gameState) # self.cyclopedia_p2.Update(self.gameState) #print(gameState.GetCurrentBotMoveName()) #debugging if not self.recorder == None: self.recorder.Update(gameState) BotBehaviors.Basic(gameState, self.botCommands) if self.gameplan == None: char_id = gameState.GetBotCharId() print("Testing Char ID: " + str(char_id)) if char_id != None: self.gameplan = GetGameplan(char_id) self.Movelist = MoveList(char_id) self.useMoves = self.Movelist.allMoves self.Movelist.getGameplan(1) if gameState.WasFightReset(): self.botCommands.ClearCommands() self.gameplan = None if gameState.IsGameHappening(): self.frameCounter += 1 self.distance = gameState.GetDist() self.BotMove = gameState.GetCurrentBotMoveName() Stance = self.Movelist.GetStanceFromGameMove(self.BotMove) if (Stance != None): self.Stance = Stance # if self.botCommands.IsAvailable(): return successfulUpdate
def Update(self, gameState: TekkenGameState): BotBehaviors.Basic(gameState, self.botCommands) if self.gameplan == None: char_id = gameState.GetBotCharId() print("Testing Char ID: " + str(char_id)) if char_id != None: self.gameplan = GetGameplan(char_id) self.Movelist = MoveList(char_id) self.useMoves = self.Movelist.allMoves self.Movelist.getGameplan(1) self.OppMovelist = MoveList(gameState.stateLog[-1].opp.char_id) if gameState.WasFightReset(): self.botCommands.ClearCommands() if gameState.IsGameHappening(): self.frameCounter += 1 self.distance = gameState.GetDist() self.BotMove = gameState.GetCurrentBotMoveName() self.AppendBotMove(gameState.GetCurrentOppMoveName()) Stance = self.Movelist.GetStanceFromGameMove(self.BotMove) if (Stance != None): self.Stance = Stance
def Update(self, gameState: TekkenGameState): successfulUpdate = gameState.Update() if gameState.IsGameHappening(): self.frameCounter += 1 self.distance = gameState.GetDist() if not self.recorder == None: self.recorder.Update(gameState) BotBehaviors.Basic(gameState, self.botCommands) if gameState.WasFightReset(): self.botCommands.ClearCommands() self.gameplan = None if self.gameplan == None: char_id = gameState.GetBotCharId() if char_id != None: self.gameplan = GetGameplan(char_id) #self.punishableMoves = self.gameplan.GetPunishableMoves() #self.allMoves = getMoves(char_id) #self.useMoves = getPunishableMoves(self.allMoves) self.allMoves = MoveList(char_id) self.useMoves = self.allMoves.allMoves self.allMoves.getGameplan(1) self.allMoves.shuffleGameplan() if self.botCommands.IsAvailable(): #if gameState.DidBotStartGettingPunishedXFramesAgo(30): #gameState.IsOppAbleToAct() if gameState.stateLog[-1].bot.IsPunish( ) or gameState.stateLog[-1].bot.IsBeingJuggled(): #if gameState.GetFramesSinceBotTookDamage() < 30: if self.lastMove: print("Punished") self.NumCorrectPunished = self.NumCorrectPunished + 1 self.allMoves.removeMoveFromGameplan(self.lastMove) self.lastMove = None if not self.allMoves.gameplan: self.exit = True print("Percentage of punishes: " + str((float(self.NumCorrectPunished) / float(self.CountOfAttempts)) * 100) + "%") print("Total Punished: " + str(self.NumCorrectPunished)) print("Total Attempts: " + str(self.CountOfAttempts)) BotBehaviors.BlockAllAttacks(gameState, self.botCommands) #Check to see if the bot is standing if gameState.stateLog[-1].bot.simple_state != ( SimpleMoveStates.STANDING): self.FrameLastAction = self.frameCounter #print(gameState.stateLog[-1].bot.simple_state) else: if self.distance > 1500: self.botCommands.AddCommand( self.botCommands.ForwarddashSmall()) elif self.DetermineIfAction(): #print(self.distance) #self.botCommands.AddCommand(random.choice(self.punishableMoves)) #print(random.choice(self.punishableMoves)) if len(self.queue) == 0: self.lastMove = self.allMoves.getNextGameplanMove() #move = self.allMoves.getMoveById(18) #self.queue.append(move) #self.queue.append(move) else: self.lastMove = self.queue.pop(0) #move = self.allMoves[-1] #command = move.getMoveCommand command = self.allMoves.getMoveCommand(self.lastMove, 0) print("Move: " + self.allMoves.getMoveName(self.lastMove) + "\nID: " + self.allMoves.getMoveId(self.lastMove) + "\n") #print(ParseMoveList(command)) if command is not None: self.botCommands.AddCommand(ParseMoveList(command)) self.CountOfAttempts = self.CountOfAttempts + 1