V60.0 Update: The Grand Source Refactoring

v60.0 Update: The Grand Source Refactoring

The Grand Source Refactoring applies a large and complex change to the inner workings of TCG ONE Game Engine and introduces seamless and robust attribution of Source effects for every effect executed or triggered and provides centralised access to them. This provides a bunch of benefits like ability to hook into more different types of triggers, ability to implement complex interactions and effects with top precision and ease, less verbose and correct code via automated inner attribution, which all mean less number of bugs. These changes affect all 16000+ playable cards on TCG ONE, making it a grand one.

TCG ONE is committed to providing the most correct and error-free gameplay experience. We’ve been tracking all bug reports in our forum since 2018 and a few months ago the open bug reports count had surpassed 2300. Through some great bug fixing effort recently, we were able to reduce this number to below 1700. That’s more than 600 resolved reports in a few months! We are prioritising handling of bug reports to further reduce this number in the upcoming releases. Please continue to be on the lookout for any bugs & errors and report them (using the in-game tool). Credits to @Tegull for great work in card testing and validation.

Fixes & Changes:

  • Stealthy Hood have been fixed properly! Despite its popularity, Stealthy Hood has been a challenging card for TCG ONE Game Engine since its release and we’ve received dozens of bug reports on this card’s interactions, the most popular one being vs Garbotoxin. With this huge refactoring, the engine is now much more flexible and can handle advanced interactions quite well, including this one, and all interactions should have been fixed. We’ll be doing validations on open bug reports and mark them resolved.
  • Can’t use attack next turn like effects will now be removed upon stage change.
  • Base damage boosting effects for the next turn will now be removed upon stage change.
  • Omega Stop Ancient Trait will now correctly only prevent effects of opponent’s abilities done to self.
  • Optimised all “use supporter’s effect” like effects; via replacing PlayTrainer usage to ActivateSimpleTrainer. Resolves many interaction problems with simplified code.
  • Light Dragonite’s Miraculous Wind (and also Spectral Breach) gets a rewrite and simplification.
  • Energy cards that are ought to be discarded at the end of the attachment turn (Boost, Aqua, Magma, Triple Accel, Miracle, etc) would now interact with Miraculous Wind similarly; with following text: “If this card is attached to 1 of your PokĂ©mon, discard it at the end of the turn.”
  • Custom type icons of special energies will be recalculated when their energy are modified through an effect, e.g. when Miraculous Wind is active, all special energy will also show up as [C]. Previously, some energy were excluded from this, leading to confusion.
  • Legendary Body (Neo) Poke-Bodies gets a rewrite to resolve some rare interactions.
  • Many other edge interaction cases were perfected.
  • Fixes many (unreleased) Platinum cards.
  • Added Sabrina & Brycen (SMP 246) to SM Series format.
  • Fixed targeting issues with "Shady Move"s, Amoonguss (UNM 14) Bursting Spores, Spiritomb (SHL) Cursed Whirlpool, Snorlax (PLS) Block, Lysandre (FLF).
  • DeveloperPanel (on dev server) will show full card name with larger page size to make it easy to find cards.
Developer Notes
  • Explicit source settings in card implementations are not effective anymore, sources are set in the root actions. Please do not set any Source.XYZ setting in new card implementations or updates. Existing references are can be cleaned up later on. (Source Erasure)
  • There are five major source objects: Attack, Ability, Card, TrainerCard, SpecialEnergyCard. They can now be accessed the Event (e), therefore, filtering can be done via properties of these objects.
Full Commit Logs

Source Refactoring: Massive initial commit

  • New class: SourceEffect. It denotes the effects which will change the source. This is only used by the effects which would change a source. TargetedEffect.getSource() has been removed.
  • EventManager automatically keeps track of SourceEffects in a stack and reuses them during delayed effect processing, via a new originalSourceEffect field in DelayedEffect.
  • All transitive Source.XYZ usages will be removed shortly.
  • TargetedEffect gets another huge refactor too; the getResolvedTarget(bg, e) method has been replaced by getTargetPokemon(). Added Effect.initialize() method to resolve legacy Targets instead. All instances and usages have been reworked.
  • Removed MultiTargetedEffect alongside TargetedEffect changes
  • Move is not an Effect anymore (as Attack is the main executor).
  • Changed many EVOLVE/LEVEL_UP usages to CHANGE_STAGE while I could.
  • Implement SourceEffect in PlayCard, Attack, UseAbility.
  • Changed many custom effects into non-MoveEffect versions to ensure flexibility.
  • Change TargetedEffect.getResolvedTarget(bg, e) to getTargetPokemon().
  • Change Event.getTarget(bg) to getTargetPokemon().
  • Removed effectiveness of Source setting in card implementations, to be followed up with an actual purge from card implementations and statics. So this commit is not target for a release.

