Skip to content
This repository was archived by the owner on Jul 31, 2021. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
92 commits
Select commit Hold shift + click to select a range
53608bc
update check disabled (faster boot), removed unused multiprocessing r…
WAZAAAAA0 Mar 26, 2018
9ccc225
fixed case-sensitive link
WAZAAAAA0 Mar 26, 2018
fa94be1
images sizes losslessly reduced with FileOptimizer
WAZAAAAA0 Mar 26, 2018
55e2384
"pip install requests" no longer needed to run from source
WAZAAAAA0 Mar 26, 2018
5c4ab5a
better overlay defaults
WAZAAAAA0 Mar 26, 2018
55b2ca5
2018-03-19 patch addresses
WAZAAAAA0 Mar 26, 2018
264bae8
updating readmes
WAZAAAAA0 Mar 26, 2018
db04087
missing "requests" requirements
WAZAAAAA0 Mar 26, 2018
2cd43a9
Add files via upload
KulaGGin Mar 29, 2018
2b958d3
Update GUI_TekkenBotPrime.py
KulaGGin Mar 29, 2018
249b49d
Update GUI_FrameDataOverlay.py
KulaGGin Mar 29, 2018
7ba7bc5
Update GUI_FrameDataOverlay.py
KulaGGin Mar 29, 2018
496cddc
Update GUI_FrameDataOverlay.py
KulaGGin Mar 29, 2018
72a45a3
Update GUI_FrameDataOverlay.py
KulaGGin Mar 29, 2018
abb7506
Add files via upload
KulaGGin Mar 29, 2018
1c38ec2
Update GUI_FrameDataOverlay.py
KulaGGin Mar 29, 2018
35e072e
2018-04-13 patch addresses (by exassasinx)
WAZAAAAA0 Apr 13, 2018
475e901
Merge pull request #2 from KulaGGin/master
WAZAAAAA0 Jun 2, 2018
07cdf9d
no more requests library dependency
WAZAAAAA0 Jun 2, 2018
f4996d4
Create Noctis.txt
craigduff Mar 28, 2018
f2d37b4
building instructions
WAZAAAAA0 Jun 2, 2018
51bab4a
repetita iuvant
WAZAAAAA0 Jun 2, 2018
0b694b5
2018-05-31 patch addresses 1.14 (by Psylence)
WAZAAAAA0 Jun 2, 2018
d08e5df
version number
WAZAAAAA0 Sep 7, 2018
a0c4d06
higher contrast text
WAZAAAAA0 Sep 7, 2018
fba61b6
CT cleaned and updated (2018-09-05)
WAZAAAAA0 Sep 7, 2018
fefe00f
2018-09-05 patch addresses 2.00
WAZAAAAA0 Sep 7, 2018
f2c0b55
Improved punish alarms to notify player how minus an attack is.
MichaelKhalil Sep 22, 2018
85e586a
Added auto throw break :) (optional)
WAZAAAAA0 Dec 3, 2018
326b0ed
rec & opp columns default off
WAZAAAAA0 Dec 3, 2018
5675428
remove outdated comment
WAZAAAAA0 Dec 3, 2018
8aa18e0
version number
WAZAAAAA0 Dec 3, 2018
bbb97e5
2018-12-03 CT updated, now prettier and smarter
WAZAAAAA0 Dec 3, 2018
d00b713
2018-12-03 patch addresses 2.10
WAZAAAAA0 Dec 3, 2018
7d03315
2.20 Patch addresses (without ignorables)
kokole Feb 28, 2019
68f72f9
FAQ
WAZAAAAA0 Mar 1, 2019
7c2a2b8
version number
WAZAAAAA0 Mar 1, 2019
015b301
Update build_project.bat
WAZAAAAA0 Mar 1, 2019
39ee22e
2019-02-28 CT 2.20 (by kokole)
WAZAAAAA0 Mar 1, 2019
8e051ab
Merge branch 'master' of https://github.com/WAZAAAAA0/TekkenBot
WAZAAAAA0 Mar 1, 2019
b3f59b1
Merge pull request #11 from kokole/patch-1
WAZAAAAA0 Mar 1, 2019
799b921
version number
WAZAAAAA0 May 31, 2019
c32761b
FAQ fix
WAZAAAAA0 May 31, 2019
c75a4a8
missing character codes
WAZAAAAA0 May 31, 2019
5f59367
2019-05-30 patch addresses 2.30
WAZAAAAA0 May 31, 2019
e94bc62
Add startup and recovery frame display to command input overlay
Jun 1, 2019
5014643
cleanup code before pull request
Jun 1, 2019
791c3e6
Merge pull request #15 from lmpriestley/master
WAZAAAAA0 Jun 4, 2019
8a3ff5e
forks info
WAZAAAAA0 Sep 10, 2019
67f3f88
version number
WAZAAAAA0 Sep 10, 2019
5705b4d
Merge branch 'master' of https://github.com/WAZAAAAA0/TekkenBot
WAZAAAAA0 Sep 10, 2019
2bd4011
Revert "Merge branch 'master' of https://github.com/WAZAAAAA0/TekkenBot"
WAZAAAAA0 Sep 10, 2019
2d73ec4
new character ID
WAZAAAAA0 Sep 10, 2019
50673d2
additional offset fix
WAZAAAAA0 Sep 10, 2019
3aa14ee
2019-09-09 patch addresses 3.00 (by Gelatin)
WAZAAAAA0 Sep 10, 2019
a9d5742
correct steps order
WAZAAAAA0 Dec 14, 2019
490112e
version number
WAZAAAAA0 Dec 14, 2019
a7e4ace
new character IDs
WAZAAAAA0 Dec 14, 2019
020e1e5
2019-12-09 CT 3.10 (added extras)
WAZAAAAA0 Dec 14, 2019
861ec2d
2019-12-09 patch addresses 3.10 (by Psylence, porcino, FimoX, Alchemy…
WAZAAAAA0 Dec 14, 2019
89868ca
version number
WAZAAAAA0 Feb 14, 2020
01880ef
accommodating the new Jump status
WAZAAAAA0 Feb 14, 2020
c8c21ae
2020-02-12 3.21 CT
WAZAAAAA0 Feb 14, 2020
eea39b3
2020-02-12 3.21 patch addresses (by FimoX, Alchemy-Meister)
WAZAAAAA0 Feb 14, 2020
3609303
Updated addresses for 3.30 patch from #1 posted by Fimox.
KulaGGin Mar 25, 2020
89fb447
Merge pull request #20 from KulaGGin/master
WAZAAAAA0 Mar 25, 2020
f9576d3
add dcep93's fork
WAZAAAAA0 Jun 26, 2020
3c87ef9
version bump
WAZAAAAA0 Nov 11, 2020
4d9fc2c
added Fahkumram and Kunimitsu to the character ID list
WAZAAAAA0 Nov 11, 2020
a51beae
2020-11-09 patch addresses 4.00 (by Gelatin)
WAZAAAAA0 Nov 11, 2020
dbf5067
version bump
WAZAAAAA0 Mar 24, 2021
93e75b4
new byte sizes for attack_type/throw_tech, new character ID
WAZAAAAA0 Mar 24, 2021
080e4c4
new throw_tech values
WAZAAAAA0 Mar 24, 2021
0c564be
2021-03-22 patch addresses 4.10 (by FimoX, Gelatin)
WAZAAAAA0 Mar 24, 2021
44d2aae
version bump
WAZAAAAA0 Mar 26, 2021
37f6689
add missing ThrowTechs enumeration
WAZAAAAA0 Mar 26, 2021
7f2a961
version bump
WAZAAAAA0 May 30, 2021
14d380d
friendlier message
WAZAAAAA0 May 30, 2021
13ea1fc
2021-05-27 patch addresses 4.20 (by FimoX)
WAZAAAAA0 May 30, 2021
d25de03
version bump
WAZAAAAA0 Oct 3, 2021
4f426d7
2021-09-28 patch addresses 4.22 (by FimoX)
WAZAAAAA0 Oct 3, 2021
a07ac31
version bump
WAZAAAAA0 Oct 29, 2021
0be4745
CPU fix by skipping error loop
WAZAAAAA0 Oct 29, 2021
d0576cc
version bump
WAZAAAAA0 Aug 17, 2022
02b632b
2022-08-17 patch addresses 5.00
WAZAAAAA0 Aug 17, 2022
b18f254
Added passiveBot; Attempts to do counters whenever possible
EdibleRoses Sep 2, 2022
34c43df
bugfix with counters
EdibleRoses Sep 3, 2022
134ca63
don't force Lucky Chloe
WAZAAAAA0 Dec 17, 2022
fe93ca1
version bump
WAZAAAAA0 Dec 17, 2022
430d9a6
2022-12-13 patch addresses 5.10 (by FimoX)
WAZAAAAA0 Dec 17, 2022
cdf28ab
fixed missing module import for sys
egdose Jun 30, 2023
5accce7
Merge pull request #55 from egdose/master
WAZAAAAA0 Feb 24, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#These are output folders, we don't want them in github
__pycache__/
/build
/dist

TekkenBotPrime.spec
43 changes: 41 additions & 2 deletions BasicCommands.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,16 @@ class UniversalCommands:
[0, 0, 2, 12]
))

