Pokémon Red/Blue AI tournament - Introduction
Iddjy
0:00 / 0:00
Pokémon Red/Blue AI tournament - Introduction
126 просмотров · 2 недели назад
Iddjy
38 подписчиков
126 просмотров · 2 недели назад
If you're curious about the ROM hack itself, the details are in the repo.
Github repo:
https://github.com/Iddjy/Predaitor/tree/ma...
I didn't push the teams for the tournament on Github yet, but I might do that later. Anyway it wouldn't be hard to replicate them in the ROM from the info given in this video.
---
The tournament format will include 2 stages:
Stage 1 is the group stage. The 16 contenders will be placed in 4 groups of 4, where each trainer will battle the other 3 twice. The 2 best trainers from each group will progress to stage 2.
Stage 2 is the knock out stage. The 8 qualified trainers will be paired in quarter finals, and the winners will progress to the semi-finals and then the finals, until only one remains.
This way no one gets eliminated straight away after just one match.
For group placement, I divided the 16 trainers into 4 tiers based on their CP, and each group has one trainer from each tier. Apart from that, it is random (I swear!).
---
CP formula for a trainer:
CP = sum of the CP of their Pokémon
CP formula for a Pokémon:
CP = Base HP + Base Defense + Base Special + Base Speed * 1.5 + moves CP
I didn't include Base Attack and only included Base Special once because I wanted attacking stats to only be made relevant by the moves the Pokémon has, since if a Pokémon only has special moves it will never use its Attack stat (except for Struggle and hitting itself in confusion), conversely, if a Pokémon only has physical moves, its Special stat is only used for defense, so it shouldn't count twice. This way, the more a Pokémon has damaging moves of a certain category, the more the corresponding stat will weigh in their CP.
I apply a 1.5 multiplier to Base Speed for several reasons. By order of importance:
critical hit ratio is based on it
going first is very important
some effects can only work if you're faster than the opponent (flinching, OHKO moves)
CP formula for a move:
CP = Base Power * Accuracy/100 * STAB bonus * attacking base stat/100 * effect coefficent + effect constant
where:
STAB bonus is:
1 if the move doesn't share a type with the Pokémon, or if it doesn't do damage, or if its damage calculation doesn't use STAB (like fixed damage moves for example)
1.5 otherwise
attakcing base stat is either Base Attack or Base Special according to the move type. I don't use the raw stat because that would blow out the CP to very high values, so instead I use the ratio over 100. For non-damaging moves or moves whose damage calculation doesn't use the Pokémon's stats, this factor is ignored.
effect coefficient is a multiplier I gave each move effect, for example to account for moves that hit multiple times, or that have a secondary effect. It can be higher or lower than 1, depending on whether the effect is positive or negative.
effect constant is an additive term I gave each move effect, mostly to non-damaging moves which would otherwise have zero CP since they have zero Base Power. I also used this to penalize certain effects by setting it to a negative value.
Here's the table I used for move effects coefficients and constants:
Move Effect Coefficient Added Constant
NO_ADDITIONAL_EFFECT 1 0
TWO_TO_FIVE_ATTACKS_EFFECT 2,5 0
PAY_DAY_EFFECT 1 0
BURN_SIDE_EFFECT1 1,1 0
FREEZE_SIDE_EFFECT 1,2 0
PARALYZE_SIDE_EFFECT1 1,15 0
OHKO_EFFECT 1 99
CHARGE_EFFECT 0,5 0
ATTACK_UP2_EFFECT 1 50
SWITCH_AND_TELEPORT_EFFECT 0 -50
FLY_EFFECT 1 0
TRAPPING_EFFECT 3 0
FLINCH_SIDE_EFFECT2 1,3 0
ATTACK_TWICE_EFFECT 2 0
JUMP_KICK_EFFECT 1 0
ACCURACY_DOWN1_EFFECT 1 30
PARALYZE_SIDE_EFFECT2 1,5 0
RECOIL_EFFECT 0,85 0
THRASH_PETAL_DANCE_EFFECT 1 -10
DEFENSE_DOWN1_EFFECT 1 20
POISON_SIDE_EFFECT1 1,15 0
TWINEEDLE_EFFECT 2,1 0
FLINCH_SIDE_EFFECT1 1,1 0
ATTACK_DOWN1_EFFECT 1 20
SLEEP_EFFECT 1 100
CONFUSION_EFFECT 1 50
SPECIAL_DAMAGE_EFFECT 1 0
DISABLE_EFFECT 1 50
DEFENSE_DOWN_SIDE_EFFECT 1,1 0
MIST_EFFECT 1 30
CONFUSION_SIDE_EFFECT 1,1 0
SPEED_DOWN_SIDE_EFFECT 1,1 0
ATTACK_DOWN_SIDE_EFFECT 1,1 0
HYPER_BEAM_EFFECT 1 -25
DRAIN_HP_EFFECT 1,5 0
LEECH_SEED_EFFECT 1 30
SPECIAL_UP1_EFFECT 1 40
POISON_EFFECT 1 40
PARALYZE_EFFECT 1 60
SPEED_DOWN1_EFFECT 1 20
SPECIAL_DOWN_SIDE_EFFECT 1,2 0
ATTACK_UP1_EFFECT 1 25
SPEED_UP2_EFFECT 1 50
RAGE_EFFECT 0,5 0
MIMIC_EFFECT 1 50
DEFENSE_DOWN2_EFFECT 1 30
EVASION_UP1_EFFECT 1 30
HEAL_EFFECT 1 50
DEFENSE_UP1_EFFECT 1 25
DEFENSE_UP2_EFFECT 1 50
LIGHT_SCREEN_EFFECT 1 40
HAZE_EFFECT 1 20
REFLECT_EFFECT 1 40
FOCUS_ENERGY_EFFECT 0 -50
BIDE_EFFECT 1 10
METRONOME_EFFECT 1 20
MIRROR_MOVE_EFFECT 1 30
EXPLODE_EFFECT 2 -200
POISON_SIDE_EFFECT2 1,3 0
BURN_SIDE_EFFECT2 1,3 0
SWIFT_EFFECT 1,2 0
SPECIAL_UP2_EFFECT 1 100
DREAM_EATER_EFFECT 1,5 -50
TRANSFORM_EFFECT 1 50
SPLASH_EFFECT 0 -50
CONVERSION_EFFECT 1 10
SUPER_FANG_EFFECT 1 50
SUBSTITUTE_EFFECT 1 50
LEVEL_DAMAGE_EFFECT 1 50
COUNTER_EFFECT 1 50
HIGH_CRITICAL_RATE_EFFECT 1,8 0
PSYWAVE_EFFECT 1 50
BAD_POISON_EFFECT 1 60
PRIORITY_EFFECT 1,5 0
REST_EFFECT 1 75
RECOIL_EFFECT2 0,7 0