Source Refactoring: Getter Effects

  • They now record their original source at the moment of registration which gets used during execution.
  • They now extend TargetedEffect and each execution inherits target from the root getter.
  • They now trigger BEFORE phase Events too, and they can now be blocked for each individual source and target value.

Source Refactoring: Abilities

  • All effects of abilities are now properly sourced via the new mechanism!
  • That is done via the new carefully constructed UseAbilityInner and UseAbilityOuter effects which are SourceEffects. Actions of abilities now use UseAbilityOuter to correctly attribute all effects by abilities.
  • Stealthy Hood (UNB) can now properly block (only) effects of abilities from opponent’s Pokemon done to this Pokemon (50+ open bug reports to be resolved).
  • Upgrades implementation of Shiftry EX (CG 97), Tyranitar (SF 30), Corviknight VMAX (BST 110), Aerodactyl (MD 15)
  • Pokemon Power usages of Legacy sets have also been reworked manually, so they are also compatible with UseAbilityOuter/Inner such that they would be compatible with Alakazam (MT) Power Cancel, etc. (Base Set until Aquapolis done, rest is next).
  • The old ability related EffectTypes were removed alongside their usages.
  • Simplified Chimecho Delta (HP 37) supporter check logic.
  • Adapt Poke-Powers in the rest of the legacy implementations to use the new UseAbilityOuter effect.

Source Refactoring: Special Energies

  • Special Energy activation process and effects were upgraded to take advantage of Source Refactoring. They now work via the new ActivateSpecialEnergy effect which marks them with SRC_SPECIAL_ENERGY.
  • All Special Energy cards including Legacy implementations were upgraded to the new mechanism.
  • Energy cards that are ought to be discarded at the end of the attachment turn (Boost, Aqua, Magma, Triple Accel, Miracle, etc) would now interact with Miraculous Wind similarly; with following text: “If this card is attached to 1 of your PokĂ©mon, discard it at the end of the turn.”
  • Streamlined and simplified Miraculous Wind and Spectral Breach effects.
  • Applied Source erasure for SRC_SPENERGY as effects do not need to set sources anymore under the new mechanism.
  • Custom type icons of special energies will be recalculated when their energy are modified through an effect, e.g. when Miraculous Wind is active, all special energy will also show up as [C]. Previously, some energy were excluded from this.

Source Refactoring: Trainers

  • PlayTrainer and AttachPokemonTool are now SourceEffects.
  • PlayTrainer & ActivateSimpleTrainer refactoring: Legacy Trainer, Item and Supporter effects are now handled through the new ActivateSimpleTrainer effect; which only applies the card’s effect without discarding it.
  • Optimizes and simplifies all “use supporter’s effect” like effects; via replacing PlayTrainer usage to ActivateSimpleTrainer. Auto infers attributed sources of these effects to whatever effect that used it, fixing many iteraction bugs.
  • Action now remembers its original source and reuses it, just like DelayedEffect and GetterEffect, in order to attribute Stadium effects to the correct source.
  • Some PLAY_POKEMON_TOOL triggers were replaced with ATTACH_POKEMON_TOOL instead.
  • Various minor fixes and cleanups.

Source Refactoring: Misc fixes

  • Omega Stop Ancient Trait will correctly only prevent effects of opponent’s abilities done to self.
  • Many other edge interaction cases were perfected.
  • Added specific targets to some statics
  • And some more fixes