BACKDASH_FULL = list(zip(
[Command.TapBack, Command.TapBack],
[0, 2]
))

FORWARDDASH= list(zip(
[Command.TapForward, Command.TapForward],
[0, 2]
))

FORWARDDASH_HALF = list(zip(
[Command.TapForward, Command.TapForward, Command.TapBack],
[0, 2, 5]
Expand All @@ -36,8 +46,13 @@ class UniversalCommands:
))

SIDESTEP_UP = list(zip(
[Command.TapUp, Command.TapBack],
[0, 16]
[Command.TapUp],
[0]
))

SIDESTEP_DOWN = list(zip(
[Command.TapDown],
[0]
))

BLOCK_LONG = list(zip(
Expand Down Expand Up @@ -134,9 +149,15 @@ def MashTech(self):
def Backdash(self):
self.AddCommand(UniversalCommands.BACKDASH)

def BackdashFull(self):
self.AddCommand(UniversalCommands.BACKDASH_FULL)

def ForwarddashSmall(self):
self.AddCommand(UniversalCommands.FORWARDDASH_HALF)

def Fowarddash(self):
self.AddCommand(UniversalCommands.FORWARDDASH)

def SidestepRight(self):
self.AddCommand(UniversalCommands.SIDESTEP_RIGHT)

Expand All @@ -146,6 +167,9 @@ def SidestepLeft(self):
def SidestepUp(self):
self.AddCommand(UniversalCommands.SIDESTEP_UP)

def SidestepDown(self):
self.AddCommand(UniversalCommands.SIDESTEP_DOWN)

def BlockAndWait(self):
self.AddCommand(UniversalCommands.BLOCK_LONG)

Expand All @@ -157,6 +181,17 @@ def BlockMidFull(self, startup):
self.AddCommand(UniversalCommands.BLOCK_MID_FULL)
self.commandBuffer[1] = (self.commandBuffer[1][0], startup)

def BlockLowNow(self, startup):
"""
Testing Function

A more instant access to blocking lows
"""
self.ClearCommands()
self.inputController.HoldBack()
self.inputController.HoldDown()
self.BlockLowFull(startup)

def BlockLowFull(self, startup):
self.commandBuffer = []
self.AddCommand(UniversalCommands.BLOCK_LOW_FULL)
Expand All @@ -171,6 +206,10 @@ def WalkForward(self, startup):
self.commandBuffer = []
self.AddCommand([(Command.HoldForward, startup)])

def WalkBackwards(self, startup):
self.commandBuffer = []
self.AddCommand([(Command.HoldBack, startup)])

def MashContinue(self):
self.AddCommand(UniversalCommands.MASH_CONTINUE)

Expand Down
133 changes: 128 additions & 5 deletions BotData.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,20 @@
from dis import dis
from xml.dom.minidom import CharacterData
from TekkenGameState import TekkenGameState
from BasicCommands import BotCommands
from CharacterData import *

import random

class BotBehaviors:

# NOTE: Bot have trouble defending against attacks like Akuma's "hyaki zangeki".
# Likely due to the fact that the initial jump is counted as a mid/high attack.
# Causing the bot to continue defending mid/high when a low is executed after.

def Basic(gameState, botCommands):
if BotBehaviors.TryBreakThrows(gameState, botCommands):
return
BotBehaviors.StopPressingButtonsAfterGettingHit(gameState, botCommands)
BotBehaviors.GetUp(gameState, botCommands)
BotBehaviors.TechCombos(gameState, botCommands)
Expand All @@ -16,7 +27,7 @@ def StopPressingButtonsAfterGettingHit(gameState, botCommands):

def TechThrows(gameState, botCommands):
if gameState.IsBotBeingThrown():
botCommands.ThrowTech()
botCommands.MashTech()

def GetUp(gameState, botCommands):
if gameState.IsBotOnGround():
Expand All @@ -26,13 +37,125 @@ def TechCombos(gameState, botCommands):
if gameState.IsBotBeingJuggled():
botCommands.MashTech()

def BlockAllAttacks(gameState: TekkenGameState, botCommands:BotCommands):
def DefendAllAttacks(gameState: TekkenGameState, botCommands:BotCommands):
if gameState.IsOppAttacking():
frames = gameState.GetOppTimeUntilImpact()
if gameState.IsOppAttackLow():
botCommands.BlockLowFull(max(0, gameState.GetOppTimeUntilImpact()))
botCommands.BlockLowFull(max(0, frames))
else:
botCommands.BlockMidFull(max(0, gameState.GetOppTimeUntilImpact()))
botCommands.BlockMidFull(max(0, frames))

def TryBreakThrows(gameState: TekkenGameState, botCommands:BotCommands) -> bool:
"""
Spam break throws when opponent is attempting to throw.

Output
-----------------
True if the bot is attempting break throws
"""
if BotBehaviors.OppIsThrowing(gameState):
print("Breaking Throws")
botCommands.MashTech()
return True
return False

def OppIsThrowing(gameState: TekkenGameState):
if gameState.IsOppAttackThrow():
return True
elif gameState.IsBotStartedBeingThrown():
return True
elif gameState.IsBotBeingThrown():
return True
return False


def DefendAndCounter(gameState: TekkenGameState, botCommands:BotCommands, gameplan: Gameplan) -> bool:
"""
Counter (with another attack) whenever possible, blocks otherwise.

Output
-----------------
If True, the bot is doing blocks/Dodges/nothing.
If False, the bot is countering.
"""

if gameState.IsBotAttackStarting():
return False

if gameState.IsOppAttacking():
# TODO: Poke on whiff
oppAirborne = gameState.IsOppAirborne()
frames = gameState.GetOppTimeUntilImpact()
dist = gameState.GetDist()

# Higher the number, the higher the chance AI chooses
# trying to counter
COUNTER_CHANCE = 90

# Dont counter if distance is too big (2.0)
if dist < 2000.0 and COUNTER_CHANCE >= random.randint(0, 100):
counter = BotBehaviors.CanCounter(frames - 2, gameState, oppAirborne)
else:
counter = False

oppLowAtk = gameState.IsOppAttackLow()
oppMidAtk = gameState.IsOppAttackMid()
oppHighAtk = not oppLowAtk and not oppMidAtk

if counter:
counterCommand = None
if oppAirborne:
counterCommand = gameplan.GetMoveByFrame(ResponseTypes.air_counters, frames - 1)
print("Get Counter for air :: " + str(counterCommand))
elif oppLowAtk:
counterCommand = gameplan.GetMoveByFrame(ResponseTypes.low_counters, frames - 1)
print("Get Counter for low :: " + str(counterCommand))
elif oppMidAtk:
counterCommand = gameplan.GetMoveByFrame(ResponseTypes.mid_counters, frames - 1)
print("Get Counter for Mid :: " + str(counterCommand))
else:
counterCommand = gameplan.GetMoveByFrame(ResponseTypes.high_counters, frames - 1)
print("Get Counter for High :: " + str(counterCommand))

if not counterCommand == None:
botCommands.AddCommand(counterCommand)
return False

# Out of 100, higher the number, higher the chance AI chooses to dodge
DODGE_CHANCE = 40
dodgeChance = random.randint(1, 100)

if DODGE_CHANCE > dodgeChance and oppHighAtk:
print("Dodging High")
botCommands.BlockLowFull(max(0, frames))
return True
elif oppLowAtk:
print("Blocking Low")
botCommands.BlockLowFull(max(0, frames))
return True
else:
print("Blocking HighMid")
botCommands.BlockMidFull(max(0, frames))
return True
return True

def UnblockIncomingAttacks(self, gameState: TekkenGameState):
if gameState.IsOppAttacking():
self.botCommands.WalkForward(max(0, gameState.GetOppTimeUntilImpact()))
self.botCommands.WalkForward(max(0, gameState.GetOppTimeUntilImpact()))

def CanCounter(frames: int, gameState: TekkenGameState, airborneOpp: bool):
# Dont counter crushes
if gameState.IsOppPowerCrush():
return False
# Dont counter if we are currently blocking
elif gameState.IsBotBlocking():
return False

# Counter if the attack is more than 10 frames
elif frames > 10:
return True
# Counter if the opponent is airborn, and the attack is more than 5 frames.
elif airborneOpp and frames > 5:
return True
else:
return False
2 changes: 1 addition & 1 deletion BotFrameTrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def Update(self, gameState: TekkenGameState):
BotBehaviors.Basic(gameState, self.botCommands)

if self.botCommands.IsAvailable():
BotBehaviors.BlockAllAttacks(gameState, self.botCommands)
BotBehaviors.DefendAllAttacks(gameState, self.botCommands)
if gameState.IsBotBlocking() or gameState.IsBotGettingHit():
self.botCommands.AddCommand(self.response)

Expand Down
Loading