As AI debug mode is working fine in the full version (yey) i can continue to add fixes to ai, i'm posting here what i got so far, i will update this topic as soon as i get new fixes out. I didn’t fully test anything for bugs etc, and i would be glad to get some feedback, some fixes aren't 100% finished yet, but one day they will be [:roll:]
Fixed some infinite ai loops with monster effects (not all of them, still need to add and check more cards)
Ai using same effect cards as much times as he can even when it's not needed (yet only for toon world)
Ai now is smarter about deciding in what position to summon monster, he won’t place monster with less attack points in attack position if player controls stronger ones, includes normal and special summoning.
Fixes for ai using power up equip spell cards on players monster, if he can't use it on his own (yet only for one card 39897277 - Elf's Light.
Update 1:
Just finished monster positioning fix, now ai will check attack points of players monsters before special summoning any monster in attack position, this now should work on all types of special summoning, spells, monster effects etc.
(TODO: Add exceptions for monster such as relinquished, and other special summons with effects)
Bug fix for card: Bait Doll
Now Ai will use it only when player has 1 or more face down spell or trap cards on the field (ai won’t destroy his own trap cards anymore)
Update 2:
Ai will activate "Hyperion" if the opponent controls at least 1 card.
Ai will activate "Phoenix Wing Wind Blast" only if the opponent controls a card.
"D.D. Warrior Lady", "D.D Assailant", "D.D Warrior" should always attack first.
Fix for Ai activating trap cards under "Royal decree" (by FAD!)
Ai will now activate "Waboku" only on players turn, if Ai has no monsters and player has 1 or more monsters in attack position, or if ai's strongest attack position monster is weaker than players.
Ai now will use "Germ Infection" and "Paralyzing Poison" equip cards only if player controls 1 or more non machine type attack position monster/s.
Ai activates "Broken Bamboo Sword", "Cursed Bill", "Mask of the accursed" and "Flint" only if opponent controls 1 or more attack position monsters.
(Thnx to Bateriemann for bug reports.)
Fix for Ai chaining cards with same id (needs testing)
TODO: Add logic for tribute summoning (Ai tributes stronger monsters to summon weaker ones. example: tributing Slifer to summon Judge man.
Update 3:
Fixed some Equip spell cards (note: ai will still use some of them on players monsters at certain situations, i will get that fixed when i have more time)
Cards:
Beast Fangs, Book of Secret Arts, Bound Wand, Abyss-scale of Cetus, Abyss-scale of the Mizuchi, Abyss-scale of the Kraken, 7 Completed, Break! Draw!, Assault Armor, Amazoness Heirloom, Buster Rancher, Ancient Gear Fist , Ancient Gear Tank ,Amplifier, Bubble Blaster, Amulet of Ambition, Armed Changer, Ballista of Rampart Smashing, Big Bang Shot, Black Pendant, Axe of Despair, Fiendish Chain, Burning Spear
Now Ai Won't Chain or Activate spell and trap cards with same id's (TODO: Add exceptions)
Updated monster poitioning logic again, it should fix some weird situations.
Update 4:
Finished equip spell card fix, now ai will activate these cards only at the right conditions, on the right monsters (no more equipping power ups to players monsters etc) Note that only cards in list below are fixed, more will be added with each update:
Beast Fangs, Book of Secret Arts, Bound Wand, Abyss-scale of Cetus, Abyss-scale of the Mizuchi, Abyss-scale of the Kraken, 7 Completed, Break! Draw!, Assault Armor, Amazoness Heirloom, Buster Rancher, Ancient Gear Fist , Ancient Gear Tank ,Amplifier, Bubble Blaster, Amulet of Ambition, Armed Changer, Ballista of Rampart Smashing, Big Bang Shot, Black Pendant, Axe of Despair, Fiendish Chain, Burning Spear, Butterfly Dagger - Elma
Fixed bug with Ai special summoning all monsters in defence position, regardless of players monsters
Now ai won’t use cards such as: Solemn Judgment, Solemn Warning (thnx FAD!), Negate Attack to prevent his own moves.
Ai will activate "Compulsory Evacuation Device" only if player has 1 or more face up monsters, and will target monster of level 5+ with highest attack (TODO, not finished yet).
Ai will always summon "The Agent of Creation - Venus" to activate his effect, if he will be able to summon stronger monster as result.
General code cleanup and optimization.
Hotfix: Ai special summoning.
Update 5:
Final fix for "Waboku", and "Negate attack", now ai will use them only one per turn, in proper conditions
Ai will use "Compulsory Evacuation Device" only on players 5+ level monsters, and on any special summoned monsters (to piss off player a bit more).
"Seven Tools of the Bandit" will now be used only on players cards.
"Gladiator Beast War Chariot" will be used only to negate players effect type monsters.
When using "Autonomous Action Unit" ai will select monster with highest ATK (as with other ss cards)
Also fixed "Chthonian Alliance", "Core Blaster" equip spell cards.
Another little update on same id card chaining (still testing)
Update 6:
AI will summon “Lord of D.” if “The Flute of Summoning Dragon” can be activated, and will select maximum amount of monsters with strongest attack when using “The Flute of Summoning Dragon”.
AI will now use “Soul Release” only when he has 3+ monsters in graveyard, and select maximum amount of monsters to banish.
AI will now use “Megamorph” only if he has less lp than player, and if player's strongest monster is stronger than AI's, and will equip it to his strongest face up monster.
AI will use “Shadow Spell” only on strong player's monsters.
AI will activate “Shrink” only if AI's strongest monster's attack points are lower than players strongest attack pos monster's points.
AI will activate “Dark Core” only if player has strong face up monsters on the field, and banish monster with highest attack.
AI will summon monsters in attack position if all player's monsters are in defense position.
“Return from the Different Dimension” now will be used to summon strong tribute monster's, or if ai has no monsters on the field, and player has any face up attack position monsters. (Ai is now able to perform decent summoning combo's with “Soul Release” and “Return from the Different Dimension”.)
Update 7:
Long awaited Tributing logic is here [:dance:] now AI will tribute only monster's of lower level and attack (there are plenty more to add, exceptions for specific card id's etc, this is only basic logic. Added support for "Egyptian god card" summoning.
AI will now calculate attack of monster's such as Slifer,RA etc, depending on their effect before summoning (before attack of these cards was 0 for AI).
AI will now look for options to increase strength of summoned monster, or negate any opposing threat and then summon or set monster depending on result (This change requires to replace old ai.lua to work). Not all possible situations are coded, you can see list of cards and combinations AI will check for in "AICheckPossibleST" file.
Fixed bug when AI didn't enter battle phase at all after using "Soul Exchange" or "Change of Hearth".
Added basic logic for "Soul Exchange", AI will now use it only if his able to tribute summon monster.
AI will use "Enemy Controller" only is his monster is weaker than players, and if his monster's attack points are higher than player's def points.
AI Will use "Cost Down" only if he has level 5 or 6 monster in hand.
"Zaborg the Thunder Monarch" Will be summoned only if Player controls 1 or more face up monster, and will select strongest player's monster to destroy.
Fix for chaining card's with same effects on same target, yet only for "Enemy Controller"
Update 8:
Added global logic for XYZ summoning:
AI will summon not set monster if hes able to summon any XYZ as result.
AI will calculate needed material count for every XYZ, and serch for possible ways of summoning it.
AI will change position of face down monsters if they are needed to special summon.
AI will now search for possible ways of increasing strength of his own monsters or destroying opposing threat, when Special Summoning monsters.
Single Card fixes:
Added logic for "Cocoon of evolution", fixed bug when AI summoned "Great Moth" and "Perfectly Ultimate Great Moth" without needed turn counter on "Cocoon of evolution"
Fixed all possible bugs with "Mecha Phantom Beast Dracossack", now AI will select correct monsters to target as destroyable targetes, and will tribute correct monsters for destroy effect cost.
Fixed using of XYZ effects for cards "Wind-Up Zenmaines", "Number 61: Volcasaurus", "Tiras, Keeper of Genesis"
AI will now use them only in right conditions, and select correct targets.
Fixed usage of "Card Destruction", AI will use it only when he has no other spell or trap cards in hand.
New supported deck for AI:
Dark World, it includes fixes of following cards for this deck:
Dark World dealings
Dragged down into the grave
Dark world lightning
Gateway to dark world
Note that cards already fixed in original Ytterbite's AI were not included in the list.
Also added notes to all important fixes i've done, to make it understandable if someone might want to change my code.
Update 8: Hotfix
Fixed position changing logic for XYZ summons, now AI should change position correctly when is able to XYZ summon, at the same time fixed bug with required tribute count function.
Fixed bug with AI always special summoning monsters in defense position when not playing "Dark World" deck, missplaced important part of coding after testing, my bad.
Fixed Number 39: Utopia's effect being activated to nagate AI's own attacks.
Fixed effect of Black Luster Soldier - Envoy of the Beginning, not being activated at all.
AI will now use "Axe of despair" in proper conditions.
Added new card support for Dark World deck:
Tour Guide From the Underworld
Update 9:
Fixed bug with AI ignoring activation conditions of some cards, (making him select wrong targets etc.) added right condition checking in SelectChain.lua
Improved logic for detecting current owner of specified card (previously AI didn't consider cards brought to his side of the field, from opponent's field or graveyard, by any card effects as his own monsters)
Added more possible counterplays in AICheckPossibleST.lua and fixed some old ones.
Implemented global fix for chaining cards with same id(this time for all trap cards at once) or activating any trap cards when trap card activation is negated.
Fixed bug with AI sometimes using less XYZ materials than required.
AI will now attack cards other than those who can't be destroyed by battle when possible.
Added "AI" prefix to all decks supported by AI.
Single Card fixes:
AI will now target player's spell/trap cards when using "Mystical Space Typhoon".
AI will select correct cards to discard and banish when using "Dark Core".
Updated effect "destroy" usage conditions for "Black Luster Soldier - Envoy of the Beginning".
New supported deck for AI:
Yami Yugi's Deck, it includes fixes of following cards for this deck:
Kuriboh
Winged Kuriboh
Catapult Turtle
Breaker the Magical Warrior
Zero Gravity
Spellbinding Circle
Diffusion Wave-Motion
Swords of Revealing Light
Mage Power
Mystic Box
Magic Formula
The Shallow Grave
Update 10:
AI now won't chain cards that shouldn't be chained together, for example "Mirror Force" and "Trap Hole", i will improve this logic in future updates if it will be needed.
Added list of cards that won't be chained when "Necrovalley" is on field.
Fixed normal summoning of some effect cards such as "Effect Veiler".
Fixed AI summoning flip effect monsters instead of setting them.
AI won't engage in battle if player has only "undestoyable by battle" face up monsters on the field
Fixed bug with AI not setting any trap or spell cards if he's playing first (on his first turn).
Small restructuring of SelectChain.lua
Temporary fix for selecting AI's cards, when using MST and other similar cards.
Single Card fixes:
"Amazoness Archers": added basic activation logic for AI, fixed bug with AI not being forced to attack player's monsters when this card was activated.
"Honest": fixed AI's infinite loop with it's return to hand effect when card's effect was negated.
"Dark Bribe": will now be used only on player's cards.
Fixed AI's crashes with "Royal Decree", added new logic for "Royal Decree" and "Trap Stun" activation.
"Mirror Force": added improved activation conditions.
"Axe of Despair": fixed some possible bugs when using second part of card's effect.
"Exiled Force": added basic activation/summoning conditions and fixed target selecting.
"No. 11 Big Eye": fixed target selecting.
"Lavalval Chain": New card activation/summoning conditions, added material detaching order for specific materials.
"Gagaga Gunman": added summoning and effect activation logic,fixed attack point calculation after using it's effect.
New supported deck for AI:
Burning Knuckle, it includes fixes of following cards for this deck:
Burnin' Boxin' Spirit
Summoner Monk
Battlin' Boxer Switchitter
Battlin' Boxer Headgeared
Battlin' Boxer Glassjaw
XYZ Reborn
are inculded in rar, and will be updated with every new AI version from now on.