Platinum Fixes (Credits to @Lithogen)

  • Update SHAYMIN_14 Damage Aid to clear status after damage
  • Update SHAYMIN_15 Growth energy requirement
  • Updated GIRATINA_28 weakness damage modifier
  • Updated CARNIVINE_43 weakness damage modifier
  • Updated CASCOON_44 weakness damage modifier
  • Updated DIALGA_23 weakness damage modifier
  • Updated CARNIVINE_68 weakness damage modifier
  • Updated BLISSEY_22 Nurse Call to only be called once per turn
  • Update BLASTOISE_2 Dig Well to not choose any energy
  • Fix SHAYMIN_LV_X_127 Revenge Seed to only apply to G pokemon and attacks
  • Fix LOTAD_SH4 Swift Swim to activate with only W energy
  • Fix VULPIX_SH6 weakness, attack cost, Inflame bug
  • Fix DIALGA_6 Time Aura to only block evolution of active
  • Fix DELCATTY_4 Power Circulation to rearrange correctly
  • Fix DIALGA_5 Reverse Time to rearrange correctly
  • Fix CACTURNE_42 Poison Experiment effect should be optional
  • Fix GARDEVOIR_8 Psychic Connect to be re-usable
  • Fix Memory Berry to not discard itself
  • Fix LUDICOLO_34 Cheerful Voice to stay after switching
  • Fix ALTARIA_18 to account for LEVEL_UP
  • Fix AMPHAROS_1 Damage Bind to target correctly
3 Likes

v60.1 Hotfix

This update fixes engine errors that were introduced with yesterday’s version.

Bug Fixes:

  • fix: Porygon (BS) Conversion 2
  • fix: Mixed Herbs condition
  • fix: Slowpoke & Psyduck GX Ditch and Splash attack requirement
  • fix: Mysterious Buzz chat spam
  • fix: All targetPokemon usages
  • fix: Metal Energy (RS)
  • fix: Sky Pillar (CLS)
  • fix: Recycle Energy (N1)
  • fix: Giratina (LOT) Distortion Door
1 Like

Hellothere is a bug in SM series , about Arceus & Dialga & Palkia-GX and Keldeo.The situation is

My Arceus & Dialga & Palkia-GX has already used the GX skill, when my ‘Keldeo’ kill my opponent’s ‘Keldeo’ , i can only get 2 prize cards.As the matter of fact, i can get 3 prize cards.

Maybe i am not right , but i hope you can see it.

Thank you TCGONE. I hope TCGONE becomes much better.

1 Like

v60.2 Update: Many bug fixes

This TCG ONE update puts many important bug fixes live!

  • feat: implemented Parasect (N3) Allergic Pollen. Due its complexity, this effect had been missing on TCG ONE but now it’s ready to use! The presence of this effect would affect some balances in Rocket-on and Neo-SKR formats.
  • fix: Applied Feraligatr (N1 5) Riptide errata: Feraligatr’s Riptide will only deal additional damage if the Water Energy cards are shuffled back into the owner’s deck.
  • fix: Baby Evolution (EX series) powers now work properly on the turn the baby Pokemon was put in play.
  • fix: Igglybuff (N2 40) Gaze will now end if target Pokemon leaves the bench and can now target Brock’s Ninetales.
  • fix: Brock’s Ninetales G2 Shapeshift will now only allow one evolution card at a time and will not shut down with poison or burn anymore.

Meanwhile, the remainder of Gen 4 cards have been receiving rigorous fixes:

  • fix: Gardevoir (SW 7) Telepass
  • fix: correct evolution treatment for LV.X
  • fix: VESPIQUEN_23 Defense Sign
  • fix: UMBREON_10 Moonlight Fang
  • fix: BASTIODON_20 Metal Trait to work at anytime
  • fix: SKIPLOOM_65, FARFETCH_D_49, QUAGSIRE_60, LICKILICKY_12, FURRET_27, WEAVILE_40
  • fix: SALAMENCE_18 Dragon Finish to discard the energies after damage
  • fix: MINUN_32 to move the energy after damage
  • fix: RAIKOU_16 Thunder Rumble to not trigger during Attack and Thunder Climb to attach energies after damage
  • fix: JYNX_30 Lovely Kiss will now move exact number of counters
  • fix: SMOOCHUM_67 Psykiss targeting
  • fix: VIBRAVA_74 Hyper Beam ordering
  • fix: HOPPIP_90 Cottonweed and Hover Heal
  • fix: NATU_96 Bothering Wave and Future Sight
  • fix: SPINDA_111 Synchro Punch Energy comparison logic
  • fix: DIGLETT_85 Down Draw will not reveal card
  • fix: ELECTRODE_26 Energy Shift turn owner
  • fix: LUDICOLO_13 Rain Dish vs Poison interaction
  • fix: MAGMORTAR_LV_X_123 Flame Buster discard logic
  • fix: Entei (SW 4) Blaze Roar to discard energy cards instead
  • fix: Blastoise (SW 2) Waterlog minimum attachment
  • fix: HONCHKROW_LV_X_132 Darkness Wing condition
  • fix: LUXRAY_3 Intimidating Fang
  • fix: YANMEGA_5 Air Slash flip
  • fix: Manaphy (POP9 2) Water Glow
  • fix: reimplement GENGAR_LV_X_97’s Level-Down as a custom effect
  • fix: special condition block effects
  • fix: MUK_63, HEATRAN_LV_X_97, TOXICROAK_36, FULL_FLAME_74, SEA_OF_NOTHINGNESS_99
  • fix: Dusk Stone (UNB) condition
Developer Notes
  • fix: default topPokemonCard values in PokemonCardSet
  • fix: correct flipThenApplySC usages
  • feat: shift Rocket’s Sneak Attack (Team Rocket) to groovy
  • feat: shift Dark Machamp and Abra (Team Rocket) to groovy
  • feat: shift Mr Fuji and Gambler (Fossil) to groovy
  • feat: shift Maintenance and Impostor Oak (Base Set) to groovy
  • feat: ShuffleToDeck will now run MoveCard internally
  • dev: implement MoveCardInner effect type

Credits to Tegull and udin for their help in testing cards.

2 Likes

v60.3 Hotfix

This update aims to fix errors with v60.2.

1 Like

v60.4: Ton of bug fixes

  • feat: dynamic type image generation for rainbow-like energies
  • feat: add Type.DARK_METAL for Dark Metal Energy
  • fix: Heal Dance shared cooldown on Bellossom (HL) and Gardevoir (EM)
  • fix: Hitmontop (WBSP) Rapid Spin weakness
  • fix: Chaos Gym will not play Clefairy Doll anymore
  • fix: Ledian (SKR) Pollen Shield
  • fix: Aggron (MT 1) Heap Up will now recover all energy cards with correct timing
  • fix: Aggron (DAA 123) Sturdy ability
  • fix: Donphan (LOT 112) Sturdy ability
  • fix: Hypno (VM) Puppet Master vs baby rule interaction
  • fix: Ho-oh (SW) Phoenix Turn for benched state
  • fix: use MoveCard for some e-card effects (for Allergic Pollen interaction)
  • fix: Alakazam (CG) Skill Copy will now work correctly
  • fix: reimplement Ho-oh (SW) Phoenix Turn [experimental]
  • refactor: Knockout internals for some edge cases [experimental]
  • refactor: Scoop Up-like effects
  • fix: reimplemented Mr. Mime (TEU) Scoop-Up Block ability with new source system.
  • fix: make Scoop-Up Block compatible with Stealthy Hood.
  • fix: reimplemented Clefairy (CEC) Doll Swap (Lillie’s PokĂ© Doll interaction) in a non-intrusive & compatible way.
  • fix: update Wishiwashi (GRI) Schooling & Aegislash (BST) Stance Change.
  • fix: update & fix Alolan Persian-GX Smug Face
  • dev: update MoveCard constructor to copy cards
  • dev: add playedSupporter zone check to ChangeImplementation
  • dev: apply source erasure for scoopUpPokemon()
  • refactor: make Discard’s result dependent on MoveCard
  • fix: correct & improve ancient trait naming & implementation
  • fix: Chaos Gym will not interfere Stadium cards anymore
  • fix: Misty’s Poliwag (G2) will use global Amnesia implementation
  • fix: Allergic Pollen error while playing stadiums
  • fix: Naganadel-GX Stinger-GX edge case
1 Like

Why is there no newer sets

1 Like

Newer sets are not within scope at the moment.

1 Like

@admin, I noticed how you credited Tegull and udin with helping you test the cards, and I was wondering if there was anything I could do to help in a similar capacity. I have no coding experience and would feel more comfortable not using the Discord, but if there is anything I can do to help you fix bugs more efficiently, please let me know and explain what this position would look like. I appreciate what you’ve done to keep the site running smoothly and how those efforts have enabled people to experience the older PokĂ©mon TCG formats for themselves. Hope you’re doing well.

2 Likes