From c39e0310dea24692fb50cf7bdf55046eb0daeb3e Mon Sep 17 00:00:00 2001 From: aed3 <32887801+aed3@users.noreply.github.com> Date: Wed, 10 Jun 2026 18:03:30 -0500 Subject: [PATCH 01/10] Start of action queue refactor and checking options The first step in making action entities reusable is not creating an entity for each action queued up. This led me to take a look at the action/decision code and find a few ways to improve it. This change makes the decision struct smaller, moves it to `Types` since it's not a component, and removes an unnecessary component add to the battle handle. There was a slight increase from doing that first and third change. Also, I noticed the simulation options were not checked for remaining the same before and after every kind of simulation, so that's fixed. I did that while adding a check that will be useful soon for simulate turn battles staying mostly unchanged. --- benchmarks/RandomInputs.cpp | 14 +- benchmarks/VerticalSlices.cpp | 12 +- extras/PokeSim.cpp | 63 ++- extras/PokeSim.hpp | 421 +++++++++-------- extras/RecentBenchmarkResults.md | 422 +++++++++--------- .../AnalyzeEffectDebugChecks.hpp | 9 +- src/CalcDamage/CalcDamageDebugChecks.hpp | 9 +- src/Components/SideDecisions.hpp | 14 + src/Components/headers.hpp | 3 +- src/SimulateTurn/ManageActionQueue.cpp | 23 +- src/SimulateTurn/SimulateTurnDebugChecks.hpp | 50 ++- src/Simulation/BattleCreationInfo.hpp | 3 +- src/Simulation/SimulationSetup.cpp | 3 +- src/Simulation/SimulationSetupDebugChecks.hpp | 3 +- src/{Components => Types}/Decisions.hpp | 14 +- src/Types/State.hpp | 2 + src/Types/headers.hpp | 1 + src/Utilities/ArgumentChecks.cpp | 43 +- src/Utilities/ArgumentChecks.hpp | 16 +- src/Utilities/DebugChecks.hpp | 17 +- tests/Effects/ChoiceLock.cpp | 8 +- tests/Effects/Paralysis.cpp | 4 +- tests/Moves/FuryAttack.cpp | 4 +- tests/Moves/KnockOff.cpp | 4 +- tests/SimulateTurnsTest.cpp | 4 +- tests/SimulationSetupTest.cpp | 21 +- tests/VerticalSlices.cpp | 12 +- 27 files changed, 653 insertions(+), 546 deletions(-) create mode 100644 src/Components/SideDecisions.hpp rename src/{Components => Types}/Decisions.hpp (60%) diff --git a/benchmarks/RandomInputs.cpp b/benchmarks/RandomInputs.cpp index cb01ad5..e021e2e 100644 --- a/benchmarks/RandomInputs.cpp +++ b/benchmarks/RandomInputs.cpp @@ -151,8 +151,8 @@ struct Random { if (simulation.isBattleFormat(BattleFormat::SINGLES)) { SlotDecision p1SlotDecision{Slot::P1A, Slot::P2A}; SlotDecision p2SlotDecision{Slot::P2A, Slot::P1A}; - p1SlotDecision.moveChoice = pickFromList(battle.sides.p1().team[0].moves, rngState).name; - p2SlotDecision.moveChoice = pickFromList(battle.sides.p2().team[0].moves, rngState).name; + p1SlotDecision.moveOrItem = pickFromList(battle.sides.p1().team[0].moves, rngState).name; + p2SlotDecision.moveOrItem = pickFromList(battle.sides.p2().team[0].moves, rngState).name; p1Decision.decisions = types::sideSlots{p1SlotDecision}; p2Decision.decisions = types::sideSlots{p2SlotDecision}; @@ -162,10 +162,10 @@ struct Random { SlotDecision p1BSlotDecision{Slot::P1B, pickFromList(std::vector{Slot::P1A, Slot::P2A, Slot::P2B}, rngState)}; SlotDecision p2ASlotDecision{Slot::P2A, pickFromList(std::vector{Slot::P2B, Slot::P1A, Slot::P1B}, rngState)}; SlotDecision p2BSlotDecision{Slot::P2B, pickFromList(std::vector{Slot::P2A, Slot::P1A, Slot::P1B}, rngState)}; - p1ASlotDecision.moveChoice = pickFromList(battle.sides.p1().team[0].moves, rngState).name; - p1BSlotDecision.moveChoice = pickFromList(battle.sides.p1().team[1].moves, rngState).name; - p2ASlotDecision.moveChoice = pickFromList(battle.sides.p2().team[0].moves, rngState).name; - p2BSlotDecision.moveChoice = pickFromList(battle.sides.p2().team[1].moves, rngState).name; + p1ASlotDecision.moveOrItem = pickFromList(battle.sides.p1().team[0].moves, rngState).name; + p1BSlotDecision.moveOrItem = pickFromList(battle.sides.p1().team[1].moves, rngState).name; + p2ASlotDecision.moveOrItem = pickFromList(battle.sides.p2().team[0].moves, rngState).name; + p2BSlotDecision.moveOrItem = pickFromList(battle.sides.p2().team[1].moves, rngState).name; p1Decision.decisions = types::slotDecisions{p1ASlotDecision, p1BSlotDecision}; p2Decision.decisions = types::slotDecisions{p2ASlotDecision, p2BSlotDecision}; @@ -175,7 +175,7 @@ struct Random { for (auto& sideDecision : turnDecision) { for (auto& slotDecision : sideDecision.decisions.get()) { - if (simulation.pokedex().moveHas(slotDecision.moveChoice.value())) { + if (simulation.pokedex().moveHas(slotDecision.moveOrItem.get())) { slotDecision.targetSlot = slotDecision.sourceSlot; } } diff --git a/benchmarks/VerticalSlices.cpp b/benchmarks/VerticalSlices.cpp index 4ad27dc..881bb87 100644 --- a/benchmarks/VerticalSlices.cpp +++ b/benchmarks/VerticalSlices.cpp @@ -104,9 +104,9 @@ struct VerticalSlice { SlotDecision p1SlotDecision{Slot::P1A, Slot::P2A}; SlotDecision p2SlotDecision{Slot::P2A, Slot::P1A}; - p1SlotDecision.moveChoice = dex::Move::KNOCK_OFF; + p1SlotDecision.moveOrItem = dex::Move::KNOCK_OFF; p1Decision.decisions = types::sideSlots{p1SlotDecision}; - p2SlotDecision.moveChoice = dex::Move::THUNDERBOLT; + p2SlotDecision.moveOrItem = dex::Move::THUNDERBOLT; p2Decision.decisions = types::sideSlots{p2SlotDecision}; battleCreationInfo.decisionsToSimulate = {{p1Decision, p2Decision}}; @@ -129,11 +129,11 @@ struct VerticalSlice { SlotDecision p2ASlotDecision{Slot::P2A, Slot::P1B}; SlotDecision p2BSlotDecision{Slot::P2B, Slot::P2B}; - p1ASlotDecision.moveChoice = dex::Move::MOONBLAST; - p1BSlotDecision.moveChoice = dex::Move::WILL_O_WISP; + p1ASlotDecision.moveOrItem = dex::Move::MOONBLAST; + p1BSlotDecision.moveOrItem = dex::Move::WILL_O_WISP; p1Decision.decisions = types::sideSlots{p1ASlotDecision, p1BSlotDecision}; - p2ASlotDecision.moveChoice = dex::Move::KNOCK_OFF; - p2BSlotDecision.moveChoice = dex::Move::QUIVER_DANCE; + p2ASlotDecision.moveOrItem = dex::Move::KNOCK_OFF; + p2BSlotDecision.moveOrItem = dex::Move::QUIVER_DANCE; p2Decision.decisions = types::sideSlots{p2ASlotDecision, p2BSlotDecision}; battleCreationInfo.decisionsToSimulate = {{p1Decision, p2Decision}}; diff --git a/extras/PokeSim.cpp b/extras/PokeSim.cpp index b970eda..68fc2a1 100644 --- a/extras/PokeSim.cpp +++ b/extras/PokeSim.cpp @@ -689,28 +689,6 @@ void check(const DamageRolls& damageRolls) { } } -template <> -void check(const SlotDecision& slotDecision) { - checkSlot(slotDecision.sourceSlot); - checkSlot(slotDecision.targetSlot); - POKESIM_REQUIRE_NM(!(slotDecision.moveChoice.has_value() && slotDecision.itemChoice.has_value())); - POKESIM_REQUIRE_NM(!(slotDecision.megaEvolve && slotDecision.primalRevert)); -} - -template <> -void check(const SideDecision& sideDecision) { - checkPlayerSideId(sideDecision.sideId); - if (sideDecision.decisions.holds()) { - const types::slotDecisions& decisions = sideDecision.decisions.get(); - for (const SlotDecision& decision : decisions) { - check(decision); - } - } - else { - checkTeamOrder(sideDecision.decisions.get()); - } -} - template <> void check(const Evs& evs) { checkEv(evs.hp); @@ -1159,6 +1137,20 @@ void check(const internal::RandomEqualChanceStack& randomEqualChanceStack, const } } +template <> +void check(const SideDecision& sideDecision) { + checkPlayerSideId(sideDecision.sideId); + if (sideDecision.decisions.holds()) { + const types::slotDecisions& decisions = sideDecision.decisions.get(); + for (const SlotDecision& decision : decisions) { + check(decision); + } + } + else { + checkTeamOrder(sideDecision.decisions.get()); + } +} + template <> void check(const SpeedTieIndexes& speedTieIndexes) { checkBounds(speedTieIndexes.val.size()); @@ -1307,6 +1299,13 @@ void check(const Winner& winner) { winner.val == PlayerSideId::P1 || winner.val == PlayerSideId::P2 || winner.val == PlayerSideId::NONE); } +template <> +void check(const SlotDecision& slotDecision) { + checkSlot(slotDecision.sourceSlot); + checkSlot(slotDecision.targetSlot); + POKESIM_REQUIRE_NM(!(slotDecision.megaEvolve && slotDecision.primalRevert)); +} + template <> void check(const DamageRollKind& damageRollKind) { if (listContains(VALID_DAMAGE_ROLL_KINDS, damageRollKind)) { @@ -3183,9 +3182,6 @@ void resolveSlotDecisions( for (const SlotDecision& decision : decisions) { POKESIM_REQUIRE(decision.sourceSlot != Slot::NONE, "Source slot must be assigned."); POKESIM_REQUIRE(decision.targetSlot != Slot::NONE, "Target slot must be assigned."); - POKESIM_REQUIRE( - !(decision.moveChoice.has_value() && decision.itemChoice.has_value()), - "Decisions can't have a move and an item choice."); types::handle actionHandle = {registry, registry.create()}; actionHandle.emplace(decision.sourceSlot); @@ -3194,25 +3190,19 @@ void resolveSlotDecisions( SpeedSort speedSort; types::entity sourceEntity = slotToPokemonEntity(registry, sideHandle.entity(), decision.sourceSlot); - stat::EffectiveSpe* effectiveSpe = registry.try_get(sourceEntity); - if (effectiveSpe != nullptr) { - speedSort.speed = effectiveSpe->val; - } - else { - speedSort.speed = registry.get(sourceEntity).val; - } + speedSort.speed = registry.get(sourceEntity).val; - if (decision.moveChoice.has_value()) { + if (decision.choice.holds()) { actionHandle.emplace(); - actionHandle.emplace(decision.moveChoice.value()); + actionHandle.emplace(decision.choice.get()); speedSort.order = ActionOrder::MOVE; speedSort.priority = Constants::MovePriority::DEFAULT; // TODO (aed3): Move priority + modify priority speedSort.fractionalPriority = false; // TODO (aed3): get fractionalPriority } - else if (decision.itemChoice.has_value()) { + else if (decision.choice.holds()) { actionHandle.emplace(); - actionHandle.emplace(decision.itemChoice.value()); + actionHandle.emplace(decision.choice.get()); speedSort.order = ActionOrder::ITEM; } else { @@ -3379,7 +3369,6 @@ void setCurrentAction(types::handle battleHandle, ActionQueue& actionQueue) { if (registry.all_of(newCurrentAction)) { battleHandle.emplace(); - battleHandle.emplace(registry.get(newCurrentAction)); } else if (registry.all_of(newCurrentAction)) { battleHandle.emplace(); diff --git a/extras/PokeSim.hpp b/extras/PokeSim.hpp index de47dd9..2e39f53 100644 --- a/extras/PokeSim.hpp +++ b/extras/PokeSim.hpp @@ -83,6 +83,8 @@ * src/CalcDamage/Helpers.hpp * src/Types/Random.hpp * src/Components/Accuracy.hpp + * src/Types/Enums/ActionOrder.hpp + * src/Types/Move.hpp * src/Types/Enums/AddedTargets.hpp * src/Components/AddedTargets.hpp * src/Components/EntityHolders/Current.hpp @@ -94,7 +96,6 @@ * src/Types/Effect.hpp * src/Components/AnalyzeEffect/RemovedEffect.hpp * src/Components/BaseEffectChance.hpp - * src/Types/Move.hpp * src/Components/BasePower.hpp * src/Components/CalcDamage/Aliases.hpp * src/Types/Enums/GameMechanics.hpp @@ -105,10 +106,6 @@ * src/Components/CalcDamage/ModifyingEventRanTags.hpp * src/Components/CalcDamage/TemporaryMoveProperties.hpp * src/Components/CloneFromCloneTo.hpp - * src/Types/Enums/Item.hpp - * src/Types/Enums/PlayerSideId.hpp - * src/Types/Enums/Slot.hpp - * src/Components/Decisions.hpp * src/Components/EVsIVs.hpp * src/Components/EntityHolders/ActionQueue.hpp * src/Components/EntityHolders/ChoiceLock.hpp @@ -128,10 +125,12 @@ * src/Components/Names/AbilityNames.hpp * src/Types/Enums/Gender.hpp * src/Components/Names/GenderNames.hpp + * src/Types/Enums/Item.hpp * src/Components/Names/ItemNames.hpp * src/Components/Names/MoveNames.hpp * src/Types/Enums/Nature.hpp * src/Components/Names/NatureNames.hpp + * src/Types/Enums/Slot.hpp * src/Components/Names/SourceSlotName.hpp * src/Types/Enums/Species.hpp * src/Components/Names/SpeciesNames.hpp @@ -139,6 +138,7 @@ * src/Types/Enums/Type.hpp * src/Components/Names/TypeNames.hpp * src/Components/PP.hpp + * src/Types/Enums/PlayerSideId.hpp * src/Components/PlayerSide.hpp * src/Components/Pokedex/Abilities.hpp * src/Components/Pokedex/BaseStats.hpp @@ -148,6 +148,8 @@ * src/Components/RNGSeed.hpp * src/Components/RandomEventInputs.hpp * src/Components/RandomEventOutputs.hpp + * src/Types/Decisions.hpp + * src/Components/SideDecisions.hpp * src/Components/SimulateTurn/ActionTags.hpp * src/Components/SimulateTurn/MoveHitStepTags.hpp * src/Components/SimulateTurn/SimulateTurnTags.hpp @@ -155,7 +157,6 @@ * src/Components/SimulateTurn/TeamAction.hpp * src/Components/SimulationResults.hpp * src/Components/SpeciesTypes.hpp - * src/Types/Enums/ActionOrder.hpp * src/Components/SpeedSort.hpp * src/Components/Stats.hpp * src/Components/Tags/AbilityTags.hpp @@ -17490,6 +17491,7 @@ using stateId = std::underlying_type_t; using battleTurn = pokesim::internal::unsignedIntType; using sideIndex = pokesim::internal::unsignedIntType; + template struct sides : public std::array { constexpr T& p1() { return this->at(0); }; @@ -17499,6 +17501,7 @@ struct sides : public std::array { template decltype(auto) get() const { + static_assert(N < Constants::SIDE_COUNT); return this->at(N); } @@ -18254,6 +18257,74 @@ struct Accuracy { ////////////////////// END OF src/Components/Accuracy.hpp ////////////////////// +/////////////////// START OF src/Types/Enums/ActionOrder.hpp /////////////////// + +namespace pokesim { +enum class ActionOrder : std::uint8_t { + NONE = std::numeric_limits>::max(), + TEAM = 1U, + START = 2U, + BEFORE_TURN = 4U, + ITEM = BEFORE_TURN, + + SWITCH = 103U, + + MOVE = 200U, + + RESIDUAL = 254U, +}; + +static constexpr inline std::array VALID_ACTION_ORDERS = { + ActionOrder::NONE, + ActionOrder::TEAM, + ActionOrder::START, + ActionOrder::BEFORE_TURN, + ActionOrder::ITEM, + ActionOrder::SWITCH, + ActionOrder::MOVE, + ActionOrder::RESIDUAL, +}; +} // namespace pokesim + +//////////////////// END OF src/Types/Enums/ActionOrder.hpp //////////////////// + +///////////////////////// START OF src/Types/Move.hpp ////////////////////////// + +namespace pokesim::types { +using pp = pokesim::internal::unsignedIntType; +using basePower = pokesim::internal::unsignedIntType; +using power = pokesim::internal::unsignedIntType; +using baseAccuracy = pokesim::internal::unsignedIntType; +using moveHits = pokesim::internal::unsignedIntType; + +using priority = pokesim::internal::signedIntType; +using fractionalPriority = bool; +} // namespace pokesim::types + +////////////////////////// END OF src/Types/Move.hpp /////////////////////////// + +/////////////////// START OF src/Components/ActionQueue.hpp //////////////////// + +namespace pokesim { +struct ActionQueue2 { + // Order of the types of actions (lower first) + ActionOrder order = ActionOrder::NONE; + // Priority of the action (higher first) + types::priority priority = Constants::MovePriority::DEFAULT; + // Whether negative fractional priority is active for the action (false first) + types::fractionalPriority fractionalPriority = false; + // Speed of Pokemon using move (higher first if priority tie) + types::stat speed = Constants::PokemonEffectiveStat::DEFAULT; + + bool operator==(const ActionQueue2& other) const { + return order == other.order && priority == other.priority && fractionalPriority == other.fractionalPriority && + speed == other.speed; + } +}; +} // namespace pokesim + +//////////////////// END OF src/Components/ActionQueue.hpp ///////////////////// + ////////////////// START OF src/Types/Enums/AddedTargets.hpp /////////////////// namespace pokesim { @@ -18535,21 +18606,6 @@ struct BaseEffectChance { ////////////////// END OF src/Components/BaseEffectChance.hpp ////////////////// -///////////////////////// START OF src/Types/Move.hpp ////////////////////////// - -namespace pokesim::types { -using pp = pokesim::internal::unsignedIntType; -using basePower = pokesim::internal::unsignedIntType; -using power = pokesim::internal::unsignedIntType; -using baseAccuracy = pokesim::internal::unsignedIntType; -using moveHits = pokesim::internal::unsignedIntType; - -using priority = pokesim::internal::signedIntType; -using fractionalPriority = bool; -} // namespace pokesim::types - -////////////////////////// END OF src/Types/Move.hpp /////////////////////////// - //////////////////// START OF src/Components/BasePower.hpp ///////////////////// namespace pokesim { @@ -18705,98 +18761,6 @@ struct CloneTo { ////////////////// END OF src/Components/CloneFromCloneTo.hpp ////////////////// -////////////////////// START OF src/Types/Enums/Item.hpp /////////////////////// - -namespace pokesim::dex { -// Name of items in Pokemon games -enum class Item : std::uint16_t { - // clang-format off - NO_ITEM = 0U, ABILITY_CAPSULE, ABILITY_PATCH, ABILITY_SHIELD, ABOMASITE, ABRA_CANDY, ABSOLITE, ABSORB_BULB, ACRO_BIKE, ADAMANT_CRYSTAL, ADAMANT_MINT, ADAMANT_ORB, ADRENALINE_ORB, ADVENTURE_GUIDE, AERODACTYLITE, AERODACTYL_CANDY, AGGRONITE, AGUAV_BERRY, AIR_BALLOON, AIR_MAIL, ALAKAZITE, ALORAICHIUM_Z, ALTARIANITE, AMAZE_MULCH, AMPHAROSITE, AMULET_COIN, ANTIDOTE, APICOT_BERRY, APRICORN, APRICORN_BOX, AQUA_SUIT, ARMOR_FOSSIL, ARMOR_PASS, ARMORITE_ORE, ARTICUNO_CANDY, ASPEAR_BERRY, ASSAULT_VEST, AUDINITE, AURORATICKET, AUSPICIOUS_ARMOR, AUTOGRAPH, AUX_EVASION, AUX_GUARD, AUX_POWER, AUX_POWERGUARD, AWAKENING, AZELFS_FANG, AZURE_FLUTE, BABIRI_BERRY, BALL_OF_MUD, BALM_MUSHROOM, BAND_AUTOGRAPH, BANETTITE, BASCULEGION_FOOD, BASEMENT_KEY, BEACH_GLASS, BEAD_MAIL, BEAN_CAKE, BEAST_BALL, BEEDRILLITE, BELLSPROUT_CANDY, BELUE_BERRY, BERRY, BERRY_JUICE, BERRY_POTS, BERRY_POUCH, BERRY_SWEET, BERSERK_GENE, BICYCLE, BIG_BAMBOO_SHOOT, BIG_MALASADA, BIG_MUSHROOM, BIG_NUGGET, BIG_PEARL, BIG_ROOT, BIKE_VOUCHER, BINDING_BAND, BITTER_BERRY, BLACK_APRICORN, BLACK_AUGURITE, BLACK_BELT, BLACK_FLUTE, BLACK_GLASSES, BLACK_MANE_HAIR, BLACK_SLUDGE, BLACK_TUMBLESTONE, BLANK_PLATE, BLASTOISINITE, BLAZIKENITE, BLOOM_MAIL, BLUE_APRICORN, BLUE_CARD, BLUE_FLUTE, BLUE_ORB, BLUE_PETAL, BLUE_SCARF, BLUE_SHARD, BLUESKY_MAIL, BLU_ID_BADGE, BLUK_BERRY, BLUNDER_POLICY, BOLD_MINT, BONSLY_CARD, BONSLY_PHOTO, BOOST_MULCH, BOOSTER_ENERGY, BOTTLE_CAP, BRAVE_MINT, BRICK_MAIL, BRICK_PIECE, BRIDGE_MAIL_D, BRIDGE_MAIL_M, BRIDGE_MAIL_S, BRIDGE_MAIL_T, BRIDGE_MAIL_V, BRIGHT_POWDER, BUBBLE_MAIL, BUG_GEM, BUG_MEMORY, BUG_TERA_SHARD, BUGINIUM_Z, BUGWORT, BULBASAUR_CANDY, BURN_DRIVE, BURN_HEAL, BURNT_BERRY, CAKE_LURE_BASE, CALCIUM, CALM_MINT, CAMERUPTITE, CAMPING_GEAR, CANDY_TRUFFLE, CARBOS, CARD_KEY, CAREFUL_MINT, CARROT_SEEDS, CASTELIACONE, CASTER_FERN, CATCHING_CHARM, CATERPIE_CANDY, CELESTICA_FLUTE, CELL_BATTERY, CHALKY_STONE, CHANSEY_CANDY, CHARCOAL, CHARIZARDITE_X, CHARIZARDITE_Y, CHARMANDER_CANDY, CHARTI_BERRY, CHERI_BERRY, CHERISH_BALL, CHESTO_BERRY, CHILAN_BERRY, CHILL_DRIVE, CHIPPED_POT, CHOICE_BAND, CHOICE_DUMPLING, CHOICE_SCARF, CHOICE_SPECS, CHOPLE_BERRY, CLAW_FOSSIL, CLEANSE_TAG, CLEAR_AMULET, CLEAR_BELL, CLEFAIRY_CANDY, CLEVER_FEATHER, CLOVER_SWEET, COBA_BERRY, COIN_CASE, COLBUR_BERRY, COLOGNE_CASE, COLRESS_MACHINE, COMET_SHARD, COMMON_STONE, CONTEST_COSTUME, CONTEST_PASS, CORNN_BERRY, COUPON_1, COUPON_2, COUPON_3, COURAGE_CANDY, COURAGE_CANDY_L, COURAGE_CANDY_XL, COVER_FOSSIL, COVERT_CLOAK, CRACKED_POT, CRAFTING_KIT, CROWN_PASS, CRUNCHY_SALT, CUBONE_CANDY, CRY_ANALYZER, CUSTAP_BERRY, DAMP_MULCH, DAMP_ROCK, DARK_GEM, DARK_MEMORY, DARK_STONE, DARK_TERA_SHARD, DARKINIUM_Z, DATA_CARDS, DATA_ROM, DAWN_STONE, DAZZLING_HONEY, D_DISK, DECIDIUM_Z, DEEP_SEA_SCALE, DEEP_SEA_TOOTH, DESTINY_KNOT, DEVON_PARTS, DEVON_SCOPE, DEVON_SCUBA_GEAR, DIANCITE, DIGGER_DRILL, DIGLETT_CANDY, DIRE_HIT, DIRESHROOM, DISC_CASE, DISCOUNT_COUPON, DISCOVERY_SLATE, DISTORTION_SLATE, DITTO_CANDY, DIVE_BALL, DNA_SAMPLE, DNA_SPLICERS, DODUO_CANDY, DOME_FOSSIL, DOPPEL_BONNETS, DOUSE_DRIVE, DOWN_ST_KEY, DOWSING_MACHINE, DRACO_PLATE, DRAGON_FANG, DRAGON_GEM, DRAGON_MEMORY, DRAGON_SCALE, DRAGON_SKULL, DRAGON_TERA_SHARD, DRAGONIUM_Z, DRASH_BERRY, DRATINI_CANDY, DREAD_PLATE, DREAM_BALL, DREAM_MAIL, DROPPED_ITEM, DROWZEE_CANDY, DS_SOUNDS, DUBIOUS_DISC, DURIN_BERRY, DUSK_BALL, DUSK_STONE, DYNAMAX_BAND, DYNAMAX_CANDY, DYNAMAX_CRYSTALS, DYNITE_ORE, EARTH_PLATE, EEVEE_CANDY, EEVIUM_Z, EGG_TICKET, EGGANT_BERRY, EIN_FILE_C, EIN_FILE_F, EIN_FILE_H, EIN_FILE_P, EIN_FILE_S, EJECT_BUTTON, EJECT_PACK, EKANS_CANDY, ELECTABUZZ_CANDY, ELECTIRIZER, ELECTRIC_GEM, ELECTRIC_MEMORY, ELECTRIC_SEED, ELECTRIC_TERA_SHARD, ELECTRIUM_Z, ELEVATOR_KEY, ELIXIR, ENDORSEMENT, ENERGY_POWDER, ENERGY_ROOT, ENIGMA_BERRY, ENIGMA_STONE, ENIGMATIC_CARD, EON_FLUTE, EON_MAIL, EON_TICKET, ESCAPE_ROPE, ETERNAL_ICE, ETHER, EVERSTONE, EVIOLITE, EXCITE_SCENT, EXEGGCUTE_CANDY, EXP_CANDY_L, EXP_CANDY_M, EXP_CANDY_S, EXP_CANDY_XL, EXP_CANDY_XS, EXP_CHARM, EXP_SHARE, EXPERT_BELT, EXPLORER_KIT, FAB_MAIL, FAIRIUM_Z, FAIRY_GEM, FAIRY_MEMORY, FAIRY_TERA_SHARD, FAME_CHECKER, FARFETCHD_CANDY, FASHION_CASE, FAST_BALL, FAVORED_MAIL, F_DISK, FEATHER_BALL, FESTIVAL_TICKET, FIGHTING_GEM, FIGHTING_MEMORY, FIGHTING_TERA_SHARD, FIGHTINIUM_Z, FIGY_BERRY, FINE_REMEDY, FIRE_GEM, FIRE_MEMORY, FIRE_STONE, FIRE_TERA_SHARD, FIRIUM_Z, FISHING_ROD, FIST_PLATE, FLAME_MAIL, FLAME_ORB, FLAME_PLATE, FLOAT_STONE, FLOWER_MAIL, FLOWER_SWEET, FLUFFY_TAIL, FLYING_GEM, FLYING_MEMORY, FLYING_TERA_SHARD, FLYINIUM_Z, FOCUS_BAND, FOCUS_SASH, FORAGE_BAG, FOREST_BALM, FOSSILIZED_BIRD, FOSSILIZED_DINO, FOSSILIZED_DRAKE, FOSSILIZED_FISH, FRESH_WATER, FRIEND_BALL, FULL_HEAL, FULL_INCENSE, FULL_RESTORE, GALACTIC_KEY, GALARICA_CUFF, GALARICA_TWIG, GALARICA_WREATH, GALLADITE, GANLON_BERRY, GARCHOMPITE, GARDEVOIRITE, GASTLY_CANDY, GB_SOUNDS, GEAR, GENGARITE, GENIUS_FEATHER, GENOME_SLATE, GENTLE_MINT, GEODUDE_CANDY, GHOST_GEM, GHOST_MEMORY, GHOST_TERA_SHARD, GHOSTIUM_Z, GIGATON_BALL, GINEMA_BERRY, GLALITITE, GLITTER_MAIL, GO_GOGGLES, GOD_STONE, GOLD_BERRY, GOLD_BOTTLE_CAP, GOLD_LEAF, GOLD_TEETH, GOLDEEN_CANDY, GONZAPS_KEY, GOLDEN_NANAB_BERRY, GOLDEN_PINAP_BERRY, GOLDEN_RAZZ_BERRY, GOOD_ROD, GOOEY_MULCH, GORGEOUS_BOX, GRACIDEA, GRAIN_CAKE, GRAM_1, GRAM_2, GRAM_3, GRASS_GEM, GRASS_MEMORY, GRASS_TERA_SHARD, GRASSIUM_Z, GRASS_MAIL, GRASSY_SEED, GREAT_BALL, GREEN_APRICORN, GREEN_PETAL, GREEN_SCARF, GREEN_SHARD, GREET_MAIL, GREPA_BERRY, GRIMER_CANDY, GRIP_CLAW, GRIT_DUST, GRIT_GRAVEL, GRIT_PEBBLE, GRIT_ROCK, GRISEOUS_CORE, GRISEOUS_ORB, GRN_ID_BADGE, GROUND_GEM, GROUND_MEMORY, GROUND_TERA_SHARD, GROUNDIUM_Z, GROWLITHE_CANDY, GROWTH_MULCH, GRUBBY_HANKY, GS_BALL, GUARD_SPEC, GUIDEBOOK, GYARADOSITE, HABAN_BERRY, HARBOR_MAIL, HARD_STONE, HASTY_MINT, HEAL_BALL, HEAL_POWDER, HEALTH_CANDY, HEALTH_CANDY_L, HEALTH_CANDY_XL, HEALTH_FEATHER, HEART_MAIL, HEART_SCALE, HEARTY_GRAINS, HEAT_ROCK, HEAVY_BALL, HEAVY_DUTY_BOOTS, HELIX_FOSSIL, HERACRONITE, HI_TECH_EARBUDS, HITMONCHAN_CANDY, HITMONLEE_CANDY, HM01, HM02, HM03, HM04, HM05, HM06, HM07, HM08, HOLO_CASTER, HOMETOWN_MUFFIN, HONDEW_BERRY, HONEY, HONEY_CAKE, HONOR_OF_KALOS, HOPO_BERRY, HORSEA_CANDY, HOUNDOOMINITE, HP_UP, HYPER_POTION, IAPAPA_BERRY, ICE_BERRY, ICE_GEM, ICE_HEAL, ICE_MEMORY, ICE_STONE, ICE_TERA_SHARD, ICEROOT_CARROT, ICICLE_PLATE, ICIUM_Z, ICY_ROCK, ID_CARD, ILIMAS_NORMALIUM_Z, IMPISH_MINT, INCINIUM_Z, INQUIRY_MAIL, INSECT_PLATE, INTRIGUING_STONE, IRON, IRON_BALL, IRON_BARKTONGUE, IRON_CHUNK, IRON_PLATE, JABOCA_BERRY, JADE_ORB, JAIL_KEY, JAW_FOSSIL, JET_BALL, JIGGLYPUFF_CANDY, JOHTO_SLATE, JOLLY_MINT, JOY_SCENT, JUBILIFE_MUFFIN, JYNX_CANDY, KABUTO_CANDY, KANGASKHAN_CANDY, KANGASKHANITE, KANTO_SLATE, KASIB_BERRY, KEBIA_BERRY, KEE_BERRY, KELPSY_BERRY, KEY_STONE, KEY_TO_ROOM_1, KEY_TO_ROOM_2, KEY_TO_ROOM_4, KEY_TO_ROOM_6, KINGS_LEAF, KINGS_ROCK, KOFFING_CANDY, KOFUS_BOOK, KOMMONIUM_Z, KORAIDONS_POKE_BALL, KRABBY_CANDY, KRANE_MEMO_1, KRANE_MEMO_2, KRANE_MEMO_3, KRANE_MEMO_4, KRANE_MEMO_5, KUO_BERRY, LAGGING_TAIL, LANSAT_BERRY, LAPRAS_CANDY, LATIASITE, LATIOSITE, LAVA_COOKIE, LAX_INCENSE, LAX_MINT, L_DISK, LEADEN_BALL, LEADERS_CREST, LEAF_LETTER, LEAF_STONE, LEEK, LEFT_POKE_BALL, LEFTOVERS, LEGEND_PLATE, LEGENDARY_CLUE_1, LEGENDARY_CLUE_2, LEGENDARY_CLUE_3, LEGENDARY_CLUE, LEMONADE, LENS_CASE, LEPPA_BERRY, LETTER, LEVEL_BALL, LIBERTY_PASS, LICKITUNG_CANDY, LIECHI_BERRY, LIFE_ORB, LIFT_KEY, LIGHT_BALL, LIGHT_CLAY, LIGHT_STONE, LIKE_MAIL, LINKING_CORD, LITEBLUEMAIL, LOADED_DICE, LOCK_CAPSULE, LONE_EARRING, LONELY_MINT, LOOKER_TICKET, LOOT_SACK, LOPUNNITE, LOST_ITEM, LOST_SATCHEL, LOVE_BALL, LOVE_SWEET, LOVELY_MAIL, LUCARIONITE, LUCK_INCENSE, LUCKY_EGG, LUCKY_PUNCH, LUM_BERRY, LUMINOUS_MOSS, LUMIOSE_GALETTE, LUNALIUM_Z, LUNAR_FEATHER, LURE, LURE_BALL, LUSTROUS_GLOBE, LUSTROUS_ORB, LUXURY_BALL, LYCANIUM_Z, MACH_BIKE, MACHINE_PART, MACHO_BRACE, MACHOP_CANDY, MAGIKARP_CANDY, MAGMA_EMBLEM, MAGMA_STONE, MAGMA_SUIT, MAGMAR_CANDY, MAGMARIZER, MAGNEMITE_CANDY, MAGNET, MAGO_BERRY, MAGOST_BERRY, MAINGATE_KEY, MAKEUP_BAG, MALICIOUS_ARMOR, MANECTITE, MANKEY_CANDY, MARANGA_BERRY, MARBLE, MARK_CHARM, MARSHADIUM_Z, MARSH_BALM, MASTER_BALL, MAWILITE, MAX_ELIXIR, MAX_ETHER, MAX_LURE, MAX_HONEY, MAX_MUSHROOMS, MAX_POTION, MAX_REPEL, MAX_REVIVE, MAYORS_NOTE, MEADOW_PLATE, MECH_MAIL, MECHANICAL_BOX, MECHANICAL_CABINET, MECHANICAL_CIRCULAR_SAW, MECHANICAL_PINWHEEL, MECHANICAL_TUB, MEDAL_BOX, MEDICHAMITE, MEDICINAL_LEEK, MEGA_BRACELET, MEGA_RING, MELTAN_CANDY, MEMBER_CARD, MENTAL_HERB, MEOWTH_CANDY, MESPRITS_PLUME, METAGROSSITE, METAL_COAT, METAL_POWDER, METEORITE, METEORITE_SHARD, METRONOME, MEW_CANDY, MEWNIUM_Z, MEWTWO_CANDY, MEWTWONITE_X, MEWTWONITE_Y, MICLE_BERRY, MIGHTY_CANDY, MIGHTY_CANDY_L, MIGHTY_CANDY_XL, MILD_MINT, MIMIKIUM_Z, MIND_PLATE, MINT_BERRY, MIRACLEBERRY, MIRACLE_SEED, MIRAGE_MAIL, MIRAIDONS_POKE_BALL, MIROR_RADAR, MIRROR_HERB, MISTY_SEED, MODEST_MINT, MOLTRES_CANDY, MOOMOO_MILK, MOON_BALL, MOON_FLUTE, MOON_SHARD, MOON_STONE, MORPH_MAIL, MOSAIC_MAIL, MOUNTAIN_BALM, MR_MIME_CANDY, MUSCLE_BAND, MUSCLE_FEATHER, MUSHROOM_CAKE, MUSIC_DISC, MUSIC_MAIL, MYSTERIOUS_BALM, MYSTERIOUS_SHARD_S, MYSTERIOUS_SHARD_L, MYSTERYBERRY, MYSTERY_EGG, MYSTIC_WATER, MYSTICTICKET, NAIVE_MINT, NANAB_BERRY, NAUGHTY_MINT, NEST_BALL, NET_BALL, NEVER_MELT_ICE, NIDORAN_MALE_CANDY, NIDORAN_FEMALE_CANDY, NINIKU_BERRY, N_LUNARIZER, NOMEL_BERRY, NORMAL_BOX, NORMAL_GEM, NORMAL_TERA_SHARD, NORMALIUM_Z, N_SOLARIZER, NUGGET, NUTPEA_BERRY, OAKS_LETTER, OAKS_PARCEL, OCCA_BERRY, OCEANIC_SLATE, ODD_INCENSE, ODD_KEYSTONE, ODDISH_CANDY, OLD_AMBER, OLD_CHARM, OLD_GATEAU, OLD_JOURNAL, OLD_LETTER, OLD_ROD, OLD_SEA_MAP, OLD_VERSES, OMANYTE_CANDY, ONIX_CANDY, ORAN_BERRY, ORANGE_MAIL, ORANGE_PETAL, ORIGIN_BALL, ORIGIN_ORE, OVAL_CHARM, OVAL_STONE, PAIR_OF_TICKETS, PAL_PAD, PAMTRE_BERRY, PARALYZE_HEAL, PARAS_CANDY, PARCEL, PARK_BALL, PASS, PASS_ORB, PASSHO_BERRY, PAYAPA_BERRY, PEARL, PEARL_STRING, PEAT_BLOCK, PECHA_BERRY, PEP_UP_PLANT, PERMIT, PERSIM_BERRY, PETAYA_BERRY, PEWTER_CRUNCHIES, PICNIC_SET, PIDGEOTITE, PIDGEY_CANDY, PIKACHU_CANDY, PIKANIUM_Z, PIKASHUNIUM_Z, PINAP_BERRY, PINK_APRICORN, PINK_BOW, PINK_NECTAR, PINK_PETAL, PINK_SCARF, PINSIR_CANDY, PINSIRITE, PIXIE_PLATE, PLASMA_CARD, PLUME_FOSSIL, PLUMP_BEANS, POFFIN_CASE, POINT_CARD, POISON_BARB, POISON_GEM, POISON_MEMORY, POISON_TERA_SHARD, POISONIUM_Z, POKE_BALL, POKE_DOLL, POKE_FLUTE, POKE_RADAR, POKE_SNACK, POKE_TOY, POKEBLOCK_CASE, POKEBLOCK_KIT, POKEDEX, POKEMON_BOX_LINK, POKESHI_DOLL, POLKADOT_BOW, POLISHED_MUD_BALL, POLIWAG_CANDY, POMEG_BERRY, PONYTA_CANDY, POP_POD, PORTRAITMAIL, PORYGON_CANDY, POTION, POWER_ANKLET, POWER_BAND, POWER_BELT, POWER_BRACER, POWER_HERB, POWER_LENS, POWER_PLANT_PASS, POWER_WEIGHT, POWERUP_PART, POWDER_JAR, PP_MAX, PP_UP, PREMIER_BALL, PRETTY_FEATHER, PRIMARIUM_Z, PRISM_SCALE, PRISON_BOTTLE, PROFS_LETTER, PROFESSORS_MASK, PROP_CASE, PROTECTIVE_PADS, PROTECTOR, PROTEIN, PRZCUREBERRY, PSNCUREBERRY, PSYCHIC_GEM, PSYCHIC_MEMORY, PSYCHIC_SEED, PSYCHIC_TERA_SHARD, PSYCHIUM_Z, PSYDUCK_CANDY, PUMKIN_BERRY, PUNCHING_GLOVE, PURE_INCENSE, PURPLE_NECTAR, PURPLE_PETAL, QUALOT_BERRY, QUICK_BALL, QUICK_CANDY, QUICK_CANDY_L, QUICK_CANDY_XL, QUICK_CLAW, QUICK_POWDER, QUIET_MINT, RABUTA_BERRY, RADIANT_PETAL, RAGECANDYBAR, RAINBOW_FLOWER, RAINBOW_PASS, RAINBOW_SLATE, RAINBOW_WING, RARE_BONE, RARE_CANDY, RASH_MINT, RATTATA_CANDY, RAWST_BERRY, RAZOR_CLAW, RAZOR_FANG, RAZZ_BERRY, R_DISK, REAPER_CLOTH, RECIPES, RED_APRICORN, RED_CARD, RED_CHAIN, RED_FLUTE, RED_ID_BADGE, RED_NECTAR, RED_ORB, RED_PETAL, RED_SCALE, RED_SCARF, RED_SHARD, REINS_OF_UNITY, RELAXED_MINT, RELIC_BAND, RELIC_COPPER, RELIC_CROWN, RELIC_GOLD, RELIC_SILVER, RELIC_STATUE, RELIC_VASE, REMEDY, REPEAT_BALL, REPEL, REPLY_MAIL, RESIST_FEATHER, RETRO_MAIL, REVEAL_GLASS, REVIVAL_HERB, REVIVE, RHYHORN_CANDY, RIBBON_SWEET, RICH_MULCH, RIDE_PAGER, RINDO_BERRY, RING_TARGET, ROCK_GEM, ROCK_INCENSE, ROCK_MEMORY, ROCK_TERA_SHARD, ROCKIUM_Z, ROCKY_HELMET, ROLLER_SKATES, ROOM_SERVICE, ROOT_FOSSIL, ROSE_INCENSE, ROSELI_BERRY, ROTO_BARGAIN, ROTO_BOOST, ROTO_CATCH, ROTO_ENCOUNTER, ROTO_EXP_POINTS, ROTO_FRIENDSHIP, ROTO_HATCH, ROTO_HP_RESTORE, ROTO_PP_RESTORE, ROTO_PRIZE_MONEY, ROTO_STEALTH, ROTOM_BIKE, ROTOM_CATALOG, ROTOM_PHONE, ROWAP_BERRY, RSVP_MAIL, RUBY, RUNNING_SHOES, RUSTED_SHIELD, RUSTED_SWORD, S_S_TICKET, SABLENITE, SACHET, SACRED_ASH, SAFARI_BALL, SAFETY_GOGGLES, SAIL_FOSSIL, SALAC_BERRY, SALAMENCITE, SALT_CAKE, SAND_RADISH, SANDSHREW_CANDY, SANDWICH, SAPPHIRE, SASSY_MINT, SCANNER, SCARLET_BOOK, SCATTER_BANG, SCEPTILITE, SCIZORITE, SCOPE_LENS, SCROLL_OF_DARKNESS, SCROLL_OF_WATERS, SCYTHER_CANDY, SEA_INCENSE, SEAL_CASE, SECRET_KEY, SECRET_MEDICINE, SEED_OF_MASTERY, SEEL_CANDY, SERIOUS_MINT, SHADOW_MAIL, SHADEROOT_CARROT, SHALOUR_SABLE, SHARP_BEAK, SHARPEDONITE, SHED_SHELL, SHELL_BELL, SHELLDER_CANDY, SHINY_CHARM, SHINY_LEAF, SHINY_STONE, SHOAL_SALT, SHOAL_SHELL, SHOCK_DRIVE, SHUCA_BERRY, SILK_SCARF, SILPH_SCOPE, SILVER_LEAF, SILVER_NANAB_BERRY, SILVER_PINAP_BERRY, SILVER_POWDER, SILVER_RAZZ_BERRY, SILVER_WING, SITRUS_BERRY, SKULL_FOSSIL, SKY_PLATE, SKY_TUMBLESTONE, SLOWBRONITE, SLOWPOKE_CANDY, SLOWPOKE_TAIL, SMALL_BOUQUET, SMALL_TABLET, SMART_CANDY, SMART_CANDY_L, SMART_CANDY_XL, SMOKE_BALL, SMOKE_BOMB, SMOOTH_ROCK, SNORLAX_CANDY, SNORLIUM_Z, SNOWBALL, SNOW_BALM, SNOW_MAIL, SODA_POP, SOFT_SAND, SOLGANIUM_Z, SONIAS_BOOK, SOOT_SACK, SOOTFOOT_ROOT, SOOTHE_BELL, SOUL_DEW, SOUL_SLATE, SPACE_BALM, SPACE_MAIL, SPARKLING_STONE, SPEAROW_CANDY, SPELL_TAG, SPELON_BERRY, SPLASH_PLATE, SPOILED_APRICORN, SPOOKY_PLATE, SPORT_BALL, SPRAYDUCK, SPRINGY_MUSHROOM, SPRINKLOTAD, SQUALL_SLATE, SQUIRT_BOTTLE, SQUIRTLE_CANDY, STABLE_MULCH, STAR_PIECE, STAR_SWEET, STARDUST, STARF_BERRY, STARYU_CANDY, STEALTH_SPRAY, STEEL_GEM, STEEL_MAIL, STEEL_MEMORY, STEEL_TEETH, STEEL_TERA_SHARD, STEELIUM_Z, STEELIXITE, STICKY_BARB, STICKY_GLOB, STONE_PLATE, STORAGE_KEY, STRANGE_BALL, STRANGE_SOUVENIR, STRATOSPHERIC_SLATE, STRAWBERRY_SWEET, STRETCHY_SPRING, STRIB_BERRY, STYLE_CARD, SUBWAY_KEY, SUITE_KEY, SUN_FLUTE, SUN_SHARD, SUN_STONE, SUPER_LURE, SUPER_POTION, SUPER_REPEL, SUPER_ROD, SUPERB_REMEDY, SURFBOARD, SURF_MAIL, SURGE_BADGE, SURPRISE_MULCH, SURVIVAL_CHARM_B, SURVIVAL_CHARM_P, SURVIVAL_CHARM_R, SURVIVAL_CHARM_T, SURVIVAL_CHARM_Y, SWAMPERTITE, SWAP_SNACK, SWEET_APPLE, SWEET_HEART, SWIFT_FEATHER, SWORDCAP, SYSTEM_LEVER, TAMATO_BERRY, TANGA_BERRY, TANGELA_CANDY, TAPUNIUM_Z, TART_APPLE, TAUROS_CANDY, TEA, TEACHY_TV, TECTONIC_SLATE, TEMPTING_CHARM_B, TEMPTING_CHARM_P, TEMPTING_CHARM_R, TEMPTING_CHARM_T, TEMPTING_CHARM_Y, TENTACOOL_CANDY, TERA_ORB, TERRAIN_EXTENDER, TERU_SAMA, THANKS_MAIL, THICK_CLUB, THROAT_SPRAY, THUNDER_STONE, TIDAL_BELL, TIME_BALM, TIME_FLUTE, TIMER_BALL, TIMID_MINT, TINY_BAMBOO_SHOOT, TINY_MUSHROOM, TM01, TM02, TM03, TM04, TM05, TM06, TM07, TM08, TM09, TM10, TM11, TM12, TM13, TM14, TM15, TM16, TM17, TM18, TM19, TM20, TM21, TM22, TM23, TM24, TM25, TM26, TM27, TM28, TM29, TM30, TM31, TM32, TM33, TM34, TM35, TM36, TM37, TM38, TM39, TM40, TM41, TM42, TM43, TM44, TM45, TM46, TM47, TM48, TM49, TM50, TM51, TM52, TM53, TM54, TM55, TM56, TM57, TM58, TM59, TM60, TM61, TM62, TM63, TM64, TM65, TM66, TM67, TM68, TM69, TM70, TM71, TM72, TM73, TM74, TM75, TM76, TM77, TM78, TM79, TM80, TM81, TM82, TM83, TM84, TM85, TM86, TM87, TM88, TM89, TM90, TM91, TM92, TM93, TM94, TM95, TM96, TM97, TM98, TM99, TM_CASE, TM_MATERIALS, TR01, TR02, TR03, TR04, TR05, TR06, TR07, TR08, TR09, TR10, TR11, TR12, TR13, TR14, TR15, TR16, TR17, TR18, TR19, TR20, TR21, TR22, TR23, TR24, TR25, TR26, TR27, TR28, TR29, TR30, TR31, TR32, TR33, TR34, TR35, TR36, TR37, TR38, TR39, TR40, TR41, TR42, TR43, TR44, TR45, TR46, TR47, TR48, TR49, TR50, TR51, TR52, TR53, TR54, TR55, TR56, TR57, TR58, TR59, TR60, TR61, TR62, TR63, TR64, TR65, TR66, TR67, TR68, TR69, TR70, TR71, TR72, TR73, TR74, TR75, TR76, TR77, TR78, TR79, TR80, TR81, TR82, TR83, TR84, TR85, TR86, TR87, TR88, TR89, TR90, TR91, TR92, TR93, TR94, TR95, TR96, TR97, TR98, TR99, TMV_PASS, TOPO_BERRY, TORN_JOURNAL, TOUGA_BERRY, TOUGH_CANDY, TOUGH_CANDY_L, TOUGH_CANDY_XL, TOWN_MAP, TOXIC_ORB, TOXIC_PLATE, TRAVEL_TRUNK, TRI_PASS, TROPIC_MAIL, TROPICAL_SHELL, TUMBLESTONE, TUNNEL_MAIL, TWICE_SPICED_RADISH, TWISTED_SPOON, TYRANITARITE, U_DISK, ULTRA_BALL, ULTRANECROZIUM_Z, UNOWN_REPORT, UNUSUAL_SHOES, UPGRADE, UTILITY_UMBRELLA, UXIES_CLAW, VENONAT_CANDY, VENUSAURITE, VIOLET_BOOK, VIVICHOKE, VIVID_SCENT, VOICE_CASE_1, VOICE_CASE_2, VOICE_CASE_3, VOICE_CASE_4, VOICE_CASE_5, VOLCANO_BALM, VOLTORB_CANDY, VS_RECORDER, VS_SEEKER, VULPIX_CANDY, WACAN_BERRY, WAILMER_PAIL, WALL_FRAGMENT, WARDING_CHARM_B, WARDING_CHARM_P, WARDING_CHARM_R, WARDING_CHARM_T, WARDING_CHARM_Y, WATER_GEM, WATER_MEMORY, WATER_STONE, WATER_TERA_SHARD, WATERIUM_Z, WATMEL_BERRY, WAVE_INCENSE, WAVE_MAIL, WEAKNESS_POLICY, WEEDLE_CANDY, WEPEAR_BERRY, WHIPPED_DREAM, WHITE_APRICORN, WHITE_FLUTE, WHITE_HERB, WHITE_MANE_HAIR, WIDE_LENS, WIKI_BERRY, WING_BALL, WISE_GLASSES, WISHING_CHIP, WISHING_PIECE, WISHING_STAR, WOOD, WOOD_MAIL, WOODEN_CROWN, WORKS_KEY, X_ACCURACY, X_ATTACK, X_DEFENSE, X_SP_ATK, X_SP_DEF, X_SPEED, XTRANSCEIVER, YACHE_BERRY, YAGO_BERRY, YELLOW_APRICORN, YELLOW_FLUTE, YELLOW_NECTAR, YELLOW_PETAL, YELLOW_SCARF, YELLOW_SHARD, YLW_ID_BADGE, ZAP_PLATE, ZAPDOS_CANDY, ZINC, ZOOM_LENS, Z_POWER_RING, Z_RING, ZUBAT_CANDY, ZYGARDE_CUBE, ITEM_TOTAL - // clang-format on -}; - -static constexpr std::uint16_t TOTAL_ITEM_COUNT = (std::uint16_t)Item::ITEM_TOTAL - 1U; -} // namespace pokesim::dex - -/////////////////////// END OF src/Types/Enums/Item.hpp //////////////////////// - -////////////////// START OF src/Types/Enums/PlayerSideId.hpp /////////////////// - -namespace pokesim { -enum class PlayerSideId : std::uint8_t { - NONE = 0U, - P1 = 1U, - P2 = 2U, -}; - -static constexpr std::uint8_t TOTAL_PLAYER_SIDE_ID_COUNT = 2U; -} // namespace pokesim - -/////////////////// END OF src/Types/Enums/PlayerSideId.hpp //////////////////// - -////////////////////// START OF src/Types/Enums/Slot.hpp /////////////////////// - -namespace pokesim { -enum class Slot : std::uint8_t { - NONE = 0U, - P1A, - P2A, - P1B, - P2B, - - P1C, - P2C, - P1D, - P2D, - P1E, - P2E, - P1F, - P2F, - - TOTAL_SLOT, -}; - -static constexpr std::uint8_t TOTAL_SLOT_COUNT = (std::uint8_t)Slot::TOTAL_SLOT - 1U; -} // namespace pokesim - -/////////////////////// END OF src/Types/Enums/Slot.hpp //////////////////////// - -//////////////////// START OF src/Components/Decisions.hpp ///////////////////// - -namespace pokesim { -struct SlotDecision { - Slot sourceSlot = Slot::NONE; - Slot targetSlot = Slot::NONE; - - bool megaEvolve = false; - bool primalRevert = false; - bool dynamax = false; - bool terastallize = false; - - std::optional moveChoice = std::nullopt; - std::optional itemChoice = std::nullopt; - - bool operator==(const SlotDecision& other) const { - return sourceSlot == other.sourceSlot && targetSlot == other.targetSlot && megaEvolve == other.megaEvolve && - primalRevert == other.primalRevert && dynamax == other.dynamax && terastallize == other.terastallize && - moveChoice == other.moveChoice && itemChoice == other.itemChoice; - } -}; - -namespace types { -using slotDecisions = types::sideSlots; -} - -struct SideDecision { - PlayerSideId sideId = PlayerSideId::NONE; - internal::variant decisions{}; - - bool operator==(const SideDecision other) const { return sideId == other.sideId && decisions == other.decisions; } -}; -} // namespace pokesim - -///////////////////// END OF src/Components/Decisions.hpp ////////////////////// - ////////////////////// START OF src/Components/EVsIVs.hpp ////////////////////// namespace pokesim { @@ -19026,6 +18990,21 @@ struct GenderName { ///////////////// END OF src/Components/Names/GenderNames.hpp ////////////////// +////////////////////// START OF src/Types/Enums/Item.hpp /////////////////////// + +namespace pokesim::dex { +// Name of items in Pokemon games +enum class Item : std::uint16_t { + // clang-format off + NO_ITEM = 0U, ABILITY_CAPSULE, ABILITY_PATCH, ABILITY_SHIELD, ABOMASITE, ABRA_CANDY, ABSOLITE, ABSORB_BULB, ACRO_BIKE, ADAMANT_CRYSTAL, ADAMANT_MINT, ADAMANT_ORB, ADRENALINE_ORB, ADVENTURE_GUIDE, AERODACTYLITE, AERODACTYL_CANDY, AGGRONITE, AGUAV_BERRY, AIR_BALLOON, AIR_MAIL, ALAKAZITE, ALORAICHIUM_Z, ALTARIANITE, AMAZE_MULCH, AMPHAROSITE, AMULET_COIN, ANTIDOTE, APICOT_BERRY, APRICORN, APRICORN_BOX, AQUA_SUIT, ARMOR_FOSSIL, ARMOR_PASS, ARMORITE_ORE, ARTICUNO_CANDY, ASPEAR_BERRY, ASSAULT_VEST, AUDINITE, AURORATICKET, AUSPICIOUS_ARMOR, AUTOGRAPH, AUX_EVASION, AUX_GUARD, AUX_POWER, AUX_POWERGUARD, AWAKENING, AZELFS_FANG, AZURE_FLUTE, BABIRI_BERRY, BALL_OF_MUD, BALM_MUSHROOM, BAND_AUTOGRAPH, BANETTITE, BASCULEGION_FOOD, BASEMENT_KEY, BEACH_GLASS, BEAD_MAIL, BEAN_CAKE, BEAST_BALL, BEEDRILLITE, BELLSPROUT_CANDY, BELUE_BERRY, BERRY, BERRY_JUICE, BERRY_POTS, BERRY_POUCH, BERRY_SWEET, BERSERK_GENE, BICYCLE, BIG_BAMBOO_SHOOT, BIG_MALASADA, BIG_MUSHROOM, BIG_NUGGET, BIG_PEARL, BIG_ROOT, BIKE_VOUCHER, BINDING_BAND, BITTER_BERRY, BLACK_APRICORN, BLACK_AUGURITE, BLACK_BELT, BLACK_FLUTE, BLACK_GLASSES, BLACK_MANE_HAIR, BLACK_SLUDGE, BLACK_TUMBLESTONE, BLANK_PLATE, BLASTOISINITE, BLAZIKENITE, BLOOM_MAIL, BLUE_APRICORN, BLUE_CARD, BLUE_FLUTE, BLUE_ORB, BLUE_PETAL, BLUE_SCARF, BLUE_SHARD, BLUESKY_MAIL, BLU_ID_BADGE, BLUK_BERRY, BLUNDER_POLICY, BOLD_MINT, BONSLY_CARD, BONSLY_PHOTO, BOOST_MULCH, BOOSTER_ENERGY, BOTTLE_CAP, BRAVE_MINT, BRICK_MAIL, BRICK_PIECE, BRIDGE_MAIL_D, BRIDGE_MAIL_M, BRIDGE_MAIL_S, BRIDGE_MAIL_T, BRIDGE_MAIL_V, BRIGHT_POWDER, BUBBLE_MAIL, BUG_GEM, BUG_MEMORY, BUG_TERA_SHARD, BUGINIUM_Z, BUGWORT, BULBASAUR_CANDY, BURN_DRIVE, BURN_HEAL, BURNT_BERRY, CAKE_LURE_BASE, CALCIUM, CALM_MINT, CAMERUPTITE, CAMPING_GEAR, CANDY_TRUFFLE, CARBOS, CARD_KEY, CAREFUL_MINT, CARROT_SEEDS, CASTELIACONE, CASTER_FERN, CATCHING_CHARM, CATERPIE_CANDY, CELESTICA_FLUTE, CELL_BATTERY, CHALKY_STONE, CHANSEY_CANDY, CHARCOAL, CHARIZARDITE_X, CHARIZARDITE_Y, CHARMANDER_CANDY, CHARTI_BERRY, CHERI_BERRY, CHERISH_BALL, CHESTO_BERRY, CHILAN_BERRY, CHILL_DRIVE, CHIPPED_POT, CHOICE_BAND, CHOICE_DUMPLING, CHOICE_SCARF, CHOICE_SPECS, CHOPLE_BERRY, CLAW_FOSSIL, CLEANSE_TAG, CLEAR_AMULET, CLEAR_BELL, CLEFAIRY_CANDY, CLEVER_FEATHER, CLOVER_SWEET, COBA_BERRY, COIN_CASE, COLBUR_BERRY, COLOGNE_CASE, COLRESS_MACHINE, COMET_SHARD, COMMON_STONE, CONTEST_COSTUME, CONTEST_PASS, CORNN_BERRY, COUPON_1, COUPON_2, COUPON_3, COURAGE_CANDY, COURAGE_CANDY_L, COURAGE_CANDY_XL, COVER_FOSSIL, COVERT_CLOAK, CRACKED_POT, CRAFTING_KIT, CROWN_PASS, CRUNCHY_SALT, CUBONE_CANDY, CRY_ANALYZER, CUSTAP_BERRY, DAMP_MULCH, DAMP_ROCK, DARK_GEM, DARK_MEMORY, DARK_STONE, DARK_TERA_SHARD, DARKINIUM_Z, DATA_CARDS, DATA_ROM, DAWN_STONE, DAZZLING_HONEY, D_DISK, DECIDIUM_Z, DEEP_SEA_SCALE, DEEP_SEA_TOOTH, DESTINY_KNOT, DEVON_PARTS, DEVON_SCOPE, DEVON_SCUBA_GEAR, DIANCITE, DIGGER_DRILL, DIGLETT_CANDY, DIRE_HIT, DIRESHROOM, DISC_CASE, DISCOUNT_COUPON, DISCOVERY_SLATE, DISTORTION_SLATE, DITTO_CANDY, DIVE_BALL, DNA_SAMPLE, DNA_SPLICERS, DODUO_CANDY, DOME_FOSSIL, DOPPEL_BONNETS, DOUSE_DRIVE, DOWN_ST_KEY, DOWSING_MACHINE, DRACO_PLATE, DRAGON_FANG, DRAGON_GEM, DRAGON_MEMORY, DRAGON_SCALE, DRAGON_SKULL, DRAGON_TERA_SHARD, DRAGONIUM_Z, DRASH_BERRY, DRATINI_CANDY, DREAD_PLATE, DREAM_BALL, DREAM_MAIL, DROPPED_ITEM, DROWZEE_CANDY, DS_SOUNDS, DUBIOUS_DISC, DURIN_BERRY, DUSK_BALL, DUSK_STONE, DYNAMAX_BAND, DYNAMAX_CANDY, DYNAMAX_CRYSTALS, DYNITE_ORE, EARTH_PLATE, EEVEE_CANDY, EEVIUM_Z, EGG_TICKET, EGGANT_BERRY, EIN_FILE_C, EIN_FILE_F, EIN_FILE_H, EIN_FILE_P, EIN_FILE_S, EJECT_BUTTON, EJECT_PACK, EKANS_CANDY, ELECTABUZZ_CANDY, ELECTIRIZER, ELECTRIC_GEM, ELECTRIC_MEMORY, ELECTRIC_SEED, ELECTRIC_TERA_SHARD, ELECTRIUM_Z, ELEVATOR_KEY, ELIXIR, ENDORSEMENT, ENERGY_POWDER, ENERGY_ROOT, ENIGMA_BERRY, ENIGMA_STONE, ENIGMATIC_CARD, EON_FLUTE, EON_MAIL, EON_TICKET, ESCAPE_ROPE, ETERNAL_ICE, ETHER, EVERSTONE, EVIOLITE, EXCITE_SCENT, EXEGGCUTE_CANDY, EXP_CANDY_L, EXP_CANDY_M, EXP_CANDY_S, EXP_CANDY_XL, EXP_CANDY_XS, EXP_CHARM, EXP_SHARE, EXPERT_BELT, EXPLORER_KIT, FAB_MAIL, FAIRIUM_Z, FAIRY_GEM, FAIRY_MEMORY, FAIRY_TERA_SHARD, FAME_CHECKER, FARFETCHD_CANDY, FASHION_CASE, FAST_BALL, FAVORED_MAIL, F_DISK, FEATHER_BALL, FESTIVAL_TICKET, FIGHTING_GEM, FIGHTING_MEMORY, FIGHTING_TERA_SHARD, FIGHTINIUM_Z, FIGY_BERRY, FINE_REMEDY, FIRE_GEM, FIRE_MEMORY, FIRE_STONE, FIRE_TERA_SHARD, FIRIUM_Z, FISHING_ROD, FIST_PLATE, FLAME_MAIL, FLAME_ORB, FLAME_PLATE, FLOAT_STONE, FLOWER_MAIL, FLOWER_SWEET, FLUFFY_TAIL, FLYING_GEM, FLYING_MEMORY, FLYING_TERA_SHARD, FLYINIUM_Z, FOCUS_BAND, FOCUS_SASH, FORAGE_BAG, FOREST_BALM, FOSSILIZED_BIRD, FOSSILIZED_DINO, FOSSILIZED_DRAKE, FOSSILIZED_FISH, FRESH_WATER, FRIEND_BALL, FULL_HEAL, FULL_INCENSE, FULL_RESTORE, GALACTIC_KEY, GALARICA_CUFF, GALARICA_TWIG, GALARICA_WREATH, GALLADITE, GANLON_BERRY, GARCHOMPITE, GARDEVOIRITE, GASTLY_CANDY, GB_SOUNDS, GEAR, GENGARITE, GENIUS_FEATHER, GENOME_SLATE, GENTLE_MINT, GEODUDE_CANDY, GHOST_GEM, GHOST_MEMORY, GHOST_TERA_SHARD, GHOSTIUM_Z, GIGATON_BALL, GINEMA_BERRY, GLALITITE, GLITTER_MAIL, GO_GOGGLES, GOD_STONE, GOLD_BERRY, GOLD_BOTTLE_CAP, GOLD_LEAF, GOLD_TEETH, GOLDEEN_CANDY, GONZAPS_KEY, GOLDEN_NANAB_BERRY, GOLDEN_PINAP_BERRY, GOLDEN_RAZZ_BERRY, GOOD_ROD, GOOEY_MULCH, GORGEOUS_BOX, GRACIDEA, GRAIN_CAKE, GRAM_1, GRAM_2, GRAM_3, GRASS_GEM, GRASS_MEMORY, GRASS_TERA_SHARD, GRASSIUM_Z, GRASS_MAIL, GRASSY_SEED, GREAT_BALL, GREEN_APRICORN, GREEN_PETAL, GREEN_SCARF, GREEN_SHARD, GREET_MAIL, GREPA_BERRY, GRIMER_CANDY, GRIP_CLAW, GRIT_DUST, GRIT_GRAVEL, GRIT_PEBBLE, GRIT_ROCK, GRISEOUS_CORE, GRISEOUS_ORB, GRN_ID_BADGE, GROUND_GEM, GROUND_MEMORY, GROUND_TERA_SHARD, GROUNDIUM_Z, GROWLITHE_CANDY, GROWTH_MULCH, GRUBBY_HANKY, GS_BALL, GUARD_SPEC, GUIDEBOOK, GYARADOSITE, HABAN_BERRY, HARBOR_MAIL, HARD_STONE, HASTY_MINT, HEAL_BALL, HEAL_POWDER, HEALTH_CANDY, HEALTH_CANDY_L, HEALTH_CANDY_XL, HEALTH_FEATHER, HEART_MAIL, HEART_SCALE, HEARTY_GRAINS, HEAT_ROCK, HEAVY_BALL, HEAVY_DUTY_BOOTS, HELIX_FOSSIL, HERACRONITE, HI_TECH_EARBUDS, HITMONCHAN_CANDY, HITMONLEE_CANDY, HM01, HM02, HM03, HM04, HM05, HM06, HM07, HM08, HOLO_CASTER, HOMETOWN_MUFFIN, HONDEW_BERRY, HONEY, HONEY_CAKE, HONOR_OF_KALOS, HOPO_BERRY, HORSEA_CANDY, HOUNDOOMINITE, HP_UP, HYPER_POTION, IAPAPA_BERRY, ICE_BERRY, ICE_GEM, ICE_HEAL, ICE_MEMORY, ICE_STONE, ICE_TERA_SHARD, ICEROOT_CARROT, ICICLE_PLATE, ICIUM_Z, ICY_ROCK, ID_CARD, ILIMAS_NORMALIUM_Z, IMPISH_MINT, INCINIUM_Z, INQUIRY_MAIL, INSECT_PLATE, INTRIGUING_STONE, IRON, IRON_BALL, IRON_BARKTONGUE, IRON_CHUNK, IRON_PLATE, JABOCA_BERRY, JADE_ORB, JAIL_KEY, JAW_FOSSIL, JET_BALL, JIGGLYPUFF_CANDY, JOHTO_SLATE, JOLLY_MINT, JOY_SCENT, JUBILIFE_MUFFIN, JYNX_CANDY, KABUTO_CANDY, KANGASKHAN_CANDY, KANGASKHANITE, KANTO_SLATE, KASIB_BERRY, KEBIA_BERRY, KEE_BERRY, KELPSY_BERRY, KEY_STONE, KEY_TO_ROOM_1, KEY_TO_ROOM_2, KEY_TO_ROOM_4, KEY_TO_ROOM_6, KINGS_LEAF, KINGS_ROCK, KOFFING_CANDY, KOFUS_BOOK, KOMMONIUM_Z, KORAIDONS_POKE_BALL, KRABBY_CANDY, KRANE_MEMO_1, KRANE_MEMO_2, KRANE_MEMO_3, KRANE_MEMO_4, KRANE_MEMO_5, KUO_BERRY, LAGGING_TAIL, LANSAT_BERRY, LAPRAS_CANDY, LATIASITE, LATIOSITE, LAVA_COOKIE, LAX_INCENSE, LAX_MINT, L_DISK, LEADEN_BALL, LEADERS_CREST, LEAF_LETTER, LEAF_STONE, LEEK, LEFT_POKE_BALL, LEFTOVERS, LEGEND_PLATE, LEGENDARY_CLUE_1, LEGENDARY_CLUE_2, LEGENDARY_CLUE_3, LEGENDARY_CLUE, LEMONADE, LENS_CASE, LEPPA_BERRY, LETTER, LEVEL_BALL, LIBERTY_PASS, LICKITUNG_CANDY, LIECHI_BERRY, LIFE_ORB, LIFT_KEY, LIGHT_BALL, LIGHT_CLAY, LIGHT_STONE, LIKE_MAIL, LINKING_CORD, LITEBLUEMAIL, LOADED_DICE, LOCK_CAPSULE, LONE_EARRING, LONELY_MINT, LOOKER_TICKET, LOOT_SACK, LOPUNNITE, LOST_ITEM, LOST_SATCHEL, LOVE_BALL, LOVE_SWEET, LOVELY_MAIL, LUCARIONITE, LUCK_INCENSE, LUCKY_EGG, LUCKY_PUNCH, LUM_BERRY, LUMINOUS_MOSS, LUMIOSE_GALETTE, LUNALIUM_Z, LUNAR_FEATHER, LURE, LURE_BALL, LUSTROUS_GLOBE, LUSTROUS_ORB, LUXURY_BALL, LYCANIUM_Z, MACH_BIKE, MACHINE_PART, MACHO_BRACE, MACHOP_CANDY, MAGIKARP_CANDY, MAGMA_EMBLEM, MAGMA_STONE, MAGMA_SUIT, MAGMAR_CANDY, MAGMARIZER, MAGNEMITE_CANDY, MAGNET, MAGO_BERRY, MAGOST_BERRY, MAINGATE_KEY, MAKEUP_BAG, MALICIOUS_ARMOR, MANECTITE, MANKEY_CANDY, MARANGA_BERRY, MARBLE, MARK_CHARM, MARSHADIUM_Z, MARSH_BALM, MASTER_BALL, MAWILITE, MAX_ELIXIR, MAX_ETHER, MAX_LURE, MAX_HONEY, MAX_MUSHROOMS, MAX_POTION, MAX_REPEL, MAX_REVIVE, MAYORS_NOTE, MEADOW_PLATE, MECH_MAIL, MECHANICAL_BOX, MECHANICAL_CABINET, MECHANICAL_CIRCULAR_SAW, MECHANICAL_PINWHEEL, MECHANICAL_TUB, MEDAL_BOX, MEDICHAMITE, MEDICINAL_LEEK, MEGA_BRACELET, MEGA_RING, MELTAN_CANDY, MEMBER_CARD, MENTAL_HERB, MEOWTH_CANDY, MESPRITS_PLUME, METAGROSSITE, METAL_COAT, METAL_POWDER, METEORITE, METEORITE_SHARD, METRONOME, MEW_CANDY, MEWNIUM_Z, MEWTWO_CANDY, MEWTWONITE_X, MEWTWONITE_Y, MICLE_BERRY, MIGHTY_CANDY, MIGHTY_CANDY_L, MIGHTY_CANDY_XL, MILD_MINT, MIMIKIUM_Z, MIND_PLATE, MINT_BERRY, MIRACLEBERRY, MIRACLE_SEED, MIRAGE_MAIL, MIRAIDONS_POKE_BALL, MIROR_RADAR, MIRROR_HERB, MISTY_SEED, MODEST_MINT, MOLTRES_CANDY, MOOMOO_MILK, MOON_BALL, MOON_FLUTE, MOON_SHARD, MOON_STONE, MORPH_MAIL, MOSAIC_MAIL, MOUNTAIN_BALM, MR_MIME_CANDY, MUSCLE_BAND, MUSCLE_FEATHER, MUSHROOM_CAKE, MUSIC_DISC, MUSIC_MAIL, MYSTERIOUS_BALM, MYSTERIOUS_SHARD_S, MYSTERIOUS_SHARD_L, MYSTERYBERRY, MYSTERY_EGG, MYSTIC_WATER, MYSTICTICKET, NAIVE_MINT, NANAB_BERRY, NAUGHTY_MINT, NEST_BALL, NET_BALL, NEVER_MELT_ICE, NIDORAN_MALE_CANDY, NIDORAN_FEMALE_CANDY, NINIKU_BERRY, N_LUNARIZER, NOMEL_BERRY, NORMAL_BOX, NORMAL_GEM, NORMAL_TERA_SHARD, NORMALIUM_Z, N_SOLARIZER, NUGGET, NUTPEA_BERRY, OAKS_LETTER, OAKS_PARCEL, OCCA_BERRY, OCEANIC_SLATE, ODD_INCENSE, ODD_KEYSTONE, ODDISH_CANDY, OLD_AMBER, OLD_CHARM, OLD_GATEAU, OLD_JOURNAL, OLD_LETTER, OLD_ROD, OLD_SEA_MAP, OLD_VERSES, OMANYTE_CANDY, ONIX_CANDY, ORAN_BERRY, ORANGE_MAIL, ORANGE_PETAL, ORIGIN_BALL, ORIGIN_ORE, OVAL_CHARM, OVAL_STONE, PAIR_OF_TICKETS, PAL_PAD, PAMTRE_BERRY, PARALYZE_HEAL, PARAS_CANDY, PARCEL, PARK_BALL, PASS, PASS_ORB, PASSHO_BERRY, PAYAPA_BERRY, PEARL, PEARL_STRING, PEAT_BLOCK, PECHA_BERRY, PEP_UP_PLANT, PERMIT, PERSIM_BERRY, PETAYA_BERRY, PEWTER_CRUNCHIES, PICNIC_SET, PIDGEOTITE, PIDGEY_CANDY, PIKACHU_CANDY, PIKANIUM_Z, PIKASHUNIUM_Z, PINAP_BERRY, PINK_APRICORN, PINK_BOW, PINK_NECTAR, PINK_PETAL, PINK_SCARF, PINSIR_CANDY, PINSIRITE, PIXIE_PLATE, PLASMA_CARD, PLUME_FOSSIL, PLUMP_BEANS, POFFIN_CASE, POINT_CARD, POISON_BARB, POISON_GEM, POISON_MEMORY, POISON_TERA_SHARD, POISONIUM_Z, POKE_BALL, POKE_DOLL, POKE_FLUTE, POKE_RADAR, POKE_SNACK, POKE_TOY, POKEBLOCK_CASE, POKEBLOCK_KIT, POKEDEX, POKEMON_BOX_LINK, POKESHI_DOLL, POLKADOT_BOW, POLISHED_MUD_BALL, POLIWAG_CANDY, POMEG_BERRY, PONYTA_CANDY, POP_POD, PORTRAITMAIL, PORYGON_CANDY, POTION, POWER_ANKLET, POWER_BAND, POWER_BELT, POWER_BRACER, POWER_HERB, POWER_LENS, POWER_PLANT_PASS, POWER_WEIGHT, POWERUP_PART, POWDER_JAR, PP_MAX, PP_UP, PREMIER_BALL, PRETTY_FEATHER, PRIMARIUM_Z, PRISM_SCALE, PRISON_BOTTLE, PROFS_LETTER, PROFESSORS_MASK, PROP_CASE, PROTECTIVE_PADS, PROTECTOR, PROTEIN, PRZCUREBERRY, PSNCUREBERRY, PSYCHIC_GEM, PSYCHIC_MEMORY, PSYCHIC_SEED, PSYCHIC_TERA_SHARD, PSYCHIUM_Z, PSYDUCK_CANDY, PUMKIN_BERRY, PUNCHING_GLOVE, PURE_INCENSE, PURPLE_NECTAR, PURPLE_PETAL, QUALOT_BERRY, QUICK_BALL, QUICK_CANDY, QUICK_CANDY_L, QUICK_CANDY_XL, QUICK_CLAW, QUICK_POWDER, QUIET_MINT, RABUTA_BERRY, RADIANT_PETAL, RAGECANDYBAR, RAINBOW_FLOWER, RAINBOW_PASS, RAINBOW_SLATE, RAINBOW_WING, RARE_BONE, RARE_CANDY, RASH_MINT, RATTATA_CANDY, RAWST_BERRY, RAZOR_CLAW, RAZOR_FANG, RAZZ_BERRY, R_DISK, REAPER_CLOTH, RECIPES, RED_APRICORN, RED_CARD, RED_CHAIN, RED_FLUTE, RED_ID_BADGE, RED_NECTAR, RED_ORB, RED_PETAL, RED_SCALE, RED_SCARF, RED_SHARD, REINS_OF_UNITY, RELAXED_MINT, RELIC_BAND, RELIC_COPPER, RELIC_CROWN, RELIC_GOLD, RELIC_SILVER, RELIC_STATUE, RELIC_VASE, REMEDY, REPEAT_BALL, REPEL, REPLY_MAIL, RESIST_FEATHER, RETRO_MAIL, REVEAL_GLASS, REVIVAL_HERB, REVIVE, RHYHORN_CANDY, RIBBON_SWEET, RICH_MULCH, RIDE_PAGER, RINDO_BERRY, RING_TARGET, ROCK_GEM, ROCK_INCENSE, ROCK_MEMORY, ROCK_TERA_SHARD, ROCKIUM_Z, ROCKY_HELMET, ROLLER_SKATES, ROOM_SERVICE, ROOT_FOSSIL, ROSE_INCENSE, ROSELI_BERRY, ROTO_BARGAIN, ROTO_BOOST, ROTO_CATCH, ROTO_ENCOUNTER, ROTO_EXP_POINTS, ROTO_FRIENDSHIP, ROTO_HATCH, ROTO_HP_RESTORE, ROTO_PP_RESTORE, ROTO_PRIZE_MONEY, ROTO_STEALTH, ROTOM_BIKE, ROTOM_CATALOG, ROTOM_PHONE, ROWAP_BERRY, RSVP_MAIL, RUBY, RUNNING_SHOES, RUSTED_SHIELD, RUSTED_SWORD, S_S_TICKET, SABLENITE, SACHET, SACRED_ASH, SAFARI_BALL, SAFETY_GOGGLES, SAIL_FOSSIL, SALAC_BERRY, SALAMENCITE, SALT_CAKE, SAND_RADISH, SANDSHREW_CANDY, SANDWICH, SAPPHIRE, SASSY_MINT, SCANNER, SCARLET_BOOK, SCATTER_BANG, SCEPTILITE, SCIZORITE, SCOPE_LENS, SCROLL_OF_DARKNESS, SCROLL_OF_WATERS, SCYTHER_CANDY, SEA_INCENSE, SEAL_CASE, SECRET_KEY, SECRET_MEDICINE, SEED_OF_MASTERY, SEEL_CANDY, SERIOUS_MINT, SHADOW_MAIL, SHADEROOT_CARROT, SHALOUR_SABLE, SHARP_BEAK, SHARPEDONITE, SHED_SHELL, SHELL_BELL, SHELLDER_CANDY, SHINY_CHARM, SHINY_LEAF, SHINY_STONE, SHOAL_SALT, SHOAL_SHELL, SHOCK_DRIVE, SHUCA_BERRY, SILK_SCARF, SILPH_SCOPE, SILVER_LEAF, SILVER_NANAB_BERRY, SILVER_PINAP_BERRY, SILVER_POWDER, SILVER_RAZZ_BERRY, SILVER_WING, SITRUS_BERRY, SKULL_FOSSIL, SKY_PLATE, SKY_TUMBLESTONE, SLOWBRONITE, SLOWPOKE_CANDY, SLOWPOKE_TAIL, SMALL_BOUQUET, SMALL_TABLET, SMART_CANDY, SMART_CANDY_L, SMART_CANDY_XL, SMOKE_BALL, SMOKE_BOMB, SMOOTH_ROCK, SNORLAX_CANDY, SNORLIUM_Z, SNOWBALL, SNOW_BALM, SNOW_MAIL, SODA_POP, SOFT_SAND, SOLGANIUM_Z, SONIAS_BOOK, SOOT_SACK, SOOTFOOT_ROOT, SOOTHE_BELL, SOUL_DEW, SOUL_SLATE, SPACE_BALM, SPACE_MAIL, SPARKLING_STONE, SPEAROW_CANDY, SPELL_TAG, SPELON_BERRY, SPLASH_PLATE, SPOILED_APRICORN, SPOOKY_PLATE, SPORT_BALL, SPRAYDUCK, SPRINGY_MUSHROOM, SPRINKLOTAD, SQUALL_SLATE, SQUIRT_BOTTLE, SQUIRTLE_CANDY, STABLE_MULCH, STAR_PIECE, STAR_SWEET, STARDUST, STARF_BERRY, STARYU_CANDY, STEALTH_SPRAY, STEEL_GEM, STEEL_MAIL, STEEL_MEMORY, STEEL_TEETH, STEEL_TERA_SHARD, STEELIUM_Z, STEELIXITE, STICKY_BARB, STICKY_GLOB, STONE_PLATE, STORAGE_KEY, STRANGE_BALL, STRANGE_SOUVENIR, STRATOSPHERIC_SLATE, STRAWBERRY_SWEET, STRETCHY_SPRING, STRIB_BERRY, STYLE_CARD, SUBWAY_KEY, SUITE_KEY, SUN_FLUTE, SUN_SHARD, SUN_STONE, SUPER_LURE, SUPER_POTION, SUPER_REPEL, SUPER_ROD, SUPERB_REMEDY, SURFBOARD, SURF_MAIL, SURGE_BADGE, SURPRISE_MULCH, SURVIVAL_CHARM_B, SURVIVAL_CHARM_P, SURVIVAL_CHARM_R, SURVIVAL_CHARM_T, SURVIVAL_CHARM_Y, SWAMPERTITE, SWAP_SNACK, SWEET_APPLE, SWEET_HEART, SWIFT_FEATHER, SWORDCAP, SYSTEM_LEVER, TAMATO_BERRY, TANGA_BERRY, TANGELA_CANDY, TAPUNIUM_Z, TART_APPLE, TAUROS_CANDY, TEA, TEACHY_TV, TECTONIC_SLATE, TEMPTING_CHARM_B, TEMPTING_CHARM_P, TEMPTING_CHARM_R, TEMPTING_CHARM_T, TEMPTING_CHARM_Y, TENTACOOL_CANDY, TERA_ORB, TERRAIN_EXTENDER, TERU_SAMA, THANKS_MAIL, THICK_CLUB, THROAT_SPRAY, THUNDER_STONE, TIDAL_BELL, TIME_BALM, TIME_FLUTE, TIMER_BALL, TIMID_MINT, TINY_BAMBOO_SHOOT, TINY_MUSHROOM, TM01, TM02, TM03, TM04, TM05, TM06, TM07, TM08, TM09, TM10, TM11, TM12, TM13, TM14, TM15, TM16, TM17, TM18, TM19, TM20, TM21, TM22, TM23, TM24, TM25, TM26, TM27, TM28, TM29, TM30, TM31, TM32, TM33, TM34, TM35, TM36, TM37, TM38, TM39, TM40, TM41, TM42, TM43, TM44, TM45, TM46, TM47, TM48, TM49, TM50, TM51, TM52, TM53, TM54, TM55, TM56, TM57, TM58, TM59, TM60, TM61, TM62, TM63, TM64, TM65, TM66, TM67, TM68, TM69, TM70, TM71, TM72, TM73, TM74, TM75, TM76, TM77, TM78, TM79, TM80, TM81, TM82, TM83, TM84, TM85, TM86, TM87, TM88, TM89, TM90, TM91, TM92, TM93, TM94, TM95, TM96, TM97, TM98, TM99, TM_CASE, TM_MATERIALS, TR01, TR02, TR03, TR04, TR05, TR06, TR07, TR08, TR09, TR10, TR11, TR12, TR13, TR14, TR15, TR16, TR17, TR18, TR19, TR20, TR21, TR22, TR23, TR24, TR25, TR26, TR27, TR28, TR29, TR30, TR31, TR32, TR33, TR34, TR35, TR36, TR37, TR38, TR39, TR40, TR41, TR42, TR43, TR44, TR45, TR46, TR47, TR48, TR49, TR50, TR51, TR52, TR53, TR54, TR55, TR56, TR57, TR58, TR59, TR60, TR61, TR62, TR63, TR64, TR65, TR66, TR67, TR68, TR69, TR70, TR71, TR72, TR73, TR74, TR75, TR76, TR77, TR78, TR79, TR80, TR81, TR82, TR83, TR84, TR85, TR86, TR87, TR88, TR89, TR90, TR91, TR92, TR93, TR94, TR95, TR96, TR97, TR98, TR99, TMV_PASS, TOPO_BERRY, TORN_JOURNAL, TOUGA_BERRY, TOUGH_CANDY, TOUGH_CANDY_L, TOUGH_CANDY_XL, TOWN_MAP, TOXIC_ORB, TOXIC_PLATE, TRAVEL_TRUNK, TRI_PASS, TROPIC_MAIL, TROPICAL_SHELL, TUMBLESTONE, TUNNEL_MAIL, TWICE_SPICED_RADISH, TWISTED_SPOON, TYRANITARITE, U_DISK, ULTRA_BALL, ULTRANECROZIUM_Z, UNOWN_REPORT, UNUSUAL_SHOES, UPGRADE, UTILITY_UMBRELLA, UXIES_CLAW, VENONAT_CANDY, VENUSAURITE, VIOLET_BOOK, VIVICHOKE, VIVID_SCENT, VOICE_CASE_1, VOICE_CASE_2, VOICE_CASE_3, VOICE_CASE_4, VOICE_CASE_5, VOLCANO_BALM, VOLTORB_CANDY, VS_RECORDER, VS_SEEKER, VULPIX_CANDY, WACAN_BERRY, WAILMER_PAIL, WALL_FRAGMENT, WARDING_CHARM_B, WARDING_CHARM_P, WARDING_CHARM_R, WARDING_CHARM_T, WARDING_CHARM_Y, WATER_GEM, WATER_MEMORY, WATER_STONE, WATER_TERA_SHARD, WATERIUM_Z, WATMEL_BERRY, WAVE_INCENSE, WAVE_MAIL, WEAKNESS_POLICY, WEEDLE_CANDY, WEPEAR_BERRY, WHIPPED_DREAM, WHITE_APRICORN, WHITE_FLUTE, WHITE_HERB, WHITE_MANE_HAIR, WIDE_LENS, WIKI_BERRY, WING_BALL, WISE_GLASSES, WISHING_CHIP, WISHING_PIECE, WISHING_STAR, WOOD, WOOD_MAIL, WOODEN_CROWN, WORKS_KEY, X_ACCURACY, X_ATTACK, X_DEFENSE, X_SP_ATK, X_SP_DEF, X_SPEED, XTRANSCEIVER, YACHE_BERRY, YAGO_BERRY, YELLOW_APRICORN, YELLOW_FLUTE, YELLOW_NECTAR, YELLOW_PETAL, YELLOW_SCARF, YELLOW_SHARD, YLW_ID_BADGE, ZAP_PLATE, ZAPDOS_CANDY, ZINC, ZOOM_LENS, Z_POWER_RING, Z_RING, ZUBAT_CANDY, ZYGARDE_CUBE, ITEM_TOTAL + // clang-format on +}; + +static constexpr std::uint16_t TOTAL_ITEM_COUNT = (std::uint16_t)Item::ITEM_TOTAL - 1U; +} // namespace pokesim::dex + +/////////////////////// END OF src/Types/Enums/Item.hpp //////////////////////// + ///////////////// START OF src/Components/Names/ItemNames.hpp ////////////////// namespace pokesim { @@ -19071,6 +19050,33 @@ struct NatureName { ///////////////// END OF src/Components/Names/NatureNames.hpp ////////////////// +////////////////////// START OF src/Types/Enums/Slot.hpp /////////////////////// + +namespace pokesim { +enum class Slot : std::uint8_t { + NONE = 0U, + P1A, + P2A, + P1B, + P2B, + + P1C, + P2C, + P1D, + P2D, + P1E, + P2E, + P1F, + P2F, + + TOTAL_SLOT, +}; + +static constexpr std::uint8_t TOTAL_SLOT_COUNT = (std::uint8_t)Slot::TOTAL_SLOT - 1U; +} // namespace pokesim + +/////////////////////// END OF src/Types/Enums/Slot.hpp //////////////////////// + /////////////// START OF src/Components/Names/SourceSlotName.hpp /////////////// namespace pokesim { @@ -19194,6 +19200,20 @@ struct MaxPp { ///////////////////////// END OF src/Components/PP.hpp ///////////////////////// +////////////////// START OF src/Types/Enums/PlayerSideId.hpp /////////////////// + +namespace pokesim { +enum class PlayerSideId : std::uint8_t { + NONE = 0U, + P1 = 1U, + P2 = 2U, +}; + +static constexpr std::uint8_t TOTAL_PLAYER_SIDE_ID_COUNT = 2U; +} // namespace pokesim + +/////////////////// END OF src/Types/Enums/PlayerSideId.hpp //////////////////// + //////////////////// START OF src/Components/PlayerSide.hpp //////////////////// namespace pokesim { @@ -19387,6 +19407,48 @@ struct RandomEventIndex { ///////////////// END OF src/Components/RandomEventOutputs.hpp ///////////////// +/////////////////////// START OF src/Types/Decisions.hpp /////////////////////// + +namespace pokesim { +struct SlotDecision { + Slot sourceSlot = Slot::NONE; + Slot targetSlot = Slot::NONE; + + bool megaEvolve = false; + bool primalRevert = false; + bool dynamax = false; + bool terastallize = false; + + internal::variant choice; + + bool operator==(const SlotDecision& other) const { + return sourceSlot == other.sourceSlot && targetSlot == other.targetSlot && megaEvolve == other.megaEvolve && + primalRevert == other.primalRevert && dynamax == other.dynamax && terastallize == other.terastallize && + choice == other.choice; + } +}; + +namespace types { +using slotDecisions = types::sideSlots; +} + +} // namespace pokesim + +//////////////////////// END OF src/Types/Decisions.hpp //////////////////////// + +////////////////// START OF src/Components/SideDecisions.hpp /////////////////// + +namespace pokesim { +struct SideDecision { + PlayerSideId sideId = PlayerSideId::NONE; + internal::variant decisions{}; + + bool operator==(const SideDecision other) const { return sideId == other.sideId && decisions == other.decisions; } +}; +} // namespace pokesim + +/////////////////// END OF src/Components/SideDecisions.hpp //////////////////// + ///////////// START OF src/Components/SimulateTurn/ActionTags.hpp ////////////// namespace pokesim::action::tags { @@ -19563,37 +19625,6 @@ struct SpeciesTypes { //////////////////// END OF src/Components/SpeciesTypes.hpp //////////////////// -/////////////////// START OF src/Types/Enums/ActionOrder.hpp /////////////////// - -namespace pokesim { -enum class ActionOrder : std::uint8_t { - NONE = std::numeric_limits>::max(), - TEAM = 1U, - START = 2U, - BEFORE_TURN = 4U, - ITEM = BEFORE_TURN, - - SWITCH = 103U, - - MOVE = 200U, - - RESIDUAL = 254U, -}; - -static constexpr inline std::array VALID_ACTION_ORDERS = { - ActionOrder::NONE, - ActionOrder::TEAM, - ActionOrder::START, - ActionOrder::BEFORE_TURN, - ActionOrder::ITEM, - ActionOrder::SWITCH, - ActionOrder::MOVE, - ActionOrder::RESIDUAL, -}; -} // namespace pokesim - -//////////////////// END OF src/Types/Enums/ActionOrder.hpp //////////////////// - //////////////////// START OF src/Components/SpeedSort.hpp ///////////////////// namespace pokesim { @@ -20315,8 +20346,6 @@ struct CloneTo; struct Damage; struct DamageRollModifiers; struct DamageRolls; -struct SlotDecision; -struct SideDecision; struct Evs; struct Ivs; struct ActionQueue; @@ -20378,6 +20407,7 @@ struct Position; struct MovePriority; struct Probability; struct RngSeed; +struct SideDecision; struct SpeedTieIndexes; struct SpeciesTypes; struct SpeedSort; @@ -20533,12 +20563,6 @@ void check(const DamageRollModifiers&); template <> void check(const DamageRolls&); -template <> -void check(const SlotDecision&); - -template <> -void check(const SideDecision&); - template <> void check(const Evs&); @@ -20761,6 +20785,9 @@ void check(const internal::RandomEqualChanceStack&, const types::registry&); // template <> void check(const internal::RandomEventIndex&); +template <> +void check(const SideDecision&); + template <> void check(const SpeedTieIndexes&); @@ -20830,6 +20857,9 @@ void check(const Turn&); template <> void check(const Winner&); +template <> +void check(const SlotDecision&); + template <> void check(const DamageRollKind&); @@ -22576,12 +22606,21 @@ class Simulation { namespace pokesim::debug { struct Checks { - Checks(const Simulation& _simulation) : simulation(&_simulation), registry(&_simulation.registry) {} + Checks(const Simulation& _simulation) + : simulation(&_simulation), + registry(&_simulation.registry), + simulateTurnOptionsOnInput(simulation->simulateTurnOptions), + calcDamageOptionsOnInput(simulation->calculateDamageOptions), + analyzeEffectOptionsOnInput(simulation->analyzeEffectOptions) {} protected: const Simulation* simulation; const types::registry* registry; types::registry registryOnInput; + simulate_turn::Options simulateTurnOptionsOnInput; + calc_damage::Options calcDamageOptionsOnInput; + analyze_effect::Options analyzeEffectOptionsOnInput; + entt::dense_map currentEntitiesToInitial; entt::dense_set specificallyChecked; types::entityIndex initialEntityCount = 0U; @@ -22614,6 +22653,12 @@ struct Checks { } } + void checkOptions() const { + POKESIM_REQUIRE_NM(simulateTurnOptionsOnInput == simulation->simulateTurnOptions); + POKESIM_REQUIRE_NM(calcDamageOptionsOnInput == simulation->calculateDamageOptions); + POKESIM_REQUIRE_NM(analyzeEffectOptionsOnInput == simulation->analyzeEffectOptions); + } + void checkRemainingOutputs() const { for (auto [original, copy] : currentEntitiesToInitial) { if (!specificallyChecked.contains(original)) { @@ -22978,8 +23023,7 @@ struct SimulationSetupChecks { POKESIM_REQUIRE_NM(slotDecision.primalRevert == slotDecisionInfo.primalRevert); POKESIM_REQUIRE_NM(slotDecision.dynamax == slotDecisionInfo.dynamax); POKESIM_REQUIRE_NM(slotDecision.terastallize == slotDecisionInfo.terastallize); - POKESIM_REQUIRE_NM(slotDecision.moveChoice == slotDecisionInfo.moveChoice); - POKESIM_REQUIRE_NM(slotDecision.itemChoice == slotDecisionInfo.itemChoice); + POKESIM_REQUIRE_NM(slotDecision.choice == slotDecisionInfo.choice); } } else if (sideDecisionInfo.decisions.holds()) { @@ -24400,11 +24444,10 @@ void clearActionQueue(types::handle battleHandle, ActionQueue& actionQueue); namespace pokesim::simulate_turn::debug { struct Checks : pokesim::debug::Checks { - Options options; - Checks(const Simulation& _simulation) - : pokesim::debug::Checks(_simulation), options(_simulation.simulateTurnOptions) {} + Checks(const Simulation& _simulation) : pokesim::debug::Checks(_simulation) {} - void checkInputs() const { + void checkInputs() { + const auto& options = simulateTurnOptionsOnInput; pokesim::debug::check(options.getDamageRollsConsidered()); pokesim::debug::checkPercentChance(options.getRandomChanceLowerLimit()); pokesim::debug::checkPercentChance(options.getRandomChanceUpperLimit()); @@ -24412,18 +24455,54 @@ struct Checks : pokesim::debug::Checks { pokesim::debug::check(Probability{options.getBranchProbabilityLowerLimit()}); } + copyBattles(); check(); } void checkOutputs() const { - POKESIM_REQUIRE_NM(options == simulation->simulateTurnOptions); - + checkOptions(); + checkBattleOutputs(); check(); } private: + auto getBattleView() const { return registry->view(); } + + void copyBattles() { + for (types::entity entity : getBattleView()) { + copyEntity(entity); + } + } + + void checkBattleOutputs() const { + pokesim::debug::TypesToIgnore typesToIgnore; + typesToIgnore.add(); + + pokesim::debug::TypesToIgnore typesIgnoredOnConstants = typesToIgnore; + typesToIgnore.add(); + + if (!simulateTurnOptionsOnInput.getMakeBranchesOnRandomEvents()) { + typesToIgnore.add(); + } + + for (types::entity entity : getBattleView()) { + types::entity original = pokesim::debug::findCopyParent(currentEntitiesToInitial, *registry, entity); + bool shouldNotChange = !simulateTurnOptionsOnInput.getApplyChangesToInputBattle() && original == entity; + if (!registryOnInput.all_of(original)) { + typesToIgnore.add(); + } + + pokesim::debug::areEntitiesEqual( + *registry, + entity, + registryOnInput, + getInitialEntity(entity), + shouldNotChange ? typesIgnoredOnConstants : typesToIgnore); + } + } + void check() const { - for (types::entity battleEntity : registry->view()) { + for (types::entity battleEntity : getBattleView()) { checkBattle(battleEntity); for (types::entity sideEntity : registry->get(battleEntity).val) { checkSide(sideEntity); @@ -24888,12 +24967,10 @@ constexpr types::typeEffectiveness getAttackEffectiveness( namespace pokesim::calc_damage::debug { struct Checks : pokesim::debug::Checks { - Options options; - Checks(const Simulation& _simulation) - : pokesim::debug::Checks(_simulation), options(_simulation.calculateDamageOptions) {} + Checks(const Simulation& _simulation) : pokesim::debug::Checks(_simulation) {} void checkInputs() { - pokesim::debug::check(options.getDamageRollOptions()); + pokesim::debug::check(calcDamageOptionsOnInput.getDamageRollOptions()); checkMoveInputs(); checkPokemonInputs(true); @@ -24907,8 +24984,7 @@ struct Checks : pokesim::debug::Checks { } void checkOutputs() const { - POKESIM_REQUIRE_NM(options == simulation->calculateDamageOptions); - + checkOptions(); checkMoveOutputs(); checkPokemonOutputs(true); checkPokemonOutputs(false); @@ -25503,12 +25579,10 @@ void enumToTag(dex::Type type, RunFunctionArgs&&... args) { namespace pokesim::analyze_effect::debug { struct Checks : pokesim::debug::Checks { - Options options; - Checks(const Simulation& _simulation) - : pokesim::debug::Checks(_simulation), options(_simulation.analyzeEffectOptions) {} + Checks(const Simulation& _simulation) : pokesim::debug::Checks(_simulation) {} void checkInputs() { - pokesim::debug::check(options.getDamageRollOptions()); + pokesim::debug::check(analyzeEffectOptionsOnInput.getDamageRollOptions()); auto view = registry->view(); types::entityVector inputs{view.begin(), view.end()}; @@ -25532,8 +25606,7 @@ struct Checks : pokesim::debug::Checks { } void checkOutputs() const { - POKESIM_REQUIRE_NM(options == simulation->analyzeEffectOptions); - + checkOptions(); types::entityIndex finalEntityCount = getFinalEntityCount(); POKESIM_REQUIRE_NM(initialEntityCount == finalEntityCount); checkInputOutputs(); diff --git a/extras/RecentBenchmarkResults.md b/extras/RecentBenchmarkResults.md index 7621167..fa5d66e 100644 --- a/extras/RecentBenchmarkResults.md +++ b/extras/RecentBenchmarkResults.md @@ -7,286 +7,286 @@ ## SV-SingleBattle-MonteCarlo-SimulateTurn-VerticalSlice1 | Inputs | Samples | Iterations / Sample | Estimated Completion Time | Mean of Samples | Standard Deviation | Mean / Input Count | Mean Lower Bound / Input Count | Mean Upper Bound / Input Count | | --- | --- | --- | --- | --- | --- | --- | --- | --- | -| 1 | 100 | 1 | 42.686600ms | 71.677420us | 12.397813us | 71.677420us | 69.971260us | 75.555430us | -| 2 | 100 | 1 | 43.637700ms | 81.768690us | 14.135944us | 40.884345us | 39.940000us | 43.185170us | -| 4 | 100 | 1 | 47.456800ms | 94.351630us | 15.499108us | 23.587908us | 23.051030us | 24.776653us | -| 8 | 100 | 1 | 51.027000ms | 114.655950us | 12.443183us | 14.331994us | 14.091234us | 14.737929us | -| 16 | 100 | 1 | 55.206500ms | 155.018130us | 12.876058us | 9.688633us | 9.569308us | 9.909428us | -| 32 | 100 | 1 | 65.644000ms | 219.742430us | 11.755610us | 6.866951us | 6.811495us | 6.965010us | -| 64 | 100 | 1 | 78.471600ms | 347.097550us | 14.043183us | 5.423399us | 5.387873us | 5.477365us | -| 128 | 100 | 1 | 105.135400ms | 568.687200us | 10.294603us | 4.442869us | 4.431304us | 4.466204us | -| 256 | 100 | 1 | 148.946300ms | 1.023886ms | 11.716033us | 3.999556us | 3.991984us | 4.010497us | -| 512 | 100 | 1 | 239.104800ms | 1.873348ms | 55.333180us | 3.658883us | 3.643921us | 3.691891us | -| 1024 | 100 | 1 | 436.389900ms | 3.622736ms | 42.548706us | 3.537828us | 3.531145us | 3.548062us | -| 2048 | 100 | 1 | 849.179100ms | 7.121922ms | 75.966519us | 3.477501us | 3.470775us | 3.485435us | -| 4096 | 100 | 1 | 1661.602700ms | 14.142980ms | 158.758946us | 3.452876us | 3.445977us | 3.461268us | -| 8192 | 100 | 1 | 2939.969000ms | 28.937484ms | 376.175091us | 3.532408us | 3.524270us | 3.542405us | -| 16384 | 100 | 1 | 5991.517100ms | 59.653404ms | 545.711054us | 3.640955us | 3.634894us | 3.647996us | -| 32768 | 100 | 1 | 12380.215000ms | 123.621082ms | 982.954473us | 3.772616us | 3.767070us | 3.778850us | -| 65536 | 100 | 1 | 28598.221500ms | 255.883671ms | 6.538011ms | 3.904475us | 3.887244us | 3.926714us | +| 1 | 100 | 1 | 44.029500ms | 75.632500us | 16.891916us | 75.632500us | 73.157540us | 80.410500us | +| 2 | 100 | 1 | 45.369300ms | 79.460290us | 11.066830us | 39.730145us | 38.915290us | 41.277665us | +| 4 | 100 | 1 | 47.512500ms | 92.860650us | 16.681993us | 23.215162us | 22.611717us | 24.405757us | +| 8 | 100 | 1 | 50.457400ms | 115.421890us | 17.903684us | 14.427736us | 14.096700us | 15.053341us | +| 16 | 100 | 1 | 56.131800ms | 155.278370us | 17.556719us | 9.704898us | 9.549842us | 10.026832us | +| 32 | 100 | 1 | 63.795400ms | 214.437530us | 17.032001us | 6.701173us | 6.629717us | 6.872996us | +| 64 | 100 | 1 | 78.287900ms | 340.158840us | 15.750151us | 5.314982us | 5.280022us | 5.387716us | +| 128 | 100 | 1 | 101.733100ms | 558.419380us | 10.558445us | 4.362651us | 4.351217us | 4.388097us | +| 256 | 100 | 1 | 149.622100ms | 1.000598ms | 14.312407us | 3.908587us | 3.901044us | 3.926319us | +| 512 | 100 | 1 | 236.239200ms | 1.820739ms | 13.325735us | 3.556130us | 3.551765us | 3.562212us | +| 1024 | 100 | 1 | 428.562500ms | 3.541910ms | 39.308537us | 3.458896us | 3.452260us | 3.467527us | +| 2048 | 100 | 1 | 848.924700ms | 6.974401ms | 68.079016us | 3.405469us | 3.399840us | 3.413186us | +| 4096 | 100 | 1 | 1454.160300ms | 13.982603ms | 251.906250us | 3.413721us | 3.402751us | 3.427023us | +| 8192 | 100 | 1 | 2903.354900ms | 28.292495ms | 338.035595us | 3.453674us | 3.446253us | 3.462538us | +| 16384 | 100 | 1 | 5831.620800ms | 58.728308ms | 610.480429us | 3.584491us | 3.577905us | 3.592682us | +| 32768 | 100 | 1 | 12211.195800ms | 121.584597ms | 1.321293ms | 3.710467us | 3.703610us | 3.719742us | +| 65536 | 100 | 1 | 28366.533200ms | 252.820864ms | 7.424520ms | 3.857740us | 3.837449us | 3.882155us | ## SV-SingleBattle-Branching-SimulateTurn-VerticalSlice1 | Inputs | Samples | Iterations / Sample | Estimated Completion Time | Mean of Samples | Standard Deviation | Mean / Input Count | Mean Lower Bound / Input Count | Mean Upper Bound / Input Count | | --- | --- | --- | --- | --- | --- | --- | --- | --- | -| 1 | 100 | 1 | 60.685900ms | 214.916300us | 13.059062us | 214.916300us | 213.182120us | 219.265460us | -| 2 | 100 | 1 | 41.047000ms | 299.930550us | 16.395717us | 149.965275us | 148.758430us | 152.232750us | -| 4 | 100 | 1 | 54.396800ms | 438.564760us | 14.642541us | 109.641190us | 109.152398us | 110.826992us | -| 8 | 100 | 1 | 84.344400ms | 726.544370us | 18.529752us | 90.818046us | 90.493310us | 91.508447us | -| 16 | 100 | 1 | 140.344700ms | 1.218861ms | 14.648183us | 76.178809us | 76.038477us | 76.420934us | -| 32 | 100 | 1 | 247.554800ms | 2.216142ms | 17.651782us | 69.254430us | 69.153987us | 69.370142us | -| 64 | 100 | 1 | 461.344200ms | 4.183938ms | 40.049227us | 65.374038us | 65.267205us | 65.516310us | -| 128 | 100 | 1 | 879.518900ms | 8.043609ms | 87.995843us | 62.840699us | 62.719146us | 62.990218us | -| 256 | 100 | 1 | 1670.127000ms | 15.655372ms | 150.340349us | 61.153797us | 61.048648us | 61.278528us | -| 512 | 100 | 1 | 3110.317300ms | 30.370697ms | 389.345804us | 59.317767us | 59.178821us | 59.476225us | -| 1024 | 100 | 1 | 6128.363900ms | 60.103176ms | 2.193512ms | 58.694508us | 58.385339us | 59.318821us | -| 2048 | 100 | 1 | 12111.434600ms | 121.666626ms | 1.407967ms | 59.407532us | 59.285462us | 59.557427us | -| 4096 | 100 | 1 | 26226.142800ms | 268.925574ms | 7.613842ms | 65.655658us | 65.365416us | 66.126693us | -| 8192 | 100 | 1 | 59750.197600ms | 586.434134ms | 2.541032ms | 71.586198us | 71.527706us | 71.648953us | +| 1 | 100 | 1 | 63.326100ms | 207.384100us | 17.924075us | 207.384100us | 204.979030us | 213.268670us | +| 2 | 100 | 1 | 40.075400ms | 294.191300us | 12.497293us | 147.095650us | 146.196985us | 148.874855us | +| 4 | 100 | 1 | 52.044700ms | 429.042680us | 17.852416us | 107.260670us | 106.697375us | 108.842913us | +| 8 | 100 | 1 | 82.571000ms | 691.506360us | 12.535121us | 86.438295us | 86.229929us | 86.948469us | +| 16 | 100 | 1 | 135.499400ms | 1.201738ms | 21.053460us | 75.108598us | 74.894516us | 75.426155us | +| 32 | 100 | 1 | 240.369100ms | 2.173825ms | 33.618715us | 67.932036us | 67.737280us | 68.148797us | +| 64 | 100 | 1 | 440.957700ms | 4.090539ms | 49.867730us | 63.914667us | 63.775419us | 64.082196us | +| 128 | 100 | 1 | 845.050100ms | 7.798878ms | 84.804326us | 60.928733us | 60.809988us | 61.070542us | +| 256 | 100 | 1 | 1584.434200ms | 15.129526ms | 161.942675us | 59.099709us | 58.986060us | 59.235967us | +| 512 | 100 | 1 | 2930.491500ms | 28.750891ms | 302.301620us | 56.154084us | 56.049431us | 56.283890us | +| 1024 | 100 | 1 | 5816.175900ms | 56.923884ms | 975.657910us | 55.589730us | 55.432520us | 55.814606us | +| 2048 | 100 | 1 | 11864.786600ms | 116.007679ms | 1.702635ms | 56.644374us | 56.513481us | 56.854391us | +| 4096 | 100 | 1 | 25242.342200ms | 254.463069ms | 3.089584ms | 62.124773us | 61.989318us | 62.287463us | +| 8192 | 100 | 1 | 56374.694400ms | 564.375894ms | 2.680058ms | 68.893542us | 68.834099us | 68.963391us | ## SV-DoubleBattle-MonteCarlo-SimulateTurn-VerticalSlice1 | Inputs | Samples | Iterations / Sample | Estimated Completion Time | Mean of Samples | Standard Deviation | Mean / Input Count | Mean Lower Bound / Input Count | Mean Upper Bound / Input Count | | --- | --- | --- | --- | --- | --- | --- | --- | --- | -| 1 | 100 | 1 | 55.964400ms | 115.877490us | 16.720004us | 115.877490us | 113.554910us | 120.909400us | -| 2 | 100 | 1 | 59.530400ms | 135.605040us | 19.475652us | 67.802520us | 66.362530us | 70.517680us | -| 4 | 100 | 1 | 62.759800ms | 162.073490us | 18.959391us | 40.518372us | 39.811813us | 41.817232us | -| 8 | 100 | 1 | 66.891000ms | 201.089840us | 18.976933us | 25.136230us | 24.801624us | 25.833714us | -| 16 | 100 | 1 | 48.290200ms | 278.583320us | 14.929359us | 17.411458us | 17.268964us | 17.657396us | -| 32 | 100 | 1 | 62.537900ms | 405.417060us | 16.080762us | 12.669283us | 12.593608us | 12.804263us | -| 64 | 100 | 1 | 89.560900ms | 635.639520us | 13.649220us | 9.931868us | 9.902686us | 9.996860us | -| 128 | 100 | 1 | 121.084400ms | 1.079786ms | 24.897752us | 8.435828us | 8.412213us | 8.511360us | -| 256 | 100 | 1 | 210.715100ms | 1.951523ms | 27.945863us | 7.623136us | 7.603233us | 7.646388us | -| 512 | 100 | 1 | 387.840800ms | 3.671426ms | 44.252494us | 7.170753us | 7.156522us | 7.191479us | -| 1024 | 100 | 1 | 724.431500ms | 6.931923ms | 58.466017us | 6.769456us | 6.759651us | 6.782334us | -| 2048 | 100 | 1 | 1419.421800ms | 13.719796ms | 165.763638us | 6.699119us | 6.685875us | 6.718696us | -| 4096 | 100 | 1 | 2779.198700ms | 27.414956ms | 326.448162us | 6.693105us | 6.679361us | 6.710962us | +| 1 | 100 | 1 | 56.026000ms | 111.917070us | 17.538929us | 111.917070us | 109.623640us | 117.805190us | +| 2 | 100 | 1 | 59.237800ms | 133.325430us | 17.740473us | 66.662715us | 65.275735us | 68.949255us | +| 4 | 100 | 1 | 62.355800ms | 162.740380us | 18.184432us | 40.685095us | 39.963110us | 41.819720us | +| 8 | 100 | 1 | 68.179000ms | 198.898520us | 17.328945us | 24.862315us | 24.558199us | 25.512057us | +| 16 | 100 | 1 | 47.832500ms | 280.795990us | 12.394938us | 17.549749us | 17.431231us | 17.755721us | +| 32 | 100 | 1 | 60.386200ms | 392.112930us | 12.850809us | 12.253529us | 12.200318us | 12.384679us | +| 64 | 100 | 1 | 85.508100ms | 624.595410us | 39.464673us | 9.759303us | 9.691726us | 10.021686us | +| 128 | 100 | 1 | 117.156700ms | 1.057714ms | 12.496845us | 8.263390us | 8.249262us | 8.291430us | +| 256 | 100 | 1 | 203.291300ms | 1.901762ms | 22.037377us | 7.428759us | 7.415111us | 7.450379us | +| 512 | 100 | 1 | 376.630200ms | 3.618163ms | 54.883556us | 7.066724us | 7.047282us | 7.089583us | +| 1024 | 100 | 1 | 718.465000ms | 6.837126ms | 83.280908us | 6.676881us | 6.662907us | 6.695164us | +| 2048 | 100 | 1 | 1396.415300ms | 13.582631ms | 259.738901us | 6.632144us | 6.610055us | 6.660136us | +| 4096 | 100 | 1 | 2726.230700ms | 26.978901ms | 458.894166us | 6.586646us | 6.566693us | 6.611001us | ## SV-DoubleBattle-Branching-SimulateTurn-VerticalSlice1 | Inputs | Samples | Iterations / Sample | Estimated Completion Time | Mean of Samples | Standard Deviation | Mean / Input Count | Mean Lower Bound / Input Count | Mean Upper Bound / Input Count | | --- | --- | --- | --- | --- | --- | --- | --- | --- | -| 1 | 100 | 1 | 75.270800ms | 508.602400us | 17.345902us | 508.602400us | 506.139640us | 513.742420us | -| 2 | 100 | 1 | 91.073600ms | 766.268280us | 20.822925us | 383.134140us | 381.601245us | 386.056480us | -| 4 | 100 | 1 | 140.884600ms | 1.234372ms | 25.630393us | 308.593075us | 307.718875us | 310.627845us | -| 8 | 100 | 1 | 237.525100ms | 2.126358ms | 29.208138us | 265.794692us | 265.265781us | 266.844206us | -| 16 | 100 | 1 | 412.565900ms | 3.843884ms | 45.760242us | 240.242774us | 239.807671us | 240.998281us | -| 32 | 100 | 1 | 779.825300ms | 7.227782ms | 91.403858us | 225.868190us | 225.368616us | 226.491117us | -| 64 | 100 | 1 | 1466.020600ms | 13.838717ms | 148.317962us | 216.229960us | 215.824493us | 216.743195us | -| 128 | 100 | 1 | 2793.256300ms | 27.019668ms | 296.437375us | 211.091153us | 210.685697us | 211.600460us | -| 256 | 100 | 1 | 5608.744500ms | 54.398256ms | 878.712537us | 212.493188us | 211.899317us | 213.258705us | -| 512 | 100 | 1 | 10780.813800ms | 108.080436ms | 1.030936ms | 211.094601us | 210.750078us | 211.552514us | -| 1024 | 100 | 1 | 22096.036300ms | 224.556038ms | 1.926193ms | 219.293006us | 218.949630us | 219.691322us | -| 2048 | 100 | 1 | 46172.211500ms | 462.778756ms | 2.329673ms | 225.966190us | 225.765048us | 226.215252us | -| 4096 | 100 | 1 | 98078.403600ms | 974.312828ms | 3.124922ms | 237.869343us | 237.719071us | 238.017367us | +| 1 | 100 | 1 | 75.734100ms | 499.265850us | 14.653648us | 499.265850us | 497.206850us | 503.626890us | +| 2 | 100 | 1 | 87.060100ms | 744.817570us | 15.247880us | 372.408785us | 371.378890us | 374.832570us | +| 4 | 100 | 1 | 137.278800ms | 1.207385ms | 15.395407us | 301.846232us | 301.356718us | 303.209085us | +| 8 | 100 | 1 | 232.646100ms | 2.101532ms | 27.644495us | 262.691537us | 262.042782us | 263.407884us | +| 16 | 100 | 1 | 408.703600ms | 3.768345ms | 43.039830us | 235.521569us | 235.046412us | 236.107916us | +| 32 | 100 | 1 | 746.505700ms | 7.069875ms | 79.465706us | 220.933584us | 220.499477us | 221.480990us | +| 64 | 100 | 1 | 1413.238100ms | 13.445983ms | 128.721662us | 210.093491us | 209.741900us | 210.539368us | +| 128 | 100 | 1 | 2748.341900ms | 26.330205ms | 666.798954us | 205.704729us | 205.000682us | 207.352873us | +| 256 | 100 | 1 | 5472.347300ms | 52.702525ms | 820.461889us | 205.869239us | 205.320629us | 206.592227us | +| 512 | 100 | 1 | 10800.876300ms | 104.334716ms | 1.861118ms | 203.778743us | 203.171770us | 204.635671us | +| 1024 | 100 | 1 | 21396.865900ms | 215.835776ms | 2.395934ms | 210.777125us | 210.370643us | 211.299570us | +| 2048 | 100 | 1 | 45058.499900ms | 444.625341ms | 2.447193ms | 217.102217us | 216.882815us | 217.353607us | +| 4096 | 100 | 1 | 93722.427500ms | 937.827466ms | 4.794415ms | 228.961784us | 228.750680us | 229.212800us | ## SV-SingleBattle-CalcDamage-VerticalSlice1 | Inputs | Samples | Iterations / Sample | Estimated Completion Time | Mean of Samples | Standard Deviation | Mean / Input Count | Mean Lower Bound / Input Count | Mean Upper Bound / Input Count | | --- | --- | --- | --- | --- | --- | --- | --- | --- | -| 1 | 100 | 1 | 7.642500ms | 10.398820us | 3.063497us | 10.398820us | 9.960560us | 11.298590us | -| 2 | 100 | 1 | 7.745100ms | 11.103900us | 3.392469us | 5.551950us | 5.325755us | 6.119065us | -| 4 | 100 | 1 | 8.026200ms | 12.309900us | 3.474284us | 3.077475us | 2.952238us | 3.325508us | -| 8 | 100 | 1 | 8.227500ms | 13.864170us | 6.102111us | 1.733021us | 1.641125us | 2.042768us | -| 16 | 100 | 1 | 8.736000ms | 16.692990us | 2.016397us | 1.043312us | 1.024764us | 1.078439us | -| 32 | 100 | 1 | 9.535100ms | 23.858510us | 2.491570us | 745.578437ns | 733.193750ns | 765.090312ns | -| 64 | 100 | 1 | 10.809900ms | 35.511910us | 2.702795us | 554.873594ns | 548.341563ns | 565.851094ns | -| 128 | 100 | 1 | 13.653200ms | 59.022540us | 3.580700us | 461.113594ns | 456.618906ns | 468.037812ns | -| 256 | 100 | 1 | 19.013100ms | 103.848520us | 3.291804us | 405.658281ns | 403.589570ns | 408.820000ns | -| 512 | 100 | 1 | 35.826100ms | 198.899650us | 10.628629us | 388.475879ns | 385.709844ns | 395.332734ns | -| 1024 | 100 | 1 | 61.840800ms | 377.479570us | 6.132247us | 368.632393ns | 367.592744ns | 369.981914ns | -| 2048 | 100 | 1 | 116.708700ms | 738.333260us | 9.389160us | 360.514287ns | 359.715317ns | 361.544409ns | -| 4096 | 100 | 1 | 227.340000ms | 1.466441ms | 25.817565us | 358.017773ns | 357.047986ns | 359.668740ns | -| 8192 | 100 | 1 | 449.032500ms | 3.033444ms | 38.899051us | 370.293453ns | 369.446519ns | 371.316660ns | -| 16384 | 100 | 1 | 898.235700ms | 6.182320ms | 72.195765us | 377.338885ns | 376.564456ns | 378.326620ns | -| 32768 | 100 | 1 | 1824.083300ms | 12.557321ms | 152.288220us | 383.219027ns | 382.413417ns | 384.258423ns | -| 65536 | 100 | 1 | 3600.715800ms | 26.273869ms | 259.742839us | 400.907430ns | 400.211568ns | 401.774471ns | +| 1 | 100 | 1 | 7.805000ms | 10.148600us | 3.932472us | 10.148600us | 9.597960us | 11.319660us | +| 2 | 100 | 1 | 7.956200ms | 11.637310us | 4.118370us | 5.818655us | 5.527020us | 6.417360us | +| 4 | 100 | 1 | 8.063000ms | 11.730230us | 4.097670us | 2.932557us | 2.789190us | 3.240847us | +| 8 | 100 | 1 | 8.522600ms | 13.006880us | 3.381656us | 1.625860us | 1.569172us | 1.768951us | +| 16 | 100 | 1 | 9.036600ms | 16.858910us | 3.226078us | 1.053682us | 1.026213us | 1.117203us | +| 32 | 100 | 1 | 10.295900ms | 23.402530us | 2.662114us | 731.329062ns | 719.160313ns | 754.539062ns | +| 64 | 100 | 1 | 11.105900ms | 36.368170us | 10.717078us | 568.252656ns | 548.399219ns | 637.319062ns | +| 128 | 100 | 1 | 13.731600ms | 57.335240us | 3.395772us | 447.931562ns | 443.922500ns | 455.033984ns | +| 256 | 100 | 1 | 18.858800ms | 104.318610us | 12.265081us | 407.494570ns | 401.884687ns | 426.889414ns | +| 512 | 100 | 1 | 35.305200ms | 192.360300us | 10.633042us | 375.703711ns | 373.238730ns | 384.164180ns | +| 1024 | 100 | 1 | 62.715100ms | 371.446800us | 5.881813us | 362.741016ns | 361.711533ns | 363.983301ns | +| 2048 | 100 | 1 | 116.645800ms | 727.678610us | 10.772259us | 355.311821ns | 354.394902ns | 356.469268ns | +| 4096 | 100 | 1 | 192.703900ms | 1.434532ms | 16.914691us | 350.227529ns | 349.527559ns | 351.182546ns | +| 8192 | 100 | 1 | 449.847200ms | 2.961202ms | 34.260009us | 361.474825ns | 360.760328ns | 362.422217ns | +| 16384 | 100 | 1 | 891.671200ms | 6.092752ms | 102.530158us | 371.872061ns | 370.879758ns | 373.422484ns | +| 32768 | 100 | 1 | 1787.578200ms | 12.383221ms | 154.812409us | 377.905914ns | 377.115583ns | 379.013234ns | +| 65536 | 100 | 1 | 3600.531300ms | 26.009269ms | 332.827964us | 396.869944ns | 396.027262ns | 398.079925ns | ## SV-SingleBattle-AnalyzeEffect-VerticalSlice1 | Inputs | Samples | Iterations / Sample | Estimated Completion Time | Mean of Samples | Standard Deviation | Mean / Input Count | Mean Lower Bound / Input Count | Mean Upper Bound / Input Count | | --- | --- | --- | --- | --- | --- | --- | --- | --- | -| 1 | 100 | 1 | 24.481600ms | 54.964360us | 7.044274us | 54.964360us | 53.911850us | 56.880880us | -| 2 | 100 | 1 | 25.104900ms | 65.947320us | 7.352050us | 32.973660us | 32.435185us | 34.000945us | -| 4 | 100 | 1 | 30.405900ms | 88.159770us | 7.485760us | 22.039943us | 21.764252us | 22.565152us | -| 8 | 100 | 1 | 20.583600ms | 123.633890us | 8.698520us | 15.454236us | 15.308336us | 15.811117us | -| 16 | 100 | 1 | 26.535300ms | 193.958910us | 10.594951us | 12.122432us | 12.035806us | 12.347179us | -| 32 | 100 | 1 | 43.723100ms | 324.832140us | 7.827796us | 10.151004us | 10.113281us | 10.214358us | -| 64 | 100 | 1 | 73.957000ms | 576.465210us | 11.948879us | 9.007269us | 8.983196us | 9.071728us | -| 128 | 100 | 1 | 130.907300ms | 1.085209ms | 9.193191us | 8.478199us | 8.464917us | 8.493125us | -| 256 | 100 | 1 | 247.298500ms | 2.050264ms | 21.500260us | 8.008845us | 7.993296us | 8.026267us | -| 512 | 100 | 1 | 462.560900ms | 4.014678ms | 47.820052us | 7.841167us | 7.825207us | 7.862244us | -| 1024 | 100 | 1 | 900.050500ms | 7.961406ms | 96.532561us | 7.774810us | 7.758503us | 7.796074us | -| 2048 | 100 | 1 | 1755.826000ms | 15.702850ms | 163.978679us | 7.667407us | 7.653746us | 7.685741us | -| 4096 | 100 | 1 | 3541.823000ms | 31.940608ms | 565.817260us | 7.798000us | 7.774238us | 7.829396us | -| 8192 | 100 | 1 | 7715.873300ms | 72.500488ms | 962.395195us | 8.850157us | 8.829439us | 8.876009us | +| 1 | 100 | 1 | 25.017300ms | 57.362780us | 7.723882us | 57.362780us | 56.232220us | 59.524990us | +| 2 | 100 | 1 | 25.792200ms | 65.773780us | 10.226176us | 32.886890us | 32.206410us | 34.597475us | +| 4 | 100 | 1 | 31.433800ms | 86.153040us | 8.319707us | 21.538260us | 21.252480us | 22.174268us | +| 8 | 100 | 1 | 20.729700ms | 121.878110us | 9.823295us | 15.234764us | 15.078314us | 15.668781us | +| 16 | 100 | 1 | 24.893100ms | 190.898190us | 10.847117us | 11.931137us | 11.847597us | 12.191246us | +| 32 | 100 | 1 | 40.910200ms | 325.556950us | 10.040326us | 10.173655us | 10.125758us | 10.257261us | +| 64 | 100 | 1 | 70.098900ms | 575.824000us | 10.810787us | 8.997250us | 8.966942us | 9.033563us | +| 128 | 100 | 1 | 127.803800ms | 1.073376ms | 8.765340us | 8.385753us | 8.373479us | 8.400464us | +| 256 | 100 | 1 | 236.836900ms | 2.020172ms | 34.690419us | 7.891298us | 7.871738us | 7.930043us | +| 512 | 100 | 1 | 451.140200ms | 3.929758ms | 34.347151us | 7.675309us | 7.664603us | 7.692117us | +| 1024 | 100 | 1 | 874.940200ms | 7.801300ms | 65.389170us | 7.618457us | 7.607831us | 7.633280us | +| 2048 | 100 | 1 | 1737.223500ms | 15.466035ms | 161.158203us | 7.551775us | 7.537787us | 7.569075us | +| 4096 | 100 | 1 | 3481.727300ms | 31.028165ms | 497.336764us | 7.575236us | 7.555017us | 7.603478us | +| 8192 | 100 | 1 | 7607.677000ms | 71.308510ms | 1.389798ms | 8.704652us | 8.675639us | 8.743119us | ## SV-SingleBattle-MonteCarlo-SimulateTurn-RandomInputs-OneRandomBattle-OneRandomInput | Inputs | Samples | Iterations / Sample | Estimated Completion Time | Mean of Samples | Standard Deviation | Mean / Input Count | Mean Lower Bound / Input Count | Mean Upper Bound / Input Count | | --- | --- | --- | --- | --- | --- | --- | --- | --- | -| 1 | 100 | 1 | 31.405100ms | 79.627850us | 16.798804us | 79.627850us | 77.065170us | 83.995270us | -| 2 | 100 | 1 | 32.859500ms | 88.241610us | 15.014696us | 44.120805us | 42.811545us | 45.790660us | -| 4 | 100 | 1 | 35.227800ms | 103.868940us | 18.084822us | 25.967235us | 25.181938us | 26.963115us | -| 8 | 100 | 1 | 38.356900ms | 122.526940us | 20.410842us | 15.315867us | 14.861446us | 15.872014us | -| 16 | 100 | 1 | 44.109700ms | 164.399640us | 26.805288us | 10.274978us | 9.967774us | 10.627374us | -| 32 | 100 | 1 | 53.756800ms | 227.502310us | 36.652149us | 7.109447us | 6.900819us | 7.349929us | -| 64 | 100 | 1 | 52.178500ms | 356.978230us | 62.386717us | 5.577785us | 5.399720us | 5.782223us | -| 128 | 100 | 1 | 95.395700ms | 602.104090us | 109.546264us | 4.703938us | 4.549463us | 4.885052us | -| 256 | 100 | 1 | 227.800100ms | 1.082499ms | 199.611478us | 4.228510us | 4.087883us | 4.396125us | -| 512 | 100 | 1 | 282.668800ms | 2.028465ms | 392.856219us | 3.961846us | 3.823944us | 4.125946us | -| 1024 | 100 | 1 | 525.508800ms | 4.363781ms | 782.736717us | 4.261505us | 4.124087us | 4.425017us | -| 2048 | 100 | 1 | 1306.134100ms | 9.276676ms | 1.583899ms | 4.529627us | 4.388070us | 4.692534us | -| 4096 | 100 | 1 | 2807.882000ms | 19.656655ms | 3.300202ms | 4.798988us | 4.652843us | 4.970605us | -| 8192 | 100 | 1 | 4096.550900ms | 43.108654ms | 7.323969ms | 5.262287us | 5.097864us | 5.448632us | +| 1 | 100 | 1 | 44.509500ms | 81.971170us | 16.459070us | 81.971170us | 79.257980us | 85.875340us | +| 2 | 100 | 1 | 45.708600ms | 90.983530us | 17.072539us | 45.491765us | 44.044040us | 47.454200us | +| 4 | 100 | 1 | 47.743300ms | 102.497470us | 16.896726us | 25.624368us | 24.868513us | 26.539245us | +| 8 | 100 | 1 | 50.444400ms | 121.247080us | 21.226502us | 15.155885us | 14.687644us | 15.738713us | +| 16 | 100 | 1 | 55.278700ms | 161.318170us | 26.253193us | 10.082386us | 9.786131us | 10.435046us | +| 32 | 100 | 1 | 62.262000ms | 223.892030us | 35.014099us | 6.996626us | 6.797677us | 7.228389us | +| 64 | 100 | 1 | 64.989100ms | 350.128650us | 60.895287us | 5.470760us | 5.296534us | 5.669618us | +| 128 | 100 | 1 | 97.391300ms | 589.688090us | 108.372977us | 4.606938us | 4.454073us | 4.787602us | +| 256 | 100 | 1 | 261.189600ms | 1.069650ms | 197.392313us | 4.178319us | 4.039840us | 4.345884us | +| 512 | 100 | 1 | 354.676600ms | 1.972618ms | 385.271436us | 3.852769us | 3.718256us | 4.014658us | +| 1024 | 100 | 1 | 695.599300ms | 4.298048ms | 788.021392us | 4.197313us | 4.057877us | 4.360223us | +| 2048 | 100 | 1 | 1305.394800ms | 9.217092ms | 1.596795ms | 4.500533us | 4.359784us | 4.667872us | +| 4096 | 100 | 1 | 3323.222200ms | 19.494995ms | 3.411458ms | 4.759520us | 4.609238us | 4.935866us | +| 8192 | 100 | 1 | 5001.725100ms | 42.805409ms | 7.234674ms | 5.225270us | 5.061525us | 5.409419us | ## SV-SingleBattle-MonteCarlo-SimulateTurn-RandomInputs-OneRandomBattle-ManyRandomInputs | Inputs | Samples | Iterations / Sample | Estimated Completion Time | Mean of Samples | Standard Deviation | Mean / Input Count | Mean Lower Bound / Input Count | Mean Upper Bound / Input Count | | --- | --- | --- | --- | --- | --- | --- | --- | --- | -| 1 | 100 | 1 | 30.121100ms | 80.781340us | 17.367615us | 80.781340us | 78.041950us | 85.083140us | -| 2 | 100 | 1 | 44.880900ms | 89.919410us | 17.300855us | 44.959705us | 43.482080us | 46.933715us | -| 4 | 100 | 1 | 47.803300ms | 101.938520us | 17.789255us | 25.484630us | 24.714028us | 26.474287us | -| 8 | 100 | 1 | 48.867600ms | 118.753320us | 20.122918us | 14.844165us | 14.396960us | 15.390319us | -| 16 | 100 | 1 | 55.006100ms | 158.468110us | 25.199222us | 9.904257us | 9.612741us | 10.235304us | -| 32 | 100 | 1 | 40.038700ms | 221.400650us | 34.847082us | 6.918770us | 6.719167us | 7.146684us | -| 64 | 100 | 1 | 71.996500ms | 338.960440us | 62.560404us | 5.296257us | 5.118236us | 5.501753us | -| 128 | 100 | 1 | 83.615600ms | 554.975250us | 105.748969us | 4.335744us | 4.185573us | 4.510324us | -| 256 | 100 | 1 | 143.709600ms | 980.446730us | 195.124015us | 3.829870us | 3.693816us | 3.993576us | -| 512 | 100 | 1 | 187.946600ms | 1.833044ms | 368.229964us | 3.580164us | 3.450057us | 3.732975us | -| 1024 | 100 | 1 | 355.572500ms | 3.523513ms | 733.367483us | 3.440930us | 3.313001us | 3.596060us | -| 2048 | 100 | 1 | 738.497200ms | 6.929981ms | 1.441611ms | 3.383780us | 3.258147us | 3.533939us | -| 4096 | 100 | 1 | 1951.701100ms | 14.028916ms | 2.828331ms | 3.425028us | 3.301326us | 3.574195us | -| 8192 | 100 | 1 | 2650.411700ms | 28.507829ms | 5.423487ms | 3.479960us | 3.361519us | 3.622731us | +| 1 | 100 | 1 | 44.271200ms | 78.705320us | 15.349045us | 78.705320us | 76.258450us | 82.508960us | +| 2 | 100 | 1 | 45.033700ms | 88.562730us | 16.139383us | 44.281365us | 42.849600us | 46.050395us | +| 4 | 100 | 1 | 47.035600ms | 100.386670us | 17.299048us | 25.096667us | 24.337162us | 26.054580us | +| 8 | 100 | 1 | 50.064400ms | 120.179890us | 19.422422us | 15.022486us | 14.580877us | 15.533506us | +| 16 | 100 | 1 | 54.946300ms | 156.145570us | 24.525861us | 9.759098us | 9.477891us | 10.079581us | +| 32 | 100 | 1 | 61.321700ms | 213.823880us | 33.786241us | 6.681996us | 6.489575us | 6.905353us | +| 64 | 100 | 1 | 71.329000ms | 334.155480us | 60.871463us | 5.221179us | 5.047243us | 5.420959us | +| 128 | 100 | 1 | 80.440300ms | 537.135950us | 102.484069us | 4.196375us | 4.051112us | 4.366583us | +| 256 | 100 | 1 | 142.099300ms | 956.524080us | 190.738916us | 3.736422us | 3.602502us | 3.896721us | +| 512 | 100 | 1 | 184.617300ms | 1.803916ms | 366.312107us | 3.523274us | 3.395298us | 3.677599us | +| 1024 | 100 | 1 | 351.409600ms | 3.444340ms | 715.074299us | 3.363614us | 3.237705us | 3.514453us | +| 2048 | 100 | 1 | 728.354900ms | 6.808213ms | 1.427481ms | 3.324323us | 3.200616us | 3.474164us | +| 4096 | 100 | 1 | 1918.893500ms | 13.817105ms | 2.823718ms | 3.373317us | 3.249863us | 3.523697us | +| 8192 | 100 | 1 | 2633.041400ms | 28.026965ms | 5.459682ms | 3.421260us | 3.301348us | 3.563138us | ## SV-SingleBattle-MonteCarlo-SimulateTurn-RandomInputs-ManyRandomBattles-ManyRandomInputs | Inputs | Samples | Iterations / Sample | Estimated Completion Time | Mean of Samples | Standard Deviation | Mean / Input Count | Mean Lower Bound / Input Count | Mean Upper Bound / Input Count | | --- | --- | --- | --- | --- | --- | --- | --- | --- | -| 1 | 100 | 1 | 42.553000ms | 81.108080us | 17.442912us | 81.108080us | 78.372810us | 85.496630us | -| 2 | 100 | 1 | 56.405400ms | 102.116280us | 19.137545us | 51.058140us | 49.529410us | 53.432670us | -| 4 | 100 | 1 | 40.246900ms | 132.205090us | 16.053161us | 33.051272us | 32.334255us | 33.923702us | -| 8 | 100 | 1 | 54.914100ms | 175.955640us | 18.210563us | 21.994455us | 21.617350us | 22.540533us | -| 16 | 100 | 1 | 65.440000ms | 230.539240us | 19.357769us | 14.408702us | 14.221073us | 14.716801us | -| 32 | 100 | 1 | 81.031300ms | 332.951890us | 24.534449us | 10.404747us | 10.285364us | 10.602595us | -| 64 | 100 | 1 | 79.207200ms | 516.057330us | 34.829066us | 8.063396us | 7.986856us | 8.226971us | -| 128 | 100 | 1 | 189.169300ms | 836.859850us | 24.604275us | 6.537968us | 6.510081us | 6.591978us | -| 256 | 100 | 1 | 266.100100ms | 1.472600ms | 36.437895us | 5.752344us | 5.730479us | 5.789780us | -| 512 | 100 | 1 | 447.265800ms | 2.819624ms | 79.202500us | 5.507079us | 5.481025us | 5.543039us | -| 1024 | 100 | 1 | 774.171300ms | 6.699105ms | 235.055795us | 6.542095us | 6.501089us | 6.591319us | -| 2048 | 100 | 1 | 1582.866400ms | 14.667931ms | 276.069397us | 7.162076us | 7.139669us | 7.193820us | -| 4096 | 100 | 1 | 3213.526200ms | 31.844605ms | 425.335216us | 7.774562us | 7.756775us | 7.798163us | -| 8192 | 100 | 1 | 7243.663300ms | 72.859805ms | 912.702451us | 8.894019us | 8.873635us | 8.917347us | +| 1 | 100 | 1 | 44.141600ms | 78.202370us | 16.192817us | 78.202370us | 75.708060us | 82.333280us | +| 2 | 100 | 1 | 58.221100ms | 101.351280us | 22.062750us | 50.675640us | 49.102585us | 53.908060us | +| 4 | 100 | 1 | 40.529800ms | 128.923320us | 17.135156us | 32.230830us | 31.540862us | 33.275128us | +| 8 | 100 | 1 | 54.764200ms | 173.160090us | 19.415373us | 21.645011us | 21.252340us | 22.238502us | +| 16 | 100 | 1 | 63.883200ms | 230.622000us | 20.273366us | 14.413875us | 14.211234us | 14.729231us | +| 32 | 100 | 1 | 78.029500ms | 331.682090us | 28.567087us | 10.365065us | 10.236447us | 10.623161us | +| 64 | 100 | 1 | 147.043500ms | 511.021310us | 28.595847us | 7.984708us | 7.914443us | 8.098217us | +| 128 | 100 | 1 | 190.160400ms | 829.751820us | 41.504503us | 6.482436us | 6.438178us | 6.583944us | +| 256 | 100 | 1 | 269.943100ms | 1.484616ms | 87.923700us | 5.799283us | 5.749138us | 5.897817us | +| 512 | 100 | 1 | 445.628900ms | 2.797371ms | 67.161056us | 5.463615us | 5.441259us | 5.493771us | +| 1024 | 100 | 1 | 761.952600ms | 6.722714ms | 216.946497us | 6.565150us | 6.528499us | 6.612547us | +| 2048 | 100 | 1 | 1574.015900ms | 14.590912ms | 238.593325us | 7.124469us | 7.105291us | 7.152033us | +| 4096 | 100 | 1 | 3201.906200ms | 31.762215ms | 416.945554us | 7.754447us | 7.736764us | 7.777183us | +| 8192 | 100 | 1 | 7453.643200ms | 72.678189ms | 1.101232ms | 8.871849us | 8.849482us | 8.903571us | ## SV-SingleBattle-CalcDamage-RandomInputs-OneRandomBattle-OneRandomInput | Inputs | Samples | Iterations / Sample | Estimated Completion Time | Mean of Samples | Standard Deviation | Mean / Input Count | Mean Lower Bound / Input Count | Mean Upper Bound / Input Count | | --- | --- | --- | --- | --- | --- | --- | --- | --- | -| 1 | 100 | 1 | 10.154500ms | 12.770960us | 4.757985us | 12.770960us | 12.039660us | 14.012200us | -| 2 | 100 | 1 | 10.565400ms | 14.725520us | 5.558946us | 7.362760us | 6.899630us | 8.024930us | -| 4 | 100 | 1 | 11.151500ms | 17.530480us | 8.261466us | 4.382620us | 4.081207us | 4.972752us | -| 8 | 100 | 1 | 12.139000ms | 21.268460us | 7.591241us | 2.658557us | 2.477965us | 2.851915us | -| 16 | 100 | 1 | 13.902100ms | 29.751230us | 11.831791us | 1.859452us | 1.717234us | 2.006126us | -| 32 | 100 | 1 | 10.695700ms | 45.104220us | 18.879927us | 1.409507us | 1.292444us | 1.523793us | -| 64 | 100 | 1 | 18.719600ms | 77.782920us | 37.174636us | 1.215358us | 1.103153us | 1.330819us | -| 128 | 100 | 1 | 50.457000ms | 139.299200us | 69.197438us | 1.088275us | 983.970312ns | 1.194662us | -| 256 | 100 | 1 | 87.918000ms | 267.140260us | 135.958140us | 1.043517us | 939.459375ns | 1.147468us | -| 512 | 100 | 1 | 166.691000ms | 477.188810us | 270.771916us | 932.009395ns | 827.687539ns | 1.034706us | -| 1024 | 100 | 1 | 329.279600ms | 1.148998ms | 644.517873us | 1.122068us | 997.091611ns | 1.242825us | -| 2048 | 100 | 1 | 652.648300ms | 2.493000ms | 1.377171ms | 1.217285us | 1.084202us | 1.346281us | -| 4096 | 100 | 1 | 1268.678400ms | 5.106965ms | 2.778428ms | 1.246818us | 1.111135us | 1.376692us | -| 8192 | 100 | 1 | 2610.247200ms | 11.288210ms | 6.208669ms | 1.377955us | 1.226488us | 1.523966us | +| 1 | 100 | 1 | 10.408800ms | 12.677360us | 5.027147us | 12.677360us | 11.924750us | 14.064900us | +| 2 | 100 | 1 | 10.821900ms | 14.411400us | 5.830292us | 7.205700us | 6.730190us | 7.911215us | +| 4 | 100 | 1 | 11.519700ms | 17.116340us | 7.345073us | 4.279085us | 3.979080us | 4.722365us | +| 8 | 100 | 1 | 12.455100ms | 21.081810us | 9.325194us | 2.635226us | 2.444415us | 2.916970us | +| 16 | 100 | 1 | 14.281900ms | 30.332270us | 14.022865us | 1.895767us | 1.743816us | 2.092667us | +| 32 | 100 | 1 | 10.903900ms | 43.619540us | 18.479347us | 1.363111us | 1.249302us | 1.475503us | +| 64 | 100 | 1 | 19.476800ms | 78.155460us | 36.025182us | 1.221179us | 1.110343us | 1.330583us | +| 128 | 100 | 1 | 50.944000ms | 136.765380us | 67.405374us | 1.068480us | 964.665156ns | 1.171406us | +| 256 | 100 | 1 | 88.414300ms | 263.866940us | 131.764286us | 1.030730us | 929.333203ns | 1.131686us | +| 512 | 100 | 1 | 169.957400ms | 477.781930us | 270.532058us | 933.167832ns | 828.694629ns | 1.035778us | +| 1024 | 100 | 1 | 333.299200ms | 1.158539ms | 650.204227us | 1.131386us | 1.005550us | 1.254159us | +| 2048 | 100 | 1 | 651.231200ms | 2.367990ms | 1.265179ms | 1.156245us | 1.032941us | 1.274550us | +| 4096 | 100 | 1 | 1272.658000ms | 5.067789ms | 2.771716ms | 1.237253us | 1.102339us | 1.368054us | +| 8192 | 100 | 1 | 2636.488300ms | 11.177638ms | 6.102066ms | 1.364458us | 1.215341us | 1.508034us | ## SV-SingleBattle-CalcDamage-RandomInputs-OneRandomBattle-ManyRandomInputs | Inputs | Samples | Iterations / Sample | Estimated Completion Time | Mean of Samples | Standard Deviation | Mean / Input Count | Mean Lower Bound / Input Count | Mean Upper Bound / Input Count | | --- | --- | --- | --- | --- | --- | --- | --- | --- | -| 1 | 100 | 1 | 10.165300ms | 12.867020us | 5.372350us | 12.867020us | 12.042290us | 14.271810us | -| 2 | 100 | 1 | 10.584700ms | 14.700520us | 4.379222us | 7.350260us | 7.037065us | 7.986950us | -| 4 | 100 | 1 | 10.471400ms | 17.385130us | 3.858959us | 4.346283us | 4.208570us | 4.629733us | -| 8 | 100 | 1 | 11.471500ms | 22.025650us | 4.468590us | 2.753206us | 2.668673us | 2.901986us | -| 16 | 100 | 1 | 12.061500ms | 32.931470us | 27.521200us | 2.058217us | 1.869211us | 2.842650us | -| 32 | 100 | 1 | 14.285100ms | 45.614030us | 17.271659us | 1.425438us | 1.362060us | 1.652059us | -| 64 | 100 | 1 | 16.516300ms | 70.599020us | 6.197957us | 1.103110us | 1.086095us | 1.124418us | -| 128 | 100 | 1 | 23.737300ms | 121.761450us | 6.389777us | 951.261328ns | 941.613125ns | 961.178437ns | -| 256 | 100 | 1 | 36.062100ms | 229.622680us | 9.427472us | 896.963594ns | 889.899727ns | 904.331094ns | -| 512 | 100 | 1 | 41.619800ms | 441.194690us | 10.889678us | 861.708379ns | 857.538359ns | 865.855410ns | -| 1024 | 100 | 1 | 87.522900ms | 857.297990us | 17.392077us | 837.205068ns | 833.891895ns | 840.563203ns | -| 2048 | 100 | 1 | 176.454500ms | 1.684521ms | 30.232978us | 822.519824ns | 819.682109ns | 825.468745ns | -| 4096 | 100 | 1 | 347.414500ms | 3.375787ms | 66.124234us | 824.166746ns | 821.349736ns | 827.720208ns | -| 8192 | 100 | 1 | 689.636000ms | 6.763567ms | 123.313306us | 825.630715ns | 822.868110ns | 828.783402ns | +| 1 | 100 | 1 | 10.493500ms | 12.621410us | 5.016899us | 12.621410us | 11.867000us | 13.975180us | +| 2 | 100 | 1 | 10.876100ms | 15.344230us | 4.394447us | 7.672115us | 7.316685us | 8.211295us | +| 4 | 100 | 1 | 10.555700ms | 16.792020us | 3.689613us | 4.198005us | 4.069177us | 4.478180us | +| 8 | 100 | 1 | 11.953900ms | 23.188930us | 4.658361us | 2.898616us | 2.802441us | 3.037383us | +| 16 | 100 | 1 | 12.522900ms | 29.104640us | 5.689178us | 1.819040us | 1.767203us | 1.920443us | +| 32 | 100 | 1 | 14.420800ms | 42.324180us | 4.859962us | 1.322631us | 1.296256us | 1.356501us | +| 64 | 100 | 1 | 16.856900ms | 68.513010us | 5.576693us | 1.070516us | 1.055381us | 1.089937us | +| 128 | 100 | 1 | 24.011500ms | 119.756900us | 5.686283us | 935.600781ns | 927.077344ns | 944.479531ns | +| 256 | 100 | 1 | 35.537800ms | 224.526570us | 10.068800us | 877.056914ns | 870.087656ns | 885.681445ns | +| 512 | 100 | 1 | 40.988700ms | 430.047030us | 10.654859us | 839.935605ns | 835.817324ns | 843.994453ns | +| 1024 | 100 | 1 | 85.651800ms | 840.590640us | 17.412392us | 820.889297ns | 817.560254ns | 824.198584ns | +| 2048 | 100 | 1 | 173.079700ms | 1.652729ms | 31.312337us | 806.996743ns | 804.243745ns | 810.304570ns | +| 4096 | 100 | 1 | 339.167900ms | 3.306413ms | 55.148046us | 807.229756ns | 804.726794ns | 810.044133ns | +| 8192 | 100 | 1 | 674.452400ms | 6.628548ms | 114.085995us | 809.148901ns | 806.571278ns | 812.039146ns | ## SV-SingleBattle-CalcDamage-RandomInputs-ManyRandomBattles-ManyRandomInputs | Inputs | Samples | Iterations / Sample | Estimated Completion Time | Mean of Samples | Standard Deviation | Mean / Input Count | Mean Lower Bound / Input Count | Mean Upper Bound / Input Count | | --- | --- | --- | --- | --- | --- | --- | --- | --- | -| 1 | 100 | 1 | 10.118900ms | 13.196670us | 5.623242us | 13.196670us | 12.315860us | 14.632450us | -| 2 | 100 | 1 | 9.975600ms | 15.488890us | 5.499116us | 7.744445us | 7.380100us | 8.653995us | -| 4 | 100 | 1 | 10.843200ms | 18.572920us | 5.870794us | 4.643230us | 4.446508us | 5.119195us | -| 8 | 100 | 1 | 11.280200ms | 23.194170us | 4.497054us | 2.899271us | 2.816280us | 3.057430us | -| 16 | 100 | 1 | 13.639600ms | 33.864060us | 7.773025us | 2.116504us | 2.050127us | 2.269154us | -| 32 | 100 | 1 | 16.975300ms | 51.248510us | 4.918828us | 1.601516us | 1.576967us | 1.639746us | -| 64 | 100 | 1 | 30.069900ms | 91.563110us | 6.391016us | 1.430674us | 1.413829us | 1.454109us | -| 128 | 100 | 1 | 51.995000ms | 169.878430us | 22.184326us | 1.327175us | 1.302509us | 1.378400us | -| 256 | 100 | 1 | 89.286100ms | 319.688410us | 16.598105us | 1.248783us | 1.237859us | 1.263646us | -| 512 | 100 | 1 | 171.896500ms | 610.812870us | 32.852947us | 1.192994us | 1.183824us | 1.211806us | -| 1024 | 100 | 1 | 336.640100ms | 1.578508ms | 67.384991us | 1.541512us | 1.529491us | 1.555314us | -| 2048 | 100 | 1 | 670.177100ms | 3.641640ms | 327.045601us | 1.778144us | 1.748979us | 1.812021us | -| 4096 | 100 | 1 | 1331.147100ms | 8.074754ms | 261.307612us | 1.971375us | 1.960577us | 1.986096us | -| 8192 | 100 | 1 | 2690.146400ms | 17.813892ms | 242.845050us | 2.174547us | 2.169275us | 2.180981us | +| 1 | 100 | 1 | 10.494200ms | 12.637510us | 5.487590us | 12.637510us | 11.844280us | 14.230950us | +| 2 | 100 | 1 | 10.103100ms | 15.287810us | 5.861732us | 7.643905us | 7.250255us | 8.608040us | +| 4 | 100 | 1 | 11.512800ms | 17.861920us | 5.837854us | 4.465480us | 4.271710us | 4.949530us | +| 8 | 100 | 1 | 11.653000ms | 22.760180us | 4.983687us | 2.845023us | 2.752922us | 3.018727us | +| 16 | 100 | 1 | 13.631700ms | 33.489740us | 8.339237us | 2.093109us | 2.021170us | 2.253591us | +| 32 | 100 | 1 | 17.226600ms | 50.565680us | 4.910430us | 1.580178us | 1.554532us | 1.616044us | +| 64 | 100 | 1 | 30.079800ms | 89.745540us | 8.906324us | 1.402274us | 1.380917us | 1.438589us | +| 128 | 100 | 1 | 51.475800ms | 166.745160us | 12.692466us | 1.302697us | 1.286358us | 1.326171us | +| 256 | 100 | 1 | 92.288800ms | 315.811460us | 23.867081us | 1.233639us | 1.220532us | 1.261480us | +| 512 | 100 | 1 | 175.439600ms | 620.898840us | 52.333886us | 1.212693us | 1.196754us | 1.239014us | +| 1024 | 100 | 1 | 337.836900ms | 1.565730ms | 71.369702us | 1.529034us | 1.517261us | 1.545195us | +| 2048 | 100 | 1 | 678.304600ms | 3.417168ms | 92.565271us | 1.668539us | 1.661544us | 1.680151us | +| 4096 | 100 | 1 | 1347.142900ms | 7.926533ms | 126.513643us | 1.935189us | 1.929701us | 1.941873us | +| 8192 | 100 | 1 | 2719.983900ms | 17.785275ms | 397.564702us | 2.171054us | 2.164223us | 2.185460us | ## SV-SingleBattle-AnalyzeEffect-RandomInputs-OneRandomBattle-OneRandomInput | Inputs | Samples | Iterations / Sample | Estimated Completion Time | Mean of Samples | Standard Deviation | Mean / Input Count | Mean Lower Bound / Input Count | Mean Upper Bound / Input Count | | --- | --- | --- | --- | --- | --- | --- | --- | --- | -| 1 | 100 | 1 | 42.531000ms | 109.316270us | 38.460601us | 109.316270us | 100.665190us | 115.998430us | -| 2 | 100 | 1 | 24.734500ms | 159.139560us | 53.088410us | 79.569780us | 73.441425us | 84.020155us | -| 4 | 100 | 1 | 36.997300ms | 249.772020us | 83.730606us | 62.443005us | 57.521828us | 65.933352us | -| 8 | 100 | 1 | 60.052200ms | 436.180360us | 146.308428us | 54.522545us | 50.184251us | 57.547200us | -| 16 | 100 | 1 | 117.921000ms | 761.197030us | 271.738756us | 47.574814us | 43.601292us | 50.407463us | -| 32 | 100 | 1 | 183.921600ms | 1.408681ms | 500.568681us | 44.021271us | 40.370078us | 46.649134us | -| 64 | 100 | 1 | 371.654900ms | 2.710436ms | 964.963685us | 42.350570us | 38.844759us | 44.865624us | -| 128 | 100 | 1 | 766.951700ms | 5.243822ms | 1.870609ms | 40.967362us | 37.561996us | 43.412360us | -| 256 | 100 | 1 | 1469.585900ms | 10.420130ms | 3.731715ms | 40.703634us | 37.301496us | 43.143086us | -| 512 | 100 | 1 | 3099.200000ms | 21.713813ms | 7.821248ms | 42.409791us | 38.857384us | 44.979531us | -| 1024 | 100 | 1 | 7386.275000ms | 54.349521ms | 19.476992ms | 53.075705us | 48.617242us | 56.244592us | -| 2048 | 100 | 1 | 13506.667400ms | 125.996615ms | 44.999922ms | 61.521785us | 56.316566us | 65.176185us | -| 4096 | 100 | 1 | 28557.440000ms | 268.259960ms | 95.773962ms | 65.493154us | 60.013779us | 69.396059us | +| 1 | 100 | 1 | 43.154900ms | 107.385060us | 38.889018us | 107.385060us | 98.883340us | 114.270960us | +| 2 | 100 | 1 | 23.957900ms | 158.191710us | 52.726162us | 79.095855us | 73.013975us | 83.506570us | +| 4 | 100 | 1 | 35.160000ms | 246.193230us | 82.289834us | 61.548307us | 56.772887us | 64.976385us | +| 8 | 100 | 1 | 58.746600ms | 433.143570us | 145.547602us | 54.142946us | 49.887380us | 57.176133us | +| 16 | 100 | 1 | 115.169700ms | 747.322620us | 264.749384us | 46.707664us | 42.855700us | 49.491369us | +| 32 | 100 | 1 | 181.002700ms | 1.385483ms | 491.525149us | 43.296342us | 39.705732us | 45.874102us | +| 64 | 100 | 1 | 373.247800ms | 2.708416ms | 963.192246us | 42.318993us | 38.785471us | 44.831547us | +| 128 | 100 | 1 | 758.081700ms | 5.169956ms | 1.845231ms | 40.390279us | 37.002044us | 42.815732us | +| 256 | 100 | 1 | 1437.158600ms | 10.276070ms | 3.682541ms | 40.140900us | 36.818654us | 42.557999us | +| 512 | 100 | 1 | 3243.135200ms | 21.206492ms | 7.630480ms | 41.418929us | 37.952965us | 43.918943us | +| 1024 | 100 | 1 | 7323.136800ms | 53.402095ms | 19.145838ms | 52.150483us | 47.757504us | 55.266145us | +| 2048 | 100 | 1 | 13797.193200ms | 124.881016ms | 44.660328ms | 60.977059us | 55.858485us | 64.609074us | +| 4096 | 100 | 1 | 28218.556400ms | 266.638122ms | 95.312321ms | 65.097198us | 59.673932us | 68.977455us | ## SV-SingleBattle-AnalyzeEffect-RandomInputs-OneRandomBattle-ManyRandomInputs | Inputs | Samples | Iterations / Sample | Estimated Completion Time | Mean of Samples | Standard Deviation | Mean / Input Count | Mean Lower Bound / Input Count | Mean Upper Bound / Input Count | | --- | --- | --- | --- | --- | --- | --- | --- | --- | -| 1 | 100 | 1 | 41.637000ms | 109.643980us | 41.596182us | 109.643980us | 100.861190us | 117.269310us | -| 2 | 100 | 1 | 23.129500ms | 148.812360us | 27.161198us | 74.406180us | 71.138555us | 76.643275us | -| 4 | 100 | 1 | 23.123600ms | 197.375650us | 20.619914us | 49.343913us | 48.258955us | 50.280367us | -| 8 | 100 | 1 | 41.765200ms | 296.526250us | 26.812168us | 37.065781us | 36.350027us | 37.670425us | -| 16 | 100 | 1 | 62.517200ms | 492.483370us | 39.648213us | 30.780211us | 30.307544us | 31.277875us | -| 32 | 100 | 1 | 99.103600ms | 874.124690us | 49.750100us | 27.316397us | 27.019154us | 27.628301us | -| 64 | 100 | 1 | 182.087300ms | 1.669714ms | 87.652872us | 26.089282us | 25.818790us | 26.357352us | -| 128 | 100 | 1 | 384.885300ms | 3.322508ms | 139.562149us | 25.957095us | 25.748588us | 26.175857us | -| 256 | 100 | 1 | 746.072400ms | 7.409611ms | 291.348554us | 28.943793us | 28.721938us | 29.167358us | -| 512 | 100 | 1 | 1831.934600ms | 18.025901ms | 599.538927us | 35.206838us | 34.982078us | 35.442248us | -| 1024 | 100 | 1 | 4495.163900ms | 44.641554ms | 1.175760ms | 43.595268us | 43.378296us | 43.830676us | -| 2048 | 100 | 1 | 10321.920600ms | 105.533562ms | 2.592880ms | 51.530060us | 51.279321us | 51.774961us | -| 4096 | 100 | 1 | 23177.237100ms | 233.712622ms | 4.984853ms | 57.058746us | 56.822787us | 57.301496us | +| 1 | 100 | 1 | 42.324500ms | 106.611040us | 38.244583us | 106.611040us | 98.175920us | 113.371150us | +| 2 | 100 | 1 | 22.635400ms | 143.452810us | 26.250814us | 71.726405us | 68.606960us | 73.916630us | +| 4 | 100 | 1 | 22.430200ms | 195.095280us | 22.644623us | 48.773820us | 47.651927us | 49.870775us | +| 8 | 100 | 1 | 40.959300ms | 291.160030us | 26.429791us | 36.395004us | 35.697766us | 36.996146us | +| 16 | 100 | 1 | 58.977300ms | 477.030420us | 37.761448us | 29.814401us | 29.353143us | 30.281468us | +| 32 | 100 | 1 | 99.168800ms | 864.898930us | 53.974901us | 27.028092us | 26.698143us | 27.360964us | +| 64 | 100 | 1 | 177.114700ms | 1.642394ms | 85.710745us | 25.662410us | 25.401285us | 25.926379us | +| 128 | 100 | 1 | 372.083000ms | 3.287395ms | 135.189116us | 25.682776us | 25.479420us | 25.892748us | +| 256 | 100 | 1 | 741.109500ms | 7.313561ms | 272.886976us | 28.568596us | 28.358526us | 28.778053us | +| 512 | 100 | 1 | 1748.442500ms | 17.597717ms | 566.559020us | 34.370542us | 34.154203us | 34.588860us | +| 1024 | 100 | 1 | 4337.528800ms | 43.040382ms | 1.123636ms | 42.031623us | 41.814731us | 42.244539us | +| 2048 | 100 | 1 | 10047.975600ms | 101.665540ms | 2.296406ms | 49.641377us | 49.422714us | 49.861122us | +| 4096 | 100 | 1 | 22467.831400ms | 224.646401ms | 3.711615ms | 54.845313us | 54.666907us | 55.021169us | ## SV-SingleBattle-AnalyzeEffect-RandomInputs-ManyRandomBattles-ManyRandomInputs | Inputs | Samples | Iterations / Sample | Estimated Completion Time | Mean of Samples | Standard Deviation | Mean / Input Count | Mean Lower Bound / Input Count | Mean Upper Bound / Input Count | | --- | --- | --- | --- | --- | --- | --- | --- | --- | -| 1 | 100 | 1 | 42.558300ms | 107.964890us | 38.505708us | 107.964890us | 99.406580us | 114.627270us | -| 2 | 100 | 1 | 28.954100ms | 173.803840us | 30.404899us | 86.901920us | 83.405830us | 89.482370us | -| 4 | 100 | 1 | 45.509200ms | 291.029400us | 34.254968us | 72.757350us | 71.033250us | 74.395245us | -| 8 | 100 | 1 | 67.321700ms | 504.829130us | 44.757951us | 63.103641us | 61.929281us | 64.125856us | -| 16 | 100 | 1 | 124.245500ms | 921.545720us | 65.010962us | 57.596607us | 56.780442us | 58.371183us | -| 32 | 100 | 1 | 221.935600ms | 1.700471ms | 81.624776us | 53.139726us | 52.624607us | 53.627066us | -| 64 | 100 | 1 | 435.242300ms | 3.309236ms | 136.302712us | 51.706820us | 51.273590us | 52.106788us | -| 128 | 100 | 1 | 819.701900ms | 6.258337ms | 180.803823us | 48.893258us | 48.614581us | 49.166315us | -| 256 | 100 | 1 | 1696.559600ms | 12.474110ms | 434.037386us | 48.726991us | 48.410046us | 49.076310us | -| 512 | 100 | 1 | 3393.983800ms | 27.957184ms | 1.081162ms | 54.603874us | 54.210460us | 55.037221us | -| 1024 | 100 | 1 | 7789.308400ms | 72.546752ms | 2.116763ms | 70.846437us | 70.455347us | 71.267056us | -| 2048 | 100 | 1 | 16209.502400ms | 161.259813ms | 2.107425ms | 78.740143us | 78.547132us | 78.947634us | -| 4096 | 100 | 1 | 33531.482700ms | 340.105325ms | 2.852476ms | 83.033527us | 82.898180us | 83.170424us | +| 1 | 100 | 1 | 42.394300ms | 108.099320us | 38.764876us | 108.099320us | 99.632760us | 114.956210us | +| 2 | 100 | 1 | 27.851900ms | 178.433530us | 33.237999us | 89.216765us | 85.589190us | 92.162260us | +| 4 | 100 | 1 | 43.584200ms | 287.535870us | 32.678627us | 71.883967us | 70.182648us | 73.385915us | +| 8 | 100 | 1 | 64.279600ms | 502.703260us | 46.121553us | 62.837908us | 61.625308us | 63.894872us | +| 16 | 100 | 1 | 122.090100ms | 932.563230us | 71.382754us | 58.285202us | 57.421358us | 59.169805us | +| 32 | 100 | 1 | 216.517100ms | 1.709589ms | 82.219567us | 53.424665us | 52.907228us | 53.916377us | +| 64 | 100 | 1 | 430.102300ms | 3.295029ms | 136.655686us | 51.484834us | 51.040584us | 51.882499us | +| 128 | 100 | 1 | 793.353800ms | 6.192593ms | 181.760239us | 48.379631us | 48.100183us | 48.656026us | +| 256 | 100 | 1 | 1676.583300ms | 12.283151ms | 405.278111us | 47.981059us | 47.681574us | 48.302759us | +| 512 | 100 | 1 | 3341.283600ms | 26.417286ms | 746.350842us | 51.596262us | 51.319399us | 51.892132us | +| 1024 | 100 | 1 | 7662.897900ms | 70.578237ms | 1.945377ms | 68.924060us | 68.583710us | 69.337008us | +| 2048 | 100 | 1 | 16050.128900ms | 160.275248ms | 2.528991ms | 78.259398us | 78.039690us | 78.525429us | +| 4096 | 100 | 1 | 33976.285200ms | 338.647304ms | 3.418839ms | 82.677564us | 82.517415us | 82.845059us | diff --git a/src/AnalyzeEffect/AnalyzeEffectDebugChecks.hpp b/src/AnalyzeEffect/AnalyzeEffectDebugChecks.hpp index 3931478..0d5ed79 100644 --- a/src/AnalyzeEffect/AnalyzeEffectDebugChecks.hpp +++ b/src/AnalyzeEffect/AnalyzeEffectDebugChecks.hpp @@ -33,12 +33,10 @@ namespace pokesim::analyze_effect::debug { struct Checks : pokesim::debug::Checks { - Options options; - Checks(const Simulation& _simulation) - : pokesim::debug::Checks(_simulation), options(_simulation.analyzeEffectOptions) {} + Checks(const Simulation& _simulation) : pokesim::debug::Checks(_simulation) {} void checkInputs() { - pokesim::debug::check(options.getDamageRollOptions()); + pokesim::debug::check(analyzeEffectOptionsOnInput.getDamageRollOptions()); auto view = registry->view(); types::entityVector inputs{view.begin(), view.end()}; @@ -62,8 +60,7 @@ struct Checks : pokesim::debug::Checks { } void checkOutputs() const { - POKESIM_REQUIRE_NM(options == simulation->analyzeEffectOptions); - + checkOptions(); types::entityIndex finalEntityCount = getFinalEntityCount(); POKESIM_REQUIRE_NM(initialEntityCount == finalEntityCount); checkInputOutputs(); diff --git a/src/CalcDamage/CalcDamageDebugChecks.hpp b/src/CalcDamage/CalcDamageDebugChecks.hpp index 9066349..f6ede7c 100644 --- a/src/CalcDamage/CalcDamageDebugChecks.hpp +++ b/src/CalcDamage/CalcDamageDebugChecks.hpp @@ -36,12 +36,10 @@ namespace pokesim::calc_damage::debug { struct Checks : pokesim::debug::Checks { - Options options; - Checks(const Simulation& _simulation) - : pokesim::debug::Checks(_simulation), options(_simulation.calculateDamageOptions) {} + Checks(const Simulation& _simulation) : pokesim::debug::Checks(_simulation) {} void checkInputs() { - pokesim::debug::check(options.getDamageRollOptions()); + pokesim::debug::check(calcDamageOptionsOnInput.getDamageRollOptions()); checkMoveInputs(); checkPokemonInputs(true); @@ -55,8 +53,7 @@ struct Checks : pokesim::debug::Checks { } void checkOutputs() const { - POKESIM_REQUIRE_NM(options == simulation->calculateDamageOptions); - + checkOptions(); checkMoveOutputs(); checkPokemonOutputs(true); checkPokemonOutputs(false); diff --git a/src/Components/SideDecisions.hpp b/src/Components/SideDecisions.hpp new file mode 100644 index 0000000..1ec8c78 --- /dev/null +++ b/src/Components/SideDecisions.hpp @@ -0,0 +1,14 @@ +#pragma once + +#include +#include +#include + +namespace pokesim { +struct SideDecision { + PlayerSideId sideId = PlayerSideId::NONE; + internal::variant decisions{}; + + bool operator==(const SideDecision other) const { return sideId == other.sideId && decisions == other.decisions; } +}; +} // namespace pokesim diff --git a/src/Components/headers.hpp b/src/Components/headers.hpp index ff533d3..a5c606f 100644 --- a/src/Components/headers.hpp +++ b/src/Components/headers.hpp @@ -3,6 +3,7 @@ #pragma once #include "Accuracy.hpp" +#include "ActionQueue.hpp" #include "AddedTargets.hpp" #include "AnalyzeEffect/Aliases.hpp" #include "AnalyzeEffect/AnalyzeEffectInputs.hpp" @@ -18,7 +19,6 @@ #include "CalcDamage/TemporaryMoveProperties.hpp" #include "CloneFromCloneTo.hpp" #include "Damage.hpp" -#include "Decisions.hpp" #include "EVsIVs.hpp" #include "EntityHolders/ActionQueue.hpp" #include "EntityHolders/Battle.hpp" @@ -63,6 +63,7 @@ #include "RNGSeed.hpp" #include "RandomEventInputs.hpp" #include "RandomEventOutputs.hpp" +#include "SideDecisions.hpp" #include "SimulateTurn/ActionTags.hpp" #include "SimulateTurn/MoveHitStepTags.hpp" #include "SimulateTurn/SimulateTurnTags.hpp" diff --git a/src/SimulateTurn/ManageActionQueue.cpp b/src/SimulateTurn/ManageActionQueue.cpp index ce747c4..0e1b93b 100644 --- a/src/SimulateTurn/ManageActionQueue.cpp +++ b/src/SimulateTurn/ManageActionQueue.cpp @@ -1,7 +1,6 @@ #include "ManageActionQueue.hpp" #include -#include #include #include #include @@ -11,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include @@ -37,9 +38,6 @@ void resolveSlotDecisions( for (const SlotDecision& decision : decisions) { POKESIM_REQUIRE(decision.sourceSlot != Slot::NONE, "Source slot must be assigned."); POKESIM_REQUIRE(decision.targetSlot != Slot::NONE, "Target slot must be assigned."); - POKESIM_REQUIRE( - !(decision.moveChoice.has_value() && decision.itemChoice.has_value()), - "Decisions can't have a move and an item choice."); types::handle actionHandle = {registry, registry.create()}; actionHandle.emplace(decision.sourceSlot); @@ -48,25 +46,19 @@ void resolveSlotDecisions( SpeedSort speedSort; types::entity sourceEntity = slotToPokemonEntity(registry, sideHandle.entity(), decision.sourceSlot); - stat::EffectiveSpe* effectiveSpe = registry.try_get(sourceEntity); - if (effectiveSpe != nullptr) { - speedSort.speed = effectiveSpe->val; - } - else { - speedSort.speed = registry.get(sourceEntity).val; - } + speedSort.speed = registry.get(sourceEntity).val; - if (decision.moveChoice.has_value()) { + if (decision.moveOrItem.holds()) { actionHandle.emplace(); - actionHandle.emplace(decision.moveChoice.value()); + actionHandle.emplace(decision.moveOrItem.get()); speedSort.order = ActionOrder::MOVE; speedSort.priority = Constants::MovePriority::DEFAULT; // TODO (aed3): Move priority + modify priority speedSort.fractionalPriority = false; // TODO (aed3): get fractionalPriority } - else if (decision.itemChoice.has_value()) { + else if (decision.moveOrItem.holds()) { actionHandle.emplace(); - actionHandle.emplace(decision.itemChoice.value()); + actionHandle.emplace(decision.moveOrItem.get()); speedSort.order = ActionOrder::ITEM; } else { @@ -233,7 +225,6 @@ void setCurrentAction(types::handle battleHandle, ActionQueue& actionQueue) { if (registry.all_of(newCurrentAction)) { battleHandle.emplace(); - battleHandle.emplace(registry.get(newCurrentAction)); } else if (registry.all_of(newCurrentAction)) { battleHandle.emplace(); diff --git a/src/SimulateTurn/SimulateTurnDebugChecks.hpp b/src/SimulateTurn/SimulateTurnDebugChecks.hpp index f9bcdfd..33f63bc 100644 --- a/src/SimulateTurn/SimulateTurnDebugChecks.hpp +++ b/src/SimulateTurn/SimulateTurnDebugChecks.hpp @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include @@ -17,11 +18,10 @@ namespace pokesim::simulate_turn::debug { struct Checks : pokesim::debug::Checks { - Options options; - Checks(const Simulation& _simulation) - : pokesim::debug::Checks(_simulation), options(_simulation.simulateTurnOptions) {} + Checks(const Simulation& _simulation) : pokesim::debug::Checks(_simulation) {} - void checkInputs() const { + void checkInputs() { + const auto& options = simulateTurnOptionsOnInput; pokesim::debug::check(options.getDamageRollsConsidered()); pokesim::debug::checkPercentChance(options.getRandomChanceLowerLimit()); pokesim::debug::checkPercentChance(options.getRandomChanceUpperLimit()); @@ -29,18 +29,54 @@ struct Checks : pokesim::debug::Checks { pokesim::debug::check(Probability{options.getBranchProbabilityLowerLimit()}); } + copyBattles(); check(); } void checkOutputs() const { - POKESIM_REQUIRE_NM(options == simulation->simulateTurnOptions); - + checkOptions(); + checkBattleOutputs(); check(); } private: + auto getBattleView() const { return registry->view(); } + + void copyBattles() { + for (types::entity entity : getBattleView()) { + copyEntity(entity); + } + } + + void checkBattleOutputs() const { + pokesim::debug::TypesToIgnore typesToIgnore; + typesToIgnore.add(); + + pokesim::debug::TypesToIgnore typesIgnoredOnConstants = typesToIgnore; + typesToIgnore.add(); + + if (!simulateTurnOptionsOnInput.getMakeBranchesOnRandomEvents()) { + typesToIgnore.add(); + } + + for (types::entity entity : getBattleView()) { + types::entity original = pokesim::debug::findCopyParent(currentEntitiesToInitial, *registry, entity); + bool shouldNotChange = !simulateTurnOptionsOnInput.getApplyChangesToInputBattle() && original == entity; + if (!registryOnInput.all_of(original)) { + typesToIgnore.add(); + } + + pokesim::debug::areEntitiesEqual( + *registry, + entity, + registryOnInput, + getInitialEntity(entity), + shouldNotChange ? typesIgnoredOnConstants : typesToIgnore); + } + } + void check() const { - for (types::entity battleEntity : registry->view()) { + for (types::entity battleEntity : getBattleView()) { checkBattle(battleEntity); for (types::entity sideEntity : registry->get(battleEntity).val) { checkSide(sideEntity); diff --git a/src/Simulation/BattleCreationInfo.hpp b/src/Simulation/BattleCreationInfo.hpp index 2af33ab..7ba18dc 100644 --- a/src/Simulation/BattleCreationInfo.hpp +++ b/src/Simulation/BattleCreationInfo.hpp @@ -1,9 +1,10 @@ #pragma once -#include +#include #include #include #include +#include #include #include #include diff --git a/src/Simulation/SimulationSetup.cpp b/src/Simulation/SimulationSetup.cpp index 1952020..0322bf7 100644 --- a/src/Simulation/SimulationSetup.cpp +++ b/src/Simulation/SimulationSetup.cpp @@ -6,7 +6,6 @@ #include #include #include -#include #include #include #include @@ -14,12 +13,14 @@ #include #include #include +#include #include #include #include #include #include #include +#include #include #include #include diff --git a/src/Simulation/SimulationSetupDebugChecks.hpp b/src/Simulation/SimulationSetupDebugChecks.hpp index 9979682..d8a5784 100644 --- a/src/Simulation/SimulationSetupDebugChecks.hpp +++ b/src/Simulation/SimulationSetupDebugChecks.hpp @@ -388,8 +388,7 @@ struct SimulationSetupChecks { POKESIM_REQUIRE_NM(slotDecision.primalRevert == slotDecisionInfo.primalRevert); POKESIM_REQUIRE_NM(slotDecision.dynamax == slotDecisionInfo.dynamax); POKESIM_REQUIRE_NM(slotDecision.terastallize == slotDecisionInfo.terastallize); - POKESIM_REQUIRE_NM(slotDecision.moveChoice == slotDecisionInfo.moveChoice); - POKESIM_REQUIRE_NM(slotDecision.itemChoice == slotDecisionInfo.itemChoice); + POKESIM_REQUIRE_NM(slotDecision.moveOrItem == slotDecisionInfo.moveOrItem); } } else if (sideDecisionInfo.decisions.holds()) { diff --git a/src/Components/Decisions.hpp b/src/Types/Decisions.hpp similarity index 60% rename from src/Components/Decisions.hpp rename to src/Types/Decisions.hpp index 4963d19..1f28215 100644 --- a/src/Components/Decisions.hpp +++ b/src/Types/Decisions.hpp @@ -2,11 +2,9 @@ #include #include -#include #include #include #include -#include namespace pokesim { struct SlotDecision { @@ -18,24 +16,16 @@ struct SlotDecision { bool dynamax = false; bool terastallize = false; - std::optional moveChoice = std::nullopt; - std::optional itemChoice = std::nullopt; + internal::variant moveOrItem; bool operator==(const SlotDecision& other) const { return sourceSlot == other.sourceSlot && targetSlot == other.targetSlot && megaEvolve == other.megaEvolve && primalRevert == other.primalRevert && dynamax == other.dynamax && terastallize == other.terastallize && - moveChoice == other.moveChoice && itemChoice == other.itemChoice; + moveOrItem == other.moveOrItem; } }; namespace types { using slotDecisions = types::sideSlots; } - -struct SideDecision { - PlayerSideId sideId = PlayerSideId::NONE; - internal::variant decisions{}; - - bool operator==(const SideDecision other) const { return sideId == other.sideId && decisions == other.decisions; } -}; } // namespace pokesim diff --git a/src/Types/State.hpp b/src/Types/State.hpp index 81b79d9..840800b 100644 --- a/src/Types/State.hpp +++ b/src/Types/State.hpp @@ -18,6 +18,7 @@ using stateId = std::underlying_type_t; using battleTurn = pokesim::internal::unsignedIntType; using sideIndex = pokesim::internal::unsignedIntType; + template struct sides : public std::array { constexpr T& p1() { return this->at(0); }; @@ -27,6 +28,7 @@ struct sides : public std::array { template decltype(auto) get() const { + static_assert(N < Constants::SIDE_COUNT); return this->at(N); } diff --git a/src/Types/headers.hpp b/src/Types/headers.hpp index 71dcb64..f3a66d3 100644 --- a/src/Types/headers.hpp +++ b/src/Types/headers.hpp @@ -4,6 +4,7 @@ #include "Constants.hpp" #include "Damage.hpp" +#include "Decisions.hpp" #include "Effect.hpp" #include "Entity.hpp" #include "Enums/Ability.hpp" diff --git a/src/Utilities/ArgumentChecks.cpp b/src/Utilities/ArgumentChecks.cpp index 3bdeb30..b17b9d6 100644 --- a/src/Utilities/ArgumentChecks.cpp +++ b/src/Utilities/ArgumentChecks.cpp @@ -531,28 +531,6 @@ void check(const DamageRolls& damageRolls) { } } -template <> -void check(const SlotDecision& slotDecision) { - checkSlot(slotDecision.sourceSlot); - checkSlot(slotDecision.targetSlot); - POKESIM_REQUIRE_NM(!(slotDecision.moveChoice.has_value() && slotDecision.itemChoice.has_value())); - POKESIM_REQUIRE_NM(!(slotDecision.megaEvolve && slotDecision.primalRevert)); -} - -template <> -void check(const SideDecision& sideDecision) { - checkPlayerSideId(sideDecision.sideId); - if (sideDecision.decisions.holds()) { - const types::slotDecisions& decisions = sideDecision.decisions.get(); - for (const SlotDecision& decision : decisions) { - check(decision); - } - } - else { - checkTeamOrder(sideDecision.decisions.get()); - } -} - template <> void check(const Evs& evs) { checkEv(evs.hp); @@ -1001,6 +979,20 @@ void check(const internal::RandomEqualChanceStack& randomEqualChanceStack, const } } +template <> +void check(const SideDecision& sideDecision) { + checkPlayerSideId(sideDecision.sideId); + if (sideDecision.decisions.holds()) { + const types::slotDecisions& decisions = sideDecision.decisions.get(); + for (const SlotDecision& decision : decisions) { + check(decision); + } + } + else { + checkTeamOrder(sideDecision.decisions.get()); + } +} + template <> void check(const SpeedTieIndexes& speedTieIndexes) { checkBounds(speedTieIndexes.val.size()); @@ -1149,6 +1141,13 @@ void check(const Winner& winner) { winner.val == PlayerSideId::P1 || winner.val == PlayerSideId::P2 || winner.val == PlayerSideId::NONE); } +template <> +void check(const SlotDecision& slotDecision) { + checkSlot(slotDecision.sourceSlot); + checkSlot(slotDecision.targetSlot); + POKESIM_REQUIRE_NM(!(slotDecision.megaEvolve && slotDecision.primalRevert)); +} + template <> void check(const DamageRollKind& damageRollKind) { if (listContains(VALID_DAMAGE_ROLL_KINDS, damageRollKind)) { diff --git a/src/Utilities/ArgumentChecks.hpp b/src/Utilities/ArgumentChecks.hpp index 7715f8b..d85bf49 100644 --- a/src/Utilities/ArgumentChecks.hpp +++ b/src/Utilities/ArgumentChecks.hpp @@ -5,6 +5,7 @@ #ifdef POKESIM_DEBUG_CHECK_UTILITIES #include +#include #include #include #include @@ -23,8 +24,6 @@ struct CloneTo; struct Damage; struct DamageRollModifiers; struct DamageRolls; -struct SlotDecision; -struct SideDecision; struct Evs; struct Ivs; struct ActionQueue; @@ -86,6 +85,7 @@ struct Position; struct MovePriority; struct Probability; struct RngSeed; +struct SideDecision; struct SpeedTieIndexes; struct SpeciesTypes; struct SpeedSort; @@ -241,12 +241,6 @@ void check(const DamageRollModifiers&); template <> void check(const DamageRolls&); -template <> -void check(const SlotDecision&); - -template <> -void check(const SideDecision&); - template <> void check(const Evs&); @@ -469,6 +463,9 @@ void check(const internal::RandomEqualChanceStack&, const types::registry&); // template <> void check(const internal::RandomEventIndex&); +template <> +void check(const SideDecision&); + template <> void check(const SpeedTieIndexes&); @@ -538,6 +535,9 @@ void check(const Turn&); template <> void check(const Winner&); +template <> +void check(const SlotDecision&); + template <> void check(const DamageRollKind&); diff --git a/src/Utilities/DebugChecks.hpp b/src/Utilities/DebugChecks.hpp index 4305190..e549b60 100644 --- a/src/Utilities/DebugChecks.hpp +++ b/src/Utilities/DebugChecks.hpp @@ -38,12 +38,21 @@ namespace pokesim::debug { struct Checks { - Checks(const Simulation& _simulation) : simulation(&_simulation), registry(&_simulation.registry) {} + Checks(const Simulation& _simulation) + : simulation(&_simulation), + registry(&_simulation.registry), + simulateTurnOptionsOnInput(simulation->simulateTurnOptions), + calcDamageOptionsOnInput(simulation->calculateDamageOptions), + analyzeEffectOptionsOnInput(simulation->analyzeEffectOptions) {} protected: const Simulation* simulation; const types::registry* registry; types::registry registryOnInput; + simulate_turn::Options simulateTurnOptionsOnInput; + calc_damage::Options calcDamageOptionsOnInput; + analyze_effect::Options analyzeEffectOptionsOnInput; + entt::dense_map currentEntitiesToInitial; entt::dense_set specificallyChecked; types::entityIndex initialEntityCount = 0U; @@ -76,6 +85,12 @@ struct Checks { } } + void checkOptions() const { + POKESIM_REQUIRE_NM(simulateTurnOptionsOnInput == simulation->simulateTurnOptions); + POKESIM_REQUIRE_NM(calcDamageOptionsOnInput == simulation->calculateDamageOptions); + POKESIM_REQUIRE_NM(analyzeEffectOptionsOnInput == simulation->analyzeEffectOptions); + } + void checkRemainingOutputs() const { for (auto [original, copy] : currentEntitiesToInitial) { if (!specificallyChecked.contains(original)) { diff --git a/tests/Effects/ChoiceLock.cpp b/tests/Effects/ChoiceLock.cpp index 21eaa0e..d07bfc7 100644 --- a/tests/Effects/ChoiceLock.cpp +++ b/tests/Effects/ChoiceLock.cpp @@ -21,9 +21,9 @@ TEST_CASE("Choice Lock: Choice lock starts", "[Simulation][SimulateTurn][Effect] SideDecision p2Decision{PlayerSideId::P2}; SlotDecision p1SlotDecision{Slot::P1A, Slot::P2A}; SlotDecision p2SlotDecision{Slot::P2A, Slot::P2A}; - p1SlotDecision.moveChoice = dex::Move::SPLASH; + p1SlotDecision.moveOrItem = dex::Move::SPLASH; p1Decision.decisions = types::sideSlots{p1SlotDecision}; - p2SlotDecision.moveChoice = dex::Move::SPLASH; + p2SlotDecision.moveOrItem = dex::Move::SPLASH; p2Decision.decisions = types::sideSlots{p2SlotDecision}; battleCreationInfo.decisionsToSimulate = {{p1Decision, p2Decision}}; @@ -112,9 +112,9 @@ TEST_CASE( SideDecision p2Decision{PlayerSideId::P2}; SlotDecision p1SlotDecision{Slot::P1A, Slot::P2A}; SlotDecision p2SlotDecision{Slot::P2A, Slot::P2A}; - p1SlotDecision.moveChoice = dex::Move::KNOCK_OFF; + p1SlotDecision.moveOrItem = dex::Move::KNOCK_OFF; p1Decision.decisions = types::sideSlots{p1SlotDecision}; - p2SlotDecision.moveChoice = dex::Move::SPLASH; + p2SlotDecision.moveOrItem = dex::Move::SPLASH; p2Decision.decisions = types::sideSlots{p2SlotDecision}; battleCreationInfo.decisionsToSimulate = {{p1Decision, p2Decision}}; diff --git a/tests/Effects/Paralysis.cpp b/tests/Effects/Paralysis.cpp index e5cf183..8c29e74 100644 --- a/tests/Effects/Paralysis.cpp +++ b/tests/Effects/Paralysis.cpp @@ -20,9 +20,9 @@ TEST_CASE("Paralysis: Can cause move failure", "[Simulation][SimulateTurn][Effec SideDecision p2Decision{PlayerSideId::P2}; SlotDecision p1SlotDecision{Slot::P1A, Slot::P2A}; SlotDecision p2SlotDecision{Slot::P2A, Slot::P2A}; - p1SlotDecision.moveChoice = dex::Move::KNOCK_OFF; + p1SlotDecision.moveOrItem = dex::Move::KNOCK_OFF; p1Decision.decisions = types::sideSlots{p1SlotDecision}; - p2SlotDecision.moveChoice = dex::Move::SPLASH; + p2SlotDecision.moveOrItem = dex::Move::SPLASH; p2Decision.decisions = types::sideSlots{p2SlotDecision}; battleCreationInfo.decisionsToSimulate = {{p1Decision, p2Decision}}; diff --git a/tests/Moves/FuryAttack.cpp b/tests/Moves/FuryAttack.cpp index 5c8186b..512ed58 100644 --- a/tests/Moves/FuryAttack.cpp +++ b/tests/Moves/FuryAttack.cpp @@ -20,9 +20,9 @@ TEST_CASE("Fury Attack: Multi-hit Branches", "[Simulation][SimulateTurn][Move][F SideDecision p2Decision{PlayerSideId::P2}; SlotDecision p1SlotDecision{Slot::P1A, Slot::P2A}; SlotDecision p2SlotDecision{Slot::P2A, Slot::P1A}; - p1SlotDecision.moveChoice = dex::Move::FURY_ATTACK; + p1SlotDecision.moveOrItem = dex::Move::FURY_ATTACK; p1Decision.decisions = types::sideSlots{p1SlotDecision}; - p2SlotDecision.moveChoice = dex::Move::SPLASH; + p2SlotDecision.moveOrItem = dex::Move::SPLASH; p2Decision.decisions = types::sideSlots{p2SlotDecision}; battleCreationInfo.decisionsToSimulate = {{p1Decision, p2Decision}}; diff --git a/tests/Moves/KnockOff.cpp b/tests/Moves/KnockOff.cpp index 21e23a9..1563b8b 100644 --- a/tests/Moves/KnockOff.cpp +++ b/tests/Moves/KnockOff.cpp @@ -22,9 +22,9 @@ TEST_CASE("Knock Off: Remove Most Items", "[Simulation][SimulateTurn][Move][Knoc SideDecision p2Decision{PlayerSideId::P2}; SlotDecision p1SlotDecision{Slot::P1A, Slot::P2A}; SlotDecision p2SlotDecision{Slot::P2A, Slot::P2A}; - p1SlotDecision.moveChoice = dex::Move::KNOCK_OFF; + p1SlotDecision.moveOrItem = dex::Move::KNOCK_OFF; p1Decision.decisions = types::sideSlots{p1SlotDecision}; - p2SlotDecision.moveChoice = dex::Move::SPLASH; + p2SlotDecision.moveOrItem = dex::Move::SPLASH; p2Decision.decisions = types::sideSlots{p2SlotDecision}; battleCreationInfo.decisionsToSimulate = {{p1Decision, p2Decision}}; diff --git a/tests/SimulateTurnsTest.cpp b/tests/SimulateTurnsTest.cpp index 12f2fdd..bf24629 100644 --- a/tests/SimulateTurnsTest.cpp +++ b/tests/SimulateTurnsTest.cpp @@ -232,9 +232,9 @@ TEST_CASE("Simulate Turn: Battle ends on faint", "[Simulation][SimulateTurn]") { SideDecision p2Decision{PlayerSideId::P2}; SlotDecision p1SlotDecision{Slot::P1A, Slot::P1A}; SlotDecision p2SlotDecision{Slot::P2A, Slot::P1A}; - p1SlotDecision.moveChoice = dex::Move::SPLASH; + p1SlotDecision.moveOrItem = dex::Move::SPLASH; p1Decision.decisions = types::sideSlots{p1SlotDecision}; - p2SlotDecision.moveChoice = dex::Move::THUNDERBOLT; + p2SlotDecision.moveOrItem = dex::Move::THUNDERBOLT; p2Decision.decisions = types::sideSlots{p2SlotDecision}; battleCreationInfo.decisionsToSimulate = {{p1Decision, p2Decision}}; diff --git a/tests/SimulationSetupTest.cpp b/tests/SimulationSetupTest.cpp index 7c20d58..3358df7 100644 --- a/tests/SimulationSetupTest.cpp +++ b/tests/SimulationSetupTest.cpp @@ -82,14 +82,15 @@ TEST_CASE("Simulation Setup: Simulate Turn", "[Simulation][SimulateTurn][Setup]" SlotDecision p1SlotDecision{Slot::P1A, Slot::P2A}; SlotDecision p2SlotDecision{Slot::P2A, Slot::P1A}; - p1SlotDecision.moveChoice = dex::Move::FURY_ATTACK; + p1SlotDecision.moveOrItem = dex::Move::FURY_ATTACK; p1Decision.decisions = types::sideSlots{p1SlotDecision}; - p2SlotDecision.moveChoice = dex::Move::THUNDERBOLT; + p2SlotDecision.moveOrItem = dex::Move::THUNDERBOLT; p2Decision.decisions = types::sideSlots{p2SlotDecision}; auto check = [&]() { Simulation simulation(pokedex, BattleFormat::SINGLES); simulation.createInitialStates({battleInfo}); + updateAllStats(simulation); types::registry& registry = simulation.registry; auto group = registry.group(); @@ -117,11 +118,11 @@ TEST_CASE("Simulation Setup: Simulate Turn", "[Simulation][SimulateTurn][Setup]" auto checkDecision = [&](types::entity decisionEntity, const pokesim::SlotDecision& decision, const PokemonCreationInfo& pokemon) { - if (decision.moveChoice) { + if (decision.moveOrItem.holds()) { const auto [target, move, speedSort] = registry.get(decisionEntity); REQUIRE(target.val == decision.targetSlot); - REQUIRE(move.val == decision.moveChoice); + REQUIRE(move.val == decision.moveOrItem.get()); REQUIRE(speedSort.speed == pokemon.stats.spe); REQUIRE(speedSort.order == ActionOrder::MOVE); REQUIRE(speedSort.priority == 0); @@ -175,17 +176,17 @@ TEST_CASE("Simulation Setup: Simulate Turn", "[Simulation][SimulateTurn][Setup]" switch (i) { case 0U: { - newP1SlotDecision.moveChoice = p1SlotDecision.moveChoice; + newP1SlotDecision.moveOrItem = p1SlotDecision.moveOrItem; newP1SlotDecision.targetSlot = Slot::P2A; break; } case 1U: { - newP1SlotDecision.moveChoice = std::nullopt; + newP1SlotDecision.moveOrItem = std::monostate{}; newP1SlotDecision.targetSlot = Slot::P1B; break; } case 2U: { - newP1SlotDecision.moveChoice = std::nullopt; + newP1SlotDecision.moveOrItem = std::monostate{}; newP1SlotDecision.targetSlot = Slot::P1C; break; } @@ -194,17 +195,17 @@ TEST_CASE("Simulation Setup: Simulate Turn", "[Simulation][SimulateTurn][Setup]" switch (j) { case 0U: { - newP2SlotDecision.moveChoice = p2SlotDecision.moveChoice; + newP2SlotDecision.moveOrItem = p2SlotDecision.moveOrItem; newP2SlotDecision.targetSlot = Slot::P1A; break; } case 1U: { - newP2SlotDecision.moveChoice = std::nullopt; + newP2SlotDecision.moveOrItem = std::monostate{}; newP2SlotDecision.targetSlot = Slot::P2B; break; } case 2U: { - newP2SlotDecision.moveChoice = std::nullopt; + newP2SlotDecision.moveOrItem = std::monostate{}; newP2SlotDecision.targetSlot = Slot::P2C; break; } diff --git a/tests/VerticalSlices.cpp b/tests/VerticalSlices.cpp index 3829f3f..0edf85c 100644 --- a/tests/VerticalSlices.cpp +++ b/tests/VerticalSlices.cpp @@ -372,9 +372,9 @@ TEST_CASE( SlotDecision p1SlotDecision{Slot::P1A, Slot::P2A}; SlotDecision p2SlotDecision{Slot::P2A, Slot::P1A}; - p1SlotDecision.moveChoice = dex::Move::KNOCK_OFF; + p1SlotDecision.moveOrItem = dex::Move::KNOCK_OFF; p1Decision.decisions = types::sideSlots{p1SlotDecision}; - p2SlotDecision.moveChoice = dex::Move::THUNDERBOLT; + p2SlotDecision.moveOrItem = dex::Move::THUNDERBOLT; p2Decision.decisions = types::sideSlots{p2SlotDecision}; battleCreationInfo.decisionsToSimulate = {{p1Decision, p2Decision}}; @@ -687,11 +687,11 @@ TEST_CASE( SlotDecision p2ASlotDecision{Slot::P2A, Slot::P1B}; SlotDecision p2BSlotDecision{Slot::P2B, Slot::P2B}; - p1ASlotDecision.moveChoice = dex::Move::MOONBLAST; - p1BSlotDecision.moveChoice = dex::Move::WILL_O_WISP; + p1ASlotDecision.moveOrItem = dex::Move::MOONBLAST; + p1BSlotDecision.moveOrItem = dex::Move::WILL_O_WISP; p1Decision.decisions = types::sideSlots{p1ASlotDecision, p1BSlotDecision}; - p2ASlotDecision.moveChoice = dex::Move::KNOCK_OFF; - p2BSlotDecision.moveChoice = dex::Move::QUIVER_DANCE; + p2ASlotDecision.moveOrItem = dex::Move::KNOCK_OFF; + p2BSlotDecision.moveOrItem = dex::Move::QUIVER_DANCE; p2Decision.decisions = types::sideSlots{p2ASlotDecision, p2BSlotDecision}; battleCreationInfo.decisionsToSimulate = {{p1Decision, p2Decision}}; From bd5d9b22608a17c73986a53b2ef24f45d96dc9cc Mon Sep 17 00:00:00 2001 From: aed3 <32887801+aed3@users.noreply.github.com> Date: Thu, 11 Jun 2026 15:58:47 -0500 Subject: [PATCH 02/10] Making the last commit better My changes from yesterday were not good from an API persepective. They were also not as good as they could be from a memory usage perspective. So, this change fixes that so each kind of decision has its own type to make it clear what actions a set of options can lead to, it's clearer how the each kind of decision map to those in Showdown, and they can all sit in an union smaller than the `SlotDecision` struct from before (6 bytes instead of 10). This didn't have much if any effect of benchmark results. --- benchmarks/RandomInputs.cpp | 38 +- benchmarks/VerticalSlices.cpp | 28 +- extras/PokeSim.cpp | 117 +++-- extras/PokeSim.hpp | 203 +++++---- extras/RecentBenchmarkResults.md | 422 +++++++++--------- src/Components/headers.hpp | 1 - src/SimulateTurn/ManageActionQueue.cpp | 91 ++-- src/Simulation/SimulationSetupDebugChecks.hpp | 8 +- src/Types/Decisions.hpp | 58 ++- src/Utilities/ArgumentChecks.cpp | 26 +- src/Utilities/ArgumentChecks.hpp | 2 +- src/Utilities/Variant.hpp | 19 +- tests/Effects/ChoiceLock.cpp | 20 +- tests/Effects/Paralysis.cpp | 10 +- tests/Moves/FuryAttack.cpp | 10 +- tests/Moves/KnockOff.cpp | 10 +- tests/SimulateTurnsTest.cpp | 15 +- tests/SimulationSetupTest.cpp | 42 +- tests/VerticalSlices.cpp | 28 +- 19 files changed, 629 insertions(+), 519 deletions(-) diff --git a/benchmarks/RandomInputs.cpp b/benchmarks/RandomInputs.cpp index e021e2e..29d547b 100644 --- a/benchmarks/RandomInputs.cpp +++ b/benchmarks/RandomInputs.cpp @@ -149,34 +149,34 @@ struct Random { SideDecision p1Decision{PlayerSideId::P1}; SideDecision p2Decision{PlayerSideId::P2}; if (simulation.isBattleFormat(BattleFormat::SINGLES)) { - SlotDecision p1SlotDecision{Slot::P1A, Slot::P2A}; - SlotDecision p2SlotDecision{Slot::P2A, Slot::P1A}; - p1SlotDecision.moveOrItem = pickFromList(battle.sides.p1().team[0].moves, rngState).name; - p2SlotDecision.moveOrItem = pickFromList(battle.sides.p2().team[0].moves, rngState).name; + MoveDecision p1MoveDecision{Slot::P1A, Slot::P2A}; + MoveDecision p2MoveDecision{Slot::P2A, Slot::P1A}; + p1MoveDecision.move = pickFromList(battle.sides.p1().team[0].moves, rngState).name; + p2MoveDecision.move = pickFromList(battle.sides.p2().team[0].moves, rngState).name; - p1Decision.decisions = types::sideSlots{p1SlotDecision}; - p2Decision.decisions = types::sideSlots{p2SlotDecision}; + p1Decision.decisions = types::slotDecisions{p1MoveDecision}; + p2Decision.decisions = types::slotDecisions{p2MoveDecision}; } else { - SlotDecision p1ASlotDecision{Slot::P1A, pickFromList(std::vector{Slot::P1B, Slot::P2A, Slot::P2B}, rngState)}; - SlotDecision p1BSlotDecision{Slot::P1B, pickFromList(std::vector{Slot::P1A, Slot::P2A, Slot::P2B}, rngState)}; - SlotDecision p2ASlotDecision{Slot::P2A, pickFromList(std::vector{Slot::P2B, Slot::P1A, Slot::P1B}, rngState)}; - SlotDecision p2BSlotDecision{Slot::P2B, pickFromList(std::vector{Slot::P2A, Slot::P1A, Slot::P1B}, rngState)}; - p1ASlotDecision.moveOrItem = pickFromList(battle.sides.p1().team[0].moves, rngState).name; - p1BSlotDecision.moveOrItem = pickFromList(battle.sides.p1().team[1].moves, rngState).name; - p2ASlotDecision.moveOrItem = pickFromList(battle.sides.p2().team[0].moves, rngState).name; - p2BSlotDecision.moveOrItem = pickFromList(battle.sides.p2().team[1].moves, rngState).name; - - p1Decision.decisions = types::slotDecisions{p1ASlotDecision, p1BSlotDecision}; - p2Decision.decisions = types::slotDecisions{p2ASlotDecision, p2BSlotDecision}; + MoveDecision p1AMoveDecision{Slot::P1A, pickFromList(std::vector{Slot::P1B, Slot::P2A, Slot::P2B}, rngState)}; + MoveDecision p1BMoveDecision{Slot::P1B, pickFromList(std::vector{Slot::P1A, Slot::P2A, Slot::P2B}, rngState)}; + MoveDecision p2AMoveDecision{Slot::P2A, pickFromList(std::vector{Slot::P2B, Slot::P1A, Slot::P1B}, rngState)}; + MoveDecision p2BMoveDecision{Slot::P2B, pickFromList(std::vector{Slot::P2A, Slot::P1A, Slot::P1B}, rngState)}; + p1AMoveDecision.move = pickFromList(battle.sides.p1().team[0].moves, rngState).name; + p1BMoveDecision.move = pickFromList(battle.sides.p1().team[1].moves, rngState).name; + p2AMoveDecision.move = pickFromList(battle.sides.p2().team[0].moves, rngState).name; + p2BMoveDecision.move = pickFromList(battle.sides.p2().team[1].moves, rngState).name; + + p1Decision.decisions = types::slotDecisions{p1AMoveDecision, p1BMoveDecision}; + p2Decision.decisions = types::slotDecisions{p2AMoveDecision, p2BMoveDecision}; } TurnDecisionInfo turnDecision{p1Decision, p2Decision}; for (auto& sideDecision : turnDecision) { for (auto& slotDecision : sideDecision.decisions.get()) { - if (simulation.pokedex().moveHas(slotDecision.moveOrItem.get())) { - slotDecision.targetSlot = slotDecision.sourceSlot; + if (simulation.pokedex().moveHas(slotDecision.get().move)) { + slotDecision.get().targetSlot = slotDecision.sourceSlot(); } } } diff --git a/benchmarks/VerticalSlices.cpp b/benchmarks/VerticalSlices.cpp index 881bb87..8e562f7 100644 --- a/benchmarks/VerticalSlices.cpp +++ b/benchmarks/VerticalSlices.cpp @@ -101,13 +101,11 @@ struct VerticalSlice { battleCreationInfo.runWithSimulateTurn = true; SideDecision p1Decision{PlayerSideId::P1}; SideDecision p2Decision{PlayerSideId::P2}; - SlotDecision p1SlotDecision{Slot::P1A, Slot::P2A}; - SlotDecision p2SlotDecision{Slot::P2A, Slot::P1A}; + MoveDecision p1MoveDecision{Slot::P1A, Slot::P2A, dex::Move::KNOCK_OFF}; + MoveDecision p2MoveDecision{Slot::P2A, Slot::P1A, dex::Move::THUNDERBOLT}; - p1SlotDecision.moveOrItem = dex::Move::KNOCK_OFF; - p1Decision.decisions = types::sideSlots{p1SlotDecision}; - p2SlotDecision.moveOrItem = dex::Move::THUNDERBOLT; - p2Decision.decisions = types::sideSlots{p2SlotDecision}; + p1Decision.decisions = types::slotDecisions{p1MoveDecision}; + p2Decision.decisions = types::slotDecisions{p2MoveDecision}; battleCreationInfo.decisionsToSimulate = {{p1Decision, p2Decision}}; simulation.createInitialStates({inputCount, battleCreationInfo}); @@ -124,17 +122,13 @@ struct VerticalSlice { battleCreationInfo.runWithSimulateTurn = true; SideDecision p1Decision{PlayerSideId::P1}; SideDecision p2Decision{PlayerSideId::P2}; - SlotDecision p1ASlotDecision{Slot::P1A, Slot::P2B}; - SlotDecision p1BSlotDecision{Slot::P1B, Slot::P2A}; - SlotDecision p2ASlotDecision{Slot::P2A, Slot::P1B}; - SlotDecision p2BSlotDecision{Slot::P2B, Slot::P2B}; - - p1ASlotDecision.moveOrItem = dex::Move::MOONBLAST; - p1BSlotDecision.moveOrItem = dex::Move::WILL_O_WISP; - p1Decision.decisions = types::sideSlots{p1ASlotDecision, p1BSlotDecision}; - p2ASlotDecision.moveOrItem = dex::Move::KNOCK_OFF; - p2BSlotDecision.moveOrItem = dex::Move::QUIVER_DANCE; - p2Decision.decisions = types::sideSlots{p2ASlotDecision, p2BSlotDecision}; + MoveDecision p1AMoveDecision{Slot::P1A, Slot::P2B, dex::Move::MOONBLAST}; + MoveDecision p1BMoveDecision{Slot::P1B, Slot::P2A, dex::Move::WILL_O_WISP}; + MoveDecision p2AMoveDecision{Slot::P2A, Slot::P1B, dex::Move::KNOCK_OFF}; + MoveDecision p2BMoveDecision{Slot::P2B, Slot::P2B, dex::Move::QUIVER_DANCE}; + + p1Decision.decisions = types::slotDecisions{p1AMoveDecision, p1BMoveDecision}; + p2Decision.decisions = types::slotDecisions{p2AMoveDecision, p2BMoveDecision}; battleCreationInfo.decisionsToSimulate = {{p1Decision, p2Decision}}; simulation.createInitialStates({inputCount, battleCreationInfo}); diff --git a/extras/PokeSim.cpp b/extras/PokeSim.cpp index 68fc2a1..25ae583 100644 --- a/extras/PokeSim.cpp +++ b/extras/PokeSim.cpp @@ -1142,7 +1142,7 @@ void check(const SideDecision& sideDecision) { checkPlayerSideId(sideDecision.sideId); if (sideDecision.decisions.holds()) { const types::slotDecisions& decisions = sideDecision.decisions.get(); - for (const SlotDecision& decision : decisions) { + for (const auto& decision : decisions) { check(decision); } } @@ -1300,10 +1300,26 @@ void check(const Winner& winner) { } template <> -void check(const SlotDecision& slotDecision) { - checkSlot(slotDecision.sourceSlot); - checkSlot(slotDecision.targetSlot); - POKESIM_REQUIRE_NM(!(slotDecision.megaEvolve && slotDecision.primalRevert)); +void check(const ActionQueue2&) {} + +template <> +void check(const types::slotDecision& slotDecision) { + checkSlot(slotDecision.sourceSlot()); + checkSlot(slotDecision.targetSlot()); + auto [moveDecision, megaDecision, zMoveDecision, dynamaxDecision, teraDecision, itemDecision] = slotDecision.get_if< + MoveDecision, + MegaEvolveAndMoveDecision, + ZMoveDecision, + DynamaxAndMoveDecision, + TerastallizeAndMoveDecision, + ItemDecision>(); + + if (moveDecision) check(MoveName{moveDecision->move}); + if (megaDecision) check(MoveName{megaDecision->move}); + if (zMoveDecision) check(MoveName{zMoveDecision->move}); + if (dynamaxDecision) check(MoveName{dynamaxDecision->move}); + if (teraDecision) check(MoveName{teraDecision->move}); + if (itemDecision) check(ItemName{itemDecision->item}); } template <> @@ -3176,43 +3192,70 @@ template void setRandomEventChances<5U>(types::handle, const Simulation&, const namespace pokesim::simulate_turn { namespace { -void resolveSlotDecisions( - types::handle sideHandle, const types::slotDecisions& decisions, ActionQueue& battleActionQueue) { - types::registry& registry = *sideHandle.registry(); - for (const SlotDecision& decision : decisions) { - POKESIM_REQUIRE(decision.sourceSlot != Slot::NONE, "Source slot must be assigned."); - POKESIM_REQUIRE(decision.targetSlot != Slot::NONE, "Target slot must be assigned."); +template +void resolveSlotDecision( + types::handle actionHandle, types::entity sideEntity, const types::slotDecision& slotDecision, + ActionQueue& actionQueue) { + if (!slotDecision.holds()) { + return; + } - types::handle actionHandle = {registry, registry.create()}; - actionHandle.emplace(decision.sourceSlot); - actionHandle.emplace(decision.targetSlot); + types::registry& registry = *actionHandle.registry(); + const auto& decision = slotDecision.get(); - SpeedSort speedSort; - types::entity sourceEntity = slotToPokemonEntity(registry, sideHandle.entity(), decision.sourceSlot); + POKESIM_REQUIRE(decision.sourceSlot != Slot::NONE, "Source slot must be assigned."); + POKESIM_REQUIRE(decision.targetSlot != Slot::NONE, "Target slot must be assigned."); - speedSort.speed = registry.get(sourceEntity).val; + actionHandle.emplace(decision.sourceSlot); + actionHandle.emplace(decision.targetSlot); - if (decision.choice.holds()) { - actionHandle.emplace(); - actionHandle.emplace(decision.choice.get()); + SpeedSort speedSort; + types::entity sourceEntity = slotToPokemonEntity(registry, sideEntity, decision.sourceSlot); + speedSort.speed = registry.get(sourceEntity).val; - speedSort.order = ActionOrder::MOVE; - speedSort.priority = Constants::MovePriority::DEFAULT; // TODO (aed3): Move priority + modify priority - speedSort.fractionalPriority = false; // TODO (aed3): get fractionalPriority - } - else if (decision.choice.holds()) { - actionHandle.emplace(); - actionHandle.emplace(decision.choice.get()); - speedSort.order = ActionOrder::ITEM; - } - else { - actionHandle.emplace(); - speedSort.order = ActionOrder::SWITCH; + if constexpr (std::is_base_of_v) { + speedSort.order = ActionOrder::MOVE; + speedSort.priority = Constants::MovePriority::DEFAULT; // TODO (aed3): Move priority + modify priority + speedSort.fractionalPriority = false; // TODO (aed3): get fractionalPriority + + actionHandle.emplace(); + actionHandle.emplace(decision.move); + + if constexpr (!std::is_same_v) { + POKESIM_REQUIRE_FAIL(std::string(entt::type_name().value()) + " is not yet supported."); } + } + else if constexpr (std::is_same_v) { + speedSort.order = ActionOrder::SWITCH; - actionHandle.emplace(speedSort); + actionHandle.emplace(); + } + else if constexpr (std::is_same_v) { + speedSort.order = ActionOrder::ITEM; + + actionHandle.emplace(); + actionHandle.emplace(decision.item); + } + else { + POKESIM_REQUIRE_FAIL(std::string(entt::type_name().value()) + " is not yet supported."); + } + + actionHandle.emplace(speedSort); + actionQueue.val.push_back(actionHandle.entity()); +} + +void resolveSlotDecisions(types::handle sideHandle, const types::slotDecisions& decisions, ActionQueue& actionQueue) { + types::registry& registry = *sideHandle.registry(); + for (const types::slotDecision& decision : decisions) { + types::handle actionHandle = {registry, registry.create()}; - battleActionQueue.val.push_back(actionHandle.entity()); + resolveSlotDecision(actionHandle, sideHandle.entity(), decision, actionQueue); + resolveSlotDecision(actionHandle, sideHandle.entity(), decision, actionQueue); + resolveSlotDecision(actionHandle, sideHandle.entity(), decision, actionQueue); + resolveSlotDecision(actionHandle, sideHandle.entity(), decision, actionQueue); + resolveSlotDecision(actionHandle, sideHandle.entity(), decision, actionQueue); + resolveSlotDecision(actionHandle, sideHandle.entity(), decision, actionQueue); + resolveSlotDecision(actionHandle, sideHandle.entity(), decision, actionQueue); } } @@ -3241,15 +3284,15 @@ void resolveDecision(types::handle sideHandle, const SideDecision& sideDecision) const auto& decisions = sideDecision.decisions.get(); #ifdef POKESIM_DEBUG_CHECK_UTILITIES - for (const SlotDecision& decision : decisions) { + for (const auto& decision : decisions) { if (sideDecision.sideId == PlayerSideId::P1) { POKESIM_REQUIRE( - (decision.sourceSlot == Slot::P1A || decision.sourceSlot == Slot::P1B), + (decision.sourceSlot() == Slot::P1A || decision.sourceSlot() == Slot::P1B), "Source must be from a player 1 in battle slot."); } else { POKESIM_REQUIRE( - (decision.sourceSlot == Slot::P2A || decision.sourceSlot == Slot::P2B), + (decision.sourceSlot() == Slot::P2A || decision.sourceSlot() == Slot::P2B), "Source must be from a player 2 in battle slot."); } } diff --git a/extras/PokeSim.hpp b/extras/PokeSim.hpp index 2e39f53..91c6670 100644 --- a/extras/PokeSim.hpp +++ b/extras/PokeSim.hpp @@ -83,8 +83,6 @@ * src/CalcDamage/Helpers.hpp * src/Types/Random.hpp * src/Components/Accuracy.hpp - * src/Types/Enums/ActionOrder.hpp - * src/Types/Move.hpp * src/Types/Enums/AddedTargets.hpp * src/Components/AddedTargets.hpp * src/Components/EntityHolders/Current.hpp @@ -96,6 +94,7 @@ * src/Types/Effect.hpp * src/Components/AnalyzeEffect/RemovedEffect.hpp * src/Components/BaseEffectChance.hpp + * src/Types/Move.hpp * src/Components/BasePower.hpp * src/Components/CalcDamage/Aliases.hpp * src/Types/Enums/GameMechanics.hpp @@ -157,6 +156,7 @@ * src/Components/SimulateTurn/TeamAction.hpp * src/Components/SimulationResults.hpp * src/Components/SpeciesTypes.hpp + * src/Types/Enums/ActionOrder.hpp * src/Components/SpeedSort.hpp * src/Components/Stats.hpp * src/Components/Tags/AbilityTags.hpp @@ -18257,74 +18257,6 @@ struct Accuracy { ////////////////////// END OF src/Components/Accuracy.hpp ////////////////////// -/////////////////// START OF src/Types/Enums/ActionOrder.hpp /////////////////// - -namespace pokesim { -enum class ActionOrder : std::uint8_t { - NONE = std::numeric_limits>::max(), - TEAM = 1U, - START = 2U, - BEFORE_TURN = 4U, - ITEM = BEFORE_TURN, - - SWITCH = 103U, - - MOVE = 200U, - - RESIDUAL = 254U, -}; - -static constexpr inline std::array VALID_ACTION_ORDERS = { - ActionOrder::NONE, - ActionOrder::TEAM, - ActionOrder::START, - ActionOrder::BEFORE_TURN, - ActionOrder::ITEM, - ActionOrder::SWITCH, - ActionOrder::MOVE, - ActionOrder::RESIDUAL, -}; -} // namespace pokesim - -//////////////////// END OF src/Types/Enums/ActionOrder.hpp //////////////////// - -///////////////////////// START OF src/Types/Move.hpp ////////////////////////// - -namespace pokesim::types { -using pp = pokesim::internal::unsignedIntType; -using basePower = pokesim::internal::unsignedIntType; -using power = pokesim::internal::unsignedIntType; -using baseAccuracy = pokesim::internal::unsignedIntType; -using moveHits = pokesim::internal::unsignedIntType; - -using priority = pokesim::internal::signedIntType; -using fractionalPriority = bool; -} // namespace pokesim::types - -////////////////////////// END OF src/Types/Move.hpp /////////////////////////// - -/////////////////// START OF src/Components/ActionQueue.hpp //////////////////// - -namespace pokesim { -struct ActionQueue2 { - // Order of the types of actions (lower first) - ActionOrder order = ActionOrder::NONE; - // Priority of the action (higher first) - types::priority priority = Constants::MovePriority::DEFAULT; - // Whether negative fractional priority is active for the action (false first) - types::fractionalPriority fractionalPriority = false; - // Speed of Pokemon using move (higher first if priority tie) - types::stat speed = Constants::PokemonEffectiveStat::DEFAULT; - - bool operator==(const ActionQueue2& other) const { - return order == other.order && priority == other.priority && fractionalPriority == other.fractionalPriority && - speed == other.speed; - } -}; -} // namespace pokesim - -//////////////////// END OF src/Components/ActionQueue.hpp ///////////////////// - ////////////////// START OF src/Types/Enums/AddedTargets.hpp /////////////////// namespace pokesim { @@ -18551,22 +18483,32 @@ class variant : public std::variant { return *this; } - bool empty() const { return holds(); } + constexpr bool empty() const { return holds(); } template - bool holds() const { + constexpr bool holds() const { return std::holds_alternative(*this); } template - auto& get() const { + constexpr auto& get() const { return std::get(*this); } template - auto& get() { + constexpr auto& get() { return std::get(*this); } + + template + constexpr auto get_if() const { + return std::forward_as_tuple(std::get_if(this)...); + } + + template + constexpr auto get_if() { + return std::forward_as_tuple(std::get_if(this)...); + } }; } // namespace pokesim::internal @@ -18606,6 +18548,21 @@ struct BaseEffectChance { ////////////////// END OF src/Components/BaseEffectChance.hpp ////////////////// +///////////////////////// START OF src/Types/Move.hpp ////////////////////////// + +namespace pokesim::types { +using pp = pokesim::internal::unsignedIntType; +using basePower = pokesim::internal::unsignedIntType; +using power = pokesim::internal::unsignedIntType; +using baseAccuracy = pokesim::internal::unsignedIntType; +using moveHits = pokesim::internal::unsignedIntType; + +using priority = pokesim::internal::signedIntType; +using fractionalPriority = bool; +} // namespace pokesim::types + +////////////////////////// END OF src/Types/Move.hpp /////////////////////////// + //////////////////// START OF src/Components/BasePower.hpp ///////////////////// namespace pokesim { @@ -19410,28 +19367,61 @@ struct RandomEventIndex { /////////////////////// START OF src/Types/Decisions.hpp /////////////////////// namespace pokesim { -struct SlotDecision { +struct MoveDecision { Slot sourceSlot = Slot::NONE; Slot targetSlot = Slot::NONE; - bool megaEvolve = false; - bool primalRevert = false; - bool dynamax = false; - bool terastallize = false; + dex::Move move = dex::Move::NO_MOVE; - internal::variant choice; + bool operator==(const MoveDecision& other) const { + return sourceSlot == other.sourceSlot && targetSlot == other.targetSlot && move == other.move; + } +}; - bool operator==(const SlotDecision& other) const { - return sourceSlot == other.sourceSlot && targetSlot == other.targetSlot && megaEvolve == other.megaEvolve && - primalRevert == other.primalRevert && dynamax == other.dynamax && terastallize == other.terastallize && - choice == other.choice; +struct MegaEvolveAndMoveDecision : MoveDecision {}; +struct ZMoveDecision : MoveDecision {}; +struct DynamaxAndMoveDecision : MoveDecision {}; +struct TerastallizeAndMoveDecision : MoveDecision {}; + +struct SwitchDecision { + Slot sourceSlot = Slot::NONE; + Slot targetSlot = Slot::NONE; + + bool operator==(const SwitchDecision& other) const { + return sourceSlot == other.sourceSlot && targetSlot == other.targetSlot; + } +}; + +struct ItemDecision { + Slot sourceSlot = Slot::NONE; + Slot targetSlot = Slot::NONE; + + dex::Item item = dex::Item::NO_ITEM; + + bool operator==(const ItemDecision& other) const { + return sourceSlot == other.sourceSlot && targetSlot == other.targetSlot && item == other.item; } }; namespace types { -using slotDecisions = types::sideSlots; -} +struct slotDecision : pokesim::internal::variant< + MoveDecision, MegaEvolveAndMoveDecision, TerastallizeAndMoveDecision, DynamaxAndMoveDecision, + ZMoveDecision, SwitchDecision, ItemDecision> { + using pokesim::internal::variant< + MoveDecision, MegaEvolveAndMoveDecision, TerastallizeAndMoveDecision, DynamaxAndMoveDecision, ZMoveDecision, + SwitchDecision, ItemDecision>::variant; + + constexpr Slot sourceSlot() const { + return std::visit([](auto&& decision) { return decision.sourceSlot; }, *this); + } + + constexpr Slot targetSlot() const { + return std::visit([](auto&& decision) { return decision.targetSlot; }, *this); + } +}; +using slotDecisions = types::sideSlots; +} // namespace types } // namespace pokesim //////////////////////// END OF src/Types/Decisions.hpp //////////////////////// @@ -19625,6 +19615,37 @@ struct SpeciesTypes { //////////////////// END OF src/Components/SpeciesTypes.hpp //////////////////// +/////////////////// START OF src/Types/Enums/ActionOrder.hpp /////////////////// + +namespace pokesim { +enum class ActionOrder : std::uint8_t { + NONE = std::numeric_limits>::max(), + TEAM = 1U, + START = 2U, + BEFORE_TURN = 4U, + ITEM = BEFORE_TURN, + + SWITCH = 103U, + + MOVE = 200U, + + RESIDUAL = 254U, +}; + +static constexpr inline std::array VALID_ACTION_ORDERS = { + ActionOrder::NONE, + ActionOrder::TEAM, + ActionOrder::START, + ActionOrder::BEFORE_TURN, + ActionOrder::ITEM, + ActionOrder::SWITCH, + ActionOrder::MOVE, + ActionOrder::RESIDUAL, +}; +} // namespace pokesim + +//////////////////// END OF src/Types/Enums/ActionOrder.hpp //////////////////// + //////////////////// START OF src/Components/SpeedSort.hpp ///////////////////// namespace pokesim { @@ -20858,7 +20879,7 @@ template <> void check(const Winner&); template <> -void check(const SlotDecision&); +void check(const types::slotDecision&); template <> void check(const DamageRollKind&); @@ -23017,13 +23038,7 @@ struct SimulationSetupChecks { const auto& slotDecision = slotDecisions[slot]; const auto& slotDecisionInfo = slotDecisionsInfo[slot]; - POKESIM_REQUIRE_NM(slotDecision.sourceSlot == slotDecisionInfo.sourceSlot); - POKESIM_REQUIRE_NM(slotDecision.targetSlot == slotDecisionInfo.targetSlot); - POKESIM_REQUIRE_NM(slotDecision.megaEvolve == slotDecisionInfo.megaEvolve); - POKESIM_REQUIRE_NM(slotDecision.primalRevert == slotDecisionInfo.primalRevert); - POKESIM_REQUIRE_NM(slotDecision.dynamax == slotDecisionInfo.dynamax); - POKESIM_REQUIRE_NM(slotDecision.terastallize == slotDecisionInfo.terastallize); - POKESIM_REQUIRE_NM(slotDecision.choice == slotDecisionInfo.choice); + POKESIM_REQUIRE_NM(slotDecision == slotDecisionInfo); } } else if (sideDecisionInfo.decisions.holds()) { diff --git a/extras/RecentBenchmarkResults.md b/extras/RecentBenchmarkResults.md index fa5d66e..d5a9344 100644 --- a/extras/RecentBenchmarkResults.md +++ b/extras/RecentBenchmarkResults.md @@ -7,286 +7,286 @@ ## SV-SingleBattle-MonteCarlo-SimulateTurn-VerticalSlice1 | Inputs | Samples | Iterations / Sample | Estimated Completion Time | Mean of Samples | Standard Deviation | Mean / Input Count | Mean Lower Bound / Input Count | Mean Upper Bound / Input Count | | --- | --- | --- | --- | --- | --- | --- | --- | --- | -| 1 | 100 | 1 | 44.029500ms | 75.632500us | 16.891916us | 75.632500us | 73.157540us | 80.410500us | -| 2 | 100 | 1 | 45.369300ms | 79.460290us | 11.066830us | 39.730145us | 38.915290us | 41.277665us | -| 4 | 100 | 1 | 47.512500ms | 92.860650us | 16.681993us | 23.215162us | 22.611717us | 24.405757us | -| 8 | 100 | 1 | 50.457400ms | 115.421890us | 17.903684us | 14.427736us | 14.096700us | 15.053341us | -| 16 | 100 | 1 | 56.131800ms | 155.278370us | 17.556719us | 9.704898us | 9.549842us | 10.026832us | -| 32 | 100 | 1 | 63.795400ms | 214.437530us | 17.032001us | 6.701173us | 6.629717us | 6.872996us | -| 64 | 100 | 1 | 78.287900ms | 340.158840us | 15.750151us | 5.314982us | 5.280022us | 5.387716us | -| 128 | 100 | 1 | 101.733100ms | 558.419380us | 10.558445us | 4.362651us | 4.351217us | 4.388097us | -| 256 | 100 | 1 | 149.622100ms | 1.000598ms | 14.312407us | 3.908587us | 3.901044us | 3.926319us | -| 512 | 100 | 1 | 236.239200ms | 1.820739ms | 13.325735us | 3.556130us | 3.551765us | 3.562212us | -| 1024 | 100 | 1 | 428.562500ms | 3.541910ms | 39.308537us | 3.458896us | 3.452260us | 3.467527us | -| 2048 | 100 | 1 | 848.924700ms | 6.974401ms | 68.079016us | 3.405469us | 3.399840us | 3.413186us | -| 4096 | 100 | 1 | 1454.160300ms | 13.982603ms | 251.906250us | 3.413721us | 3.402751us | 3.427023us | -| 8192 | 100 | 1 | 2903.354900ms | 28.292495ms | 338.035595us | 3.453674us | 3.446253us | 3.462538us | -| 16384 | 100 | 1 | 5831.620800ms | 58.728308ms | 610.480429us | 3.584491us | 3.577905us | 3.592682us | -| 32768 | 100 | 1 | 12211.195800ms | 121.584597ms | 1.321293ms | 3.710467us | 3.703610us | 3.719742us | -| 65536 | 100 | 1 | 28366.533200ms | 252.820864ms | 7.424520ms | 3.857740us | 3.837449us | 3.882155us | +| 1 | 100 | 1 | 45.586600ms | 72.612160us | 36.870301us | 72.612160us | 68.047960us | 86.833730us | +| 2 | 100 | 1 | 45.360000ms | 78.903690us | 13.716725us | 39.451845us | 38.663290us | 42.418775us | +| 4 | 100 | 1 | 47.979000ms | 91.269010us | 12.313323us | 22.817252us | 22.393313us | 23.790180us | +| 8 | 100 | 1 | 51.805500ms | 113.429860us | 14.740678us | 14.178733us | 13.925684us | 14.756475us | +| 16 | 100 | 1 | 56.845400ms | 154.173530us | 13.831314us | 9.635846us | 9.526197us | 9.940584us | +| 32 | 100 | 1 | 65.834300ms | 219.595020us | 16.694929us | 6.862344us | 6.795959us | 7.048406us | +| 64 | 100 | 1 | 79.222300ms | 337.052180us | 11.963431us | 5.266440us | 5.242059us | 5.329134us | +| 128 | 100 | 1 | 101.996900ms | 567.496590us | 33.538267us | 4.433567us | 4.403642us | 4.543706us | +| 256 | 100 | 1 | 152.568600ms | 1.006173ms | 11.046391us | 3.930365us | 3.923118us | 3.940410us | +| 512 | 100 | 1 | 243.114600ms | 1.846706ms | 25.752537us | 3.606847us | 3.598646us | 3.618895us | +| 1024 | 100 | 1 | 440.402000ms | 3.567251ms | 37.778364us | 3.483644us | 3.476871us | 3.491402us | +| 2048 | 100 | 1 | 862.438600ms | 7.025896ms | 79.199517us | 3.430613us | 3.423856us | 3.439235us | +| 4096 | 100 | 1 | 1446.821700ms | 13.976661ms | 161.507938us | 3.412271us | 3.405289us | 3.420820us | +| 8192 | 100 | 1 | 2887.719700ms | 28.465571ms | 325.447651us | 3.474801us | 3.467713us | 3.483333us | +| 16384 | 100 | 1 | 5943.221900ms | 59.166400ms | 633.777646us | 3.611230us | 3.604239us | 3.619450us | +| 32768 | 100 | 1 | 12138.322500ms | 122.010729ms | 1.047967ms | 3.723472us | 3.717506us | 3.730022us | +| 65536 | 100 | 1 | 28543.582300ms | 254.573653ms | 8.262153ms | 3.884486us | 3.861702us | 3.911339us | ## SV-SingleBattle-Branching-SimulateTurn-VerticalSlice1 | Inputs | Samples | Iterations / Sample | Estimated Completion Time | Mean of Samples | Standard Deviation | Mean / Input Count | Mean Lower Bound / Input Count | Mean Upper Bound / Input Count | | --- | --- | --- | --- | --- | --- | --- | --- | --- | -| 1 | 100 | 1 | 63.326100ms | 207.384100us | 17.924075us | 207.384100us | 204.979030us | 213.268670us | -| 2 | 100 | 1 | 40.075400ms | 294.191300us | 12.497293us | 147.095650us | 146.196985us | 148.874855us | -| 4 | 100 | 1 | 52.044700ms | 429.042680us | 17.852416us | 107.260670us | 106.697375us | 108.842913us | -| 8 | 100 | 1 | 82.571000ms | 691.506360us | 12.535121us | 86.438295us | 86.229929us | 86.948469us | -| 16 | 100 | 1 | 135.499400ms | 1.201738ms | 21.053460us | 75.108598us | 74.894516us | 75.426155us | -| 32 | 100 | 1 | 240.369100ms | 2.173825ms | 33.618715us | 67.932036us | 67.737280us | 68.148797us | -| 64 | 100 | 1 | 440.957700ms | 4.090539ms | 49.867730us | 63.914667us | 63.775419us | 64.082196us | -| 128 | 100 | 1 | 845.050100ms | 7.798878ms | 84.804326us | 60.928733us | 60.809988us | 61.070542us | -| 256 | 100 | 1 | 1584.434200ms | 15.129526ms | 161.942675us | 59.099709us | 58.986060us | 59.235967us | -| 512 | 100 | 1 | 2930.491500ms | 28.750891ms | 302.301620us | 56.154084us | 56.049431us | 56.283890us | -| 1024 | 100 | 1 | 5816.175900ms | 56.923884ms | 975.657910us | 55.589730us | 55.432520us | 55.814606us | -| 2048 | 100 | 1 | 11864.786600ms | 116.007679ms | 1.702635ms | 56.644374us | 56.513481us | 56.854391us | -| 4096 | 100 | 1 | 25242.342200ms | 254.463069ms | 3.089584ms | 62.124773us | 61.989318us | 62.287463us | -| 8192 | 100 | 1 | 56374.694400ms | 564.375894ms | 2.680058ms | 68.893542us | 68.834099us | 68.963391us | +| 1 | 100 | 1 | 62.413200ms | 212.262920us | 12.260236us | 212.262920us | 210.761250us | 216.880840us | +| 2 | 100 | 1 | 40.747900ms | 295.356840us | 15.038254us | 147.678420us | 146.745300us | 150.498715us | +| 4 | 100 | 1 | 53.213300ms | 438.008600us | 12.252830us | 109.502150us | 109.096490us | 110.508105us | +| 8 | 100 | 1 | 82.873100ms | 709.100450us | 12.901636us | 88.637556us | 88.416869us | 89.143395us | +| 16 | 100 | 1 | 140.976100ms | 1.220784ms | 21.304769us | 76.299016us | 76.052406us | 76.575449us | +| 32 | 100 | 1 | 243.951500ms | 2.205185ms | 30.267656us | 68.912029us | 68.775715us | 69.189863us | +| 64 | 100 | 1 | 458.172000ms | 4.161231ms | 53.025267us | 65.019233us | 64.876231us | 65.206469us | +| 128 | 100 | 1 | 863.819400ms | 8.036071ms | 69.393793us | 62.781806us | 62.686053us | 62.902105us | +| 256 | 100 | 1 | 1662.278100ms | 15.623492ms | 187.195075us | 61.029265us | 60.903714us | 61.194300us | +| 512 | 100 | 1 | 3082.813100ms | 29.907497ms | 297.660407us | 58.413080us | 58.311218us | 58.542328us | +| 1024 | 100 | 1 | 6142.838700ms | 59.704664ms | 1.136477ms | 58.305336us | 58.147228us | 58.631954us | +| 2048 | 100 | 1 | 12157.960200ms | 122.354378ms | 1.960724ms | 59.743349us | 59.584370us | 59.968807us | +| 4096 | 100 | 1 | 26496.501900ms | 268.116796ms | 2.985465ms | 65.458202us | 65.322643us | 65.608708us | +| 8192 | 100 | 1 | 58551.333900ms | 590.918014ms | 3.141484ms | 72.133547us | 72.059976us | 72.210254us | ## SV-DoubleBattle-MonteCarlo-SimulateTurn-VerticalSlice1 | Inputs | Samples | Iterations / Sample | Estimated Completion Time | Mean of Samples | Standard Deviation | Mean / Input Count | Mean Lower Bound / Input Count | Mean Upper Bound / Input Count | | --- | --- | --- | --- | --- | --- | --- | --- | --- | -| 1 | 100 | 1 | 56.026000ms | 111.917070us | 17.538929us | 111.917070us | 109.623640us | 117.805190us | -| 2 | 100 | 1 | 59.237800ms | 133.325430us | 17.740473us | 66.662715us | 65.275735us | 68.949255us | -| 4 | 100 | 1 | 62.355800ms | 162.740380us | 18.184432us | 40.685095us | 39.963110us | 41.819720us | -| 8 | 100 | 1 | 68.179000ms | 198.898520us | 17.328945us | 24.862315us | 24.558199us | 25.512057us | -| 16 | 100 | 1 | 47.832500ms | 280.795990us | 12.394938us | 17.549749us | 17.431231us | 17.755721us | -| 32 | 100 | 1 | 60.386200ms | 392.112930us | 12.850809us | 12.253529us | 12.200318us | 12.384679us | -| 64 | 100 | 1 | 85.508100ms | 624.595410us | 39.464673us | 9.759303us | 9.691726us | 10.021686us | -| 128 | 100 | 1 | 117.156700ms | 1.057714ms | 12.496845us | 8.263390us | 8.249262us | 8.291430us | -| 256 | 100 | 1 | 203.291300ms | 1.901762ms | 22.037377us | 7.428759us | 7.415111us | 7.450379us | -| 512 | 100 | 1 | 376.630200ms | 3.618163ms | 54.883556us | 7.066724us | 7.047282us | 7.089583us | -| 1024 | 100 | 1 | 718.465000ms | 6.837126ms | 83.280908us | 6.676881us | 6.662907us | 6.695164us | -| 2048 | 100 | 1 | 1396.415300ms | 13.582631ms | 259.738901us | 6.632144us | 6.610055us | 6.660136us | -| 4096 | 100 | 1 | 2726.230700ms | 26.978901ms | 458.894166us | 6.586646us | 6.566693us | 6.611001us | +| 1 | 100 | 1 | 56.139100ms | 113.915600us | 17.038369us | 113.915600us | 111.829690us | 120.483810us | +| 2 | 100 | 1 | 59.579600ms | 139.103680us | 15.740024us | 69.551840us | 68.436825us | 71.856225us | +| 4 | 100 | 1 | 63.010200ms | 164.520690us | 28.411635us | 41.130173us | 40.137960us | 43.285897us | +| 8 | 100 | 1 | 68.364300ms | 198.752600us | 18.831438us | 24.844075us | 24.522119us | 25.589527us | +| 16 | 100 | 1 | 48.822200ms | 274.142030us | 20.597218us | 17.133877us | 16.947761us | 17.506199us | +| 32 | 100 | 1 | 62.115000ms | 399.004660us | 12.203792us | 12.468896us | 12.420193us | 12.600902us | +| 64 | 100 | 1 | 88.468400ms | 626.797780us | 13.165536us | 9.793715us | 9.765039us | 9.856547us | +| 128 | 100 | 1 | 118.160900ms | 1.068353ms | 13.237349us | 8.346507us | 8.331137us | 8.375140us | +| 256 | 100 | 1 | 207.517400ms | 1.931110ms | 24.321584us | 7.543400us | 7.526393us | 7.563830us | +| 512 | 100 | 1 | 385.870500ms | 3.619361ms | 42.236813us | 7.069064us | 7.053958us | 7.086490us | +| 1024 | 100 | 1 | 715.116200ms | 6.869895ms | 73.579681us | 6.708881us | 6.695679us | 6.724093us | +| 2048 | 100 | 1 | 1400.109800ms | 13.565039ms | 158.008791us | 6.623554us | 6.609585us | 6.640140us | +| 4096 | 100 | 1 | 2743.989200ms | 27.144909ms | 374.595875us | 6.627175us | 6.610915us | 6.647117us | ## SV-DoubleBattle-Branching-SimulateTurn-VerticalSlice1 | Inputs | Samples | Iterations / Sample | Estimated Completion Time | Mean of Samples | Standard Deviation | Mean / Input Count | Mean Lower Bound / Input Count | Mean Upper Bound / Input Count | | --- | --- | --- | --- | --- | --- | --- | --- | --- | -| 1 | 100 | 1 | 75.734100ms | 499.265850us | 14.653648us | 499.265850us | 497.206850us | 503.626890us | -| 2 | 100 | 1 | 87.060100ms | 744.817570us | 15.247880us | 372.408785us | 371.378890us | 374.832570us | -| 4 | 100 | 1 | 137.278800ms | 1.207385ms | 15.395407us | 301.846232us | 301.356718us | 303.209085us | -| 8 | 100 | 1 | 232.646100ms | 2.101532ms | 27.644495us | 262.691537us | 262.042782us | 263.407884us | -| 16 | 100 | 1 | 408.703600ms | 3.768345ms | 43.039830us | 235.521569us | 235.046412us | 236.107916us | -| 32 | 100 | 1 | 746.505700ms | 7.069875ms | 79.465706us | 220.933584us | 220.499477us | 221.480990us | -| 64 | 100 | 1 | 1413.238100ms | 13.445983ms | 128.721662us | 210.093491us | 209.741900us | 210.539368us | -| 128 | 100 | 1 | 2748.341900ms | 26.330205ms | 666.798954us | 205.704729us | 205.000682us | 207.352873us | -| 256 | 100 | 1 | 5472.347300ms | 52.702525ms | 820.461889us | 205.869239us | 205.320629us | 206.592227us | -| 512 | 100 | 1 | 10800.876300ms | 104.334716ms | 1.861118ms | 203.778743us | 203.171770us | 204.635671us | -| 1024 | 100 | 1 | 21396.865900ms | 215.835776ms | 2.395934ms | 210.777125us | 210.370643us | 211.299570us | -| 2048 | 100 | 1 | 45058.499900ms | 444.625341ms | 2.447193ms | 217.102217us | 216.882815us | 217.353607us | -| 4096 | 100 | 1 | 93722.427500ms | 937.827466ms | 4.794415ms | 228.961784us | 228.750680us | 229.212800us | +| 1 | 100 | 1 | 76.056400ms | 512.683740us | 15.685977us | 512.683740us | 510.606340us | 517.815100us | +| 2 | 100 | 1 | 87.503800ms | 766.571190us | 16.545056us | 383.285595us | 382.201860us | 386.029200us | +| 4 | 100 | 1 | 141.025000ms | 1.248618ms | 20.239379us | 312.154532us | 311.412643us | 313.565497us | +| 8 | 100 | 1 | 239.094500ms | 2.123076ms | 29.190160us | 265.384481us | 264.745864us | 266.194028us | +| 16 | 100 | 1 | 409.526400ms | 3.824705ms | 54.272343us | 239.044094us | 238.492109us | 239.862944us | +| 32 | 100 | 1 | 769.334600ms | 7.272913ms | 68.357248us | 227.278545us | 226.883450us | 227.723038us | +| 64 | 100 | 1 | 1468.781500ms | 13.845677ms | 137.976061us | 216.338703us | 215.968656us | 216.828335us | +| 128 | 100 | 1 | 2839.736700ms | 27.081953ms | 403.486162us | 211.577761us | 211.058874us | 212.339617us | +| 256 | 100 | 1 | 5686.503300ms | 54.560356ms | 1.388467ms | 213.126389us | 212.324214us | 214.620379us | +| 512 | 100 | 1 | 10872.876500ms | 109.268916ms | 2.113869ms | 213.415851us | 212.782351us | 214.522748us | +| 1024 | 100 | 1 | 22829.154600ms | 226.982693ms | 2.681968ms | 221.662786us | 221.215660us | 222.255564us | +| 2048 | 100 | 1 | 46357.208600ms | 466.699115ms | 3.012516ms | 227.880427us | 227.622006us | 228.204529us | +| 4096 | 100 | 1 | 97962.181500ms | 982.613498ms | 4.244872ms | 239.895874us | 239.702751us | 240.111496us | ## SV-SingleBattle-CalcDamage-VerticalSlice1 | Inputs | Samples | Iterations / Sample | Estimated Completion Time | Mean of Samples | Standard Deviation | Mean / Input Count | Mean Lower Bound / Input Count | Mean Upper Bound / Input Count | | --- | --- | --- | --- | --- | --- | --- | --- | --- | -| 1 | 100 | 1 | 7.805000ms | 10.148600us | 3.932472us | 10.148600us | 9.597960us | 11.319660us | -| 2 | 100 | 1 | 7.956200ms | 11.637310us | 4.118370us | 5.818655us | 5.527020us | 6.417360us | -| 4 | 100 | 1 | 8.063000ms | 11.730230us | 4.097670us | 2.932557us | 2.789190us | 3.240847us | -| 8 | 100 | 1 | 8.522600ms | 13.006880us | 3.381656us | 1.625860us | 1.569172us | 1.768951us | -| 16 | 100 | 1 | 9.036600ms | 16.858910us | 3.226078us | 1.053682us | 1.026213us | 1.117203us | -| 32 | 100 | 1 | 10.295900ms | 23.402530us | 2.662114us | 731.329062ns | 719.160313ns | 754.539062ns | -| 64 | 100 | 1 | 11.105900ms | 36.368170us | 10.717078us | 568.252656ns | 548.399219ns | 637.319062ns | -| 128 | 100 | 1 | 13.731600ms | 57.335240us | 3.395772us | 447.931562ns | 443.922500ns | 455.033984ns | -| 256 | 100 | 1 | 18.858800ms | 104.318610us | 12.265081us | 407.494570ns | 401.884687ns | 426.889414ns | -| 512 | 100 | 1 | 35.305200ms | 192.360300us | 10.633042us | 375.703711ns | 373.238730ns | 384.164180ns | -| 1024 | 100 | 1 | 62.715100ms | 371.446800us | 5.881813us | 362.741016ns | 361.711533ns | 363.983301ns | -| 2048 | 100 | 1 | 116.645800ms | 727.678610us | 10.772259us | 355.311821ns | 354.394902ns | 356.469268ns | -| 4096 | 100 | 1 | 192.703900ms | 1.434532ms | 16.914691us | 350.227529ns | 349.527559ns | 351.182546ns | -| 8192 | 100 | 1 | 449.847200ms | 2.961202ms | 34.260009us | 361.474825ns | 360.760328ns | 362.422217ns | -| 16384 | 100 | 1 | 891.671200ms | 6.092752ms | 102.530158us | 371.872061ns | 370.879758ns | 373.422484ns | -| 32768 | 100 | 1 | 1787.578200ms | 12.383221ms | 154.812409us | 377.905914ns | 377.115583ns | 379.013234ns | -| 65536 | 100 | 1 | 3600.531300ms | 26.009269ms | 332.827964us | 396.869944ns | 396.027262ns | 398.079925ns | +| 1 | 100 | 1 | 8.108700ms | 9.910560us | 3.735469us | 9.910560us | 9.406760us | 11.147770us | +| 2 | 100 | 1 | 8.321300ms | 11.230630us | 3.813415us | 5.615315us | 5.359100us | 6.245805us | +| 4 | 100 | 1 | 8.694600ms | 11.532080us | 3.708387us | 2.883020us | 2.758223us | 3.194898us | +| 8 | 100 | 1 | 8.803700ms | 12.784660us | 2.556226us | 1.598083us | 1.561088us | 1.740395us | +| 16 | 100 | 1 | 9.307100ms | 16.470550us | 2.340975us | 1.029409us | 1.009974us | 1.078093us | +| 32 | 100 | 1 | 9.889700ms | 22.984090us | 2.874482us | 718.252813ns | 707.108750ns | 752.316563ns | +| 64 | 100 | 1 | 11.188100ms | 34.568110us | 3.604282us | 540.126719ns | 532.311563ns | 557.494844ns | +| 128 | 100 | 1 | 13.900500ms | 58.237640us | 16.721370us | 454.981562ns | 440.525547ns | 516.017969ns | +| 256 | 100 | 1 | 19.034000ms | 102.547090us | 14.584170us | 400.574570ns | 394.055820ns | 424.778125ns | +| 512 | 100 | 1 | 35.707200ms | 192.139570us | 7.730298us | 375.272598ns | 373.040059ns | 379.466094ns | +| 1024 | 100 | 1 | 62.002000ms | 368.642630us | 7.257515us | 360.002568ns | 358.798115ns | 361.644727ns | +| 2048 | 100 | 1 | 117.150400ms | 722.584340us | 9.720684us | 352.824385ns | 352.036665ns | 353.937905ns | +| 4096 | 100 | 1 | 224.368400ms | 1.437033ms | 23.528150us | 350.838074ns | 349.813093ns | 352.084641ns | +| 8192 | 100 | 1 | 449.585500ms | 2.983118ms | 47.687215us | 364.150181ns | 363.065052ns | 365.357142ns | +| 16384 | 100 | 1 | 901.485100ms | 6.080521ms | 87.803068us | 371.125577ns | 370.250431ns | 372.418959ns | +| 32768 | 100 | 1 | 1830.961600ms | 12.348842ms | 144.123008us | 376.856736ns | 376.069455ns | 377.802163ns | +| 65536 | 100 | 1 | 3568.540600ms | 25.829382ms | 239.418815us | 394.125087ns | 393.465028ns | 394.902408ns | ## SV-SingleBattle-AnalyzeEffect-VerticalSlice1 | Inputs | Samples | Iterations / Sample | Estimated Completion Time | Mean of Samples | Standard Deviation | Mean / Input Count | Mean Lower Bound / Input Count | Mean Upper Bound / Input Count | | --- | --- | --- | --- | --- | --- | --- | --- | --- | -| 1 | 100 | 1 | 25.017300ms | 57.362780us | 7.723882us | 57.362780us | 56.232220us | 59.524990us | -| 2 | 100 | 1 | 25.792200ms | 65.773780us | 10.226176us | 32.886890us | 32.206410us | 34.597475us | -| 4 | 100 | 1 | 31.433800ms | 86.153040us | 8.319707us | 21.538260us | 21.252480us | 22.174268us | -| 8 | 100 | 1 | 20.729700ms | 121.878110us | 9.823295us | 15.234764us | 15.078314us | 15.668781us | -| 16 | 100 | 1 | 24.893100ms | 190.898190us | 10.847117us | 11.931137us | 11.847597us | 12.191246us | -| 32 | 100 | 1 | 40.910200ms | 325.556950us | 10.040326us | 10.173655us | 10.125758us | 10.257261us | -| 64 | 100 | 1 | 70.098900ms | 575.824000us | 10.810787us | 8.997250us | 8.966942us | 9.033563us | -| 128 | 100 | 1 | 127.803800ms | 1.073376ms | 8.765340us | 8.385753us | 8.373479us | 8.400464us | -| 256 | 100 | 1 | 236.836900ms | 2.020172ms | 34.690419us | 7.891298us | 7.871738us | 7.930043us | -| 512 | 100 | 1 | 451.140200ms | 3.929758ms | 34.347151us | 7.675309us | 7.664603us | 7.692117us | -| 1024 | 100 | 1 | 874.940200ms | 7.801300ms | 65.389170us | 7.618457us | 7.607831us | 7.633280us | -| 2048 | 100 | 1 | 1737.223500ms | 15.466035ms | 161.158203us | 7.551775us | 7.537787us | 7.569075us | -| 4096 | 100 | 1 | 3481.727300ms | 31.028165ms | 497.336764us | 7.575236us | 7.555017us | 7.603478us | -| 8192 | 100 | 1 | 7607.677000ms | 71.308510ms | 1.389798ms | 8.704652us | 8.675639us | 8.743119us | +| 1 | 100 | 1 | 27.867500ms | 53.619000us | 8.122014us | 53.619000us | 52.526650us | 56.245270us | +| 2 | 100 | 1 | 29.248200ms | 64.366620us | 9.969053us | 32.183310us | 31.603870us | 34.258040us | +| 4 | 100 | 1 | 31.854000ms | 90.441970us | 10.660729us | 22.610492us | 22.260535us | 23.520257us | +| 8 | 100 | 1 | 20.686900ms | 123.996190us | 9.081815us | 15.499524us | 15.358738us | 15.922013us | +| 16 | 100 | 1 | 26.006700ms | 192.332370us | 7.817704us | 12.020773us | 11.959454us | 12.194928us | +| 32 | 100 | 1 | 41.825100ms | 323.087400us | 8.460468us | 10.096481us | 10.060330us | 10.179903us | +| 64 | 100 | 1 | 71.103800ms | 580.960770us | 10.962616us | 9.077512us | 9.051515us | 9.123853us | +| 128 | 100 | 1 | 131.771700ms | 1.099483ms | 15.815319us | 8.589707us | 8.567374us | 8.615986us | +| 256 | 100 | 1 | 236.697000ms | 2.061947ms | 27.134031us | 8.054482us | 8.034776us | 8.076504us | +| 512 | 100 | 1 | 456.283300ms | 4.043922ms | 39.222287us | 7.898285us | 7.884007us | 7.914252us | +| 1024 | 100 | 1 | 891.956700ms | 7.987767ms | 223.056717us | 7.800553us | 7.774178us | 7.884741us | +| 2048 | 100 | 1 | 1764.105000ms | 15.810163ms | 193.079827us | 7.719806us | 7.703045us | 7.740206us | +| 4096 | 100 | 1 | 3553.940900ms | 32.413781ms | 802.882284us | 7.913521us | 7.879854us | 7.957355us | +| 8192 | 100 | 1 | 7908.214700ms | 74.405842ms | 2.691988ms | 9.082744us | 9.034463us | 9.174209us | ## SV-SingleBattle-MonteCarlo-SimulateTurn-RandomInputs-OneRandomBattle-OneRandomInput | Inputs | Samples | Iterations / Sample | Estimated Completion Time | Mean of Samples | Standard Deviation | Mean / Input Count | Mean Lower Bound / Input Count | Mean Upper Bound / Input Count | | --- | --- | --- | --- | --- | --- | --- | --- | --- | -| 1 | 100 | 1 | 44.509500ms | 81.971170us | 16.459070us | 81.971170us | 79.257980us | 85.875340us | -| 2 | 100 | 1 | 45.708600ms | 90.983530us | 17.072539us | 45.491765us | 44.044040us | 47.454200us | -| 4 | 100 | 1 | 47.743300ms | 102.497470us | 16.896726us | 25.624368us | 24.868513us | 26.539245us | -| 8 | 100 | 1 | 50.444400ms | 121.247080us | 21.226502us | 15.155885us | 14.687644us | 15.738713us | -| 16 | 100 | 1 | 55.278700ms | 161.318170us | 26.253193us | 10.082386us | 9.786131us | 10.435046us | -| 32 | 100 | 1 | 62.262000ms | 223.892030us | 35.014099us | 6.996626us | 6.797677us | 7.228389us | -| 64 | 100 | 1 | 64.989100ms | 350.128650us | 60.895287us | 5.470760us | 5.296534us | 5.669618us | -| 128 | 100 | 1 | 97.391300ms | 589.688090us | 108.372977us | 4.606938us | 4.454073us | 4.787602us | -| 256 | 100 | 1 | 261.189600ms | 1.069650ms | 197.392313us | 4.178319us | 4.039840us | 4.345884us | -| 512 | 100 | 1 | 354.676600ms | 1.972618ms | 385.271436us | 3.852769us | 3.718256us | 4.014658us | -| 1024 | 100 | 1 | 695.599300ms | 4.298048ms | 788.021392us | 4.197313us | 4.057877us | 4.360223us | -| 2048 | 100 | 1 | 1305.394800ms | 9.217092ms | 1.596795ms | 4.500533us | 4.359784us | 4.667872us | -| 4096 | 100 | 1 | 3323.222200ms | 19.494995ms | 3.411458ms | 4.759520us | 4.609238us | 4.935866us | -| 8192 | 100 | 1 | 5001.725100ms | 42.805409ms | 7.234674ms | 5.225270us | 5.061525us | 5.409419us | +| 1 | 100 | 1 | 44.477400ms | 79.006780us | 13.863698us | 79.006780us | 76.873120us | 82.642840us | +| 2 | 100 | 1 | 45.423100ms | 91.869420us | 20.538699us | 45.934710us | 44.260580us | 48.435435us | +| 4 | 100 | 1 | 47.733900ms | 102.397270us | 18.247829us | 25.599318us | 24.817213us | 26.636510us | +| 8 | 100 | 1 | 50.903300ms | 123.077880us | 21.494564us | 15.384735us | 14.924916us | 15.994126us | +| 16 | 100 | 1 | 56.341000ms | 161.694560us | 24.831180us | 10.105910us | 9.820111us | 10.434540us | +| 32 | 100 | 1 | 63.006200ms | 227.084960us | 34.662485us | 7.096405us | 6.898562us | 7.324986us | +| 64 | 100 | 1 | 63.869900ms | 351.955840us | 59.636536us | 5.499310us | 5.327976us | 5.696484us | +| 128 | 100 | 1 | 98.411600ms | 603.601010us | 106.869974us | 4.715633us | 4.564790us | 4.893425us | +| 256 | 100 | 1 | 263.308800ms | 1.078165ms | 197.179455us | 4.211581us | 4.071308us | 4.375636us | +| 512 | 100 | 1 | 359.279300ms | 2.046414ms | 427.359327us | 3.996901us | 3.848762us | 4.180319us | +| 1024 | 100 | 1 | 684.829900ms | 4.406205ms | 795.068710us | 4.302935us | 4.162017us | 4.466622us | +| 2048 | 100 | 1 | 1297.154700ms | 9.296353ms | 1.612059ms | 4.539235us | 4.397210us | 4.707502us | +| 4096 | 100 | 1 | 3364.166400ms | 19.691454ms | 3.492430ms | 4.807484us | 4.654046us | 4.988932us | +| 8192 | 100 | 1 | 5100.140200ms | 43.124689ms | 7.475893ms | 5.264244us | 5.096281us | 5.454490us | ## SV-SingleBattle-MonteCarlo-SimulateTurn-RandomInputs-OneRandomBattle-ManyRandomInputs | Inputs | Samples | Iterations / Sample | Estimated Completion Time | Mean of Samples | Standard Deviation | Mean / Input Count | Mean Lower Bound / Input Count | Mean Upper Bound / Input Count | | --- | --- | --- | --- | --- | --- | --- | --- | --- | -| 1 | 100 | 1 | 44.271200ms | 78.705320us | 15.349045us | 78.705320us | 76.258450us | 82.508960us | -| 2 | 100 | 1 | 45.033700ms | 88.562730us | 16.139383us | 44.281365us | 42.849600us | 46.050395us | -| 4 | 100 | 1 | 47.035600ms | 100.386670us | 17.299048us | 25.096667us | 24.337162us | 26.054580us | -| 8 | 100 | 1 | 50.064400ms | 120.179890us | 19.422422us | 15.022486us | 14.580877us | 15.533506us | -| 16 | 100 | 1 | 54.946300ms | 156.145570us | 24.525861us | 9.759098us | 9.477891us | 10.079581us | -| 32 | 100 | 1 | 61.321700ms | 213.823880us | 33.786241us | 6.681996us | 6.489575us | 6.905353us | -| 64 | 100 | 1 | 71.329000ms | 334.155480us | 60.871463us | 5.221179us | 5.047243us | 5.420959us | -| 128 | 100 | 1 | 80.440300ms | 537.135950us | 102.484069us | 4.196375us | 4.051112us | 4.366583us | -| 256 | 100 | 1 | 142.099300ms | 956.524080us | 190.738916us | 3.736422us | 3.602502us | 3.896721us | -| 512 | 100 | 1 | 184.617300ms | 1.803916ms | 366.312107us | 3.523274us | 3.395298us | 3.677599us | -| 1024 | 100 | 1 | 351.409600ms | 3.444340ms | 715.074299us | 3.363614us | 3.237705us | 3.514453us | -| 2048 | 100 | 1 | 728.354900ms | 6.808213ms | 1.427481ms | 3.324323us | 3.200616us | 3.474164us | -| 4096 | 100 | 1 | 1918.893500ms | 13.817105ms | 2.823718ms | 3.373317us | 3.249863us | 3.523697us | -| 8192 | 100 | 1 | 2633.041400ms | 28.026965ms | 5.459682ms | 3.421260us | 3.301348us | 3.563138us | +| 1 | 100 | 1 | 44.172700ms | 78.016830us | 14.970407us | 78.016830us | 75.815100us | 82.219330us | +| 2 | 100 | 1 | 45.395400ms | 90.666780us | 20.197585us | 45.333390us | 43.755865us | 47.919100us | +| 4 | 100 | 1 | 47.162400ms | 101.746670us | 18.740616us | 25.436667us | 24.644245us | 26.517238us | +| 8 | 100 | 1 | 50.010800ms | 120.391130us | 19.708817us | 15.048891us | 14.616636us | 15.595474us | +| 16 | 100 | 1 | 55.534800ms | 158.802460us | 24.829820us | 9.925154us | 9.640879us | 10.250862us | +| 32 | 100 | 1 | 47.524600ms | 221.965570us | 35.079377us | 6.936424us | 6.734748us | 7.167315us | +| 64 | 100 | 1 | 79.436400ms | 333.941010us | 60.395976us | 5.217828us | 5.045471us | 5.416305us | +| 128 | 100 | 1 | 81.024600ms | 544.137870us | 102.755635us | 4.251077us | 4.105338us | 4.421129us | +| 256 | 100 | 1 | 156.529000ms | 970.196990us | 190.607183us | 3.789832us | 3.656001us | 3.949333us | +| 512 | 100 | 1 | 184.938200ms | 1.828129ms | 387.025731us | 3.570565us | 3.437439us | 3.736346us | +| 1024 | 100 | 1 | 355.229500ms | 3.502461ms | 722.197595us | 3.420372us | 3.294711us | 3.571806us | +| 2048 | 100 | 1 | 780.599600ms | 6.946692ms | 1.457544ms | 3.391940us | 3.265602us | 3.547280us | +| 4096 | 100 | 1 | 1953.802100ms | 14.110339ms | 2.845674ms | 3.444907us | 3.320733us | 3.593770us | +| 8192 | 100 | 1 | 2685.583900ms | 28.486272ms | 5.553285ms | 3.477328us | 3.356180us | 3.625694us | ## SV-SingleBattle-MonteCarlo-SimulateTurn-RandomInputs-ManyRandomBattles-ManyRandomInputs | Inputs | Samples | Iterations / Sample | Estimated Completion Time | Mean of Samples | Standard Deviation | Mean / Input Count | Mean Lower Bound / Input Count | Mean Upper Bound / Input Count | | --- | --- | --- | --- | --- | --- | --- | --- | --- | -| 1 | 100 | 1 | 44.141600ms | 78.202370us | 16.192817us | 78.202370us | 75.708060us | 82.333280us | -| 2 | 100 | 1 | 58.221100ms | 101.351280us | 22.062750us | 50.675640us | 49.102585us | 53.908060us | -| 4 | 100 | 1 | 40.529800ms | 128.923320us | 17.135156us | 32.230830us | 31.540862us | 33.275128us | -| 8 | 100 | 1 | 54.764200ms | 173.160090us | 19.415373us | 21.645011us | 21.252340us | 22.238502us | -| 16 | 100 | 1 | 63.883200ms | 230.622000us | 20.273366us | 14.413875us | 14.211234us | 14.729231us | -| 32 | 100 | 1 | 78.029500ms | 331.682090us | 28.567087us | 10.365065us | 10.236447us | 10.623161us | -| 64 | 100 | 1 | 147.043500ms | 511.021310us | 28.595847us | 7.984708us | 7.914443us | 8.098217us | -| 128 | 100 | 1 | 190.160400ms | 829.751820us | 41.504503us | 6.482436us | 6.438178us | 6.583944us | -| 256 | 100 | 1 | 269.943100ms | 1.484616ms | 87.923700us | 5.799283us | 5.749138us | 5.897817us | -| 512 | 100 | 1 | 445.628900ms | 2.797371ms | 67.161056us | 5.463615us | 5.441259us | 5.493771us | -| 1024 | 100 | 1 | 761.952600ms | 6.722714ms | 216.946497us | 6.565150us | 6.528499us | 6.612547us | -| 2048 | 100 | 1 | 1574.015900ms | 14.590912ms | 238.593325us | 7.124469us | 7.105291us | 7.152033us | -| 4096 | 100 | 1 | 3201.906200ms | 31.762215ms | 416.945554us | 7.754447us | 7.736764us | 7.777183us | -| 8192 | 100 | 1 | 7453.643200ms | 72.678189ms | 1.101232ms | 8.871849us | 8.849482us | 8.903571us | +| 1 | 100 | 1 | 44.350700ms | 79.280220us | 14.863259us | 79.280220us | 77.078570us | 83.424630us | +| 2 | 100 | 1 | 59.263700ms | 102.893420us | 20.752582us | 51.446710us | 49.902635us | 54.274035us | +| 4 | 100 | 1 | 47.299000ms | 130.159240us | 14.882032us | 32.539810us | 31.935445us | 33.455637us | +| 8 | 100 | 1 | 61.590700ms | 171.155920us | 19.147598us | 21.394490us | 21.051524us | 22.099784us | +| 16 | 100 | 1 | 71.854700ms | 231.175730us | 15.241935us | 14.448483us | 14.302148us | 14.695795us | +| 32 | 100 | 1 | 84.490700ms | 325.754940us | 19.604681us | 10.179842us | 10.084138us | 10.336732us | +| 64 | 100 | 1 | 152.661100ms | 514.238980us | 33.377494us | 8.034984us | 7.957928us | 8.180535us | +| 128 | 100 | 1 | 204.914600ms | 845.242230us | 31.787673us | 6.603455us | 6.561696us | 6.661246us | +| 256 | 100 | 1 | 299.229600ms | 1.476414ms | 44.344621us | 5.767243us | 5.741107us | 5.813123us | +| 512 | 100 | 1 | 504.133100ms | 2.910029ms | 210.376642us | 5.683650us | 5.623060us | 5.797441us | +| 1024 | 100 | 1 | 930.603400ms | 6.770211ms | 296.594928us | 6.611534us | 6.557519us | 6.671112us | +| 2048 | 100 | 1 | 1591.099400ms | 14.853675ms | 491.609485us | 7.252771us | 7.221395us | 7.334117us | +| 4096 | 100 | 1 | 3220.324100ms | 32.515516ms | 975.204450us | 7.938358us | 7.902066us | 8.001254us | +| 8192 | 100 | 1 | 7407.308800ms | 74.064953ms | 1.217278ms | 9.041132us | 9.015344us | 9.074915us | ## SV-SingleBattle-CalcDamage-RandomInputs-OneRandomBattle-OneRandomInput | Inputs | Samples | Iterations / Sample | Estimated Completion Time | Mean of Samples | Standard Deviation | Mean / Input Count | Mean Lower Bound / Input Count | Mean Upper Bound / Input Count | | --- | --- | --- | --- | --- | --- | --- | --- | --- | -| 1 | 100 | 1 | 10.408800ms | 12.677360us | 5.027147us | 12.677360us | 11.924750us | 14.064900us | -| 2 | 100 | 1 | 10.821900ms | 14.411400us | 5.830292us | 7.205700us | 6.730190us | 7.911215us | -| 4 | 100 | 1 | 11.519700ms | 17.116340us | 7.345073us | 4.279085us | 3.979080us | 4.722365us | -| 8 | 100 | 1 | 12.455100ms | 21.081810us | 9.325194us | 2.635226us | 2.444415us | 2.916970us | -| 16 | 100 | 1 | 14.281900ms | 30.332270us | 14.022865us | 1.895767us | 1.743816us | 2.092667us | -| 32 | 100 | 1 | 10.903900ms | 43.619540us | 18.479347us | 1.363111us | 1.249302us | 1.475503us | -| 64 | 100 | 1 | 19.476800ms | 78.155460us | 36.025182us | 1.221179us | 1.110343us | 1.330583us | -| 128 | 100 | 1 | 50.944000ms | 136.765380us | 67.405374us | 1.068480us | 964.665156ns | 1.171406us | -| 256 | 100 | 1 | 88.414300ms | 263.866940us | 131.764286us | 1.030730us | 929.333203ns | 1.131686us | -| 512 | 100 | 1 | 169.957400ms | 477.781930us | 270.532058us | 933.167832ns | 828.694629ns | 1.035778us | -| 1024 | 100 | 1 | 333.299200ms | 1.158539ms | 650.204227us | 1.131386us | 1.005550us | 1.254159us | -| 2048 | 100 | 1 | 651.231200ms | 2.367990ms | 1.265179ms | 1.156245us | 1.032941us | 1.274550us | -| 4096 | 100 | 1 | 1272.658000ms | 5.067789ms | 2.771716ms | 1.237253us | 1.102339us | 1.368054us | -| 8192 | 100 | 1 | 2636.488300ms | 11.177638ms | 6.102066ms | 1.364458us | 1.215341us | 1.508034us | +| 1 | 100 | 1 | 10.885700ms | 13.023680us | 5.360867us | 13.023680us | 12.237980us | 14.509220us | +| 2 | 100 | 1 | 11.328900ms | 14.545580us | 5.644011us | 7.272790us | 6.810920us | 7.954235us | +| 4 | 100 | 1 | 11.855300ms | 17.365920us | 7.457153us | 4.341480us | 4.051250us | 4.817092us | +| 8 | 100 | 1 | 12.877700ms | 29.465730us | 84.045493us | 3.683216us | 2.568861us | 8.848460us | +| 16 | 100 | 1 | 9.987000ms | 29.102010us | 12.550676us | 1.818876us | 1.683224us | 1.995805us | +| 32 | 100 | 1 | 10.997500ms | 44.600700us | 18.977112us | 1.393772us | 1.279217us | 1.511385us | +| 64 | 100 | 1 | 19.734200ms | 77.126350us | 35.031509us | 1.205099us | 1.096004us | 1.310331us | +| 128 | 100 | 1 | 50.200500ms | 138.862750us | 68.993258us | 1.084865us | 980.245937ns | 1.190858us | +| 256 | 100 | 1 | 89.694500ms | 263.799160us | 132.376104us | 1.030465us | 928.616211ns | 1.131438us | +| 512 | 100 | 1 | 138.071100ms | 482.072280us | 277.483157us | 941.547422ns | 835.541484ns | 1.048033us | +| 1024 | 100 | 1 | 334.627800ms | 1.134894ms | 629.448801us | 1.108295us | 986.455508ns | 1.227796us | +| 2048 | 100 | 1 | 664.551700ms | 2.408694ms | 1.288489ms | 1.176120us | 1.051202us | 1.297532us | +| 4096 | 100 | 1 | 1356.431100ms | 5.177013ms | 2.762448ms | 1.263919us | 1.128595us | 1.392412us | +| 8192 | 100 | 1 | 2743.122500ms | 11.395473ms | 6.283325ms | 1.391049us | 1.239030us | 1.538802us | ## SV-SingleBattle-CalcDamage-RandomInputs-OneRandomBattle-ManyRandomInputs | Inputs | Samples | Iterations / Sample | Estimated Completion Time | Mean of Samples | Standard Deviation | Mean / Input Count | Mean Lower Bound / Input Count | Mean Upper Bound / Input Count | | --- | --- | --- | --- | --- | --- | --- | --- | --- | -| 1 | 100 | 1 | 10.493500ms | 12.621410us | 5.016899us | 12.621410us | 11.867000us | 13.975180us | -| 2 | 100 | 1 | 10.876100ms | 15.344230us | 4.394447us | 7.672115us | 7.316685us | 8.211295us | -| 4 | 100 | 1 | 10.555700ms | 16.792020us | 3.689613us | 4.198005us | 4.069177us | 4.478180us | -| 8 | 100 | 1 | 11.953900ms | 23.188930us | 4.658361us | 2.898616us | 2.802441us | 3.037383us | -| 16 | 100 | 1 | 12.522900ms | 29.104640us | 5.689178us | 1.819040us | 1.767203us | 1.920443us | -| 32 | 100 | 1 | 14.420800ms | 42.324180us | 4.859962us | 1.322631us | 1.296256us | 1.356501us | -| 64 | 100 | 1 | 16.856900ms | 68.513010us | 5.576693us | 1.070516us | 1.055381us | 1.089937us | -| 128 | 100 | 1 | 24.011500ms | 119.756900us | 5.686283us | 935.600781ns | 927.077344ns | 944.479531ns | -| 256 | 100 | 1 | 35.537800ms | 224.526570us | 10.068800us | 877.056914ns | 870.087656ns | 885.681445ns | -| 512 | 100 | 1 | 40.988700ms | 430.047030us | 10.654859us | 839.935605ns | 835.817324ns | 843.994453ns | -| 1024 | 100 | 1 | 85.651800ms | 840.590640us | 17.412392us | 820.889297ns | 817.560254ns | 824.198584ns | -| 2048 | 100 | 1 | 173.079700ms | 1.652729ms | 31.312337us | 806.996743ns | 804.243745ns | 810.304570ns | -| 4096 | 100 | 1 | 339.167900ms | 3.306413ms | 55.148046us | 807.229756ns | 804.726794ns | 810.044133ns | -| 8192 | 100 | 1 | 674.452400ms | 6.628548ms | 114.085995us | 809.148901ns | 806.571278ns | 812.039146ns | +| 1 | 100 | 1 | 10.943800ms | 12.623740us | 5.243837us | 12.623740us | 11.864660us | 14.127200us | +| 2 | 100 | 1 | 11.337400ms | 14.772880us | 4.276678us | 7.386440us | 7.078165us | 8.000790us | +| 4 | 100 | 1 | 10.846000ms | 17.300540us | 4.500536us | 4.325135us | 4.172220us | 4.696385us | +| 8 | 100 | 1 | 11.958800ms | 21.285660us | 4.117113us | 2.660708us | 2.585742us | 2.807474us | +| 16 | 100 | 1 | 12.627800ms | 28.616300us | 4.644829us | 1.788519us | 1.745676us | 1.868897us | +| 32 | 100 | 1 | 14.889800ms | 42.749720us | 4.808821us | 1.335929us | 1.311697us | 1.373036us | +| 64 | 100 | 1 | 17.184400ms | 69.797250us | 5.417010us | 1.090582us | 1.075365us | 1.108725us | +| 128 | 100 | 1 | 22.569200ms | 120.122130us | 7.321975us | 938.454141ns | 928.162266ns | 950.796250ns | +| 256 | 100 | 1 | 24.206300ms | 223.222050us | 8.823904us | 871.961133ns | 865.487266ns | 879.049336ns | +| 512 | 100 | 1 | 40.945100ms | 430.501190us | 11.386416us | 840.822637ns | 836.631719ns | 845.323887ns | +| 1024 | 100 | 1 | 86.115200ms | 848.545020us | 20.575394us | 828.657246ns | 824.851660ns | 832.765654ns | +| 2048 | 100 | 1 | 175.542300ms | 1.668391ms | 35.510391us | 814.643911ns | 811.421245ns | 818.230176ns | +| 4096 | 100 | 1 | 340.274600ms | 3.311948ms | 56.847568us | 808.581099ns | 805.921772ns | 811.391860ns | +| 8192 | 100 | 1 | 675.003300ms | 6.661506ms | 240.507742us | 813.172140ns | 808.808228ns | 821.172601ns | ## SV-SingleBattle-CalcDamage-RandomInputs-ManyRandomBattles-ManyRandomInputs | Inputs | Samples | Iterations / Sample | Estimated Completion Time | Mean of Samples | Standard Deviation | Mean / Input Count | Mean Lower Bound / Input Count | Mean Upper Bound / Input Count | | --- | --- | --- | --- | --- | --- | --- | --- | --- | -| 1 | 100 | 1 | 10.494200ms | 12.637510us | 5.487590us | 12.637510us | 11.844280us | 14.230950us | -| 2 | 100 | 1 | 10.103100ms | 15.287810us | 5.861732us | 7.643905us | 7.250255us | 8.608040us | -| 4 | 100 | 1 | 11.512800ms | 17.861920us | 5.837854us | 4.465480us | 4.271710us | 4.949530us | -| 8 | 100 | 1 | 11.653000ms | 22.760180us | 4.983687us | 2.845023us | 2.752922us | 3.018727us | -| 16 | 100 | 1 | 13.631700ms | 33.489740us | 8.339237us | 2.093109us | 2.021170us | 2.253591us | -| 32 | 100 | 1 | 17.226600ms | 50.565680us | 4.910430us | 1.580178us | 1.554532us | 1.616044us | -| 64 | 100 | 1 | 30.079800ms | 89.745540us | 8.906324us | 1.402274us | 1.380917us | 1.438589us | -| 128 | 100 | 1 | 51.475800ms | 166.745160us | 12.692466us | 1.302697us | 1.286358us | 1.326171us | -| 256 | 100 | 1 | 92.288800ms | 315.811460us | 23.867081us | 1.233639us | 1.220532us | 1.261480us | -| 512 | 100 | 1 | 175.439600ms | 620.898840us | 52.333886us | 1.212693us | 1.196754us | 1.239014us | -| 1024 | 100 | 1 | 337.836900ms | 1.565730ms | 71.369702us | 1.529034us | 1.517261us | 1.545195us | -| 2048 | 100 | 1 | 678.304600ms | 3.417168ms | 92.565271us | 1.668539us | 1.661544us | 1.680151us | -| 4096 | 100 | 1 | 1347.142900ms | 7.926533ms | 126.513643us | 1.935189us | 1.929701us | 1.941873us | -| 8192 | 100 | 1 | 2719.983900ms | 17.785275ms | 397.564702us | 2.171054us | 2.164223us | 2.185460us | +| 1 | 100 | 1 | 10.885400ms | 12.730850us | 5.333069us | 12.730850us | 11.945180us | 14.205860us | +| 2 | 100 | 1 | 10.611300ms | 15.400500us | 6.750125us | 7.700250us | 7.278590us | 8.917625us | +| 4 | 100 | 1 | 11.256300ms | 19.967080us | 21.812035us | 4.991770us | 4.371118us | 7.451420us | +| 8 | 100 | 1 | 11.835400ms | 22.809720us | 4.413965us | 2.851215us | 2.772016us | 3.014874us | +| 16 | 100 | 1 | 13.989300ms | 32.923970us | 8.317577us | 2.057748us | 1.990988us | 2.238971us | +| 32 | 100 | 1 | 17.305500ms | 50.609170us | 5.495759us | 1.581537us | 1.555028us | 1.625850us | +| 64 | 100 | 1 | 30.371200ms | 91.775770us | 8.231954us | 1.433996us | 1.414762us | 1.469135us | +| 128 | 100 | 1 | 52.489400ms | 166.287000us | 10.230215us | 1.299117us | 1.285692us | 1.317701us | +| 256 | 100 | 1 | 91.738800ms | 317.455980us | 15.625760us | 1.240062us | 1.229526us | 1.253931us | +| 512 | 100 | 1 | 174.965000ms | 614.993990us | 43.923817us | 1.201160us | 1.187735us | 1.223135us | +| 1024 | 100 | 1 | 334.579400ms | 1.625687ms | 102.791709us | 1.587585us | 1.568603us | 1.608085us | +| 2048 | 100 | 1 | 686.323300ms | 3.496694ms | 110.529614us | 1.707370us | 1.698168us | 1.719733us | +| 4096 | 100 | 1 | 1362.766500ms | 8.144074ms | 249.390141us | 1.988299us | 1.978093us | 2.002597us | +| 8192 | 100 | 1 | 2763.587300ms | 18.215632ms | 477.500313us | 2.223588us | 2.213595us | 2.236758us | ## SV-SingleBattle-AnalyzeEffect-RandomInputs-OneRandomBattle-OneRandomInput | Inputs | Samples | Iterations / Sample | Estimated Completion Time | Mean of Samples | Standard Deviation | Mean / Input Count | Mean Lower Bound / Input Count | Mean Upper Bound / Input Count | | --- | --- | --- | --- | --- | --- | --- | --- | --- | -| 1 | 100 | 1 | 43.154900ms | 107.385060us | 38.889018us | 107.385060us | 98.883340us | 114.270960us | -| 2 | 100 | 1 | 23.957900ms | 158.191710us | 52.726162us | 79.095855us | 73.013975us | 83.506570us | -| 4 | 100 | 1 | 35.160000ms | 246.193230us | 82.289834us | 61.548307us | 56.772887us | 64.976385us | -| 8 | 100 | 1 | 58.746600ms | 433.143570us | 145.547602us | 54.142946us | 49.887380us | 57.176133us | -| 16 | 100 | 1 | 115.169700ms | 747.322620us | 264.749384us | 46.707664us | 42.855700us | 49.491369us | -| 32 | 100 | 1 | 181.002700ms | 1.385483ms | 491.525149us | 43.296342us | 39.705732us | 45.874102us | -| 64 | 100 | 1 | 373.247800ms | 2.708416ms | 963.192246us | 42.318993us | 38.785471us | 44.831547us | -| 128 | 100 | 1 | 758.081700ms | 5.169956ms | 1.845231ms | 40.390279us | 37.002044us | 42.815732us | -| 256 | 100 | 1 | 1437.158600ms | 10.276070ms | 3.682541ms | 40.140900us | 36.818654us | 42.557999us | -| 512 | 100 | 1 | 3243.135200ms | 21.206492ms | 7.630480ms | 41.418929us | 37.952965us | 43.918943us | -| 1024 | 100 | 1 | 7323.136800ms | 53.402095ms | 19.145838ms | 52.150483us | 47.757504us | 55.266145us | -| 2048 | 100 | 1 | 13797.193200ms | 124.881016ms | 44.660328ms | 60.977059us | 55.858485us | 64.609074us | -| 4096 | 100 | 1 | 28218.556400ms | 266.638122ms | 95.312321ms | 65.097198us | 59.673932us | 68.977455us | +| 1 | 100 | 1 | 43.591600ms | 108.285200us | 38.731774us | 108.285200us | 99.725520us | 115.118170us | +| 2 | 100 | 1 | 23.415200ms | 158.196510us | 52.664378us | 79.098255us | 72.945295us | 83.516100us | +| 4 | 100 | 1 | 35.543300ms | 249.117430us | 83.320921us | 62.279357us | 57.424265us | 65.776995us | +| 8 | 100 | 1 | 58.211500ms | 437.555690us | 147.291787us | 54.694461us | 50.380781us | 57.765912us | +| 16 | 100 | 1 | 118.101100ms | 760.751360us | 269.949380us | 47.546960us | 43.548988us | 50.367970us | +| 32 | 100 | 1 | 182.829400ms | 1.432708ms | 508.588968us | 44.772116us | 41.090812us | 47.424588us | +| 64 | 100 | 1 | 375.551400ms | 2.745539ms | 977.356217us | 42.899052us | 39.322933us | 45.454265us | +| 128 | 100 | 1 | 770.291100ms | 5.292082ms | 1.888443ms | 41.344388us | 37.885477us | 43.815027us | +| 256 | 100 | 1 | 1458.293400ms | 10.554769ms | 3.816437ms | 41.229566us | 37.781704us | 43.744190us | +| 512 | 100 | 1 | 3189.390500ms | 22.064758ms | 7.950388ms | 43.095230us | 39.462909us | 45.697807us | +| 1024 | 100 | 1 | 7569.623900ms | 55.932451ms | 20.112797ms | 54.621534us | 50.025606us | 57.918972us | +| 2048 | 100 | 1 | 13627.369100ms | 129.944972ms | 46.618195ms | 63.449693us | 58.141108us | 67.257946us | +| 4096 | 100 | 1 | 29794.170400ms | 272.698801ms | 97.612132ms | 66.576856us | 61.067262us | 70.592252us | ## SV-SingleBattle-AnalyzeEffect-RandomInputs-OneRandomBattle-ManyRandomInputs | Inputs | Samples | Iterations / Sample | Estimated Completion Time | Mean of Samples | Standard Deviation | Mean / Input Count | Mean Lower Bound / Input Count | Mean Upper Bound / Input Count | | --- | --- | --- | --- | --- | --- | --- | --- | --- | -| 1 | 100 | 1 | 42.324500ms | 106.611040us | 38.244583us | 106.611040us | 98.175920us | 113.371150us | -| 2 | 100 | 1 | 22.635400ms | 143.452810us | 26.250814us | 71.726405us | 68.606960us | 73.916630us | -| 4 | 100 | 1 | 22.430200ms | 195.095280us | 22.644623us | 48.773820us | 47.651927us | 49.870775us | -| 8 | 100 | 1 | 40.959300ms | 291.160030us | 26.429791us | 36.395004us | 35.697766us | 36.996146us | -| 16 | 100 | 1 | 58.977300ms | 477.030420us | 37.761448us | 29.814401us | 29.353143us | 30.281468us | -| 32 | 100 | 1 | 99.168800ms | 864.898930us | 53.974901us | 27.028092us | 26.698143us | 27.360964us | -| 64 | 100 | 1 | 177.114700ms | 1.642394ms | 85.710745us | 25.662410us | 25.401285us | 25.926379us | -| 128 | 100 | 1 | 372.083000ms | 3.287395ms | 135.189116us | 25.682776us | 25.479420us | 25.892748us | -| 256 | 100 | 1 | 741.109500ms | 7.313561ms | 272.886976us | 28.568596us | 28.358526us | 28.778053us | -| 512 | 100 | 1 | 1748.442500ms | 17.597717ms | 566.559020us | 34.370542us | 34.154203us | 34.588860us | -| 1024 | 100 | 1 | 4337.528800ms | 43.040382ms | 1.123636ms | 42.031623us | 41.814731us | 42.244539us | -| 2048 | 100 | 1 | 10047.975600ms | 101.665540ms | 2.296406ms | 49.641377us | 49.422714us | 49.861122us | -| 4096 | 100 | 1 | 22467.831400ms | 224.646401ms | 3.711615ms | 54.845313us | 54.666907us | 55.021169us | +| 1 | 100 | 1 | 43.805000ms | 107.682730us | 37.940697us | 107.682730us | 99.142050us | 114.249060us | +| 2 | 100 | 1 | 22.914200ms | 145.722520us | 25.883703us | 72.861260us | 69.705865us | 74.933810us | +| 4 | 100 | 1 | 22.872800ms | 196.400050us | 21.786657us | 49.100012us | 47.967067us | 50.109355us | +| 8 | 100 | 1 | 41.466800ms | 292.795070us | 25.758554us | 36.599384us | 35.939329us | 37.205430us | +| 16 | 100 | 1 | 60.384100ms | 491.428930us | 43.523201us | 30.714308us | 30.220280us | 31.293265us | +| 32 | 100 | 1 | 100.121500ms | 866.004590us | 53.158362us | 27.062643us | 26.740362us | 27.394822us | +| 64 | 100 | 1 | 180.733800ms | 1.676862ms | 89.771185us | 26.200975us | 25.922456us | 26.475137us | +| 128 | 100 | 1 | 381.520300ms | 3.338994ms | 147.201763us | 26.085890us | 25.865024us | 26.317284us | +| 256 | 100 | 1 | 744.055200ms | 7.466083ms | 298.289411us | 29.164387us | 28.937321us | 29.391978us | +| 512 | 100 | 1 | 1817.041700ms | 18.076781ms | 618.995588us | 35.306212us | 35.075279us | 35.550953us | +| 1024 | 100 | 1 | 4434.491600ms | 45.812513ms | 1.603833ms | 44.738782us | 44.439832us | 45.056952us | +| 2048 | 100 | 1 | 10218.129200ms | 105.525469ms | 2.359154ms | 51.526108us | 51.300149us | 51.752544us | +| 4096 | 100 | 1 | 22527.083700ms | 231.658337ms | 3.508841ms | 56.557211us | 56.388921us | 56.726056us | ## SV-SingleBattle-AnalyzeEffect-RandomInputs-ManyRandomBattles-ManyRandomInputs | Inputs | Samples | Iterations / Sample | Estimated Completion Time | Mean of Samples | Standard Deviation | Mean / Input Count | Mean Lower Bound / Input Count | Mean Upper Bound / Input Count | | --- | --- | --- | --- | --- | --- | --- | --- | --- | -| 1 | 100 | 1 | 42.394300ms | 108.099320us | 38.764876us | 108.099320us | 99.632760us | 114.956210us | -| 2 | 100 | 1 | 27.851900ms | 178.433530us | 33.237999us | 89.216765us | 85.589190us | 92.162260us | -| 4 | 100 | 1 | 43.584200ms | 287.535870us | 32.678627us | 71.883967us | 70.182648us | 73.385915us | -| 8 | 100 | 1 | 64.279600ms | 502.703260us | 46.121553us | 62.837908us | 61.625308us | 63.894872us | -| 16 | 100 | 1 | 122.090100ms | 932.563230us | 71.382754us | 58.285202us | 57.421358us | 59.169805us | -| 32 | 100 | 1 | 216.517100ms | 1.709589ms | 82.219567us | 53.424665us | 52.907228us | 53.916377us | -| 64 | 100 | 1 | 430.102300ms | 3.295029ms | 136.655686us | 51.484834us | 51.040584us | 51.882499us | -| 128 | 100 | 1 | 793.353800ms | 6.192593ms | 181.760239us | 48.379631us | 48.100183us | 48.656026us | -| 256 | 100 | 1 | 1676.583300ms | 12.283151ms | 405.278111us | 47.981059us | 47.681574us | 48.302759us | -| 512 | 100 | 1 | 3341.283600ms | 26.417286ms | 746.350842us | 51.596262us | 51.319399us | 51.892132us | -| 1024 | 100 | 1 | 7662.897900ms | 70.578237ms | 1.945377ms | 68.924060us | 68.583710us | 69.337008us | -| 2048 | 100 | 1 | 16050.128900ms | 160.275248ms | 2.528991ms | 78.259398us | 78.039690us | 78.525429us | -| 4096 | 100 | 1 | 33976.285200ms | 338.647304ms | 3.418839ms | 82.677564us | 82.517415us | 82.845059us | +| 1 | 100 | 1 | 43.808400ms | 109.729750us | 39.737339us | 109.729750us | 101.066410us | 116.786340us | +| 2 | 100 | 1 | 29.159500ms | 176.413970us | 33.365178us | 88.206985us | 84.593470us | 91.186590us | +| 4 | 100 | 1 | 44.416300ms | 295.160720us | 34.305714us | 73.790180us | 72.034122us | 75.406830us | +| 8 | 100 | 1 | 66.406500ms | 513.303290us | 46.555725us | 64.162911us | 62.933192us | 65.229374us | +| 16 | 100 | 1 | 121.231500ms | 935.822010us | 66.560784us | 58.488876us | 57.665650us | 59.290429us | +| 32 | 100 | 1 | 225.893200ms | 1.767799ms | 88.633458us | 55.243708us | 54.690923us | 55.775292us | +| 64 | 100 | 1 | 441.074300ms | 3.392927ms | 156.086210us | 53.014485us | 52.511374us | 53.474113us | +| 128 | 100 | 1 | 830.162200ms | 6.404093ms | 262.769055us | 50.031976us | 49.644054us | 50.454197us | +| 256 | 100 | 1 | 1749.350900ms | 12.800394ms | 626.011419us | 50.001538us | 49.563752us | 50.527258us | +| 512 | 100 | 1 | 3622.799800ms | 29.105960ms | 2.464750ms | 56.847579us | 55.988435us | 57.886970us | +| 1024 | 100 | 1 | 7630.856400ms | 75.554737ms | 3.369076ms | 73.783923us | 73.157216us | 74.444369us | +| 2048 | 100 | 1 | 16385.363300ms | 168.364389ms | 3.348663ms | 82.209174us | 81.889092us | 82.532414us | +| 4096 | 100 | 1 | 34579.310400ms | 349.481038ms | 2.962684ms | 85.322519us | 85.182537us | 85.466953us | diff --git a/src/Components/headers.hpp b/src/Components/headers.hpp index a5c606f..44747c6 100644 --- a/src/Components/headers.hpp +++ b/src/Components/headers.hpp @@ -3,7 +3,6 @@ #pragma once #include "Accuracy.hpp" -#include "ActionQueue.hpp" #include "AddedTargets.hpp" #include "AnalyzeEffect/Aliases.hpp" #include "AnalyzeEffect/AnalyzeEffectInputs.hpp" diff --git a/src/SimulateTurn/ManageActionQueue.cpp b/src/SimulateTurn/ManageActionQueue.cpp index 0e1b93b..0e895a6 100644 --- a/src/SimulateTurn/ManageActionQueue.cpp +++ b/src/SimulateTurn/ManageActionQueue.cpp @@ -32,43 +32,70 @@ namespace pokesim::simulate_turn { namespace { -void resolveSlotDecisions( - types::handle sideHandle, const types::slotDecisions& decisions, ActionQueue& battleActionQueue) { - types::registry& registry = *sideHandle.registry(); - for (const SlotDecision& decision : decisions) { - POKESIM_REQUIRE(decision.sourceSlot != Slot::NONE, "Source slot must be assigned."); - POKESIM_REQUIRE(decision.targetSlot != Slot::NONE, "Target slot must be assigned."); +template +void resolveSlotDecision( + types::handle actionHandle, types::entity sideEntity, const types::slotDecision& slotDecision, + ActionQueue& actionQueue) { + if (!slotDecision.holds()) { + return; + } - types::handle actionHandle = {registry, registry.create()}; - actionHandle.emplace(decision.sourceSlot); - actionHandle.emplace(decision.targetSlot); + types::registry& registry = *actionHandle.registry(); + const auto& decision = slotDecision.get(); - SpeedSort speedSort; - types::entity sourceEntity = slotToPokemonEntity(registry, sideHandle.entity(), decision.sourceSlot); + POKESIM_REQUIRE(decision.sourceSlot != Slot::NONE, "Source slot must be assigned."); + POKESIM_REQUIRE(decision.targetSlot != Slot::NONE, "Target slot must be assigned."); - speedSort.speed = registry.get(sourceEntity).val; + actionHandle.emplace(decision.sourceSlot); + actionHandle.emplace(decision.targetSlot); - if (decision.moveOrItem.holds()) { - actionHandle.emplace(); - actionHandle.emplace(decision.moveOrItem.get()); + SpeedSort speedSort; + types::entity sourceEntity = slotToPokemonEntity(registry, sideEntity, decision.sourceSlot); + speedSort.speed = registry.get(sourceEntity).val; - speedSort.order = ActionOrder::MOVE; - speedSort.priority = Constants::MovePriority::DEFAULT; // TODO (aed3): Move priority + modify priority - speedSort.fractionalPriority = false; // TODO (aed3): get fractionalPriority - } - else if (decision.moveOrItem.holds()) { - actionHandle.emplace(); - actionHandle.emplace(decision.moveOrItem.get()); - speedSort.order = ActionOrder::ITEM; - } - else { - actionHandle.emplace(); - speedSort.order = ActionOrder::SWITCH; + if constexpr (std::is_base_of_v) { + speedSort.order = ActionOrder::MOVE; + speedSort.priority = Constants::MovePriority::DEFAULT; // TODO (aed3): Move priority + modify priority + speedSort.fractionalPriority = false; // TODO (aed3): get fractionalPriority + + actionHandle.emplace(); + actionHandle.emplace(decision.move); + + if constexpr (!std::is_same_v) { + POKESIM_REQUIRE_FAIL(std::string(entt::type_name().value()) + " is not yet supported."); } + } + else if constexpr (std::is_same_v) { + speedSort.order = ActionOrder::SWITCH; + + actionHandle.emplace(); + } + else if constexpr (std::is_same_v) { + speedSort.order = ActionOrder::ITEM; - actionHandle.emplace(speedSort); + actionHandle.emplace(); + actionHandle.emplace(decision.item); + } + else { + POKESIM_REQUIRE_FAIL(std::string(entt::type_name().value()) + " is not yet supported."); + } + + actionHandle.emplace(speedSort); + actionQueue.val.push_back(actionHandle.entity()); +} + +void resolveSlotDecisions(types::handle sideHandle, const types::slotDecisions& decisions, ActionQueue& actionQueue) { + types::registry& registry = *sideHandle.registry(); + for (const types::slotDecision& decision : decisions) { + types::handle actionHandle = {registry, registry.create()}; - battleActionQueue.val.push_back(actionHandle.entity()); + resolveSlotDecision(actionHandle, sideHandle.entity(), decision, actionQueue); + resolveSlotDecision(actionHandle, sideHandle.entity(), decision, actionQueue); + resolveSlotDecision(actionHandle, sideHandle.entity(), decision, actionQueue); + resolveSlotDecision(actionHandle, sideHandle.entity(), decision, actionQueue); + resolveSlotDecision(actionHandle, sideHandle.entity(), decision, actionQueue); + resolveSlotDecision(actionHandle, sideHandle.entity(), decision, actionQueue); + resolveSlotDecision(actionHandle, sideHandle.entity(), decision, actionQueue); } } @@ -97,15 +124,15 @@ void resolveDecision(types::handle sideHandle, const SideDecision& sideDecision) const auto& decisions = sideDecision.decisions.get(); #ifdef POKESIM_DEBUG_CHECK_UTILITIES - for (const SlotDecision& decision : decisions) { + for (const auto& decision : decisions) { if (sideDecision.sideId == PlayerSideId::P1) { POKESIM_REQUIRE( - (decision.sourceSlot == Slot::P1A || decision.sourceSlot == Slot::P1B), + (decision.sourceSlot() == Slot::P1A || decision.sourceSlot() == Slot::P1B), "Source must be from a player 1 in battle slot."); } else { POKESIM_REQUIRE( - (decision.sourceSlot == Slot::P2A || decision.sourceSlot == Slot::P2B), + (decision.sourceSlot() == Slot::P2A || decision.sourceSlot() == Slot::P2B), "Source must be from a player 2 in battle slot."); } } diff --git a/src/Simulation/SimulationSetupDebugChecks.hpp b/src/Simulation/SimulationSetupDebugChecks.hpp index d8a5784..8b61f00 100644 --- a/src/Simulation/SimulationSetupDebugChecks.hpp +++ b/src/Simulation/SimulationSetupDebugChecks.hpp @@ -382,13 +382,7 @@ struct SimulationSetupChecks { const auto& slotDecision = slotDecisions[slot]; const auto& slotDecisionInfo = slotDecisionsInfo[slot]; - POKESIM_REQUIRE_NM(slotDecision.sourceSlot == slotDecisionInfo.sourceSlot); - POKESIM_REQUIRE_NM(slotDecision.targetSlot == slotDecisionInfo.targetSlot); - POKESIM_REQUIRE_NM(slotDecision.megaEvolve == slotDecisionInfo.megaEvolve); - POKESIM_REQUIRE_NM(slotDecision.primalRevert == slotDecisionInfo.primalRevert); - POKESIM_REQUIRE_NM(slotDecision.dynamax == slotDecisionInfo.dynamax); - POKESIM_REQUIRE_NM(slotDecision.terastallize == slotDecisionInfo.terastallize); - POKESIM_REQUIRE_NM(slotDecision.moveOrItem == slotDecisionInfo.moveOrItem); + POKESIM_REQUIRE_NM(slotDecision == slotDecisionInfo); } } else if (sideDecisionInfo.decisions.holds()) { diff --git a/src/Types/Decisions.hpp b/src/Types/Decisions.hpp index 1f28215..cfe2126 100644 --- a/src/Types/Decisions.hpp +++ b/src/Types/Decisions.hpp @@ -7,25 +7,59 @@ #include namespace pokesim { -struct SlotDecision { +struct MoveDecision { Slot sourceSlot = Slot::NONE; Slot targetSlot = Slot::NONE; - bool megaEvolve = false; - bool primalRevert = false; - bool dynamax = false; - bool terastallize = false; + dex::Move move = dex::Move::NO_MOVE; - internal::variant moveOrItem; + bool operator==(const MoveDecision& other) const { + return sourceSlot == other.sourceSlot && targetSlot == other.targetSlot && move == other.move; + } +}; + +struct MegaEvolveAndMoveDecision : MoveDecision {}; +struct ZMoveDecision : MoveDecision {}; +struct DynamaxAndMoveDecision : MoveDecision {}; +struct TerastallizeAndMoveDecision : MoveDecision {}; + +struct SwitchDecision { + Slot sourceSlot = Slot::NONE; + Slot targetSlot = Slot::NONE; - bool operator==(const SlotDecision& other) const { - return sourceSlot == other.sourceSlot && targetSlot == other.targetSlot && megaEvolve == other.megaEvolve && - primalRevert == other.primalRevert && dynamax == other.dynamax && terastallize == other.terastallize && - moveOrItem == other.moveOrItem; + bool operator==(const SwitchDecision& other) const { + return sourceSlot == other.sourceSlot && targetSlot == other.targetSlot; + } +}; + +struct ItemDecision { + Slot sourceSlot = Slot::NONE; + Slot targetSlot = Slot::NONE; + + dex::Item item = dex::Item::NO_ITEM; + + bool operator==(const ItemDecision& other) const { + return sourceSlot == other.sourceSlot && targetSlot == other.targetSlot && item == other.item; } }; namespace types { -using slotDecisions = types::sideSlots; -} +struct slotDecision : pokesim::internal::variant< + MoveDecision, MegaEvolveAndMoveDecision, TerastallizeAndMoveDecision, DynamaxAndMoveDecision, + ZMoveDecision, SwitchDecision, ItemDecision> { + using pokesim::internal::variant< + MoveDecision, MegaEvolveAndMoveDecision, TerastallizeAndMoveDecision, DynamaxAndMoveDecision, ZMoveDecision, + SwitchDecision, ItemDecision>::variant; + + constexpr Slot sourceSlot() const { + return std::visit([](auto&& decision) { return decision.sourceSlot; }, *this); + } + + constexpr Slot targetSlot() const { + return std::visit([](auto&& decision) { return decision.targetSlot; }, *this); + } +}; + +using slotDecisions = types::sideSlots; +} // namespace types } // namespace pokesim diff --git a/src/Utilities/ArgumentChecks.cpp b/src/Utilities/ArgumentChecks.cpp index b17b9d6..7927d2e 100644 --- a/src/Utilities/ArgumentChecks.cpp +++ b/src/Utilities/ArgumentChecks.cpp @@ -984,7 +984,7 @@ void check(const SideDecision& sideDecision) { checkPlayerSideId(sideDecision.sideId); if (sideDecision.decisions.holds()) { const types::slotDecisions& decisions = sideDecision.decisions.get(); - for (const SlotDecision& decision : decisions) { + for (const auto& decision : decisions) { check(decision); } } @@ -1142,10 +1142,26 @@ void check(const Winner& winner) { } template <> -void check(const SlotDecision& slotDecision) { - checkSlot(slotDecision.sourceSlot); - checkSlot(slotDecision.targetSlot); - POKESIM_REQUIRE_NM(!(slotDecision.megaEvolve && slotDecision.primalRevert)); +void check(const ActionQueue2&) {} + +template <> +void check(const types::slotDecision& slotDecision) { + checkSlot(slotDecision.sourceSlot()); + checkSlot(slotDecision.targetSlot()); + auto [moveDecision, megaDecision, zMoveDecision, dynamaxDecision, teraDecision, itemDecision] = slotDecision.get_if< + MoveDecision, + MegaEvolveAndMoveDecision, + ZMoveDecision, + DynamaxAndMoveDecision, + TerastallizeAndMoveDecision, + ItemDecision>(); + + if (moveDecision) check(MoveName{moveDecision->move}); + if (megaDecision) check(MoveName{megaDecision->move}); + if (zMoveDecision) check(MoveName{zMoveDecision->move}); + if (dynamaxDecision) check(MoveName{dynamaxDecision->move}); + if (teraDecision) check(MoveName{teraDecision->move}); + if (itemDecision) check(ItemName{itemDecision->item}); } template <> diff --git a/src/Utilities/ArgumentChecks.hpp b/src/Utilities/ArgumentChecks.hpp index d85bf49..3d3aa61 100644 --- a/src/Utilities/ArgumentChecks.hpp +++ b/src/Utilities/ArgumentChecks.hpp @@ -536,7 +536,7 @@ template <> void check(const Winner&); template <> -void check(const SlotDecision&); +void check(const types::slotDecision&); template <> void check(const DamageRollKind&); diff --git a/src/Utilities/Variant.hpp b/src/Utilities/Variant.hpp index 005c440..c1b3498 100644 --- a/src/Utilities/Variant.hpp +++ b/src/Utilities/Variant.hpp @@ -1,5 +1,6 @@ #pragma once +#include #include namespace pokesim::internal { @@ -14,21 +15,31 @@ class variant : public std::variant { return *this; } - bool empty() const { return holds(); } + constexpr bool empty() const { return holds(); } template - bool holds() const { + constexpr bool holds() const { return std::holds_alternative(*this); } template - auto& get() const { + constexpr auto& get() const { return std::get(*this); } template - auto& get() { + constexpr auto& get() { return std::get(*this); } + + template + constexpr auto get_if() const { + return std::forward_as_tuple(std::get_if(this)...); + } + + template + constexpr auto get_if() { + return std::forward_as_tuple(std::get_if(this)...); + } }; } // namespace pokesim::internal diff --git a/tests/Effects/ChoiceLock.cpp b/tests/Effects/ChoiceLock.cpp index d07bfc7..f5068ce 100644 --- a/tests/Effects/ChoiceLock.cpp +++ b/tests/Effects/ChoiceLock.cpp @@ -19,12 +19,10 @@ TEST_CASE("Choice Lock: Choice lock starts", "[Simulation][SimulateTurn][Effect] battleCreationInfo.runWithSimulateTurn = true; SideDecision p1Decision{PlayerSideId::P1}; SideDecision p2Decision{PlayerSideId::P2}; - SlotDecision p1SlotDecision{Slot::P1A, Slot::P2A}; - SlotDecision p2SlotDecision{Slot::P2A, Slot::P2A}; - p1SlotDecision.moveOrItem = dex::Move::SPLASH; - p1Decision.decisions = types::sideSlots{p1SlotDecision}; - p2SlotDecision.moveOrItem = dex::Move::SPLASH; - p2Decision.decisions = types::sideSlots{p2SlotDecision}; + MoveDecision p1MoveDecision{Slot::P1A, Slot::P2A, dex::Move::SPLASH}; + MoveDecision p2MoveDecision{Slot::P2A, Slot::P2A, dex::Move::SPLASH}; + p1Decision.decisions = types::slotDecisions{p1MoveDecision}; + p2Decision.decisions = types::slotDecisions{p2MoveDecision}; battleCreationInfo.decisionsToSimulate = {{p1Decision, p2Decision}}; simulation.createInitialStates({battleCreationInfo}); @@ -110,12 +108,10 @@ TEST_CASE( battleCreationInfo.runWithSimulateTurn = true; SideDecision p1Decision{PlayerSideId::P1}; SideDecision p2Decision{PlayerSideId::P2}; - SlotDecision p1SlotDecision{Slot::P1A, Slot::P2A}; - SlotDecision p2SlotDecision{Slot::P2A, Slot::P2A}; - p1SlotDecision.moveOrItem = dex::Move::KNOCK_OFF; - p1Decision.decisions = types::sideSlots{p1SlotDecision}; - p2SlotDecision.moveOrItem = dex::Move::SPLASH; - p2Decision.decisions = types::sideSlots{p2SlotDecision}; + MoveDecision p1MoveDecision{Slot::P1A, Slot::P2A, dex::Move::KNOCK_OFF}; + MoveDecision p2MoveDecision{Slot::P2A, Slot::P2A, dex::Move::SPLASH}; + p1Decision.decisions = types::slotDecisions{p1MoveDecision}; + p2Decision.decisions = types::slotDecisions{p2MoveDecision}; battleCreationInfo.decisionsToSimulate = {{p1Decision, p2Decision}}; simulation.createInitialStates({battleCreationInfo}); diff --git a/tests/Effects/Paralysis.cpp b/tests/Effects/Paralysis.cpp index 8c29e74..845bb89 100644 --- a/tests/Effects/Paralysis.cpp +++ b/tests/Effects/Paralysis.cpp @@ -18,12 +18,10 @@ TEST_CASE("Paralysis: Can cause move failure", "[Simulation][SimulateTurn][Effec battleCreationInfo.runWithSimulateTurn = true; SideDecision p1Decision{PlayerSideId::P1}; SideDecision p2Decision{PlayerSideId::P2}; - SlotDecision p1SlotDecision{Slot::P1A, Slot::P2A}; - SlotDecision p2SlotDecision{Slot::P2A, Slot::P2A}; - p1SlotDecision.moveOrItem = dex::Move::KNOCK_OFF; - p1Decision.decisions = types::sideSlots{p1SlotDecision}; - p2SlotDecision.moveOrItem = dex::Move::SPLASH; - p2Decision.decisions = types::sideSlots{p2SlotDecision}; + MoveDecision p1MoveDecision{Slot::P1A, Slot::P2A, dex::Move::KNOCK_OFF}; + MoveDecision p2MoveDecision{Slot::P2A, Slot::P2A, dex::Move::SPLASH}; + p1Decision.decisions = types::slotDecisions{p1MoveDecision}; + p2Decision.decisions = types::slotDecisions{p2MoveDecision}; battleCreationInfo.decisionsToSimulate = {{p1Decision, p2Decision}}; simulation.createInitialStates({battleCreationInfo}); diff --git a/tests/Moves/FuryAttack.cpp b/tests/Moves/FuryAttack.cpp index 512ed58..d2ee40d 100644 --- a/tests/Moves/FuryAttack.cpp +++ b/tests/Moves/FuryAttack.cpp @@ -18,12 +18,10 @@ TEST_CASE("Fury Attack: Multi-hit Branches", "[Simulation][SimulateTurn][Move][F battleCreationInfo.runWithSimulateTurn = true; SideDecision p1Decision{PlayerSideId::P1}; SideDecision p2Decision{PlayerSideId::P2}; - SlotDecision p1SlotDecision{Slot::P1A, Slot::P2A}; - SlotDecision p2SlotDecision{Slot::P2A, Slot::P1A}; - p1SlotDecision.moveOrItem = dex::Move::FURY_ATTACK; - p1Decision.decisions = types::sideSlots{p1SlotDecision}; - p2SlotDecision.moveOrItem = dex::Move::SPLASH; - p2Decision.decisions = types::sideSlots{p2SlotDecision}; + MoveDecision p1MoveDecision{Slot::P1A, Slot::P2A, dex::Move::FURY_ATTACK}; + MoveDecision p2MoveDecision{Slot::P2A, Slot::P1A, dex::Move::SPLASH}; + p1Decision.decisions = types::slotDecisions{p1MoveDecision}; + p2Decision.decisions = types::slotDecisions{p2MoveDecision}; battleCreationInfo.decisionsToSimulate = {{p1Decision, p2Decision}}; simulation.createInitialStates({battleCreationInfo}); diff --git a/tests/Moves/KnockOff.cpp b/tests/Moves/KnockOff.cpp index 1563b8b..29e9241 100644 --- a/tests/Moves/KnockOff.cpp +++ b/tests/Moves/KnockOff.cpp @@ -20,12 +20,10 @@ TEST_CASE("Knock Off: Remove Most Items", "[Simulation][SimulateTurn][Move][Knoc battleCreationInfo.runWithSimulateTurn = true; SideDecision p1Decision{PlayerSideId::P1}; SideDecision p2Decision{PlayerSideId::P2}; - SlotDecision p1SlotDecision{Slot::P1A, Slot::P2A}; - SlotDecision p2SlotDecision{Slot::P2A, Slot::P2A}; - p1SlotDecision.moveOrItem = dex::Move::KNOCK_OFF; - p1Decision.decisions = types::sideSlots{p1SlotDecision}; - p2SlotDecision.moveOrItem = dex::Move::SPLASH; - p2Decision.decisions = types::sideSlots{p2SlotDecision}; + MoveDecision p1MoveDecision{Slot::P1A, Slot::P2A, dex::Move::KNOCK_OFF}; + MoveDecision p2MoveDecision{Slot::P2A, Slot::P2A, dex::Move::SPLASH}; + p1Decision.decisions = types::slotDecisions{p1MoveDecision}; + p2Decision.decisions = types::slotDecisions{p2MoveDecision}; battleCreationInfo.decisionsToSimulate = {{p1Decision, p2Decision}}; simulation.createInitialStates({battleCreationInfo}); diff --git a/tests/SimulateTurnsTest.cpp b/tests/SimulateTurnsTest.cpp index bf24629..0a77126 100644 --- a/tests/SimulateTurnsTest.cpp +++ b/tests/SimulateTurnsTest.cpp @@ -230,14 +230,13 @@ TEST_CASE("Simulate Turn: Battle ends on faint", "[Simulation][SimulateTurn]") { battleCreationInfo.runWithSimulateTurn = true; SideDecision p1Decision{PlayerSideId::P1}; SideDecision p2Decision{PlayerSideId::P2}; - SlotDecision p1SlotDecision{Slot::P1A, Slot::P1A}; - SlotDecision p2SlotDecision{Slot::P2A, Slot::P1A}; - p1SlotDecision.moveOrItem = dex::Move::SPLASH; - p1Decision.decisions = types::sideSlots{p1SlotDecision}; - p2SlotDecision.moveOrItem = dex::Move::THUNDERBOLT; - p2Decision.decisions = types::sideSlots{p2SlotDecision}; - - battleCreationInfo.decisionsToSimulate = {{p1Decision, p2Decision}}; + MoveDecision p1MoveDecision{Slot::P1A, Slot::P1A, dex::Move::SPLASH}; + MoveDecision p2MoveDecision{Slot::P2A, Slot::P1A, dex::Move::THUNDERBOLT}; + p1Decision.decisions = types::slotDecisions{p1MoveDecision}; + p2Decision.decisions = types::slotDecisions{p2MoveDecision}; + sizeof(types::slotDecision) + + battleCreationInfo.decisionsToSimulate = {{p1Decision, p2Decision}}; simulation.createInitialStates({battleCreationInfo}); auto& options = simulation.simulateTurnOptions; diff --git a/tests/SimulationSetupTest.cpp b/tests/SimulationSetupTest.cpp index 3358df7..601ecec 100644 --- a/tests/SimulationSetupTest.cpp +++ b/tests/SimulationSetupTest.cpp @@ -79,13 +79,11 @@ TEST_CASE("Simulation Setup: Simulate Turn", "[Simulation][SimulateTurn][Setup]" SideDecision p1Decision{PlayerSideId::P1}; SideDecision p2Decision{PlayerSideId::P2}; - SlotDecision p1SlotDecision{Slot::P1A, Slot::P2A}; - SlotDecision p2SlotDecision{Slot::P2A, Slot::P1A}; + MoveDecision p1MoveDecision{Slot::P1A, Slot::P2A, dex::Move::FURY_ATTACK}; + MoveDecision p2MoveDecision{Slot::P2A, Slot::P1A, dex::Move::THUNDERBOLT}; - p1SlotDecision.moveOrItem = dex::Move::FURY_ATTACK; - p1Decision.decisions = types::sideSlots{p1SlotDecision}; - p2SlotDecision.moveOrItem = dex::Move::THUNDERBOLT; - p2Decision.decisions = types::sideSlots{p2SlotDecision}; + p1Decision.decisions = types::slotDecisions{p1MoveDecision}; + p2Decision.decisions = types::slotDecisions{p2MoveDecision}; auto check = [&]() { Simulation simulation(pokedex, BattleFormat::SINGLES); @@ -117,22 +115,24 @@ TEST_CASE("Simulation Setup: Simulate Turn", "[Simulation][SimulateTurn][Setup]" }); auto checkDecision = - [&](types::entity decisionEntity, const pokesim::SlotDecision& decision, const PokemonCreationInfo& pokemon) { - if (decision.moveOrItem.holds()) { + [&](types::entity decisionEntity, const types::slotDecision& decision, const PokemonCreationInfo& pokemon) { + if (decision.holds()) { const auto [target, move, speedSort] = registry.get(decisionEntity); + const auto& moveDecision = decision.get(); - REQUIRE(target.val == decision.targetSlot); - REQUIRE(move.val == decision.moveOrItem.get()); + REQUIRE(target.val == moveDecision.targetSlot); + REQUIRE(move.val == moveDecision.move); REQUIRE(speedSort.speed == pokemon.stats.spe); REQUIRE(speedSort.order == ActionOrder::MOVE); REQUIRE(speedSort.priority == 0); REQUIRE(speedSort.fractionalPriority == false); } - else { + else if (decision.holds()) { REQUIRE(registry.all_of(decisionEntity)); const auto [target, speedSort] = registry.get(decisionEntity); + const auto& switchDecision = decision.get(); - REQUIRE(target.val == decision.targetSlot); + REQUIRE(target.val == switchDecision.targetSlot); REQUIRE(speedSort.speed == pokemon.stats.spe); REQUIRE(speedSort.order == ActionOrder::SWITCH); REQUIRE(speedSort.priority == 0); @@ -176,18 +176,15 @@ TEST_CASE("Simulation Setup: Simulate Turn", "[Simulation][SimulateTurn][Setup]" switch (i) { case 0U: { - newP1SlotDecision.moveOrItem = p1SlotDecision.moveOrItem; - newP1SlotDecision.targetSlot = Slot::P2A; + newP1SlotDecision = MoveDecision{p1MoveDecision.sourceSlot, Slot::P2A, p1MoveDecision.move}; break; } case 1U: { - newP1SlotDecision.moveOrItem = std::monostate{}; - newP1SlotDecision.targetSlot = Slot::P1B; + newP1SlotDecision = SwitchDecision{p1MoveDecision.sourceSlot, Slot::P1B}; break; } case 2U: { - newP1SlotDecision.moveOrItem = std::monostate{}; - newP1SlotDecision.targetSlot = Slot::P1C; + newP1SlotDecision = SwitchDecision{p1MoveDecision.sourceSlot, Slot::P1C}; break; } default: break; @@ -195,18 +192,15 @@ TEST_CASE("Simulation Setup: Simulate Turn", "[Simulation][SimulateTurn][Setup]" switch (j) { case 0U: { - newP2SlotDecision.moveOrItem = p2SlotDecision.moveOrItem; - newP2SlotDecision.targetSlot = Slot::P1A; + newP2SlotDecision = MoveDecision{p2MoveDecision.sourceSlot, Slot::P2A, p2MoveDecision.move}; break; } case 1U: { - newP2SlotDecision.moveOrItem = std::monostate{}; - newP2SlotDecision.targetSlot = Slot::P2B; + newP2SlotDecision = SwitchDecision{p2MoveDecision.sourceSlot, Slot::P2B}; break; } case 2U: { - newP2SlotDecision.moveOrItem = std::monostate{}; - newP2SlotDecision.targetSlot = Slot::P2C; + newP2SlotDecision = SwitchDecision{p2MoveDecision.sourceSlot, Slot::P2C}; break; } default: break; diff --git a/tests/VerticalSlices.cpp b/tests/VerticalSlices.cpp index 0edf85c..a0d7134 100644 --- a/tests/VerticalSlices.cpp +++ b/tests/VerticalSlices.cpp @@ -369,13 +369,11 @@ TEST_CASE( BattleCreationInfo battleCreationInfo; SideDecision p1Decision{PlayerSideId::P1}; SideDecision p2Decision{PlayerSideId::P2}; - SlotDecision p1SlotDecision{Slot::P1A, Slot::P2A}; - SlotDecision p2SlotDecision{Slot::P2A, Slot::P1A}; + MoveDecision p1MoveDecision{Slot::P1A, Slot::P2A, dex::Move::KNOCK_OFF}; + MoveDecision p2MoveDecision{Slot::P2A, Slot::P1A, dex::Move::THUNDERBOLT}; - p1SlotDecision.moveOrItem = dex::Move::KNOCK_OFF; - p1Decision.decisions = types::sideSlots{p1SlotDecision}; - p2SlotDecision.moveOrItem = dex::Move::THUNDERBOLT; - p2Decision.decisions = types::sideSlots{p2SlotDecision}; + p1Decision.decisions = types::slotDecisions{p1MoveDecision}; + p2Decision.decisions = types::slotDecisions{p2MoveDecision}; battleCreationInfo.decisionsToSimulate = {{p1Decision, p2Decision}}; Simulation simulation = createSingleBattleSimulation(pokedex, battleCreationInfo); @@ -682,17 +680,13 @@ TEST_CASE( SideDecision p1Decision{PlayerSideId::P1}; SideDecision p2Decision{PlayerSideId::P2}; - SlotDecision p1ASlotDecision{Slot::P1A, Slot::P2B}; - SlotDecision p1BSlotDecision{Slot::P1B, Slot::P2A}; - SlotDecision p2ASlotDecision{Slot::P2A, Slot::P1B}; - SlotDecision p2BSlotDecision{Slot::P2B, Slot::P2B}; - - p1ASlotDecision.moveOrItem = dex::Move::MOONBLAST; - p1BSlotDecision.moveOrItem = dex::Move::WILL_O_WISP; - p1Decision.decisions = types::sideSlots{p1ASlotDecision, p1BSlotDecision}; - p2ASlotDecision.moveOrItem = dex::Move::KNOCK_OFF; - p2BSlotDecision.moveOrItem = dex::Move::QUIVER_DANCE; - p2Decision.decisions = types::sideSlots{p2ASlotDecision, p2BSlotDecision}; + MoveDecision p1AMoveDecision{Slot::P1A, Slot::P2B, dex::Move::MOONBLAST}; + MoveDecision p1BMoveDecision{Slot::P1B, Slot::P2A, dex::Move::WILL_O_WISP}; + MoveDecision p2AMoveDecision{Slot::P2A, Slot::P1B, dex::Move::KNOCK_OFF}; + MoveDecision p2BMoveDecision{Slot::P2B, Slot::P2B, dex::Move::QUIVER_DANCE}; + + p1Decision.decisions = types::slotDecisions{p1AMoveDecision, p1BMoveDecision}; + p2Decision.decisions = types::slotDecisions{p2AMoveDecision, p2BMoveDecision}; battleCreationInfo.decisionsToSimulate = {{p1Decision, p2Decision}}; auto simulation = createDoubleBattleSimulation(pokedex, battleCreationInfo); From 0a435923860ba15cc8b27c3fc68972491865f725 Mon Sep 17 00:00:00 2001 From: aed3 <32887801+aed3@users.noreply.github.com> Date: Fri, 12 Jun 2026 14:07:30 -0500 Subject: [PATCH 03/10] Reusable Action Entity This commit changes how the action queue works so information about an action is only applied to an entity when the action is active. That allows for only allocating one entity per battle instead one per action. Actions are also now cleared using the `remove` function rather than `destroy`, which allows it to select the exact components to remove from it instead of looping over all possible components. These changes together made the simulate turn benchmarks ~10% faster and the ManageActionQueue.cpp code simpler. --- extras/PokeSim.cpp | 263 +++--- extras/PokeSim.hpp | 882 ++++++++++-------- extras/RecentBenchmarkResults.md | 422 ++++----- src/Battle/Clone/Clone.cpp | 19 +- src/Battle/ManageBattleState.cpp | 5 +- src/Battle/Setup/BattleStateSetup.cpp | 9 +- src/Battle/Setup/BattleStateSetup.hpp | 3 +- src/Components/ActionQueue.hpp | 58 ++ src/Components/EntityHolders/ActionQueue.hpp | 12 - src/Components/EntityHolders/Current.hpp | 4 - .../EntityHolders/RecycledEntities.hpp | 9 + src/Components/EntityHolders/headers.hpp | 2 +- src/Components/SpeedSort.hpp | 26 - src/Components/Tags/RecycledEntities.hpp | 5 + src/Components/Tags/headers.hpp | 1 + src/Components/headers.hpp | 5 +- src/SimulateTurn/ManageActionQueue.cpp | 178 ++-- src/SimulateTurn/ManageActionQueue.hpp | 9 +- src/SimulateTurn/SimulateTurn.cpp | 13 +- src/SimulateTurn/SimulateTurnDebugChecks.hpp | 31 +- src/Simulation/SimulationSetup.cpp | 1 - src/Simulation/SimulationSetupDebugChecks.hpp | 2 +- src/Utilities/ArgumentChecks.cpp | 55 +- src/Utilities/ArgumentChecks.hpp | 24 +- src/Utilities/Variant.hpp | 4 +- tests/SimulateTurnsTest.cpp | 159 ++-- tests/SimulationSetupTest.cpp | 49 +- 27 files changed, 1127 insertions(+), 1123 deletions(-) create mode 100644 src/Components/ActionQueue.hpp delete mode 100644 src/Components/EntityHolders/ActionQueue.hpp create mode 100644 src/Components/EntityHolders/RecycledEntities.hpp delete mode 100644 src/Components/SpeedSort.hpp create mode 100644 src/Components/Tags/RecycledEntities.hpp diff --git a/extras/PokeSim.cpp b/extras/PokeSim.cpp index 25ae583..f1b1b72 100644 --- a/extras/PokeSim.cpp +++ b/extras/PokeSim.cpp @@ -265,23 +265,18 @@ void checkAction(types::entity actionEntity, const types::registry& registry) { POKESIM_REQUIRE_NM(!has(actionEntity, registry)); POKESIM_REQUIRE_NM(!has(actionEntity, registry)); POKESIM_REQUIRE_NM(!has(actionEntity, registry)); - POKESIM_REQUIRE_NM(!has(actionEntity, registry)); checkTeamOrder(registry.get(actionEntity).val); } - else { - POKESIM_REQUIRE_NM(has(actionEntity, registry)); - } if (registry.any_of(actionEntity)) { POKESIM_REQUIRE_NM(has(actionEntity, registry)); POKESIM_REQUIRE_NM(has(actionEntity, registry)); POKESIM_REQUIRE_NM(!has(actionEntity, registry)); - const auto& [source, target, speedSort] = registry.get(actionEntity); + const auto& [source, target] = registry.get(actionEntity); check(source); check(target); - check(speedSort); if (has(actionEntity, registry)) { check(registry.get(actionEntity)); @@ -485,6 +480,25 @@ void check(const Accuracy& accuracy) { checkBounds(accuracy.val); } +template <> +void check(const ActionQueueItem& actionQueueItem) { + POKESIM_REQUIRE_NM(listContains(VALID_ACTION_ORDERS, actionQueueItem.order)); + checkBounds(actionQueueItem.priority); + checkStat(actionQueueItem.speed); + + if (actionQueueItem.order == ActionOrder::MOVE || actionQueueItem.order == ActionOrder::SWITCH) { + check(actionQueueItem.decision); + } +} + +template <> +void check(const ActionQueue& actionQueue) { + checkBounds(actionQueue.val.size()); + for (const ActionQueueItem& actionQueueItem : actionQueue.val) { + check(actionQueueItem); + } +} + template <> void check(const AddedTargets& addedTargets) { POKESIM_REQUIRE_NM(listContains(VALID_ADDED_TARGET_OPTIONS, addedTargets.val)); @@ -709,14 +723,6 @@ void check(const Ivs& ivs) { checkIv(ivs.spe); } -template <> -void check(const ActionQueue& actionQueue, const types::registry& registry) { - checkBounds(actionQueue.val.size()); - for (types::entity entity : actionQueue.val) { - checkAction(entity, registry); - } -} - template <> void check(const Battle& battle, const types::registry& registry) { checkBattle(battle.val, registry); @@ -747,11 +753,6 @@ void check(const CurrentAction& currentAction, const types::registry& registry) checkAction(currentAction.val, registry); } -template <> -void check(const NextAction& nextAction, const types::registry& registry) { - checkAction(nextAction.val, registry); -} - template <> void check(const CurrentActionTargets& targets, const types::registry& registry) { checkBounds(targets.val.size()); @@ -857,6 +858,12 @@ void check(const Pokemon& pokemon, const types::registry& registry) { checkPokemon(pokemon.val, registry); } +template <> +void check(const RecycledAction& recycledAction, const types::registry& registry) { + types::registry::checkEntity(recycledAction.val, registry); + POKESIM_REQUIRE_NM(has(recycledAction.val, registry)); +} + template <> void check(const Side& side, const types::registry& registry) { checkSide(side.val, registry); @@ -1220,13 +1227,6 @@ void check(const SpeciesTypes& speciesTypes) { } } -template <> -void check(const SpeedSort& speedSort) { - POKESIM_REQUIRE_NM(listContains(VALID_ACTION_ORDERS, speedSort.order)); - checkBounds(speedSort.priority); - checkStat(speedSort.speed); -} - template <> void check(const stat::Hp& hp) { checkStat(hp.val, true); @@ -1299,9 +1299,6 @@ void check(const Winner& winner) { winner.val == PlayerSideId::P1 || winner.val == PlayerSideId::P2 || winner.val == PlayerSideId::NONE); } -template <> -void check(const ActionQueue2&) {} - template <> void check(const types::slotDecision& slotDecision) { checkSlot(slotDecision.sourceSlot()); @@ -2469,7 +2466,7 @@ void checkWin(types::handle battleHandle, const Sides& sides) { types::teamPositionIndex pokemonLeft = foeSidePokemonLeft(registry, sideEntity); if (!pokemonLeft) { battleHandle.emplace(registry.get(sideEntity).val); - clearActionQueue(battleHandle, battleHandle.get()); + clearActionQueue(battleHandle.get()); return; } } @@ -2573,8 +2570,11 @@ void simulateTurn(Simulation& simulation) { simulation.addToEntities(); const auto entityMap = clone(simulation.registry, 1U); for (const auto& inputBattleMapping : entityMap) { - simulation.registry.emplace(inputBattleMapping.first); - simulation.registry.remove(inputBattleMapping.first); + types::entity original = inputBattleMapping.first; + if (simulation.registry.all_of(original)) { + simulation.registry.emplace(original); + simulation.registry.remove(original); + } } } @@ -3193,78 +3193,59 @@ template void setRandomEventChances<5U>(types::handle, const Simulation&, const namespace pokesim::simulate_turn { namespace { template -void resolveSlotDecision( - types::handle actionHandle, types::entity sideEntity, const types::slotDecision& slotDecision, - ActionQueue& actionQueue) { +void resolveSlotDecision(types::handle sideHandle, const types::slotDecision& slotDecision, ActionQueue& actionQueue) { if (!slotDecision.holds()) { return; } - types::registry& registry = *actionHandle.registry(); + types::registry& registry = *sideHandle.registry(); const auto& decision = slotDecision.get(); POKESIM_REQUIRE(decision.sourceSlot != Slot::NONE, "Source slot must be assigned."); POKESIM_REQUIRE(decision.targetSlot != Slot::NONE, "Target slot must be assigned."); - actionHandle.emplace(decision.sourceSlot); - actionHandle.emplace(decision.targetSlot); + ActionQueueItem actionQueueItem; + actionQueueItem.decision = decision; - SpeedSort speedSort; - types::entity sourceEntity = slotToPokemonEntity(registry, sideEntity, decision.sourceSlot); - speedSort.speed = registry.get(sourceEntity).val; + types::entity sourceEntity = slotToPokemonEntity(registry, sideHandle.entity(), decision.sourceSlot); + actionQueueItem.speed = registry.get(sourceEntity).val; if constexpr (std::is_base_of_v) { - speedSort.order = ActionOrder::MOVE; - speedSort.priority = Constants::MovePriority::DEFAULT; // TODO (aed3): Move priority + modify priority - speedSort.fractionalPriority = false; // TODO (aed3): get fractionalPriority - - actionHandle.emplace(); - actionHandle.emplace(decision.move); + actionQueueItem.order = ActionOrder::MOVE; + actionQueueItem.priority = Constants::MovePriority::DEFAULT; // TODO (aed3): Move priority + modify priority + actionQueueItem.fractionalPriority = false; // TODO (aed3): get fractionalPriority if constexpr (!std::is_same_v) { POKESIM_REQUIRE_FAIL(std::string(entt::type_name().value()) + " is not yet supported."); } } else if constexpr (std::is_same_v) { - speedSort.order = ActionOrder::SWITCH; - - actionHandle.emplace(); + actionQueueItem.order = ActionOrder::SWITCH; } else if constexpr (std::is_same_v) { - speedSort.order = ActionOrder::ITEM; - - actionHandle.emplace(); - actionHandle.emplace(decision.item); + actionQueueItem.order = ActionOrder::ITEM; } else { POKESIM_REQUIRE_FAIL(std::string(entt::type_name().value()) + " is not yet supported."); } - actionHandle.emplace(speedSort); - actionQueue.val.push_back(actionHandle.entity()); + actionQueue.val.push_back(actionQueueItem); } void resolveSlotDecisions(types::handle sideHandle, const types::slotDecisions& decisions, ActionQueue& actionQueue) { - types::registry& registry = *sideHandle.registry(); for (const types::slotDecision& decision : decisions) { - types::handle actionHandle = {registry, registry.create()}; - - resolveSlotDecision(actionHandle, sideHandle.entity(), decision, actionQueue); - resolveSlotDecision(actionHandle, sideHandle.entity(), decision, actionQueue); - resolveSlotDecision(actionHandle, sideHandle.entity(), decision, actionQueue); - resolveSlotDecision(actionHandle, sideHandle.entity(), decision, actionQueue); - resolveSlotDecision(actionHandle, sideHandle.entity(), decision, actionQueue); - resolveSlotDecision(actionHandle, sideHandle.entity(), decision, actionQueue); - resolveSlotDecision(actionHandle, sideHandle.entity(), decision, actionQueue); + resolveSlotDecision(sideHandle, decision, actionQueue); + resolveSlotDecision(sideHandle, decision, actionQueue); + resolveSlotDecision(sideHandle, decision, actionQueue); + resolveSlotDecision(sideHandle, decision, actionQueue); + resolveSlotDecision(sideHandle, decision, actionQueue); + resolveSlotDecision(sideHandle, decision, actionQueue); + resolveSlotDecision(sideHandle, decision, actionQueue); } } void resolveTeamDecision(types::registry& registry, const types::teamOrder& teamOrder, ActionQueue& battleActionQueue) { - types::handle actionHandle = {registry, registry.create()}; - - actionHandle.emplace(teamOrder); - battleActionQueue.val.push_back(actionHandle.entity()); } } // namespace @@ -3274,7 +3255,7 @@ void resolveDecision(types::handle sideHandle, const SideDecision& sideDecision) const Battle& battle = sideHandle.get(); types::registry& registry = *sideHandle.registry(); - ActionQueue& battleActionQueue = registry.get(battle.val); + ActionQueue& actionQueue = registry.get(battle.val); if (sideDecision.decisions.holds()) { POKESIM_REQUIRE( @@ -3298,7 +3279,7 @@ void resolveDecision(types::handle sideHandle, const SideDecision& sideDecision) } #endif - resolveSlotDecisions(sideHandle, decisions, battleActionQueue); + resolveSlotDecisions(sideHandle, decisions, actionQueue); } else if (sideDecision.decisions.holds()) { POKESIM_REQUIRE( @@ -3310,7 +3291,7 @@ void resolveDecision(types::handle sideHandle, const SideDecision& sideDecision) POKESIM_REQUIRE( sideHandle.get().val.size() == teamOrder.size(), "Must pick a placement for each Pokemon on the team."); - resolveTeamDecision(*sideHandle.registry(), teamOrder, battleActionQueue); + resolveTeamDecision(*sideHandle.registry(), teamOrder, actionQueue); } else { POKESIM_REQUIRE_FAIL( @@ -3319,51 +3300,23 @@ void resolveDecision(types::handle sideHandle, const SideDecision& sideDecision) } void speedSort(types::handle handle, ActionQueue& actionQueue) { - auto& entityList = actionQueue.val; + auto& actionQueueItems = actionQueue.val; - if (entityList.size() == 1U) return; - const types::registry* registry = handle.registry(); - - internal::maxSizedVector, Constants::ActionQueueLength::MAX> speedSortList; - speedSortList.reserve(entityList.size()); - - for (types::entity entity : entityList) { - speedSortList.push_back({registry->get(entity), entity}); + if (actionQueueItems.size() == 1U) { + return; } // TODO(aed3): Test how different sorting algorithms affect speed - std::sort(speedSortList.begin(), speedSortList.end(), [](const auto& pairA, const auto& pairB) { - if (pairA.first.order != pairB.first.order) { - return pairA.first.order < pairB.first.order; - } - - if (pairA.first.priority != pairB.first.priority) { - return pairB.first.priority < pairA.first.priority; - } - - if (pairA.first.fractionalPriority != pairB.first.fractionalPriority) { - return pairB.first.fractionalPriority; - } - - if (pairA.first.speed != pairB.first.speed) { - return pairB.first.speed < pairA.first.speed; - } - - return false; - }); + std::sort( + actionQueueItems.begin(), + actionQueueItems.end(), + [](const ActionQueueItem& itemA, const ActionQueueItem& itemB) { return itemA.isFasterThan(itemB); }); SpeedTieIndexes speedTies; types::activePokemonIndex lastEqual = 0U, tieCount = 1U; - auto speedSortEqual = [](const SpeedSort& speedSortA, const SpeedSort& speedSortB) { - return speedSortA.order == speedSortB.order && speedSortA.priority == speedSortB.priority && - speedSortA.speed == speedSortB.speed && speedSortA.fractionalPriority == speedSortB.fractionalPriority; - }; - - for (types::activePokemonIndex i = 0U; i < speedSortList.size(); i++) { - entityList[i] = speedSortList[i].second; - - if (i > 0U && speedSortEqual(speedSortList[i].first, speedSortList[i - 1].first)) { + for (types::activePokemonIndex i = 1U; i < actionQueueItems.size(); i++) { + if (actionQueueItems[i].isSameSpeed(actionQueueItems[i - 1U])) { tieCount++; } else { @@ -3384,54 +3337,51 @@ void speedSort(types::handle handle, ActionQueue& actionQueue) { } } -void addBeforeTurnAction(types::registry& registry, ActionQueue& actionQueue) { - types::handle actionHandle{registry, registry.create()}; - SpeedSort speedSort{ActionOrder::BEFORE_TURN}; - - actionHandle.emplace(); - actionHandle.emplace(speedSort); - actionQueue.val.push_back(actionHandle.entity()); +void addBeforeTurnAction(ActionQueue& actionQueue) { + actionQueue.val.push_back({ActionOrder::BEFORE_TURN}); } -void addResidualAction(types::registry& registry, ActionQueue& actionQueue) { - types::handle actionHandle{registry, registry.create()}; - SpeedSort speedSort{ActionOrder::RESIDUAL}; - - actionHandle.emplace(); - actionHandle.emplace(speedSort); - actionQueue.val.push_back(actionHandle.entity()); +void addResidualAction(ActionQueue& actionQueue) { + actionQueue.val.push_back({ActionOrder::RESIDUAL}); } -void setCurrentAction(types::handle battleHandle, ActionQueue& actionQueue) { +void setCurrentAction(types::handle battleHandle, ActionQueue& actionQueue, RecycledAction& action) { types::registry& registry = *battleHandle.registry(); if (actionQueue.val.empty()) return; - types::entity newCurrentAction = actionQueue.val.front(); - registry.emplace(newCurrentAction); + ActionQueueItem nextActon = actionQueue.val.front(); + registry.emplace(action.val); - if (registry.all_of(newCurrentAction)) { - battleHandle.emplace(); - } - else if (registry.all_of(newCurrentAction)) { - battleHandle.emplace(); - } - else { - POKESIM_REQUIRE_FAIL("Action kind not implemented yet."); + switch (nextActon.order) { + case ActionOrder::MOVE: { + battleHandle.emplace(); + const MoveDecision& decision = nextActon.decision.get(); + registry.emplace(action.val, decision.sourceSlot); + registry.emplace(action.val, decision.targetSlot); + registry.emplace(action.val, decision.move); + break; + } + case ActionOrder::RESIDUAL: { + battleHandle.emplace(); + break; + } + case ActionOrder::BEFORE_TURN: { + battleHandle.emplace(); + break; + } + default: { + POKESIM_REQUIRE_FAIL("Action kind not implemented yet."); + break; + } } actionQueue.val.erase(actionQueue.val.begin()); - battleHandle.remove(); - battleHandle.emplace(newCurrentAction); - if (!actionQueue.val.empty()) { - battleHandle.emplace(actionQueue.val[0]); - } + battleHandle.emplace(action.val); } -void clearActionQueue(types::handle battleHandle, ActionQueue& actionQueue) { - battleHandle.remove(); - battleHandle.registry()->destroy(actionQueue.val.begin(), actionQueue.val.end()); +void clearActionQueue(ActionQueue& actionQueue) { actionQueue.val.clear(); } } // namespace pokesim::simulate_turn @@ -5390,6 +5340,9 @@ BattleStateSetup::BattleStateSetup(types::registry& registry, types::entity enti if (!handle.any_of()) { handle.emplace(); handle.emplace(); + + types::entity recycledAction = handle.emplace(registry.create()).val; + registry.emplace(recycledAction); } } @@ -5432,7 +5385,7 @@ void BattleStateSetup::setRNGSeed(std::optional seed) { handle.emplace(seed.value()); } -void BattleStateSetup::setActionQueue(const std::vector& queue) { +void BattleStateSetup::setActionQueue(const std::vector& queue) { handle.emplace(queue); } @@ -5982,7 +5935,10 @@ void clearCurrentAction(Simulation& simulation) { auto currentActions = registry.view(); registry.destroy(actionMoves.begin(), actionMoves.end()); registry.destroy(failedActionMoves.begin(), failedActionMoves.end()); - registry.destroy(currentActions.begin(), currentActions.end()); + + registry.remove( + currentActions.begin(), + currentActions.end()); auto battles = simulation.battleEntities(); registry.remove< @@ -6146,20 +6102,18 @@ void traverseBattle(types::registry& registry, VisitEntity visitEntity = nullptr const static bool ForCloning = !std::is_same_v; using Tag = std::conditional_t; - for (const auto [entity, sides, actionQueue] : registry.view().each()) { + for (const auto [entity, sides] : registry.view().each()) { for (auto side : sides.val) { registry.emplace(side); } - for (auto queueItem : actionQueue.val) { - registry.emplace(queueItem); - } if constexpr (ForCloning) { visitEntity(entity); } } - for (const auto [entity, currentAction] : registry.view().each()) { - registry.emplace(currentAction.val); + + for (const auto [entity, recycledAction] : registry.view().each()) { + registry.emplace(recycledAction.val); } } @@ -6184,8 +6138,8 @@ void traverseAction(types::registry& registry, VisitEntity visitEntity = nullptr const static bool ForCloning = !std::is_same_v; using Tag = std::conditional_t; - if constexpr (ForCloning) { - for (types::entity entity : registry.view()) { + for (types::entity entity : registry.view()) { + if constexpr (ForCloning) { visitEntity(entity); } } @@ -6393,7 +6347,6 @@ types::ClonedEntityMap clone(types::registry& registry, std::optional(registry, entityMap); remapComponentEntities(registry, entityMap); remapComponentEntities(registry, entityMap); remapComponentEntities(registry, entityMap); @@ -6413,8 +6366,8 @@ types::ClonedEntityMap clone(types::registry& registry, std::optional(registry, entityMap); remapComponentEntities(registry, entityMap); remapComponentEntities(registry, entityMap); - remapComponentEntities(registry, entityMap); remapComponentEntities(registry, entityMap); + remapComponentEntities(registry, entityMap); remapComponentEntities(registry, entityMap); remapComponentEntities(registry, entityMap); remapComponentEntities(registry, entityMap); diff --git a/extras/PokeSim.hpp b/extras/PokeSim.hpp index 91c6670..c97191d 100644 --- a/extras/PokeSim.hpp +++ b/extras/PokeSim.hpp @@ -83,18 +83,23 @@ * src/CalcDamage/Helpers.hpp * src/Types/Random.hpp * src/Components/Accuracy.hpp + * src/Types/Enums/Item.hpp + * src/Types/Enums/Move.hpp + * src/Types/Enums/Slot.hpp + * src/Utilities/Variant.hpp + * src/Types/Decisions.hpp + * src/Types/Enums/ActionOrder.hpp + * src/Types/Move.hpp + * src/Components/ActionQueue.hpp * src/Types/Enums/AddedTargets.hpp * src/Components/AddedTargets.hpp * src/Components/EntityHolders/Current.hpp * src/Components/Tags/Current.hpp * src/Components/AnalyzeEffect/Aliases.hpp - * src/Types/Enums/Move.hpp * src/Components/AnalyzeEffect/AnalyzeEffectInputs.hpp - * src/Utilities/Variant.hpp * src/Types/Effect.hpp * src/Components/AnalyzeEffect/RemovedEffect.hpp * src/Components/BaseEffectChance.hpp - * src/Types/Move.hpp * src/Components/BasePower.hpp * src/Components/CalcDamage/Aliases.hpp * src/Types/Enums/GameMechanics.hpp @@ -106,13 +111,13 @@ * src/Components/CalcDamage/TemporaryMoveProperties.hpp * src/Components/CloneFromCloneTo.hpp * src/Components/EVsIVs.hpp - * src/Components/EntityHolders/ActionQueue.hpp * src/Components/EntityHolders/ChoiceLock.hpp * src/Components/EntityHolders/FaintQueue.hpp * src/Components/EntityHolders/FoeSide.hpp * src/Components/EntityHolders/LastUsedMove.hpp * src/Components/EntityHolders/MoveSlots.hpp * src/Components/EntityHolders/Pokemon.hpp + * src/Components/EntityHolders/RecycledEntities.hpp * src/Components/EntityHolders/Side.hpp * src/Components/EntityHolders/Sides.hpp * src/Components/EntityHolders/Team.hpp @@ -124,12 +129,10 @@ * src/Components/Names/AbilityNames.hpp * src/Types/Enums/Gender.hpp * src/Components/Names/GenderNames.hpp - * src/Types/Enums/Item.hpp * src/Components/Names/ItemNames.hpp * src/Components/Names/MoveNames.hpp * src/Types/Enums/Nature.hpp * src/Components/Names/NatureNames.hpp - * src/Types/Enums/Slot.hpp * src/Components/Names/SourceSlotName.hpp * src/Types/Enums/Species.hpp * src/Components/Names/SpeciesNames.hpp @@ -147,7 +150,6 @@ * src/Components/RNGSeed.hpp * src/Components/RandomEventInputs.hpp * src/Components/RandomEventOutputs.hpp - * src/Types/Decisions.hpp * src/Components/SideDecisions.hpp * src/Components/SimulateTurn/ActionTags.hpp * src/Components/SimulateTurn/MoveHitStepTags.hpp @@ -156,8 +158,6 @@ * src/Components/SimulateTurn/TeamAction.hpp * src/Components/SimulationResults.hpp * src/Components/SpeciesTypes.hpp - * src/Types/Enums/ActionOrder.hpp - * src/Components/SpeedSort.hpp * src/Components/Stats.hpp * src/Components/Tags/AbilityTags.hpp * src/Components/Tags/BattleTags.hpp @@ -167,6 +167,7 @@ * src/Components/Tags/MoveTags.hpp * src/Components/Tags/NatureTags.hpp * src/Components/Tags/PokemonTags.hpp + * src/Components/Tags/RecycledEntities.hpp * src/Components/Tags/RunEventTags.hpp * src/Components/Tags/Selection.hpp * src/Components/Tags/SimulationTags.hpp @@ -18257,147 +18258,20 @@ struct Accuracy { ////////////////////// END OF src/Components/Accuracy.hpp ////////////////////// -////////////////// START OF src/Types/Enums/AddedTargets.hpp /////////////////// - -namespace pokesim { -enum class AddedTargetOptions : std::uint8_t { - NONE = 0b00000000, - TARGET_ALLY = 0b00000001, - USER_ALLY = 0b00000010, - TARGET_SIDE = 0b00000100, - USER_SIDE = 0b00001000, - FIELD = 0b00010000, -}; - -constexpr AddedTargetOptions operator|(AddedTargetOptions optionA, AddedTargetOptions optionB) { - return static_cast(static_cast(optionA) | static_cast(optionB)); -} - -constexpr bool operator&(AddedTargetOptions optionA, AddedTargetOptions optionB) { - return (static_cast(optionA) & static_cast(optionB)) != 0U; -} - -static constexpr inline std::array VALID_ADDED_TARGET_OPTIONS = { - AddedTargetOptions::NONE, - AddedTargetOptions::TARGET_ALLY, - AddedTargetOptions::USER_ALLY, - AddedTargetOptions::TARGET_SIDE, - AddedTargetOptions::USER_SIDE, - AddedTargetOptions::FIELD, -}; -} // namespace pokesim - -/////////////////// END OF src/Types/Enums/AddedTargets.hpp //////////////////// - -/////////////////// START OF src/Components/AddedTargets.hpp /////////////////// - -namespace pokesim { -struct AddedTargets { - AddedTargetOptions val = AddedTargetOptions::NONE; -}; -} // namespace pokesim - -//////////////////// END OF src/Components/AddedTargets.hpp //////////////////// - -////////////// START OF src/Components/EntityHolders/Current.hpp /////////////// - -namespace pokesim { -struct CurrentAction { - types::entity val{}; -}; - -struct NextAction { - types::entity val{}; -}; - -struct CurrentActionTargets { - types::targets val{}; -}; - -struct CurrentActionSource { - types::entity val{}; -}; - -struct CurrentActionTarget { - types::entity val{}; -}; - -struct FailedCurrentActionSource { - types::entity val{}; -}; - -struct FailedCurrentActionTarget { - types::entity val{}; -}; - -struct CurrentActionMovesAsSource { - types::entityVector val{}; -}; - -struct CurrentActionMovesAsTarget { - types::entityVector val{}; -}; - -struct CurrentActionMoveSlot { - types::entity val{}; -}; - -struct CurrentEffectSource { - types::entity val{}; -}; - -struct CurrentEffectTarget { - types::entity val{}; -}; - -struct CurrentEffectsAsSource { - types::entityVector val{}; -}; +////////////////////// START OF src/Types/Enums/Item.hpp /////////////////////// -struct CurrentEffectsAsTarget { - types::entityVector val{}; +namespace pokesim::dex { +// Name of items in Pokemon games +enum class Item : std::uint16_t { + // clang-format off + NO_ITEM = 0U, ABILITY_CAPSULE, ABILITY_PATCH, ABILITY_SHIELD, ABOMASITE, ABRA_CANDY, ABSOLITE, ABSORB_BULB, ACRO_BIKE, ADAMANT_CRYSTAL, ADAMANT_MINT, ADAMANT_ORB, ADRENALINE_ORB, ADVENTURE_GUIDE, AERODACTYLITE, AERODACTYL_CANDY, AGGRONITE, AGUAV_BERRY, AIR_BALLOON, AIR_MAIL, ALAKAZITE, ALORAICHIUM_Z, ALTARIANITE, AMAZE_MULCH, AMPHAROSITE, AMULET_COIN, ANTIDOTE, APICOT_BERRY, APRICORN, APRICORN_BOX, AQUA_SUIT, ARMOR_FOSSIL, ARMOR_PASS, ARMORITE_ORE, ARTICUNO_CANDY, ASPEAR_BERRY, ASSAULT_VEST, AUDINITE, AURORATICKET, AUSPICIOUS_ARMOR, AUTOGRAPH, AUX_EVASION, AUX_GUARD, AUX_POWER, AUX_POWERGUARD, AWAKENING, AZELFS_FANG, AZURE_FLUTE, BABIRI_BERRY, BALL_OF_MUD, BALM_MUSHROOM, BAND_AUTOGRAPH, BANETTITE, BASCULEGION_FOOD, BASEMENT_KEY, BEACH_GLASS, BEAD_MAIL, BEAN_CAKE, BEAST_BALL, BEEDRILLITE, BELLSPROUT_CANDY, BELUE_BERRY, BERRY, BERRY_JUICE, BERRY_POTS, BERRY_POUCH, BERRY_SWEET, BERSERK_GENE, BICYCLE, BIG_BAMBOO_SHOOT, BIG_MALASADA, BIG_MUSHROOM, BIG_NUGGET, BIG_PEARL, BIG_ROOT, BIKE_VOUCHER, BINDING_BAND, BITTER_BERRY, BLACK_APRICORN, BLACK_AUGURITE, BLACK_BELT, BLACK_FLUTE, BLACK_GLASSES, BLACK_MANE_HAIR, BLACK_SLUDGE, BLACK_TUMBLESTONE, BLANK_PLATE, BLASTOISINITE, BLAZIKENITE, BLOOM_MAIL, BLUE_APRICORN, BLUE_CARD, BLUE_FLUTE, BLUE_ORB, BLUE_PETAL, BLUE_SCARF, BLUE_SHARD, BLUESKY_MAIL, BLU_ID_BADGE, BLUK_BERRY, BLUNDER_POLICY, BOLD_MINT, BONSLY_CARD, BONSLY_PHOTO, BOOST_MULCH, BOOSTER_ENERGY, BOTTLE_CAP, BRAVE_MINT, BRICK_MAIL, BRICK_PIECE, BRIDGE_MAIL_D, BRIDGE_MAIL_M, BRIDGE_MAIL_S, BRIDGE_MAIL_T, BRIDGE_MAIL_V, BRIGHT_POWDER, BUBBLE_MAIL, BUG_GEM, BUG_MEMORY, BUG_TERA_SHARD, BUGINIUM_Z, BUGWORT, BULBASAUR_CANDY, BURN_DRIVE, BURN_HEAL, BURNT_BERRY, CAKE_LURE_BASE, CALCIUM, CALM_MINT, CAMERUPTITE, CAMPING_GEAR, CANDY_TRUFFLE, CARBOS, CARD_KEY, CAREFUL_MINT, CARROT_SEEDS, CASTELIACONE, CASTER_FERN, CATCHING_CHARM, CATERPIE_CANDY, CELESTICA_FLUTE, CELL_BATTERY, CHALKY_STONE, CHANSEY_CANDY, CHARCOAL, CHARIZARDITE_X, CHARIZARDITE_Y, CHARMANDER_CANDY, CHARTI_BERRY, CHERI_BERRY, CHERISH_BALL, CHESTO_BERRY, CHILAN_BERRY, CHILL_DRIVE, CHIPPED_POT, CHOICE_BAND, CHOICE_DUMPLING, CHOICE_SCARF, CHOICE_SPECS, CHOPLE_BERRY, CLAW_FOSSIL, CLEANSE_TAG, CLEAR_AMULET, CLEAR_BELL, CLEFAIRY_CANDY, CLEVER_FEATHER, CLOVER_SWEET, COBA_BERRY, COIN_CASE, COLBUR_BERRY, COLOGNE_CASE, COLRESS_MACHINE, COMET_SHARD, COMMON_STONE, CONTEST_COSTUME, CONTEST_PASS, CORNN_BERRY, COUPON_1, COUPON_2, COUPON_3, COURAGE_CANDY, COURAGE_CANDY_L, COURAGE_CANDY_XL, COVER_FOSSIL, COVERT_CLOAK, CRACKED_POT, CRAFTING_KIT, CROWN_PASS, CRUNCHY_SALT, CUBONE_CANDY, CRY_ANALYZER, CUSTAP_BERRY, DAMP_MULCH, DAMP_ROCK, DARK_GEM, DARK_MEMORY, DARK_STONE, DARK_TERA_SHARD, DARKINIUM_Z, DATA_CARDS, DATA_ROM, DAWN_STONE, DAZZLING_HONEY, D_DISK, DECIDIUM_Z, DEEP_SEA_SCALE, DEEP_SEA_TOOTH, DESTINY_KNOT, DEVON_PARTS, DEVON_SCOPE, DEVON_SCUBA_GEAR, DIANCITE, DIGGER_DRILL, DIGLETT_CANDY, DIRE_HIT, DIRESHROOM, DISC_CASE, DISCOUNT_COUPON, DISCOVERY_SLATE, DISTORTION_SLATE, DITTO_CANDY, DIVE_BALL, DNA_SAMPLE, DNA_SPLICERS, DODUO_CANDY, DOME_FOSSIL, DOPPEL_BONNETS, DOUSE_DRIVE, DOWN_ST_KEY, DOWSING_MACHINE, DRACO_PLATE, DRAGON_FANG, DRAGON_GEM, DRAGON_MEMORY, DRAGON_SCALE, DRAGON_SKULL, DRAGON_TERA_SHARD, DRAGONIUM_Z, DRASH_BERRY, DRATINI_CANDY, DREAD_PLATE, DREAM_BALL, DREAM_MAIL, DROPPED_ITEM, DROWZEE_CANDY, DS_SOUNDS, DUBIOUS_DISC, DURIN_BERRY, DUSK_BALL, DUSK_STONE, DYNAMAX_BAND, DYNAMAX_CANDY, DYNAMAX_CRYSTALS, DYNITE_ORE, EARTH_PLATE, EEVEE_CANDY, EEVIUM_Z, EGG_TICKET, EGGANT_BERRY, EIN_FILE_C, EIN_FILE_F, EIN_FILE_H, EIN_FILE_P, EIN_FILE_S, EJECT_BUTTON, EJECT_PACK, EKANS_CANDY, ELECTABUZZ_CANDY, ELECTIRIZER, ELECTRIC_GEM, ELECTRIC_MEMORY, ELECTRIC_SEED, ELECTRIC_TERA_SHARD, ELECTRIUM_Z, ELEVATOR_KEY, ELIXIR, ENDORSEMENT, ENERGY_POWDER, ENERGY_ROOT, ENIGMA_BERRY, ENIGMA_STONE, ENIGMATIC_CARD, EON_FLUTE, EON_MAIL, EON_TICKET, ESCAPE_ROPE, ETERNAL_ICE, ETHER, EVERSTONE, EVIOLITE, EXCITE_SCENT, EXEGGCUTE_CANDY, EXP_CANDY_L, EXP_CANDY_M, EXP_CANDY_S, EXP_CANDY_XL, EXP_CANDY_XS, EXP_CHARM, EXP_SHARE, EXPERT_BELT, EXPLORER_KIT, FAB_MAIL, FAIRIUM_Z, FAIRY_GEM, FAIRY_MEMORY, FAIRY_TERA_SHARD, FAME_CHECKER, FARFETCHD_CANDY, FASHION_CASE, FAST_BALL, FAVORED_MAIL, F_DISK, FEATHER_BALL, FESTIVAL_TICKET, FIGHTING_GEM, FIGHTING_MEMORY, FIGHTING_TERA_SHARD, FIGHTINIUM_Z, FIGY_BERRY, FINE_REMEDY, FIRE_GEM, FIRE_MEMORY, FIRE_STONE, FIRE_TERA_SHARD, FIRIUM_Z, FISHING_ROD, FIST_PLATE, FLAME_MAIL, FLAME_ORB, FLAME_PLATE, FLOAT_STONE, FLOWER_MAIL, FLOWER_SWEET, FLUFFY_TAIL, FLYING_GEM, FLYING_MEMORY, FLYING_TERA_SHARD, FLYINIUM_Z, FOCUS_BAND, FOCUS_SASH, FORAGE_BAG, FOREST_BALM, FOSSILIZED_BIRD, FOSSILIZED_DINO, FOSSILIZED_DRAKE, FOSSILIZED_FISH, FRESH_WATER, FRIEND_BALL, FULL_HEAL, FULL_INCENSE, FULL_RESTORE, GALACTIC_KEY, GALARICA_CUFF, GALARICA_TWIG, GALARICA_WREATH, GALLADITE, GANLON_BERRY, GARCHOMPITE, GARDEVOIRITE, GASTLY_CANDY, GB_SOUNDS, GEAR, GENGARITE, GENIUS_FEATHER, GENOME_SLATE, GENTLE_MINT, GEODUDE_CANDY, GHOST_GEM, GHOST_MEMORY, GHOST_TERA_SHARD, GHOSTIUM_Z, GIGATON_BALL, GINEMA_BERRY, GLALITITE, GLITTER_MAIL, GO_GOGGLES, GOD_STONE, GOLD_BERRY, GOLD_BOTTLE_CAP, GOLD_LEAF, GOLD_TEETH, GOLDEEN_CANDY, GONZAPS_KEY, GOLDEN_NANAB_BERRY, GOLDEN_PINAP_BERRY, GOLDEN_RAZZ_BERRY, GOOD_ROD, GOOEY_MULCH, GORGEOUS_BOX, GRACIDEA, GRAIN_CAKE, GRAM_1, GRAM_2, GRAM_3, GRASS_GEM, GRASS_MEMORY, GRASS_TERA_SHARD, GRASSIUM_Z, GRASS_MAIL, GRASSY_SEED, GREAT_BALL, GREEN_APRICORN, GREEN_PETAL, GREEN_SCARF, GREEN_SHARD, GREET_MAIL, GREPA_BERRY, GRIMER_CANDY, GRIP_CLAW, GRIT_DUST, GRIT_GRAVEL, GRIT_PEBBLE, GRIT_ROCK, GRISEOUS_CORE, GRISEOUS_ORB, GRN_ID_BADGE, GROUND_GEM, GROUND_MEMORY, GROUND_TERA_SHARD, GROUNDIUM_Z, GROWLITHE_CANDY, GROWTH_MULCH, GRUBBY_HANKY, GS_BALL, GUARD_SPEC, GUIDEBOOK, GYARADOSITE, HABAN_BERRY, HARBOR_MAIL, HARD_STONE, HASTY_MINT, HEAL_BALL, HEAL_POWDER, HEALTH_CANDY, HEALTH_CANDY_L, HEALTH_CANDY_XL, HEALTH_FEATHER, HEART_MAIL, HEART_SCALE, HEARTY_GRAINS, HEAT_ROCK, HEAVY_BALL, HEAVY_DUTY_BOOTS, HELIX_FOSSIL, HERACRONITE, HI_TECH_EARBUDS, HITMONCHAN_CANDY, HITMONLEE_CANDY, HM01, HM02, HM03, HM04, HM05, HM06, HM07, HM08, HOLO_CASTER, HOMETOWN_MUFFIN, HONDEW_BERRY, HONEY, HONEY_CAKE, HONOR_OF_KALOS, HOPO_BERRY, HORSEA_CANDY, HOUNDOOMINITE, HP_UP, HYPER_POTION, IAPAPA_BERRY, ICE_BERRY, ICE_GEM, ICE_HEAL, ICE_MEMORY, ICE_STONE, ICE_TERA_SHARD, ICEROOT_CARROT, ICICLE_PLATE, ICIUM_Z, ICY_ROCK, ID_CARD, ILIMAS_NORMALIUM_Z, IMPISH_MINT, INCINIUM_Z, INQUIRY_MAIL, INSECT_PLATE, INTRIGUING_STONE, IRON, IRON_BALL, IRON_BARKTONGUE, IRON_CHUNK, IRON_PLATE, JABOCA_BERRY, JADE_ORB, JAIL_KEY, JAW_FOSSIL, JET_BALL, JIGGLYPUFF_CANDY, JOHTO_SLATE, JOLLY_MINT, JOY_SCENT, JUBILIFE_MUFFIN, JYNX_CANDY, KABUTO_CANDY, KANGASKHAN_CANDY, KANGASKHANITE, KANTO_SLATE, KASIB_BERRY, KEBIA_BERRY, KEE_BERRY, KELPSY_BERRY, KEY_STONE, KEY_TO_ROOM_1, KEY_TO_ROOM_2, KEY_TO_ROOM_4, KEY_TO_ROOM_6, KINGS_LEAF, KINGS_ROCK, KOFFING_CANDY, KOFUS_BOOK, KOMMONIUM_Z, KORAIDONS_POKE_BALL, KRABBY_CANDY, KRANE_MEMO_1, KRANE_MEMO_2, KRANE_MEMO_3, KRANE_MEMO_4, KRANE_MEMO_5, KUO_BERRY, LAGGING_TAIL, LANSAT_BERRY, LAPRAS_CANDY, LATIASITE, LATIOSITE, LAVA_COOKIE, LAX_INCENSE, LAX_MINT, L_DISK, LEADEN_BALL, LEADERS_CREST, LEAF_LETTER, LEAF_STONE, LEEK, LEFT_POKE_BALL, LEFTOVERS, LEGEND_PLATE, LEGENDARY_CLUE_1, LEGENDARY_CLUE_2, LEGENDARY_CLUE_3, LEGENDARY_CLUE, LEMONADE, LENS_CASE, LEPPA_BERRY, LETTER, LEVEL_BALL, LIBERTY_PASS, LICKITUNG_CANDY, LIECHI_BERRY, LIFE_ORB, LIFT_KEY, LIGHT_BALL, LIGHT_CLAY, LIGHT_STONE, LIKE_MAIL, LINKING_CORD, LITEBLUEMAIL, LOADED_DICE, LOCK_CAPSULE, LONE_EARRING, LONELY_MINT, LOOKER_TICKET, LOOT_SACK, LOPUNNITE, LOST_ITEM, LOST_SATCHEL, LOVE_BALL, LOVE_SWEET, LOVELY_MAIL, LUCARIONITE, LUCK_INCENSE, LUCKY_EGG, LUCKY_PUNCH, LUM_BERRY, LUMINOUS_MOSS, LUMIOSE_GALETTE, LUNALIUM_Z, LUNAR_FEATHER, LURE, LURE_BALL, LUSTROUS_GLOBE, LUSTROUS_ORB, LUXURY_BALL, LYCANIUM_Z, MACH_BIKE, MACHINE_PART, MACHO_BRACE, MACHOP_CANDY, MAGIKARP_CANDY, MAGMA_EMBLEM, MAGMA_STONE, MAGMA_SUIT, MAGMAR_CANDY, MAGMARIZER, MAGNEMITE_CANDY, MAGNET, MAGO_BERRY, MAGOST_BERRY, MAINGATE_KEY, MAKEUP_BAG, MALICIOUS_ARMOR, MANECTITE, MANKEY_CANDY, MARANGA_BERRY, MARBLE, MARK_CHARM, MARSHADIUM_Z, MARSH_BALM, MASTER_BALL, MAWILITE, MAX_ELIXIR, MAX_ETHER, MAX_LURE, MAX_HONEY, MAX_MUSHROOMS, MAX_POTION, MAX_REPEL, MAX_REVIVE, MAYORS_NOTE, MEADOW_PLATE, MECH_MAIL, MECHANICAL_BOX, MECHANICAL_CABINET, MECHANICAL_CIRCULAR_SAW, MECHANICAL_PINWHEEL, MECHANICAL_TUB, MEDAL_BOX, MEDICHAMITE, MEDICINAL_LEEK, MEGA_BRACELET, MEGA_RING, MELTAN_CANDY, MEMBER_CARD, MENTAL_HERB, MEOWTH_CANDY, MESPRITS_PLUME, METAGROSSITE, METAL_COAT, METAL_POWDER, METEORITE, METEORITE_SHARD, METRONOME, MEW_CANDY, MEWNIUM_Z, MEWTWO_CANDY, MEWTWONITE_X, MEWTWONITE_Y, MICLE_BERRY, MIGHTY_CANDY, MIGHTY_CANDY_L, MIGHTY_CANDY_XL, MILD_MINT, MIMIKIUM_Z, MIND_PLATE, MINT_BERRY, MIRACLEBERRY, MIRACLE_SEED, MIRAGE_MAIL, MIRAIDONS_POKE_BALL, MIROR_RADAR, MIRROR_HERB, MISTY_SEED, MODEST_MINT, MOLTRES_CANDY, MOOMOO_MILK, MOON_BALL, MOON_FLUTE, MOON_SHARD, MOON_STONE, MORPH_MAIL, MOSAIC_MAIL, MOUNTAIN_BALM, MR_MIME_CANDY, MUSCLE_BAND, MUSCLE_FEATHER, MUSHROOM_CAKE, MUSIC_DISC, MUSIC_MAIL, MYSTERIOUS_BALM, MYSTERIOUS_SHARD_S, MYSTERIOUS_SHARD_L, MYSTERYBERRY, MYSTERY_EGG, MYSTIC_WATER, MYSTICTICKET, NAIVE_MINT, NANAB_BERRY, NAUGHTY_MINT, NEST_BALL, NET_BALL, NEVER_MELT_ICE, NIDORAN_MALE_CANDY, NIDORAN_FEMALE_CANDY, NINIKU_BERRY, N_LUNARIZER, NOMEL_BERRY, NORMAL_BOX, NORMAL_GEM, NORMAL_TERA_SHARD, NORMALIUM_Z, N_SOLARIZER, NUGGET, NUTPEA_BERRY, OAKS_LETTER, OAKS_PARCEL, OCCA_BERRY, OCEANIC_SLATE, ODD_INCENSE, ODD_KEYSTONE, ODDISH_CANDY, OLD_AMBER, OLD_CHARM, OLD_GATEAU, OLD_JOURNAL, OLD_LETTER, OLD_ROD, OLD_SEA_MAP, OLD_VERSES, OMANYTE_CANDY, ONIX_CANDY, ORAN_BERRY, ORANGE_MAIL, ORANGE_PETAL, ORIGIN_BALL, ORIGIN_ORE, OVAL_CHARM, OVAL_STONE, PAIR_OF_TICKETS, PAL_PAD, PAMTRE_BERRY, PARALYZE_HEAL, PARAS_CANDY, PARCEL, PARK_BALL, PASS, PASS_ORB, PASSHO_BERRY, PAYAPA_BERRY, PEARL, PEARL_STRING, PEAT_BLOCK, PECHA_BERRY, PEP_UP_PLANT, PERMIT, PERSIM_BERRY, PETAYA_BERRY, PEWTER_CRUNCHIES, PICNIC_SET, PIDGEOTITE, PIDGEY_CANDY, PIKACHU_CANDY, PIKANIUM_Z, PIKASHUNIUM_Z, PINAP_BERRY, PINK_APRICORN, PINK_BOW, PINK_NECTAR, PINK_PETAL, PINK_SCARF, PINSIR_CANDY, PINSIRITE, PIXIE_PLATE, PLASMA_CARD, PLUME_FOSSIL, PLUMP_BEANS, POFFIN_CASE, POINT_CARD, POISON_BARB, POISON_GEM, POISON_MEMORY, POISON_TERA_SHARD, POISONIUM_Z, POKE_BALL, POKE_DOLL, POKE_FLUTE, POKE_RADAR, POKE_SNACK, POKE_TOY, POKEBLOCK_CASE, POKEBLOCK_KIT, POKEDEX, POKEMON_BOX_LINK, POKESHI_DOLL, POLKADOT_BOW, POLISHED_MUD_BALL, POLIWAG_CANDY, POMEG_BERRY, PONYTA_CANDY, POP_POD, PORTRAITMAIL, PORYGON_CANDY, POTION, POWER_ANKLET, POWER_BAND, POWER_BELT, POWER_BRACER, POWER_HERB, POWER_LENS, POWER_PLANT_PASS, POWER_WEIGHT, POWERUP_PART, POWDER_JAR, PP_MAX, PP_UP, PREMIER_BALL, PRETTY_FEATHER, PRIMARIUM_Z, PRISM_SCALE, PRISON_BOTTLE, PROFS_LETTER, PROFESSORS_MASK, PROP_CASE, PROTECTIVE_PADS, PROTECTOR, PROTEIN, PRZCUREBERRY, PSNCUREBERRY, PSYCHIC_GEM, PSYCHIC_MEMORY, PSYCHIC_SEED, PSYCHIC_TERA_SHARD, PSYCHIUM_Z, PSYDUCK_CANDY, PUMKIN_BERRY, PUNCHING_GLOVE, PURE_INCENSE, PURPLE_NECTAR, PURPLE_PETAL, QUALOT_BERRY, QUICK_BALL, QUICK_CANDY, QUICK_CANDY_L, QUICK_CANDY_XL, QUICK_CLAW, QUICK_POWDER, QUIET_MINT, RABUTA_BERRY, RADIANT_PETAL, RAGECANDYBAR, RAINBOW_FLOWER, RAINBOW_PASS, RAINBOW_SLATE, RAINBOW_WING, RARE_BONE, RARE_CANDY, RASH_MINT, RATTATA_CANDY, RAWST_BERRY, RAZOR_CLAW, RAZOR_FANG, RAZZ_BERRY, R_DISK, REAPER_CLOTH, RECIPES, RED_APRICORN, RED_CARD, RED_CHAIN, RED_FLUTE, RED_ID_BADGE, RED_NECTAR, RED_ORB, RED_PETAL, RED_SCALE, RED_SCARF, RED_SHARD, REINS_OF_UNITY, RELAXED_MINT, RELIC_BAND, RELIC_COPPER, RELIC_CROWN, RELIC_GOLD, RELIC_SILVER, RELIC_STATUE, RELIC_VASE, REMEDY, REPEAT_BALL, REPEL, REPLY_MAIL, RESIST_FEATHER, RETRO_MAIL, REVEAL_GLASS, REVIVAL_HERB, REVIVE, RHYHORN_CANDY, RIBBON_SWEET, RICH_MULCH, RIDE_PAGER, RINDO_BERRY, RING_TARGET, ROCK_GEM, ROCK_INCENSE, ROCK_MEMORY, ROCK_TERA_SHARD, ROCKIUM_Z, ROCKY_HELMET, ROLLER_SKATES, ROOM_SERVICE, ROOT_FOSSIL, ROSE_INCENSE, ROSELI_BERRY, ROTO_BARGAIN, ROTO_BOOST, ROTO_CATCH, ROTO_ENCOUNTER, ROTO_EXP_POINTS, ROTO_FRIENDSHIP, ROTO_HATCH, ROTO_HP_RESTORE, ROTO_PP_RESTORE, ROTO_PRIZE_MONEY, ROTO_STEALTH, ROTOM_BIKE, ROTOM_CATALOG, ROTOM_PHONE, ROWAP_BERRY, RSVP_MAIL, RUBY, RUNNING_SHOES, RUSTED_SHIELD, RUSTED_SWORD, S_S_TICKET, SABLENITE, SACHET, SACRED_ASH, SAFARI_BALL, SAFETY_GOGGLES, SAIL_FOSSIL, SALAC_BERRY, SALAMENCITE, SALT_CAKE, SAND_RADISH, SANDSHREW_CANDY, SANDWICH, SAPPHIRE, SASSY_MINT, SCANNER, SCARLET_BOOK, SCATTER_BANG, SCEPTILITE, SCIZORITE, SCOPE_LENS, SCROLL_OF_DARKNESS, SCROLL_OF_WATERS, SCYTHER_CANDY, SEA_INCENSE, SEAL_CASE, SECRET_KEY, SECRET_MEDICINE, SEED_OF_MASTERY, SEEL_CANDY, SERIOUS_MINT, SHADOW_MAIL, SHADEROOT_CARROT, SHALOUR_SABLE, SHARP_BEAK, SHARPEDONITE, SHED_SHELL, SHELL_BELL, SHELLDER_CANDY, SHINY_CHARM, SHINY_LEAF, SHINY_STONE, SHOAL_SALT, SHOAL_SHELL, SHOCK_DRIVE, SHUCA_BERRY, SILK_SCARF, SILPH_SCOPE, SILVER_LEAF, SILVER_NANAB_BERRY, SILVER_PINAP_BERRY, SILVER_POWDER, SILVER_RAZZ_BERRY, SILVER_WING, SITRUS_BERRY, SKULL_FOSSIL, SKY_PLATE, SKY_TUMBLESTONE, SLOWBRONITE, SLOWPOKE_CANDY, SLOWPOKE_TAIL, SMALL_BOUQUET, SMALL_TABLET, SMART_CANDY, SMART_CANDY_L, SMART_CANDY_XL, SMOKE_BALL, SMOKE_BOMB, SMOOTH_ROCK, SNORLAX_CANDY, SNORLIUM_Z, SNOWBALL, SNOW_BALM, SNOW_MAIL, SODA_POP, SOFT_SAND, SOLGANIUM_Z, SONIAS_BOOK, SOOT_SACK, SOOTFOOT_ROOT, SOOTHE_BELL, SOUL_DEW, SOUL_SLATE, SPACE_BALM, SPACE_MAIL, SPARKLING_STONE, SPEAROW_CANDY, SPELL_TAG, SPELON_BERRY, SPLASH_PLATE, SPOILED_APRICORN, SPOOKY_PLATE, SPORT_BALL, SPRAYDUCK, SPRINGY_MUSHROOM, SPRINKLOTAD, SQUALL_SLATE, SQUIRT_BOTTLE, SQUIRTLE_CANDY, STABLE_MULCH, STAR_PIECE, STAR_SWEET, STARDUST, STARF_BERRY, STARYU_CANDY, STEALTH_SPRAY, STEEL_GEM, STEEL_MAIL, STEEL_MEMORY, STEEL_TEETH, STEEL_TERA_SHARD, STEELIUM_Z, STEELIXITE, STICKY_BARB, STICKY_GLOB, STONE_PLATE, STORAGE_KEY, STRANGE_BALL, STRANGE_SOUVENIR, STRATOSPHERIC_SLATE, STRAWBERRY_SWEET, STRETCHY_SPRING, STRIB_BERRY, STYLE_CARD, SUBWAY_KEY, SUITE_KEY, SUN_FLUTE, SUN_SHARD, SUN_STONE, SUPER_LURE, SUPER_POTION, SUPER_REPEL, SUPER_ROD, SUPERB_REMEDY, SURFBOARD, SURF_MAIL, SURGE_BADGE, SURPRISE_MULCH, SURVIVAL_CHARM_B, SURVIVAL_CHARM_P, SURVIVAL_CHARM_R, SURVIVAL_CHARM_T, SURVIVAL_CHARM_Y, SWAMPERTITE, SWAP_SNACK, SWEET_APPLE, SWEET_HEART, SWIFT_FEATHER, SWORDCAP, SYSTEM_LEVER, TAMATO_BERRY, TANGA_BERRY, TANGELA_CANDY, TAPUNIUM_Z, TART_APPLE, TAUROS_CANDY, TEA, TEACHY_TV, TECTONIC_SLATE, TEMPTING_CHARM_B, TEMPTING_CHARM_P, TEMPTING_CHARM_R, TEMPTING_CHARM_T, TEMPTING_CHARM_Y, TENTACOOL_CANDY, TERA_ORB, TERRAIN_EXTENDER, TERU_SAMA, THANKS_MAIL, THICK_CLUB, THROAT_SPRAY, THUNDER_STONE, TIDAL_BELL, TIME_BALM, TIME_FLUTE, TIMER_BALL, TIMID_MINT, TINY_BAMBOO_SHOOT, TINY_MUSHROOM, TM01, TM02, TM03, TM04, TM05, TM06, TM07, TM08, TM09, TM10, TM11, TM12, TM13, TM14, TM15, TM16, TM17, TM18, TM19, TM20, TM21, TM22, TM23, TM24, TM25, TM26, TM27, TM28, TM29, TM30, TM31, TM32, TM33, TM34, TM35, TM36, TM37, TM38, TM39, TM40, TM41, TM42, TM43, TM44, TM45, TM46, TM47, TM48, TM49, TM50, TM51, TM52, TM53, TM54, TM55, TM56, TM57, TM58, TM59, TM60, TM61, TM62, TM63, TM64, TM65, TM66, TM67, TM68, TM69, TM70, TM71, TM72, TM73, TM74, TM75, TM76, TM77, TM78, TM79, TM80, TM81, TM82, TM83, TM84, TM85, TM86, TM87, TM88, TM89, TM90, TM91, TM92, TM93, TM94, TM95, TM96, TM97, TM98, TM99, TM_CASE, TM_MATERIALS, TR01, TR02, TR03, TR04, TR05, TR06, TR07, TR08, TR09, TR10, TR11, TR12, TR13, TR14, TR15, TR16, TR17, TR18, TR19, TR20, TR21, TR22, TR23, TR24, TR25, TR26, TR27, TR28, TR29, TR30, TR31, TR32, TR33, TR34, TR35, TR36, TR37, TR38, TR39, TR40, TR41, TR42, TR43, TR44, TR45, TR46, TR47, TR48, TR49, TR50, TR51, TR52, TR53, TR54, TR55, TR56, TR57, TR58, TR59, TR60, TR61, TR62, TR63, TR64, TR65, TR66, TR67, TR68, TR69, TR70, TR71, TR72, TR73, TR74, TR75, TR76, TR77, TR78, TR79, TR80, TR81, TR82, TR83, TR84, TR85, TR86, TR87, TR88, TR89, TR90, TR91, TR92, TR93, TR94, TR95, TR96, TR97, TR98, TR99, TMV_PASS, TOPO_BERRY, TORN_JOURNAL, TOUGA_BERRY, TOUGH_CANDY, TOUGH_CANDY_L, TOUGH_CANDY_XL, TOWN_MAP, TOXIC_ORB, TOXIC_PLATE, TRAVEL_TRUNK, TRI_PASS, TROPIC_MAIL, TROPICAL_SHELL, TUMBLESTONE, TUNNEL_MAIL, TWICE_SPICED_RADISH, TWISTED_SPOON, TYRANITARITE, U_DISK, ULTRA_BALL, ULTRANECROZIUM_Z, UNOWN_REPORT, UNUSUAL_SHOES, UPGRADE, UTILITY_UMBRELLA, UXIES_CLAW, VENONAT_CANDY, VENUSAURITE, VIOLET_BOOK, VIVICHOKE, VIVID_SCENT, VOICE_CASE_1, VOICE_CASE_2, VOICE_CASE_3, VOICE_CASE_4, VOICE_CASE_5, VOLCANO_BALM, VOLTORB_CANDY, VS_RECORDER, VS_SEEKER, VULPIX_CANDY, WACAN_BERRY, WAILMER_PAIL, WALL_FRAGMENT, WARDING_CHARM_B, WARDING_CHARM_P, WARDING_CHARM_R, WARDING_CHARM_T, WARDING_CHARM_Y, WATER_GEM, WATER_MEMORY, WATER_STONE, WATER_TERA_SHARD, WATERIUM_Z, WATMEL_BERRY, WAVE_INCENSE, WAVE_MAIL, WEAKNESS_POLICY, WEEDLE_CANDY, WEPEAR_BERRY, WHIPPED_DREAM, WHITE_APRICORN, WHITE_FLUTE, WHITE_HERB, WHITE_MANE_HAIR, WIDE_LENS, WIKI_BERRY, WING_BALL, WISE_GLASSES, WISHING_CHIP, WISHING_PIECE, WISHING_STAR, WOOD, WOOD_MAIL, WOODEN_CROWN, WORKS_KEY, X_ACCURACY, X_ATTACK, X_DEFENSE, X_SP_ATK, X_SP_DEF, X_SPEED, XTRANSCEIVER, YACHE_BERRY, YAGO_BERRY, YELLOW_APRICORN, YELLOW_FLUTE, YELLOW_NECTAR, YELLOW_PETAL, YELLOW_SCARF, YELLOW_SHARD, YLW_ID_BADGE, ZAP_PLATE, ZAPDOS_CANDY, ZINC, ZOOM_LENS, Z_POWER_RING, Z_RING, ZUBAT_CANDY, ZYGARDE_CUBE, ITEM_TOTAL + // clang-format on }; -} // namespace pokesim - -/////////////// END OF src/Components/EntityHolders/Current.hpp //////////////// - -/////////////////// START OF src/Components/Tags/Current.hpp /////////////////// - -namespace pokesim::tags { -// Current Action Tag: The move action being processed by the simulator -struct CurrentActionMove {}; -// Current Action Tag: The move action that was being processed but failed -struct FailedCurrentActionMove {}; -// A move that actively hitting a target and is or will be processed by calcDamage -struct CurrentMoveHit {}; -struct FailedCurrentMoveHit {}; - -// Current Action Tag: The move slot the current action's move was chosen and will deduct PP from -struct CurrentActionMoveSlot {}; -// Current Action Tag: The target of the active move -struct CurrentActionMoveTarget {}; -// Current Action Tag: The user of the active move -struct CurrentActionMoveSource {}; -} // namespace pokesim::tags - -//////////////////// END OF src/Components/Tags/Current.hpp //////////////////// - -////////////// START OF src/Components/AnalyzeEffect/Aliases.hpp /////////////// -namespace pokesim::analyze_effect { -using Attacker = CurrentActionSource; -using Defender = CurrentActionTarget; -using UsedMovesAsAttacker = CurrentActionMovesAsSource; -using UsedMovesAsDefender = CurrentActionMovesAsTarget; - -namespace tags { -using Attacker = pokesim::tags::CurrentActionMoveSource; -using Defender = pokesim::tags::CurrentActionMoveTarget; -using Move = pokesim::tags::CurrentActionMove; -} // namespace tags -} // namespace pokesim::analyze_effect +static constexpr std::uint16_t TOTAL_ITEM_COUNT = (std::uint16_t)Item::ITEM_TOTAL - 1U; +} // namespace pokesim::dex -/////////////// END OF src/Components/AnalyzeEffect/Aliases.hpp //////////////// +/////////////////////// END OF src/Types/Enums/Item.hpp //////////////////////// ////////////////////// START OF src/Types/Enums/Move.hpp /////////////////////// @@ -18414,58 +18288,32 @@ static constexpr std::uint16_t TOTAL_MOVE_COUNT = (std::uint16_t)Move::MOVE_TOTA /////////////////////// END OF src/Types/Enums/Move.hpp //////////////////////// -//////// START OF src/Components/AnalyzeEffect/AnalyzeEffectInputs.hpp ///////// - -namespace pokesim::analyze_effect { -struct EffectTarget { - types::entity val{}; -}; - -struct EffectMove { - dex::Move val = dex::Move::NO_MOVE; -}; - -struct GroupedInputs { - internal::maxSizedVector val{}; -}; - -struct Inputs { - types::entityVector val{}; -}; - -struct OriginalInputEntities { - types::entity battle{}; - types::entity attacker{}; - types::entity defender{}; - types::entity effectTarget{}; - - bool operator==(const OriginalInputEntities& other) const { - return battle == other.battle && attacker == other.attacker && defender == other.defender && - effectTarget == other.effectTarget; - } -}; +////////////////////// START OF src/Types/Enums/Slot.hpp /////////////////////// -struct MovePair { - types::entity original; - types::entity copy; +namespace pokesim { +enum class Slot : std::uint8_t { + NONE = 0U, + P1A, + P2A, + P1B, + P2B, - bool operator==(const MovePair& other) const { return original == other.original && copy == other.copy; } -}; + P1C, + P2C, + P1D, + P2D, + P1E, + P2E, + P1F, + P2F, -struct SkippedInputCount { - types::entityIndex val = 0U; + TOTAL_SLOT, }; -namespace tags { -struct Input {}; -struct GroupedWithOtherInput {}; -struct RunOneCalculation {}; -struct BattleCloneForCalculation {}; -struct InvertFinalAnswer {}; -} // namespace tags -} // namespace pokesim::analyze_effect +static constexpr std::uint8_t TOTAL_SLOT_COUNT = (std::uint8_t)Slot::TOTAL_SLOT - 1U; +} // namespace pokesim -///////// END OF src/Components/AnalyzeEffect/AnalyzeEffectInputs.hpp ////////// +/////////////////////// END OF src/Types/Enums/Slot.hpp //////////////////////// ////////////////////// START OF src/Utilities/Variant.hpp ////////////////////// @@ -18502,38 +18350,390 @@ class variant : public std::variant { template constexpr auto get_if() const { - return std::forward_as_tuple(std::get_if(this)...); + return std::make_tuple(std::get_if(this)...); } template constexpr auto get_if() { - return std::forward_as_tuple(std::get_if(this)...); + return std::make_tuple(std::get_if(this)...); } }; } // namespace pokesim::internal /////////////////////// END OF src/Utilities/Variant.hpp /////////////////////// -//////////////////////// START OF src/Types/Effect.hpp ///////////////////////// - -namespace pokesim::types { -using effectEnum = pokesim::internal::variant< - std::monostate, dex::PseudoWeather, dex::SideCondition, dex::Status, dex::Terrain, dex::Volatile, dex::Weather>; -} // namespace pokesim::types +/////////////////////// START OF src/Types/Decisions.hpp /////////////////////// -///////////////////////// END OF src/Types/Effect.hpp ////////////////////////// +namespace pokesim { +struct MoveDecision { + Slot sourceSlot = Slot::NONE; + Slot targetSlot = Slot::NONE; -/////////// START OF src/Components/AnalyzeEffect/RemovedEffect.hpp //////////// + dex::Move move = dex::Move::NO_MOVE; -namespace pokesim::analyze_effect { -struct RemovedEffect { - types::effectEnum val{}; + bool operator==(const MoveDecision& other) const { + return sourceSlot == other.sourceSlot && targetSlot == other.targetSlot && move == other.move; + } }; -} // namespace pokesim::analyze_effect -//////////// END OF src/Components/AnalyzeEffect/RemovedEffect.hpp ///////////// +struct MegaEvolveAndMoveDecision : MoveDecision {}; +struct ZMoveDecision : MoveDecision {}; +struct DynamaxAndMoveDecision : MoveDecision {}; +struct TerastallizeAndMoveDecision : MoveDecision {}; -///////////////// START OF src/Components/BaseEffectChance.hpp ///////////////// +struct SwitchDecision { + Slot sourceSlot = Slot::NONE; + Slot targetSlot = Slot::NONE; + + bool operator==(const SwitchDecision& other) const { + return sourceSlot == other.sourceSlot && targetSlot == other.targetSlot; + } +}; + +struct ItemDecision { + Slot sourceSlot = Slot::NONE; + Slot targetSlot = Slot::NONE; + + dex::Item item = dex::Item::NO_ITEM; + + bool operator==(const ItemDecision& other) const { + return sourceSlot == other.sourceSlot && targetSlot == other.targetSlot && item == other.item; + } +}; + +namespace types { +struct slotDecision : pokesim::internal::variant< + MoveDecision, MegaEvolveAndMoveDecision, TerastallizeAndMoveDecision, DynamaxAndMoveDecision, + ZMoveDecision, SwitchDecision, ItemDecision> { + using pokesim::internal::variant< + MoveDecision, MegaEvolveAndMoveDecision, TerastallizeAndMoveDecision, DynamaxAndMoveDecision, ZMoveDecision, + SwitchDecision, ItemDecision>::variant; + + constexpr Slot sourceSlot() const { + return std::visit([](auto&& decision) { return decision.sourceSlot; }, *this); + } + + constexpr Slot targetSlot() const { + return std::visit([](auto&& decision) { return decision.targetSlot; }, *this); + } +}; + +using slotDecisions = types::sideSlots; +} // namespace types +} // namespace pokesim + +//////////////////////// END OF src/Types/Decisions.hpp //////////////////////// + +/////////////////// START OF src/Types/Enums/ActionOrder.hpp /////////////////// + +namespace pokesim { +enum class ActionOrder : std::uint8_t { + NONE = std::numeric_limits>::max(), + TEAM = 1U, + START = 2U, + BEFORE_TURN = 4U, + ITEM = BEFORE_TURN, + + SWITCH = 103U, + + MOVE = 200U, + + RESIDUAL = 254U, +}; + +static constexpr inline std::array VALID_ACTION_ORDERS = { + ActionOrder::NONE, + ActionOrder::TEAM, + ActionOrder::START, + ActionOrder::BEFORE_TURN, + ActionOrder::ITEM, + ActionOrder::SWITCH, + ActionOrder::MOVE, + ActionOrder::RESIDUAL, +}; +} // namespace pokesim + +//////////////////// END OF src/Types/Enums/ActionOrder.hpp //////////////////// + +///////////////////////// START OF src/Types/Move.hpp ////////////////////////// + +namespace pokesim::types { +using pp = pokesim::internal::unsignedIntType; +using basePower = pokesim::internal::unsignedIntType; +using power = pokesim::internal::unsignedIntType; +using baseAccuracy = pokesim::internal::unsignedIntType; +using moveHits = pokesim::internal::unsignedIntType; + +using priority = pokesim::internal::signedIntType; +using fractionalPriority = bool; +} // namespace pokesim::types + +////////////////////////// END OF src/Types/Move.hpp /////////////////////////// + +/////////////////// START OF src/Components/ActionQueue.hpp //////////////////// + +namespace pokesim { +struct ActionQueueItem { + // Order of the types of actions (lower first). + ActionOrder order = ActionOrder::NONE; + // Priority of the action (higher first). + types::priority priority = Constants::MovePriority::DEFAULT; + // Whether negative fractional priority is active for the action (false first). + types::fractionalPriority fractionalPriority = false; + // Speed of Pokemon using move (higher first if priority tie). + types::stat speed = Constants::PokemonEffectiveStat::DEFAULT; + + // The decision that created this action queue item. + types::slotDecision decision{}; + + constexpr bool operator==(const ActionQueueItem& other) const { + return isSameSpeed(other) && decision == other.decision; + } + + constexpr bool isSameSpeed(const ActionQueueItem& other) const { + return order == other.order && priority == other.priority && fractionalPriority == other.fractionalPriority && + speed == other.speed; + } + + constexpr bool isFasterThan(const ActionQueueItem& other) const { + if (order != other.order) { + return order < other.order; + } + + if (priority != other.priority) { + return priority > other.priority; + } + + if (fractionalPriority != other.fractionalPriority) { + return !fractionalPriority; + } + + if (speed != other.speed) { + return speed > other.speed; + } + + return false; + } +}; + +struct ActionQueue { + internal::maxSizedVector val{}; +}; +} // namespace pokesim + +//////////////////// END OF src/Components/ActionQueue.hpp ///////////////////// + +////////////////// START OF src/Types/Enums/AddedTargets.hpp /////////////////// + +namespace pokesim { +enum class AddedTargetOptions : std::uint8_t { + NONE = 0b00000000, + TARGET_ALLY = 0b00000001, + USER_ALLY = 0b00000010, + TARGET_SIDE = 0b00000100, + USER_SIDE = 0b00001000, + FIELD = 0b00010000, +}; + +constexpr AddedTargetOptions operator|(AddedTargetOptions optionA, AddedTargetOptions optionB) { + return static_cast(static_cast(optionA) | static_cast(optionB)); +} + +constexpr bool operator&(AddedTargetOptions optionA, AddedTargetOptions optionB) { + return (static_cast(optionA) & static_cast(optionB)) != 0U; +} + +static constexpr inline std::array VALID_ADDED_TARGET_OPTIONS = { + AddedTargetOptions::NONE, + AddedTargetOptions::TARGET_ALLY, + AddedTargetOptions::USER_ALLY, + AddedTargetOptions::TARGET_SIDE, + AddedTargetOptions::USER_SIDE, + AddedTargetOptions::FIELD, +}; +} // namespace pokesim + +/////////////////// END OF src/Types/Enums/AddedTargets.hpp //////////////////// + +/////////////////// START OF src/Components/AddedTargets.hpp /////////////////// + +namespace pokesim { +struct AddedTargets { + AddedTargetOptions val = AddedTargetOptions::NONE; +}; +} // namespace pokesim + +//////////////////// END OF src/Components/AddedTargets.hpp //////////////////// + +////////////// START OF src/Components/EntityHolders/Current.hpp /////////////// + +namespace pokesim { +struct CurrentAction { + types::entity val{}; +}; + +struct CurrentActionTargets { + types::targets val{}; +}; + +struct CurrentActionSource { + types::entity val{}; +}; + +struct CurrentActionTarget { + types::entity val{}; +}; + +struct FailedCurrentActionSource { + types::entity val{}; +}; + +struct FailedCurrentActionTarget { + types::entity val{}; +}; + +struct CurrentActionMovesAsSource { + types::entityVector val{}; +}; + +struct CurrentActionMovesAsTarget { + types::entityVector val{}; +}; + +struct CurrentActionMoveSlot { + types::entity val{}; +}; + +struct CurrentEffectSource { + types::entity val{}; +}; + +struct CurrentEffectTarget { + types::entity val{}; +}; + +struct CurrentEffectsAsSource { + types::entityVector val{}; +}; + +struct CurrentEffectsAsTarget { + types::entityVector val{}; +}; +} // namespace pokesim + +/////////////// END OF src/Components/EntityHolders/Current.hpp //////////////// + +/////////////////// START OF src/Components/Tags/Current.hpp /////////////////// + +namespace pokesim::tags { +// Current Action Tag: The move action being processed by the simulator +struct CurrentActionMove {}; +// Current Action Tag: The move action that was being processed but failed +struct FailedCurrentActionMove {}; +// A move that actively hitting a target and is or will be processed by calcDamage +struct CurrentMoveHit {}; +struct FailedCurrentMoveHit {}; + +// Current Action Tag: The move slot the current action's move was chosen and will deduct PP from +struct CurrentActionMoveSlot {}; +// Current Action Tag: The target of the active move +struct CurrentActionMoveTarget {}; +// Current Action Tag: The user of the active move +struct CurrentActionMoveSource {}; +} // namespace pokesim::tags + +//////////////////// END OF src/Components/Tags/Current.hpp //////////////////// + +////////////// START OF src/Components/AnalyzeEffect/Aliases.hpp /////////////// + +namespace pokesim::analyze_effect { +using Attacker = CurrentActionSource; +using Defender = CurrentActionTarget; +using UsedMovesAsAttacker = CurrentActionMovesAsSource; +using UsedMovesAsDefender = CurrentActionMovesAsTarget; + +namespace tags { +using Attacker = pokesim::tags::CurrentActionMoveSource; +using Defender = pokesim::tags::CurrentActionMoveTarget; +using Move = pokesim::tags::CurrentActionMove; +} // namespace tags +} // namespace pokesim::analyze_effect + +/////////////// END OF src/Components/AnalyzeEffect/Aliases.hpp //////////////// + +//////// START OF src/Components/AnalyzeEffect/AnalyzeEffectInputs.hpp ///////// + +namespace pokesim::analyze_effect { +struct EffectTarget { + types::entity val{}; +}; + +struct EffectMove { + dex::Move val = dex::Move::NO_MOVE; +}; + +struct GroupedInputs { + internal::maxSizedVector val{}; +}; + +struct Inputs { + types::entityVector val{}; +}; + +struct OriginalInputEntities { + types::entity battle{}; + types::entity attacker{}; + types::entity defender{}; + types::entity effectTarget{}; + + bool operator==(const OriginalInputEntities& other) const { + return battle == other.battle && attacker == other.attacker && defender == other.defender && + effectTarget == other.effectTarget; + } +}; + +struct MovePair { + types::entity original; + types::entity copy; + + bool operator==(const MovePair& other) const { return original == other.original && copy == other.copy; } +}; + +struct SkippedInputCount { + types::entityIndex val = 0U; +}; + +namespace tags { +struct Input {}; +struct GroupedWithOtherInput {}; +struct RunOneCalculation {}; +struct BattleCloneForCalculation {}; +struct InvertFinalAnswer {}; +} // namespace tags +} // namespace pokesim::analyze_effect + +///////// END OF src/Components/AnalyzeEffect/AnalyzeEffectInputs.hpp ////////// + +//////////////////////// START OF src/Types/Effect.hpp ///////////////////////// + +namespace pokesim::types { +using effectEnum = pokesim::internal::variant< + std::monostate, dex::PseudoWeather, dex::SideCondition, dex::Status, dex::Terrain, dex::Volatile, dex::Weather>; +} // namespace pokesim::types + +///////////////////////// END OF src/Types/Effect.hpp ////////////////////////// + +/////////// START OF src/Components/AnalyzeEffect/RemovedEffect.hpp //////////// + +namespace pokesim::analyze_effect { +struct RemovedEffect { + types::effectEnum val{}; +}; +} // namespace pokesim::analyze_effect + +//////////// END OF src/Components/AnalyzeEffect/RemovedEffect.hpp ///////////// + +///////////////// START OF src/Components/BaseEffectChance.hpp ///////////////// namespace pokesim { /** @@ -18548,21 +18748,6 @@ struct BaseEffectChance { ////////////////// END OF src/Components/BaseEffectChance.hpp ////////////////// -///////////////////////// START OF src/Types/Move.hpp ////////////////////////// - -namespace pokesim::types { -using pp = pokesim::internal::unsignedIntType; -using basePower = pokesim::internal::unsignedIntType; -using power = pokesim::internal::unsignedIntType; -using baseAccuracy = pokesim::internal::unsignedIntType; -using moveHits = pokesim::internal::unsignedIntType; - -using priority = pokesim::internal::signedIntType; -using fractionalPriority = bool; -} // namespace pokesim::types - -////////////////////////// END OF src/Types/Move.hpp /////////////////////////// - //////////////////// START OF src/Components/BasePower.hpp ///////////////////// namespace pokesim { @@ -18752,17 +18937,6 @@ struct Ivs { /////////////////////// END OF src/Components/EVsIVs.hpp /////////////////////// -//////////// START OF src/Components/EntityHolders/ActionQueue.hpp ///////////// - -namespace pokesim { -// Contains the list of action entities queued up to be simulated for a battle's current turn. -struct ActionQueue { - internal::maxSizedVector val{}; -}; -} // namespace pokesim - -///////////// END OF src/Components/EntityHolders/ActionQueue.hpp ////////////// - ///////////// START OF src/Components/EntityHolders/ChoiceLock.hpp ///////////// namespace pokesim { @@ -18827,6 +19001,16 @@ struct Pokemon { /////////////// END OF src/Components/EntityHolders/Pokemon.hpp //////////////// +////////// START OF src/Components/EntityHolders/RecycledEntities.hpp ////////// + +namespace pokesim { +struct RecycledAction { + types::entity val{}; +}; +} // namespace pokesim + +/////////// END OF src/Components/EntityHolders/RecycledEntities.hpp /////////// + //////////////// START OF src/Components/EntityHolders/Side.hpp //////////////// namespace pokesim { @@ -18947,21 +19131,6 @@ struct GenderName { ///////////////// END OF src/Components/Names/GenderNames.hpp ////////////////// -////////////////////// START OF src/Types/Enums/Item.hpp /////////////////////// - -namespace pokesim::dex { -// Name of items in Pokemon games -enum class Item : std::uint16_t { - // clang-format off - NO_ITEM = 0U, ABILITY_CAPSULE, ABILITY_PATCH, ABILITY_SHIELD, ABOMASITE, ABRA_CANDY, ABSOLITE, ABSORB_BULB, ACRO_BIKE, ADAMANT_CRYSTAL, ADAMANT_MINT, ADAMANT_ORB, ADRENALINE_ORB, ADVENTURE_GUIDE, AERODACTYLITE, AERODACTYL_CANDY, AGGRONITE, AGUAV_BERRY, AIR_BALLOON, AIR_MAIL, ALAKAZITE, ALORAICHIUM_Z, ALTARIANITE, AMAZE_MULCH, AMPHAROSITE, AMULET_COIN, ANTIDOTE, APICOT_BERRY, APRICORN, APRICORN_BOX, AQUA_SUIT, ARMOR_FOSSIL, ARMOR_PASS, ARMORITE_ORE, ARTICUNO_CANDY, ASPEAR_BERRY, ASSAULT_VEST, AUDINITE, AURORATICKET, AUSPICIOUS_ARMOR, AUTOGRAPH, AUX_EVASION, AUX_GUARD, AUX_POWER, AUX_POWERGUARD, AWAKENING, AZELFS_FANG, AZURE_FLUTE, BABIRI_BERRY, BALL_OF_MUD, BALM_MUSHROOM, BAND_AUTOGRAPH, BANETTITE, BASCULEGION_FOOD, BASEMENT_KEY, BEACH_GLASS, BEAD_MAIL, BEAN_CAKE, BEAST_BALL, BEEDRILLITE, BELLSPROUT_CANDY, BELUE_BERRY, BERRY, BERRY_JUICE, BERRY_POTS, BERRY_POUCH, BERRY_SWEET, BERSERK_GENE, BICYCLE, BIG_BAMBOO_SHOOT, BIG_MALASADA, BIG_MUSHROOM, BIG_NUGGET, BIG_PEARL, BIG_ROOT, BIKE_VOUCHER, BINDING_BAND, BITTER_BERRY, BLACK_APRICORN, BLACK_AUGURITE, BLACK_BELT, BLACK_FLUTE, BLACK_GLASSES, BLACK_MANE_HAIR, BLACK_SLUDGE, BLACK_TUMBLESTONE, BLANK_PLATE, BLASTOISINITE, BLAZIKENITE, BLOOM_MAIL, BLUE_APRICORN, BLUE_CARD, BLUE_FLUTE, BLUE_ORB, BLUE_PETAL, BLUE_SCARF, BLUE_SHARD, BLUESKY_MAIL, BLU_ID_BADGE, BLUK_BERRY, BLUNDER_POLICY, BOLD_MINT, BONSLY_CARD, BONSLY_PHOTO, BOOST_MULCH, BOOSTER_ENERGY, BOTTLE_CAP, BRAVE_MINT, BRICK_MAIL, BRICK_PIECE, BRIDGE_MAIL_D, BRIDGE_MAIL_M, BRIDGE_MAIL_S, BRIDGE_MAIL_T, BRIDGE_MAIL_V, BRIGHT_POWDER, BUBBLE_MAIL, BUG_GEM, BUG_MEMORY, BUG_TERA_SHARD, BUGINIUM_Z, BUGWORT, BULBASAUR_CANDY, BURN_DRIVE, BURN_HEAL, BURNT_BERRY, CAKE_LURE_BASE, CALCIUM, CALM_MINT, CAMERUPTITE, CAMPING_GEAR, CANDY_TRUFFLE, CARBOS, CARD_KEY, CAREFUL_MINT, CARROT_SEEDS, CASTELIACONE, CASTER_FERN, CATCHING_CHARM, CATERPIE_CANDY, CELESTICA_FLUTE, CELL_BATTERY, CHALKY_STONE, CHANSEY_CANDY, CHARCOAL, CHARIZARDITE_X, CHARIZARDITE_Y, CHARMANDER_CANDY, CHARTI_BERRY, CHERI_BERRY, CHERISH_BALL, CHESTO_BERRY, CHILAN_BERRY, CHILL_DRIVE, CHIPPED_POT, CHOICE_BAND, CHOICE_DUMPLING, CHOICE_SCARF, CHOICE_SPECS, CHOPLE_BERRY, CLAW_FOSSIL, CLEANSE_TAG, CLEAR_AMULET, CLEAR_BELL, CLEFAIRY_CANDY, CLEVER_FEATHER, CLOVER_SWEET, COBA_BERRY, COIN_CASE, COLBUR_BERRY, COLOGNE_CASE, COLRESS_MACHINE, COMET_SHARD, COMMON_STONE, CONTEST_COSTUME, CONTEST_PASS, CORNN_BERRY, COUPON_1, COUPON_2, COUPON_3, COURAGE_CANDY, COURAGE_CANDY_L, COURAGE_CANDY_XL, COVER_FOSSIL, COVERT_CLOAK, CRACKED_POT, CRAFTING_KIT, CROWN_PASS, CRUNCHY_SALT, CUBONE_CANDY, CRY_ANALYZER, CUSTAP_BERRY, DAMP_MULCH, DAMP_ROCK, DARK_GEM, DARK_MEMORY, DARK_STONE, DARK_TERA_SHARD, DARKINIUM_Z, DATA_CARDS, DATA_ROM, DAWN_STONE, DAZZLING_HONEY, D_DISK, DECIDIUM_Z, DEEP_SEA_SCALE, DEEP_SEA_TOOTH, DESTINY_KNOT, DEVON_PARTS, DEVON_SCOPE, DEVON_SCUBA_GEAR, DIANCITE, DIGGER_DRILL, DIGLETT_CANDY, DIRE_HIT, DIRESHROOM, DISC_CASE, DISCOUNT_COUPON, DISCOVERY_SLATE, DISTORTION_SLATE, DITTO_CANDY, DIVE_BALL, DNA_SAMPLE, DNA_SPLICERS, DODUO_CANDY, DOME_FOSSIL, DOPPEL_BONNETS, DOUSE_DRIVE, DOWN_ST_KEY, DOWSING_MACHINE, DRACO_PLATE, DRAGON_FANG, DRAGON_GEM, DRAGON_MEMORY, DRAGON_SCALE, DRAGON_SKULL, DRAGON_TERA_SHARD, DRAGONIUM_Z, DRASH_BERRY, DRATINI_CANDY, DREAD_PLATE, DREAM_BALL, DREAM_MAIL, DROPPED_ITEM, DROWZEE_CANDY, DS_SOUNDS, DUBIOUS_DISC, DURIN_BERRY, DUSK_BALL, DUSK_STONE, DYNAMAX_BAND, DYNAMAX_CANDY, DYNAMAX_CRYSTALS, DYNITE_ORE, EARTH_PLATE, EEVEE_CANDY, EEVIUM_Z, EGG_TICKET, EGGANT_BERRY, EIN_FILE_C, EIN_FILE_F, EIN_FILE_H, EIN_FILE_P, EIN_FILE_S, EJECT_BUTTON, EJECT_PACK, EKANS_CANDY, ELECTABUZZ_CANDY, ELECTIRIZER, ELECTRIC_GEM, ELECTRIC_MEMORY, ELECTRIC_SEED, ELECTRIC_TERA_SHARD, ELECTRIUM_Z, ELEVATOR_KEY, ELIXIR, ENDORSEMENT, ENERGY_POWDER, ENERGY_ROOT, ENIGMA_BERRY, ENIGMA_STONE, ENIGMATIC_CARD, EON_FLUTE, EON_MAIL, EON_TICKET, ESCAPE_ROPE, ETERNAL_ICE, ETHER, EVERSTONE, EVIOLITE, EXCITE_SCENT, EXEGGCUTE_CANDY, EXP_CANDY_L, EXP_CANDY_M, EXP_CANDY_S, EXP_CANDY_XL, EXP_CANDY_XS, EXP_CHARM, EXP_SHARE, EXPERT_BELT, EXPLORER_KIT, FAB_MAIL, FAIRIUM_Z, FAIRY_GEM, FAIRY_MEMORY, FAIRY_TERA_SHARD, FAME_CHECKER, FARFETCHD_CANDY, FASHION_CASE, FAST_BALL, FAVORED_MAIL, F_DISK, FEATHER_BALL, FESTIVAL_TICKET, FIGHTING_GEM, FIGHTING_MEMORY, FIGHTING_TERA_SHARD, FIGHTINIUM_Z, FIGY_BERRY, FINE_REMEDY, FIRE_GEM, FIRE_MEMORY, FIRE_STONE, FIRE_TERA_SHARD, FIRIUM_Z, FISHING_ROD, FIST_PLATE, FLAME_MAIL, FLAME_ORB, FLAME_PLATE, FLOAT_STONE, FLOWER_MAIL, FLOWER_SWEET, FLUFFY_TAIL, FLYING_GEM, FLYING_MEMORY, FLYING_TERA_SHARD, FLYINIUM_Z, FOCUS_BAND, FOCUS_SASH, FORAGE_BAG, FOREST_BALM, FOSSILIZED_BIRD, FOSSILIZED_DINO, FOSSILIZED_DRAKE, FOSSILIZED_FISH, FRESH_WATER, FRIEND_BALL, FULL_HEAL, FULL_INCENSE, FULL_RESTORE, GALACTIC_KEY, GALARICA_CUFF, GALARICA_TWIG, GALARICA_WREATH, GALLADITE, GANLON_BERRY, GARCHOMPITE, GARDEVOIRITE, GASTLY_CANDY, GB_SOUNDS, GEAR, GENGARITE, GENIUS_FEATHER, GENOME_SLATE, GENTLE_MINT, GEODUDE_CANDY, GHOST_GEM, GHOST_MEMORY, GHOST_TERA_SHARD, GHOSTIUM_Z, GIGATON_BALL, GINEMA_BERRY, GLALITITE, GLITTER_MAIL, GO_GOGGLES, GOD_STONE, GOLD_BERRY, GOLD_BOTTLE_CAP, GOLD_LEAF, GOLD_TEETH, GOLDEEN_CANDY, GONZAPS_KEY, GOLDEN_NANAB_BERRY, GOLDEN_PINAP_BERRY, GOLDEN_RAZZ_BERRY, GOOD_ROD, GOOEY_MULCH, GORGEOUS_BOX, GRACIDEA, GRAIN_CAKE, GRAM_1, GRAM_2, GRAM_3, GRASS_GEM, GRASS_MEMORY, GRASS_TERA_SHARD, GRASSIUM_Z, GRASS_MAIL, GRASSY_SEED, GREAT_BALL, GREEN_APRICORN, GREEN_PETAL, GREEN_SCARF, GREEN_SHARD, GREET_MAIL, GREPA_BERRY, GRIMER_CANDY, GRIP_CLAW, GRIT_DUST, GRIT_GRAVEL, GRIT_PEBBLE, GRIT_ROCK, GRISEOUS_CORE, GRISEOUS_ORB, GRN_ID_BADGE, GROUND_GEM, GROUND_MEMORY, GROUND_TERA_SHARD, GROUNDIUM_Z, GROWLITHE_CANDY, GROWTH_MULCH, GRUBBY_HANKY, GS_BALL, GUARD_SPEC, GUIDEBOOK, GYARADOSITE, HABAN_BERRY, HARBOR_MAIL, HARD_STONE, HASTY_MINT, HEAL_BALL, HEAL_POWDER, HEALTH_CANDY, HEALTH_CANDY_L, HEALTH_CANDY_XL, HEALTH_FEATHER, HEART_MAIL, HEART_SCALE, HEARTY_GRAINS, HEAT_ROCK, HEAVY_BALL, HEAVY_DUTY_BOOTS, HELIX_FOSSIL, HERACRONITE, HI_TECH_EARBUDS, HITMONCHAN_CANDY, HITMONLEE_CANDY, HM01, HM02, HM03, HM04, HM05, HM06, HM07, HM08, HOLO_CASTER, HOMETOWN_MUFFIN, HONDEW_BERRY, HONEY, HONEY_CAKE, HONOR_OF_KALOS, HOPO_BERRY, HORSEA_CANDY, HOUNDOOMINITE, HP_UP, HYPER_POTION, IAPAPA_BERRY, ICE_BERRY, ICE_GEM, ICE_HEAL, ICE_MEMORY, ICE_STONE, ICE_TERA_SHARD, ICEROOT_CARROT, ICICLE_PLATE, ICIUM_Z, ICY_ROCK, ID_CARD, ILIMAS_NORMALIUM_Z, IMPISH_MINT, INCINIUM_Z, INQUIRY_MAIL, INSECT_PLATE, INTRIGUING_STONE, IRON, IRON_BALL, IRON_BARKTONGUE, IRON_CHUNK, IRON_PLATE, JABOCA_BERRY, JADE_ORB, JAIL_KEY, JAW_FOSSIL, JET_BALL, JIGGLYPUFF_CANDY, JOHTO_SLATE, JOLLY_MINT, JOY_SCENT, JUBILIFE_MUFFIN, JYNX_CANDY, KABUTO_CANDY, KANGASKHAN_CANDY, KANGASKHANITE, KANTO_SLATE, KASIB_BERRY, KEBIA_BERRY, KEE_BERRY, KELPSY_BERRY, KEY_STONE, KEY_TO_ROOM_1, KEY_TO_ROOM_2, KEY_TO_ROOM_4, KEY_TO_ROOM_6, KINGS_LEAF, KINGS_ROCK, KOFFING_CANDY, KOFUS_BOOK, KOMMONIUM_Z, KORAIDONS_POKE_BALL, KRABBY_CANDY, KRANE_MEMO_1, KRANE_MEMO_2, KRANE_MEMO_3, KRANE_MEMO_4, KRANE_MEMO_5, KUO_BERRY, LAGGING_TAIL, LANSAT_BERRY, LAPRAS_CANDY, LATIASITE, LATIOSITE, LAVA_COOKIE, LAX_INCENSE, LAX_MINT, L_DISK, LEADEN_BALL, LEADERS_CREST, LEAF_LETTER, LEAF_STONE, LEEK, LEFT_POKE_BALL, LEFTOVERS, LEGEND_PLATE, LEGENDARY_CLUE_1, LEGENDARY_CLUE_2, LEGENDARY_CLUE_3, LEGENDARY_CLUE, LEMONADE, LENS_CASE, LEPPA_BERRY, LETTER, LEVEL_BALL, LIBERTY_PASS, LICKITUNG_CANDY, LIECHI_BERRY, LIFE_ORB, LIFT_KEY, LIGHT_BALL, LIGHT_CLAY, LIGHT_STONE, LIKE_MAIL, LINKING_CORD, LITEBLUEMAIL, LOADED_DICE, LOCK_CAPSULE, LONE_EARRING, LONELY_MINT, LOOKER_TICKET, LOOT_SACK, LOPUNNITE, LOST_ITEM, LOST_SATCHEL, LOVE_BALL, LOVE_SWEET, LOVELY_MAIL, LUCARIONITE, LUCK_INCENSE, LUCKY_EGG, LUCKY_PUNCH, LUM_BERRY, LUMINOUS_MOSS, LUMIOSE_GALETTE, LUNALIUM_Z, LUNAR_FEATHER, LURE, LURE_BALL, LUSTROUS_GLOBE, LUSTROUS_ORB, LUXURY_BALL, LYCANIUM_Z, MACH_BIKE, MACHINE_PART, MACHO_BRACE, MACHOP_CANDY, MAGIKARP_CANDY, MAGMA_EMBLEM, MAGMA_STONE, MAGMA_SUIT, MAGMAR_CANDY, MAGMARIZER, MAGNEMITE_CANDY, MAGNET, MAGO_BERRY, MAGOST_BERRY, MAINGATE_KEY, MAKEUP_BAG, MALICIOUS_ARMOR, MANECTITE, MANKEY_CANDY, MARANGA_BERRY, MARBLE, MARK_CHARM, MARSHADIUM_Z, MARSH_BALM, MASTER_BALL, MAWILITE, MAX_ELIXIR, MAX_ETHER, MAX_LURE, MAX_HONEY, MAX_MUSHROOMS, MAX_POTION, MAX_REPEL, MAX_REVIVE, MAYORS_NOTE, MEADOW_PLATE, MECH_MAIL, MECHANICAL_BOX, MECHANICAL_CABINET, MECHANICAL_CIRCULAR_SAW, MECHANICAL_PINWHEEL, MECHANICAL_TUB, MEDAL_BOX, MEDICHAMITE, MEDICINAL_LEEK, MEGA_BRACELET, MEGA_RING, MELTAN_CANDY, MEMBER_CARD, MENTAL_HERB, MEOWTH_CANDY, MESPRITS_PLUME, METAGROSSITE, METAL_COAT, METAL_POWDER, METEORITE, METEORITE_SHARD, METRONOME, MEW_CANDY, MEWNIUM_Z, MEWTWO_CANDY, MEWTWONITE_X, MEWTWONITE_Y, MICLE_BERRY, MIGHTY_CANDY, MIGHTY_CANDY_L, MIGHTY_CANDY_XL, MILD_MINT, MIMIKIUM_Z, MIND_PLATE, MINT_BERRY, MIRACLEBERRY, MIRACLE_SEED, MIRAGE_MAIL, MIRAIDONS_POKE_BALL, MIROR_RADAR, MIRROR_HERB, MISTY_SEED, MODEST_MINT, MOLTRES_CANDY, MOOMOO_MILK, MOON_BALL, MOON_FLUTE, MOON_SHARD, MOON_STONE, MORPH_MAIL, MOSAIC_MAIL, MOUNTAIN_BALM, MR_MIME_CANDY, MUSCLE_BAND, MUSCLE_FEATHER, MUSHROOM_CAKE, MUSIC_DISC, MUSIC_MAIL, MYSTERIOUS_BALM, MYSTERIOUS_SHARD_S, MYSTERIOUS_SHARD_L, MYSTERYBERRY, MYSTERY_EGG, MYSTIC_WATER, MYSTICTICKET, NAIVE_MINT, NANAB_BERRY, NAUGHTY_MINT, NEST_BALL, NET_BALL, NEVER_MELT_ICE, NIDORAN_MALE_CANDY, NIDORAN_FEMALE_CANDY, NINIKU_BERRY, N_LUNARIZER, NOMEL_BERRY, NORMAL_BOX, NORMAL_GEM, NORMAL_TERA_SHARD, NORMALIUM_Z, N_SOLARIZER, NUGGET, NUTPEA_BERRY, OAKS_LETTER, OAKS_PARCEL, OCCA_BERRY, OCEANIC_SLATE, ODD_INCENSE, ODD_KEYSTONE, ODDISH_CANDY, OLD_AMBER, OLD_CHARM, OLD_GATEAU, OLD_JOURNAL, OLD_LETTER, OLD_ROD, OLD_SEA_MAP, OLD_VERSES, OMANYTE_CANDY, ONIX_CANDY, ORAN_BERRY, ORANGE_MAIL, ORANGE_PETAL, ORIGIN_BALL, ORIGIN_ORE, OVAL_CHARM, OVAL_STONE, PAIR_OF_TICKETS, PAL_PAD, PAMTRE_BERRY, PARALYZE_HEAL, PARAS_CANDY, PARCEL, PARK_BALL, PASS, PASS_ORB, PASSHO_BERRY, PAYAPA_BERRY, PEARL, PEARL_STRING, PEAT_BLOCK, PECHA_BERRY, PEP_UP_PLANT, PERMIT, PERSIM_BERRY, PETAYA_BERRY, PEWTER_CRUNCHIES, PICNIC_SET, PIDGEOTITE, PIDGEY_CANDY, PIKACHU_CANDY, PIKANIUM_Z, PIKASHUNIUM_Z, PINAP_BERRY, PINK_APRICORN, PINK_BOW, PINK_NECTAR, PINK_PETAL, PINK_SCARF, PINSIR_CANDY, PINSIRITE, PIXIE_PLATE, PLASMA_CARD, PLUME_FOSSIL, PLUMP_BEANS, POFFIN_CASE, POINT_CARD, POISON_BARB, POISON_GEM, POISON_MEMORY, POISON_TERA_SHARD, POISONIUM_Z, POKE_BALL, POKE_DOLL, POKE_FLUTE, POKE_RADAR, POKE_SNACK, POKE_TOY, POKEBLOCK_CASE, POKEBLOCK_KIT, POKEDEX, POKEMON_BOX_LINK, POKESHI_DOLL, POLKADOT_BOW, POLISHED_MUD_BALL, POLIWAG_CANDY, POMEG_BERRY, PONYTA_CANDY, POP_POD, PORTRAITMAIL, PORYGON_CANDY, POTION, POWER_ANKLET, POWER_BAND, POWER_BELT, POWER_BRACER, POWER_HERB, POWER_LENS, POWER_PLANT_PASS, POWER_WEIGHT, POWERUP_PART, POWDER_JAR, PP_MAX, PP_UP, PREMIER_BALL, PRETTY_FEATHER, PRIMARIUM_Z, PRISM_SCALE, PRISON_BOTTLE, PROFS_LETTER, PROFESSORS_MASK, PROP_CASE, PROTECTIVE_PADS, PROTECTOR, PROTEIN, PRZCUREBERRY, PSNCUREBERRY, PSYCHIC_GEM, PSYCHIC_MEMORY, PSYCHIC_SEED, PSYCHIC_TERA_SHARD, PSYCHIUM_Z, PSYDUCK_CANDY, PUMKIN_BERRY, PUNCHING_GLOVE, PURE_INCENSE, PURPLE_NECTAR, PURPLE_PETAL, QUALOT_BERRY, QUICK_BALL, QUICK_CANDY, QUICK_CANDY_L, QUICK_CANDY_XL, QUICK_CLAW, QUICK_POWDER, QUIET_MINT, RABUTA_BERRY, RADIANT_PETAL, RAGECANDYBAR, RAINBOW_FLOWER, RAINBOW_PASS, RAINBOW_SLATE, RAINBOW_WING, RARE_BONE, RARE_CANDY, RASH_MINT, RATTATA_CANDY, RAWST_BERRY, RAZOR_CLAW, RAZOR_FANG, RAZZ_BERRY, R_DISK, REAPER_CLOTH, RECIPES, RED_APRICORN, RED_CARD, RED_CHAIN, RED_FLUTE, RED_ID_BADGE, RED_NECTAR, RED_ORB, RED_PETAL, RED_SCALE, RED_SCARF, RED_SHARD, REINS_OF_UNITY, RELAXED_MINT, RELIC_BAND, RELIC_COPPER, RELIC_CROWN, RELIC_GOLD, RELIC_SILVER, RELIC_STATUE, RELIC_VASE, REMEDY, REPEAT_BALL, REPEL, REPLY_MAIL, RESIST_FEATHER, RETRO_MAIL, REVEAL_GLASS, REVIVAL_HERB, REVIVE, RHYHORN_CANDY, RIBBON_SWEET, RICH_MULCH, RIDE_PAGER, RINDO_BERRY, RING_TARGET, ROCK_GEM, ROCK_INCENSE, ROCK_MEMORY, ROCK_TERA_SHARD, ROCKIUM_Z, ROCKY_HELMET, ROLLER_SKATES, ROOM_SERVICE, ROOT_FOSSIL, ROSE_INCENSE, ROSELI_BERRY, ROTO_BARGAIN, ROTO_BOOST, ROTO_CATCH, ROTO_ENCOUNTER, ROTO_EXP_POINTS, ROTO_FRIENDSHIP, ROTO_HATCH, ROTO_HP_RESTORE, ROTO_PP_RESTORE, ROTO_PRIZE_MONEY, ROTO_STEALTH, ROTOM_BIKE, ROTOM_CATALOG, ROTOM_PHONE, ROWAP_BERRY, RSVP_MAIL, RUBY, RUNNING_SHOES, RUSTED_SHIELD, RUSTED_SWORD, S_S_TICKET, SABLENITE, SACHET, SACRED_ASH, SAFARI_BALL, SAFETY_GOGGLES, SAIL_FOSSIL, SALAC_BERRY, SALAMENCITE, SALT_CAKE, SAND_RADISH, SANDSHREW_CANDY, SANDWICH, SAPPHIRE, SASSY_MINT, SCANNER, SCARLET_BOOK, SCATTER_BANG, SCEPTILITE, SCIZORITE, SCOPE_LENS, SCROLL_OF_DARKNESS, SCROLL_OF_WATERS, SCYTHER_CANDY, SEA_INCENSE, SEAL_CASE, SECRET_KEY, SECRET_MEDICINE, SEED_OF_MASTERY, SEEL_CANDY, SERIOUS_MINT, SHADOW_MAIL, SHADEROOT_CARROT, SHALOUR_SABLE, SHARP_BEAK, SHARPEDONITE, SHED_SHELL, SHELL_BELL, SHELLDER_CANDY, SHINY_CHARM, SHINY_LEAF, SHINY_STONE, SHOAL_SALT, SHOAL_SHELL, SHOCK_DRIVE, SHUCA_BERRY, SILK_SCARF, SILPH_SCOPE, SILVER_LEAF, SILVER_NANAB_BERRY, SILVER_PINAP_BERRY, SILVER_POWDER, SILVER_RAZZ_BERRY, SILVER_WING, SITRUS_BERRY, SKULL_FOSSIL, SKY_PLATE, SKY_TUMBLESTONE, SLOWBRONITE, SLOWPOKE_CANDY, SLOWPOKE_TAIL, SMALL_BOUQUET, SMALL_TABLET, SMART_CANDY, SMART_CANDY_L, SMART_CANDY_XL, SMOKE_BALL, SMOKE_BOMB, SMOOTH_ROCK, SNORLAX_CANDY, SNORLIUM_Z, SNOWBALL, SNOW_BALM, SNOW_MAIL, SODA_POP, SOFT_SAND, SOLGANIUM_Z, SONIAS_BOOK, SOOT_SACK, SOOTFOOT_ROOT, SOOTHE_BELL, SOUL_DEW, SOUL_SLATE, SPACE_BALM, SPACE_MAIL, SPARKLING_STONE, SPEAROW_CANDY, SPELL_TAG, SPELON_BERRY, SPLASH_PLATE, SPOILED_APRICORN, SPOOKY_PLATE, SPORT_BALL, SPRAYDUCK, SPRINGY_MUSHROOM, SPRINKLOTAD, SQUALL_SLATE, SQUIRT_BOTTLE, SQUIRTLE_CANDY, STABLE_MULCH, STAR_PIECE, STAR_SWEET, STARDUST, STARF_BERRY, STARYU_CANDY, STEALTH_SPRAY, STEEL_GEM, STEEL_MAIL, STEEL_MEMORY, STEEL_TEETH, STEEL_TERA_SHARD, STEELIUM_Z, STEELIXITE, STICKY_BARB, STICKY_GLOB, STONE_PLATE, STORAGE_KEY, STRANGE_BALL, STRANGE_SOUVENIR, STRATOSPHERIC_SLATE, STRAWBERRY_SWEET, STRETCHY_SPRING, STRIB_BERRY, STYLE_CARD, SUBWAY_KEY, SUITE_KEY, SUN_FLUTE, SUN_SHARD, SUN_STONE, SUPER_LURE, SUPER_POTION, SUPER_REPEL, SUPER_ROD, SUPERB_REMEDY, SURFBOARD, SURF_MAIL, SURGE_BADGE, SURPRISE_MULCH, SURVIVAL_CHARM_B, SURVIVAL_CHARM_P, SURVIVAL_CHARM_R, SURVIVAL_CHARM_T, SURVIVAL_CHARM_Y, SWAMPERTITE, SWAP_SNACK, SWEET_APPLE, SWEET_HEART, SWIFT_FEATHER, SWORDCAP, SYSTEM_LEVER, TAMATO_BERRY, TANGA_BERRY, TANGELA_CANDY, TAPUNIUM_Z, TART_APPLE, TAUROS_CANDY, TEA, TEACHY_TV, TECTONIC_SLATE, TEMPTING_CHARM_B, TEMPTING_CHARM_P, TEMPTING_CHARM_R, TEMPTING_CHARM_T, TEMPTING_CHARM_Y, TENTACOOL_CANDY, TERA_ORB, TERRAIN_EXTENDER, TERU_SAMA, THANKS_MAIL, THICK_CLUB, THROAT_SPRAY, THUNDER_STONE, TIDAL_BELL, TIME_BALM, TIME_FLUTE, TIMER_BALL, TIMID_MINT, TINY_BAMBOO_SHOOT, TINY_MUSHROOM, TM01, TM02, TM03, TM04, TM05, TM06, TM07, TM08, TM09, TM10, TM11, TM12, TM13, TM14, TM15, TM16, TM17, TM18, TM19, TM20, TM21, TM22, TM23, TM24, TM25, TM26, TM27, TM28, TM29, TM30, TM31, TM32, TM33, TM34, TM35, TM36, TM37, TM38, TM39, TM40, TM41, TM42, TM43, TM44, TM45, TM46, TM47, TM48, TM49, TM50, TM51, TM52, TM53, TM54, TM55, TM56, TM57, TM58, TM59, TM60, TM61, TM62, TM63, TM64, TM65, TM66, TM67, TM68, TM69, TM70, TM71, TM72, TM73, TM74, TM75, TM76, TM77, TM78, TM79, TM80, TM81, TM82, TM83, TM84, TM85, TM86, TM87, TM88, TM89, TM90, TM91, TM92, TM93, TM94, TM95, TM96, TM97, TM98, TM99, TM_CASE, TM_MATERIALS, TR01, TR02, TR03, TR04, TR05, TR06, TR07, TR08, TR09, TR10, TR11, TR12, TR13, TR14, TR15, TR16, TR17, TR18, TR19, TR20, TR21, TR22, TR23, TR24, TR25, TR26, TR27, TR28, TR29, TR30, TR31, TR32, TR33, TR34, TR35, TR36, TR37, TR38, TR39, TR40, TR41, TR42, TR43, TR44, TR45, TR46, TR47, TR48, TR49, TR50, TR51, TR52, TR53, TR54, TR55, TR56, TR57, TR58, TR59, TR60, TR61, TR62, TR63, TR64, TR65, TR66, TR67, TR68, TR69, TR70, TR71, TR72, TR73, TR74, TR75, TR76, TR77, TR78, TR79, TR80, TR81, TR82, TR83, TR84, TR85, TR86, TR87, TR88, TR89, TR90, TR91, TR92, TR93, TR94, TR95, TR96, TR97, TR98, TR99, TMV_PASS, TOPO_BERRY, TORN_JOURNAL, TOUGA_BERRY, TOUGH_CANDY, TOUGH_CANDY_L, TOUGH_CANDY_XL, TOWN_MAP, TOXIC_ORB, TOXIC_PLATE, TRAVEL_TRUNK, TRI_PASS, TROPIC_MAIL, TROPICAL_SHELL, TUMBLESTONE, TUNNEL_MAIL, TWICE_SPICED_RADISH, TWISTED_SPOON, TYRANITARITE, U_DISK, ULTRA_BALL, ULTRANECROZIUM_Z, UNOWN_REPORT, UNUSUAL_SHOES, UPGRADE, UTILITY_UMBRELLA, UXIES_CLAW, VENONAT_CANDY, VENUSAURITE, VIOLET_BOOK, VIVICHOKE, VIVID_SCENT, VOICE_CASE_1, VOICE_CASE_2, VOICE_CASE_3, VOICE_CASE_4, VOICE_CASE_5, VOLCANO_BALM, VOLTORB_CANDY, VS_RECORDER, VS_SEEKER, VULPIX_CANDY, WACAN_BERRY, WAILMER_PAIL, WALL_FRAGMENT, WARDING_CHARM_B, WARDING_CHARM_P, WARDING_CHARM_R, WARDING_CHARM_T, WARDING_CHARM_Y, WATER_GEM, WATER_MEMORY, WATER_STONE, WATER_TERA_SHARD, WATERIUM_Z, WATMEL_BERRY, WAVE_INCENSE, WAVE_MAIL, WEAKNESS_POLICY, WEEDLE_CANDY, WEPEAR_BERRY, WHIPPED_DREAM, WHITE_APRICORN, WHITE_FLUTE, WHITE_HERB, WHITE_MANE_HAIR, WIDE_LENS, WIKI_BERRY, WING_BALL, WISE_GLASSES, WISHING_CHIP, WISHING_PIECE, WISHING_STAR, WOOD, WOOD_MAIL, WOODEN_CROWN, WORKS_KEY, X_ACCURACY, X_ATTACK, X_DEFENSE, X_SP_ATK, X_SP_DEF, X_SPEED, XTRANSCEIVER, YACHE_BERRY, YAGO_BERRY, YELLOW_APRICORN, YELLOW_FLUTE, YELLOW_NECTAR, YELLOW_PETAL, YELLOW_SCARF, YELLOW_SHARD, YLW_ID_BADGE, ZAP_PLATE, ZAPDOS_CANDY, ZINC, ZOOM_LENS, Z_POWER_RING, Z_RING, ZUBAT_CANDY, ZYGARDE_CUBE, ITEM_TOTAL - // clang-format on -}; - -static constexpr std::uint16_t TOTAL_ITEM_COUNT = (std::uint16_t)Item::ITEM_TOTAL - 1U; -} // namespace pokesim::dex - -/////////////////////// END OF src/Types/Enums/Item.hpp //////////////////////// - ///////////////// START OF src/Components/Names/ItemNames.hpp ////////////////// namespace pokesim { @@ -19007,33 +19176,6 @@ struct NatureName { ///////////////// END OF src/Components/Names/NatureNames.hpp ////////////////// -////////////////////// START OF src/Types/Enums/Slot.hpp /////////////////////// - -namespace pokesim { -enum class Slot : std::uint8_t { - NONE = 0U, - P1A, - P2A, - P1B, - P2B, - - P1C, - P2C, - P1D, - P2D, - P1E, - P2E, - P1F, - P2F, - - TOTAL_SLOT, -}; - -static constexpr std::uint8_t TOTAL_SLOT_COUNT = (std::uint8_t)Slot::TOTAL_SLOT - 1U; -} // namespace pokesim - -/////////////////////// END OF src/Types/Enums/Slot.hpp //////////////////////// - /////////////// START OF src/Components/Names/SourceSlotName.hpp /////////////// namespace pokesim { @@ -19364,68 +19506,6 @@ struct RandomEventIndex { ///////////////// END OF src/Components/RandomEventOutputs.hpp ///////////////// -/////////////////////// START OF src/Types/Decisions.hpp /////////////////////// - -namespace pokesim { -struct MoveDecision { - Slot sourceSlot = Slot::NONE; - Slot targetSlot = Slot::NONE; - - dex::Move move = dex::Move::NO_MOVE; - - bool operator==(const MoveDecision& other) const { - return sourceSlot == other.sourceSlot && targetSlot == other.targetSlot && move == other.move; - } -}; - -struct MegaEvolveAndMoveDecision : MoveDecision {}; -struct ZMoveDecision : MoveDecision {}; -struct DynamaxAndMoveDecision : MoveDecision {}; -struct TerastallizeAndMoveDecision : MoveDecision {}; - -struct SwitchDecision { - Slot sourceSlot = Slot::NONE; - Slot targetSlot = Slot::NONE; - - bool operator==(const SwitchDecision& other) const { - return sourceSlot == other.sourceSlot && targetSlot == other.targetSlot; - } -}; - -struct ItemDecision { - Slot sourceSlot = Slot::NONE; - Slot targetSlot = Slot::NONE; - - dex::Item item = dex::Item::NO_ITEM; - - bool operator==(const ItemDecision& other) const { - return sourceSlot == other.sourceSlot && targetSlot == other.targetSlot && item == other.item; - } -}; - -namespace types { -struct slotDecision : pokesim::internal::variant< - MoveDecision, MegaEvolveAndMoveDecision, TerastallizeAndMoveDecision, DynamaxAndMoveDecision, - ZMoveDecision, SwitchDecision, ItemDecision> { - using pokesim::internal::variant< - MoveDecision, MegaEvolveAndMoveDecision, TerastallizeAndMoveDecision, DynamaxAndMoveDecision, ZMoveDecision, - SwitchDecision, ItemDecision>::variant; - - constexpr Slot sourceSlot() const { - return std::visit([](auto&& decision) { return decision.sourceSlot; }, *this); - } - - constexpr Slot targetSlot() const { - return std::visit([](auto&& decision) { return decision.targetSlot; }, *this); - } -}; - -using slotDecisions = types::sideSlots; -} // namespace types -} // namespace pokesim - -//////////////////////// END OF src/Types/Decisions.hpp //////////////////////// - ////////////////// START OF src/Components/SideDecisions.hpp /////////////////// namespace pokesim { @@ -19615,60 +19695,6 @@ struct SpeciesTypes { //////////////////// END OF src/Components/SpeciesTypes.hpp //////////////////// -/////////////////// START OF src/Types/Enums/ActionOrder.hpp /////////////////// - -namespace pokesim { -enum class ActionOrder : std::uint8_t { - NONE = std::numeric_limits>::max(), - TEAM = 1U, - START = 2U, - BEFORE_TURN = 4U, - ITEM = BEFORE_TURN, - - SWITCH = 103U, - - MOVE = 200U, - - RESIDUAL = 254U, -}; - -static constexpr inline std::array VALID_ACTION_ORDERS = { - ActionOrder::NONE, - ActionOrder::TEAM, - ActionOrder::START, - ActionOrder::BEFORE_TURN, - ActionOrder::ITEM, - ActionOrder::SWITCH, - ActionOrder::MOVE, - ActionOrder::RESIDUAL, -}; -} // namespace pokesim - -//////////////////// END OF src/Types/Enums/ActionOrder.hpp //////////////////// - -//////////////////// START OF src/Components/SpeedSort.hpp ///////////////////// - -namespace pokesim { -// Data that determines the order actions take place -struct SpeedSort { - // Order of the types of actions (lower first) - ActionOrder order = ActionOrder::NONE; - // Priority of the action (higher first) - types::priority priority = Constants::MovePriority::DEFAULT; - // Whether negative fractional priority is active for the action (false first) - types::fractionalPriority fractionalPriority = false; - // Speed of Pokemon using move (higher first if priority tie) - types::stat speed = Constants::PokemonEffectiveStat::DEFAULT; - - bool operator==(const SpeedSort& other) const { - return order == other.order && priority == other.priority && fractionalPriority == other.fractionalPriority && - speed == other.speed; - } -}; -} // namespace pokesim - -///////////////////// END OF src/Components/SpeedSort.hpp ////////////////////// - ////////////////////// START OF src/Components/Stats.hpp /////////////////////// namespace pokesim::stat { @@ -19899,6 +19925,14 @@ struct CanSetStatus {}; ////////////////// END OF src/Components/Tags/PokemonTags.hpp ////////////////// +////////////// START OF src/Components/Tags/RecycledEntities.hpp /////////////// + +namespace pokesim::tags { +struct RecycledAction {}; +} // namespace pokesim::tags + +/////////////// END OF src/Components/Tags/RecycledEntities.hpp //////////////// + //////////////// START OF src/Components/Tags/RunEventTags.hpp ///////////////// namespace pokesim::tags { @@ -20355,6 +20389,8 @@ struct Options { namespace pokesim { struct Accuracy; +struct ActionQueueItem; +struct ActionQueue; struct AddedTargets; struct BaseEffectChance; struct BasePower; @@ -20369,14 +20405,12 @@ struct DamageRollModifiers; struct DamageRolls; struct Evs; struct Ivs; -struct ActionQueue; struct Battle; struct ParentBattle; struct RootBattle; struct ParentEntity; struct ChoiceLock; struct CurrentAction; -struct NextAction; struct CurrentActionTargets; struct CurrentActionSource; struct CurrentActionTarget; @@ -20394,6 +20428,7 @@ struct FoeSide; struct LastUsedMove; struct MoveSlots; struct Pokemon; +struct RecycledAction; struct Side; struct Sides; struct Team; @@ -20431,7 +20466,6 @@ struct RngSeed; struct SideDecision; struct SpeedTieIndexes; struct SpeciesTypes; -struct SpeedSort; struct Turn; struct Winner; namespace analyze_effect { @@ -20507,6 +20541,12 @@ void checkPercentChance(types::percentChance); template <> void check(const Accuracy&); +template <> +void check(const ActionQueueItem&); + +template <> +void check(const ActionQueue&); + template <> void check(const AddedTargets&); @@ -20590,9 +20630,6 @@ void check(const Evs&); template <> void check(const Ivs&); -template <> -void check(const ActionQueue&, const types::registry&); - template <> void check(const Battle&, const types::registry&); @@ -20611,9 +20648,6 @@ void check(const ChoiceLock&, const types::registry&); template <> void check(const CurrentAction&, const types::registry&); -template <> -void check(const NextAction&, const types::registry&); - template <> void check(const CurrentActionTargets&, const types::registry&); @@ -20665,6 +20699,9 @@ void check(const MoveSlots&, const types::registry&); template <> void check(const Pokemon&, const types::registry&); +template <> +void check(const RecycledAction&, const types::registry&); + template <> void check(const Side&, const types::registry&); @@ -20833,9 +20870,6 @@ void check(const analyze_effect::EffectMultiplier&); template <> void check(const SpeciesTypes&); -template <> -void check(const SpeedSort&); - template <> void check(const stat::Hp&); @@ -21433,6 +21467,7 @@ namespace pokesim { struct SimulateTurnOptions; struct CalculateDamageOptions; struct AnalyzeEffectOptions; +struct ActionQueueItem; // Tool to set properties of a battle's state to an entity. struct BattleStateSetup : internal::StateSetupBase { @@ -21458,7 +21493,7 @@ struct BattleStateSetup : internal::StateSetupBase { // If a seed is not provided, the seed is set to a random number based on the current time in nanoseconds. void setRNGSeed(std::optional seed = std::nullopt); - void setActionQueue(const std::vector& queue); + void setActionQueue(const std::vector& queue); void setTurn(types::battleTurn turn); void setCurrentActionTarget(types::targets actionTargets); void setCurrentActionSource(types::entity actionSource); @@ -24439,15 +24474,16 @@ types::teamPositionIndex foeSidePokemonLeft(const types::registry& registry, typ namespace pokesim { struct SideDecision; struct ActionQueue; +struct RecycledAction; namespace simulate_turn { void resolveDecision(types::handle sideHandle, const SideDecision& sideDecision); void speedSort(types::handle handle, ActionQueue& actionQueue); -void addBeforeTurnAction(types::registry& registry, ActionQueue& actionQueue); -void addResidualAction(types::registry& registry, ActionQueue& actionQueue); -void setCurrentAction(types::handle battleHandle, ActionQueue& actionQueue); -void clearActionQueue(types::handle battleHandle, ActionQueue& actionQueue); +void addBeforeTurnAction(ActionQueue& actionQueue); +void addResidualAction(ActionQueue& actionQueue); +void setCurrentAction(types::handle battleHandle, ActionQueue& actionQueue, RecycledAction& action); +void clearActionQueue(ActionQueue& actionQueue); } // namespace simulate_turn } // namespace pokesim @@ -24486,6 +24522,7 @@ struct Checks : pokesim::debug::Checks { void copyBattles() { for (types::entity entity : getBattleView()) { copyEntity(entity); + copyEntity(registry->get(entity).val); } } @@ -24494,25 +24531,40 @@ struct Checks : pokesim::debug::Checks { typesToIgnore.add(); pokesim::debug::TypesToIgnore typesIgnoredOnConstants = typesToIgnore; - typesToIgnore.add(); + typesToIgnore.add(); if (!simulateTurnOptionsOnInput.getMakeBranchesOnRandomEvents()) { typesToIgnore.add(); } - for (types::entity entity : getBattleView()) { - types::entity original = pokesim::debug::findCopyParent(currentEntitiesToInitial, *registry, entity); - bool shouldNotChange = !simulateTurnOptionsOnInput.getApplyChangesToInputBattle() && original == entity; + for (types::entity currentEntity : getBattleView()) { + types::entity original = pokesim::debug::findCopyParent(currentEntitiesToInitial, *registry, currentEntity); + bool shouldNotChange = !simulateTurnOptionsOnInput.getApplyChangesToInputBattle() && original == currentEntity; if (!registryOnInput.all_of(original)) { typesToIgnore.add(); } + types::entity initialEntity = getInitialEntity(currentEntity); pokesim::debug::areEntitiesEqual( *registry, - entity, + currentEntity, registryOnInput, - getInitialEntity(entity), + initialEntity, shouldNotChange ? typesIgnoredOnConstants : typesToIgnore); + + bool initialIsMidTurn = registryOnInput.all_of(initialEntity); + bool currentIsMidTurn = registry->all_of(currentEntity); + types::entity currAction = registry->get(currentEntity).val; + if (!initialIsMidTurn && !currentIsMidTurn) { + pokesim::debug::areEntitiesEqual(*registry, currAction, registryOnInput, getInitialEntity(currAction)); + } + + if (!currentIsMidTurn) { + types::registry blankRegistry; + types::entity idealRecycledAction = blankRegistry.create(); + blankRegistry.emplace(idealRecycledAction); + pokesim::debug::hasSameComponents(*registry, currAction, blankRegistry, idealRecycledAction); + } } } diff --git a/extras/RecentBenchmarkResults.md b/extras/RecentBenchmarkResults.md index d5a9344..6174da6 100644 --- a/extras/RecentBenchmarkResults.md +++ b/extras/RecentBenchmarkResults.md @@ -7,286 +7,286 @@ ## SV-SingleBattle-MonteCarlo-SimulateTurn-VerticalSlice1 | Inputs | Samples | Iterations / Sample | Estimated Completion Time | Mean of Samples | Standard Deviation | Mean / Input Count | Mean Lower Bound / Input Count | Mean Upper Bound / Input Count | | --- | --- | --- | --- | --- | --- | --- | --- | --- | -| 1 | 100 | 1 | 45.586600ms | 72.612160us | 36.870301us | 72.612160us | 68.047960us | 86.833730us | -| 2 | 100 | 1 | 45.360000ms | 78.903690us | 13.716725us | 39.451845us | 38.663290us | 42.418775us | -| 4 | 100 | 1 | 47.979000ms | 91.269010us | 12.313323us | 22.817252us | 22.393313us | 23.790180us | -| 8 | 100 | 1 | 51.805500ms | 113.429860us | 14.740678us | 14.178733us | 13.925684us | 14.756475us | -| 16 | 100 | 1 | 56.845400ms | 154.173530us | 13.831314us | 9.635846us | 9.526197us | 9.940584us | -| 32 | 100 | 1 | 65.834300ms | 219.595020us | 16.694929us | 6.862344us | 6.795959us | 7.048406us | -| 64 | 100 | 1 | 79.222300ms | 337.052180us | 11.963431us | 5.266440us | 5.242059us | 5.329134us | -| 128 | 100 | 1 | 101.996900ms | 567.496590us | 33.538267us | 4.433567us | 4.403642us | 4.543706us | -| 256 | 100 | 1 | 152.568600ms | 1.006173ms | 11.046391us | 3.930365us | 3.923118us | 3.940410us | -| 512 | 100 | 1 | 243.114600ms | 1.846706ms | 25.752537us | 3.606847us | 3.598646us | 3.618895us | -| 1024 | 100 | 1 | 440.402000ms | 3.567251ms | 37.778364us | 3.483644us | 3.476871us | 3.491402us | -| 2048 | 100 | 1 | 862.438600ms | 7.025896ms | 79.199517us | 3.430613us | 3.423856us | 3.439235us | -| 4096 | 100 | 1 | 1446.821700ms | 13.976661ms | 161.507938us | 3.412271us | 3.405289us | 3.420820us | -| 8192 | 100 | 1 | 2887.719700ms | 28.465571ms | 325.447651us | 3.474801us | 3.467713us | 3.483333us | -| 16384 | 100 | 1 | 5943.221900ms | 59.166400ms | 633.777646us | 3.611230us | 3.604239us | 3.619450us | -| 32768 | 100 | 1 | 12138.322500ms | 122.010729ms | 1.047967ms | 3.723472us | 3.717506us | 3.730022us | -| 65536 | 100 | 1 | 28543.582300ms | 254.573653ms | 8.262153ms | 3.884486us | 3.861702us | 3.911339us | +| 1 | 100 | 1 | 43.036200ms | 62.889530us | 12.403818us | 62.889530us | 61.373210us | 67.696170us | +| 2 | 100 | 1 | 45.409800ms | 70.657180us | 15.838655us | 35.328590us | 34.392960us | 38.618510us | +| 4 | 100 | 1 | 45.756900ms | 81.255940us | 13.177858us | 20.313985us | 19.925410us | 21.686275us | +| 8 | 100 | 1 | 48.318300ms | 97.743780us | 14.579921us | 12.217973us | 11.965109us | 12.772417us | +| 16 | 100 | 1 | 54.224800ms | 136.766550us | 12.711347us | 8.547909us | 8.433032us | 8.772299us | +| 32 | 100 | 1 | 59.370900ms | 183.914000us | 11.892801us | 5.747312us | 5.692381us | 5.851131us | +| 64 | 100 | 1 | 72.067200ms | 286.457050us | 13.122662us | 4.475891us | 4.446073us | 4.534322us | +| 128 | 100 | 1 | 94.512500ms | 485.950520us | 22.216319us | 3.796488us | 3.771794us | 3.847070us | +| 256 | 100 | 1 | 133.613800ms | 857.680610us | 15.422076us | 3.350315us | 3.341366us | 3.366934us | +| 512 | 100 | 1 | 228.571000ms | 1.617709ms | 24.020018us | 3.159588us | 3.152384us | 3.172014us | +| 1024 | 100 | 1 | 402.123400ms | 3.235419ms | 711.556029us | 3.159589us | 3.086793us | 3.501180us | +| 2048 | 100 | 1 | 762.140600ms | 6.227778ms | 78.084692us | 3.040907us | 3.034186us | 3.049268us | +| 4096 | 100 | 1 | 1486.891200ms | 12.362110ms | 183.011739us | 3.018093us | 3.010493us | 3.028256us | +| 8192 | 100 | 1 | 2605.532300ms | 25.406504ms | 407.273670us | 3.101380us | 3.092766us | 3.112583us | +| 16384 | 100 | 1 | 5230.642200ms | 52.609158ms | 743.212351us | 3.211008us | 3.203707us | 3.222135us | +| 32768 | 100 | 1 | 10825.299900ms | 109.166809ms | 1.155224ms | 3.331507us | 3.325319us | 3.339309us | +| 65536 | 100 | 1 | 25160.138200ms | 226.372002ms | 6.260352ms | 3.454163us | 3.438286us | 3.476467us | ## SV-SingleBattle-Branching-SimulateTurn-VerticalSlice1 | Inputs | Samples | Iterations / Sample | Estimated Completion Time | Mean of Samples | Standard Deviation | Mean / Input Count | Mean Lower Bound / Input Count | Mean Upper Bound / Input Count | | --- | --- | --- | --- | --- | --- | --- | --- | --- | -| 1 | 100 | 1 | 62.413200ms | 212.262920us | 12.260236us | 212.262920us | 210.761250us | 216.880840us | -| 2 | 100 | 1 | 40.747900ms | 295.356840us | 15.038254us | 147.678420us | 146.745300us | 150.498715us | -| 4 | 100 | 1 | 53.213300ms | 438.008600us | 12.252830us | 109.502150us | 109.096490us | 110.508105us | -| 8 | 100 | 1 | 82.873100ms | 709.100450us | 12.901636us | 88.637556us | 88.416869us | 89.143395us | -| 16 | 100 | 1 | 140.976100ms | 1.220784ms | 21.304769us | 76.299016us | 76.052406us | 76.575449us | -| 32 | 100 | 1 | 243.951500ms | 2.205185ms | 30.267656us | 68.912029us | 68.775715us | 69.189863us | -| 64 | 100 | 1 | 458.172000ms | 4.161231ms | 53.025267us | 65.019233us | 64.876231us | 65.206469us | -| 128 | 100 | 1 | 863.819400ms | 8.036071ms | 69.393793us | 62.781806us | 62.686053us | 62.902105us | -| 256 | 100 | 1 | 1662.278100ms | 15.623492ms | 187.195075us | 61.029265us | 60.903714us | 61.194300us | -| 512 | 100 | 1 | 3082.813100ms | 29.907497ms | 297.660407us | 58.413080us | 58.311218us | 58.542328us | -| 1024 | 100 | 1 | 6142.838700ms | 59.704664ms | 1.136477ms | 58.305336us | 58.147228us | 58.631954us | -| 2048 | 100 | 1 | 12157.960200ms | 122.354378ms | 1.960724ms | 59.743349us | 59.584370us | 59.968807us | -| 4096 | 100 | 1 | 26496.501900ms | 268.116796ms | 2.985465ms | 65.458202us | 65.322643us | 65.608708us | -| 8192 | 100 | 1 | 58551.333900ms | 590.918014ms | 3.141484ms | 72.133547us | 72.059976us | 72.210254us | +| 1 | 100 | 1 | 61.803200ms | 192.835480us | 11.253860us | 192.835480us | 191.429580us | 197.058260us | +| 2 | 100 | 1 | 67.671100ms | 264.467440us | 14.015096us | 132.233720us | 131.366635us | 134.846925us | +| 4 | 100 | 1 | 47.368100ms | 390.787340us | 15.046180us | 97.696835us | 97.226195us | 99.065467us | +| 8 | 100 | 1 | 73.527500ms | 631.050580us | 13.110884us | 78.881322us | 78.633827us | 79.322477us | +| 16 | 100 | 1 | 123.333300ms | 1.068295ms | 16.250887us | 66.768413us | 66.626819us | 67.078746us | +| 32 | 100 | 1 | 220.118000ms | 1.957605ms | 31.747182us | 61.175145us | 61.014313us | 61.416214us | +| 64 | 100 | 1 | 398.243400ms | 3.662542ms | 46.111308us | 57.227215us | 57.097696us | 57.381943us | +| 128 | 100 | 1 | 758.389900ms | 7.015844ms | 90.809629us | 54.811284us | 54.684557us | 54.964024us | +| 256 | 100 | 1 | 1425.747200ms | 13.681825ms | 294.658699us | 53.444629us | 53.261856us | 53.733271us | +| 512 | 100 | 1 | 2705.056000ms | 26.150996ms | 313.012744us | 51.076164us | 50.964919us | 51.205398us | +| 1024 | 100 | 1 | 5318.551600ms | 52.000460ms | 1.342433ms | 50.781700us | 50.591750us | 51.151289us | +| 2048 | 100 | 1 | 10629.217200ms | 106.187923ms | 3.247309ms | 51.849572us | 51.621261us | 52.307176us | +| 4096 | 100 | 1 | 23550.384400ms | 233.968907ms | 6.074906ms | 57.121315us | 56.890702us | 57.499744us | +| 8192 | 100 | 1 | 53876.510600ms | 539.534633ms | 6.766069ms | 65.861161us | 65.724456us | 66.058346us | ## SV-DoubleBattle-MonteCarlo-SimulateTurn-VerticalSlice1 | Inputs | Samples | Iterations / Sample | Estimated Completion Time | Mean of Samples | Standard Deviation | Mean / Input Count | Mean Lower Bound / Input Count | Mean Upper Bound / Input Count | | --- | --- | --- | --- | --- | --- | --- | --- | --- | -| 1 | 100 | 1 | 56.139100ms | 113.915600us | 17.038369us | 113.915600us | 111.829690us | 120.483810us | -| 2 | 100 | 1 | 59.579600ms | 139.103680us | 15.740024us | 69.551840us | 68.436825us | 71.856225us | -| 4 | 100 | 1 | 63.010200ms | 164.520690us | 28.411635us | 41.130173us | 40.137960us | 43.285897us | -| 8 | 100 | 1 | 68.364300ms | 198.752600us | 18.831438us | 24.844075us | 24.522119us | 25.589527us | -| 16 | 100 | 1 | 48.822200ms | 274.142030us | 20.597218us | 17.133877us | 16.947761us | 17.506199us | -| 32 | 100 | 1 | 62.115000ms | 399.004660us | 12.203792us | 12.468896us | 12.420193us | 12.600902us | -| 64 | 100 | 1 | 88.468400ms | 626.797780us | 13.165536us | 9.793715us | 9.765039us | 9.856547us | -| 128 | 100 | 1 | 118.160900ms | 1.068353ms | 13.237349us | 8.346507us | 8.331137us | 8.375140us | -| 256 | 100 | 1 | 207.517400ms | 1.931110ms | 24.321584us | 7.543400us | 7.526393us | 7.563830us | -| 512 | 100 | 1 | 385.870500ms | 3.619361ms | 42.236813us | 7.069064us | 7.053958us | 7.086490us | -| 1024 | 100 | 1 | 715.116200ms | 6.869895ms | 73.579681us | 6.708881us | 6.695679us | 6.724093us | -| 2048 | 100 | 1 | 1400.109800ms | 13.565039ms | 158.008791us | 6.623554us | 6.609585us | 6.640140us | -| 4096 | 100 | 1 | 2743.989200ms | 27.144909ms | 374.595875us | 6.627175us | 6.610915us | 6.647117us | +| 1 | 100 | 1 | 27.860300ms | 97.521060us | 11.368638us | 97.521060us | 96.152360us | 101.916280us | +| 2 | 100 | 1 | 27.709100ms | 116.008090us | 13.912843us | 58.004045us | 57.179810us | 60.743165us | +| 4 | 100 | 1 | 29.875800ms | 140.672470us | 17.807832us | 35.168118us | 34.530253us | 36.463730us | +| 8 | 100 | 1 | 35.396500ms | 170.326600us | 13.123529us | 21.290825us | 21.070836us | 21.817425us | +| 16 | 100 | 1 | 43.548300ms | 234.155070us | 12.508275us | 14.634692us | 14.523846us | 14.864514us | +| 32 | 100 | 1 | 43.099900ms | 328.715710us | 14.015457us | 10.272366us | 10.219551us | 10.444704us | +| 64 | 100 | 1 | 62.472800ms | 530.340490us | 14.498173us | 8.286570us | 8.252347us | 8.347303us | +| 128 | 100 | 1 | 104.070800ms | 895.349360us | 15.038206us | 6.994917us | 6.975207us | 7.021926us | +| 256 | 100 | 1 | 175.010100ms | 1.628515ms | 26.773174us | 6.361386us | 6.345407us | 6.389178us | +| 512 | 100 | 1 | 325.172100ms | 3.077679ms | 27.009724us | 6.011093us | 6.001873us | 6.022785us | +| 1024 | 100 | 1 | 621.968600ms | 5.955360ms | 76.706204us | 5.815781us | 5.802122us | 5.831527us | +| 2048 | 100 | 1 | 1213.580700ms | 11.817182ms | 292.695183us | 5.770109us | 5.749164us | 5.809852us | +| 4096 | 100 | 1 | 2441.101800ms | 23.974863ms | 553.315900us | 5.853238us | 5.831414us | 5.885897us | ## SV-DoubleBattle-Branching-SimulateTurn-VerticalSlice1 | Inputs | Samples | Iterations / Sample | Estimated Completion Time | Mean of Samples | Standard Deviation | Mean / Input Count | Mean Lower Bound / Input Count | Mean Upper Bound / Input Count | | --- | --- | --- | --- | --- | --- | --- | --- | --- | -| 1 | 100 | 1 | 76.056400ms | 512.683740us | 15.685977us | 512.683740us | 510.606340us | 517.815100us | -| 2 | 100 | 1 | 87.503800ms | 766.571190us | 16.545056us | 383.285595us | 382.201860us | 386.029200us | -| 4 | 100 | 1 | 141.025000ms | 1.248618ms | 20.239379us | 312.154532us | 311.412643us | 313.565497us | -| 8 | 100 | 1 | 239.094500ms | 2.123076ms | 29.190160us | 265.384481us | 264.745864us | 266.194028us | -| 16 | 100 | 1 | 409.526400ms | 3.824705ms | 54.272343us | 239.044094us | 238.492109us | 239.862944us | -| 32 | 100 | 1 | 769.334600ms | 7.272913ms | 68.357248us | 227.278545us | 226.883450us | 227.723038us | -| 64 | 100 | 1 | 1468.781500ms | 13.845677ms | 137.976061us | 216.338703us | 215.968656us | 216.828335us | -| 128 | 100 | 1 | 2839.736700ms | 27.081953ms | 403.486162us | 211.577761us | 211.058874us | 212.339617us | -| 256 | 100 | 1 | 5686.503300ms | 54.560356ms | 1.388467ms | 213.126389us | 212.324214us | 214.620379us | -| 512 | 100 | 1 | 10872.876500ms | 109.268916ms | 2.113869ms | 213.415851us | 212.782351us | 214.522748us | -| 1024 | 100 | 1 | 22829.154600ms | 226.982693ms | 2.681968ms | 221.662786us | 221.215660us | 222.255564us | -| 2048 | 100 | 1 | 46357.208600ms | 466.699115ms | 3.012516ms | 227.880427us | 227.622006us | 228.204529us | -| 4096 | 100 | 1 | 97962.181500ms | 982.613498ms | 4.244872ms | 239.895874us | 239.702751us | 240.111496us | +| 1 | 100 | 1 | 70.096000ms | 451.444420us | 16.651479us | 451.444420us | 449.381530us | 457.721400us | +| 2 | 100 | 1 | 79.649900ms | 686.392640us | 16.611743us | 343.196320us | 341.685375us | 344.962165us | +| 4 | 100 | 1 | 122.288400ms | 1.076258ms | 15.362888us | 269.064597us | 268.559495us | 270.355715us | +| 8 | 100 | 1 | 202.731900ms | 1.836434ms | 20.191596us | 229.554199us | 229.171057us | 230.225214us | +| 16 | 100 | 1 | 364.184900ms | 3.312983ms | 38.543537us | 207.061442us | 206.624725us | 207.576890us | +| 32 | 100 | 1 | 690.164500ms | 6.267243ms | 75.897193us | 195.851357us | 195.439056us | 196.382865us | +| 64 | 100 | 1 | 1265.009300ms | 12.020025ms | 237.493102us | 187.812887us | 187.212349us | 188.715361us | +| 128 | 100 | 1 | 2455.522100ms | 23.229834ms | 339.528672us | 181.483081us | 181.010498us | 182.059185us | +| 256 | 100 | 1 | 5326.020400ms | 46.531433ms | 1.864522ms | 181.763409us | 180.811923us | 184.204321us | +| 512 | 100 | 1 | 9226.963500ms | 91.750585ms | 2.280062ms | 179.200361us | 178.535151us | 180.411474us | +| 1024 | 100 | 1 | 18066.813400ms | 183.308606ms | 3.291548ms | 179.012311us | 178.508519us | 179.823557us | +| 2048 | 100 | 1 | 37282.153900ms | 375.945531ms | 4.748537ms | 183.567154us | 183.208537us | 184.167501us | +| 4096 | 100 | 1 | 80013.517300ms | 804.779567ms | 5.664494ms | 196.479386us | 196.233316us | 196.780551us | ## SV-SingleBattle-CalcDamage-VerticalSlice1 | Inputs | Samples | Iterations / Sample | Estimated Completion Time | Mean of Samples | Standard Deviation | Mean / Input Count | Mean Lower Bound / Input Count | Mean Upper Bound / Input Count | | --- | --- | --- | --- | --- | --- | --- | --- | --- | -| 1 | 100 | 1 | 8.108700ms | 9.910560us | 3.735469us | 9.910560us | 9.406760us | 11.147770us | -| 2 | 100 | 1 | 8.321300ms | 11.230630us | 3.813415us | 5.615315us | 5.359100us | 6.245805us | -| 4 | 100 | 1 | 8.694600ms | 11.532080us | 3.708387us | 2.883020us | 2.758223us | 3.194898us | -| 8 | 100 | 1 | 8.803700ms | 12.784660us | 2.556226us | 1.598083us | 1.561088us | 1.740395us | -| 16 | 100 | 1 | 9.307100ms | 16.470550us | 2.340975us | 1.029409us | 1.009974us | 1.078093us | -| 32 | 100 | 1 | 9.889700ms | 22.984090us | 2.874482us | 718.252813ns | 707.108750ns | 752.316563ns | -| 64 | 100 | 1 | 11.188100ms | 34.568110us | 3.604282us | 540.126719ns | 532.311563ns | 557.494844ns | -| 128 | 100 | 1 | 13.900500ms | 58.237640us | 16.721370us | 454.981562ns | 440.525547ns | 516.017969ns | -| 256 | 100 | 1 | 19.034000ms | 102.547090us | 14.584170us | 400.574570ns | 394.055820ns | 424.778125ns | -| 512 | 100 | 1 | 35.707200ms | 192.139570us | 7.730298us | 375.272598ns | 373.040059ns | 379.466094ns | -| 1024 | 100 | 1 | 62.002000ms | 368.642630us | 7.257515us | 360.002568ns | 358.798115ns | 361.644727ns | -| 2048 | 100 | 1 | 117.150400ms | 722.584340us | 9.720684us | 352.824385ns | 352.036665ns | 353.937905ns | -| 4096 | 100 | 1 | 224.368400ms | 1.437033ms | 23.528150us | 350.838074ns | 349.813093ns | 352.084641ns | -| 8192 | 100 | 1 | 449.585500ms | 2.983118ms | 47.687215us | 364.150181ns | 363.065052ns | 365.357142ns | -| 16384 | 100 | 1 | 901.485100ms | 6.080521ms | 87.803068us | 371.125577ns | 370.250431ns | 372.418959ns | -| 32768 | 100 | 1 | 1830.961600ms | 12.348842ms | 144.123008us | 376.856736ns | 376.069455ns | 377.802163ns | -| 65536 | 100 | 1 | 3568.540600ms | 25.829382ms | 239.418815us | 394.125087ns | 393.465028ns | 394.902408ns | +| 1 | 100 | 1 | 7.935200ms | 10.271510us | 3.492715us | 10.271510us | 9.796580us | 11.386720us | +| 2 | 100 | 1 | 8.132600ms | 11.475080us | 4.003053us | 5.737540us | 5.457705us | 6.348635us | +| 4 | 100 | 1 | 8.272000ms | 11.438880us | 3.114085us | 2.859720us | 2.757835us | 3.148250us | +| 8 | 100 | 1 | 8.567600ms | 13.123670us | 2.959634us | 1.640459us | 1.590789us | 1.759091us | +| 16 | 100 | 1 | 8.995800ms | 16.716730us | 3.134768us | 1.044796us | 1.018856us | 1.111584us | +| 32 | 100 | 1 | 9.878500ms | 24.547010us | 3.429815us | 767.094062ns | 752.196563ns | 799.918125ns | +| 64 | 100 | 1 | 11.501900ms | 35.665880us | 3.393685us | 557.279375ns | 549.625469ns | 572.497500ns | +| 128 | 100 | 1 | 13.816400ms | 57.574030us | 3.265106us | 449.797109ns | 445.998672ns | 456.833516ns | +| 256 | 100 | 1 | 18.984900ms | 103.069580us | 3.557387us | 402.615547ns | 400.330586ns | 405.938789ns | +| 512 | 100 | 1 | 35.706300ms | 191.844970us | 4.695318us | 374.697207ns | 373.218691ns | 376.942207ns | +| 1024 | 100 | 1 | 63.726300ms | 367.404660us | 5.191427us | 358.793613ns | 357.951416ns | 359.992520ns | +| 2048 | 100 | 1 | 117.819800ms | 722.662720us | 9.997334us | 352.862656ns | 352.039443ns | 353.996577ns | +| 4096 | 100 | 1 | 235.110000ms | 1.444082ms | 32.761707us | 352.559021ns | 351.339119ns | 354.681978ns | +| 8192 | 100 | 1 | 467.327700ms | 3.048989ms | 56.511266us | 372.191017ns | 370.949302ns | 373.668976ns | +| 16384 | 100 | 1 | 934.852200ms | 6.197596ms | 75.472017us | 378.271249ns | 377.480701ns | 379.309343ns | +| 32768 | 100 | 1 | 1871.845200ms | 12.654959ms | 316.402961us | 386.198692ns | 384.826534ns | 389.051187ns | +| 65536 | 100 | 1 | 3750.665800ms | 26.650461ms | 581.872660us | 406.653769ns | 405.245233ns | 408.862578ns | ## SV-SingleBattle-AnalyzeEffect-VerticalSlice1 | Inputs | Samples | Iterations / Sample | Estimated Completion Time | Mean of Samples | Standard Deviation | Mean / Input Count | Mean Lower Bound / Input Count | Mean Upper Bound / Input Count | | --- | --- | --- | --- | --- | --- | --- | --- | --- | -| 1 | 100 | 1 | 27.867500ms | 53.619000us | 8.122014us | 53.619000us | 52.526650us | 56.245270us | -| 2 | 100 | 1 | 29.248200ms | 64.366620us | 9.969053us | 32.183310us | 31.603870us | 34.258040us | -| 4 | 100 | 1 | 31.854000ms | 90.441970us | 10.660729us | 22.610492us | 22.260535us | 23.520257us | -| 8 | 100 | 1 | 20.686900ms | 123.996190us | 9.081815us | 15.499524us | 15.358738us | 15.922013us | -| 16 | 100 | 1 | 26.006700ms | 192.332370us | 7.817704us | 12.020773us | 11.959454us | 12.194928us | -| 32 | 100 | 1 | 41.825100ms | 323.087400us | 8.460468us | 10.096481us | 10.060330us | 10.179903us | -| 64 | 100 | 1 | 71.103800ms | 580.960770us | 10.962616us | 9.077512us | 9.051515us | 9.123853us | -| 128 | 100 | 1 | 131.771700ms | 1.099483ms | 15.815319us | 8.589707us | 8.567374us | 8.615986us | -| 256 | 100 | 1 | 236.697000ms | 2.061947ms | 27.134031us | 8.054482us | 8.034776us | 8.076504us | -| 512 | 100 | 1 | 456.283300ms | 4.043922ms | 39.222287us | 7.898285us | 7.884007us | 7.914252us | -| 1024 | 100 | 1 | 891.956700ms | 7.987767ms | 223.056717us | 7.800553us | 7.774178us | 7.884741us | -| 2048 | 100 | 1 | 1764.105000ms | 15.810163ms | 193.079827us | 7.719806us | 7.703045us | 7.740206us | -| 4096 | 100 | 1 | 3553.940900ms | 32.413781ms | 802.882284us | 7.913521us | 7.879854us | 7.957355us | -| 8192 | 100 | 1 | 7908.214700ms | 74.405842ms | 2.691988ms | 9.082744us | 9.034463us | 9.174209us | +| 1 | 100 | 1 | 29.577700ms | 56.845370us | 9.599896us | 56.845370us | 55.633660us | 60.344100us | +| 2 | 100 | 1 | 29.938100ms | 67.274570us | 9.665283us | 33.637285us | 33.073770us | 35.644095us | +| 4 | 100 | 1 | 32.162300ms | 89.078570us | 9.641466us | 22.269643us | 21.984057us | 23.234117us | +| 8 | 100 | 1 | 20.991400ms | 128.153110us | 9.278205us | 16.019139us | 15.880005us | 16.479191us | +| 16 | 100 | 1 | 26.424300ms | 200.705280us | 9.698604us | 12.544080us | 12.471436us | 12.780129us | +| 32 | 100 | 1 | 45.014100ms | 341.598700us | 9.843276us | 10.674959us | 10.633213us | 10.772791us | +| 64 | 100 | 1 | 75.472500ms | 623.558710us | 12.541751us | 9.743105us | 9.712173us | 9.792628us | +| 128 | 100 | 1 | 141.624400ms | 1.161219ms | 18.758135us | 9.072022us | 9.045394us | 9.103036us | +| 256 | 100 | 1 | 250.979400ms | 2.196064ms | 28.945251us | 8.578375us | 8.557107us | 8.601465us | +| 512 | 100 | 1 | 486.295700ms | 4.269246ms | 44.574550us | 8.338372us | 8.322439us | 8.356736us | +| 1024 | 100 | 1 | 948.572800ms | 8.500570ms | 104.441338us | 8.301338us | 8.283143us | 8.323425us | +| 2048 | 100 | 1 | 1901.733600ms | 16.847337ms | 208.982061us | 8.226239us | 8.207187us | 8.247207us | +| 4096 | 100 | 1 | 3799.005000ms | 34.323095ms | 1.956298ms | 8.379662us | 8.324359us | 8.578086us | +| 8192 | 100 | 1 | 8744.130500ms | 85.026690ms | 5.510656ms | 10.379235us | 10.281450us | 10.570844us | ## SV-SingleBattle-MonteCarlo-SimulateTurn-RandomInputs-OneRandomBattle-OneRandomInput | Inputs | Samples | Iterations / Sample | Estimated Completion Time | Mean of Samples | Standard Deviation | Mean / Input Count | Mean Lower Bound / Input Count | Mean Upper Bound / Input Count | | --- | --- | --- | --- | --- | --- | --- | --- | --- | -| 1 | 100 | 1 | 44.477400ms | 79.006780us | 13.863698us | 79.006780us | 76.873120us | 82.642840us | -| 2 | 100 | 1 | 45.423100ms | 91.869420us | 20.538699us | 45.934710us | 44.260580us | 48.435435us | -| 4 | 100 | 1 | 47.733900ms | 102.397270us | 18.247829us | 25.599318us | 24.817213us | 26.636510us | -| 8 | 100 | 1 | 50.903300ms | 123.077880us | 21.494564us | 15.384735us | 14.924916us | 15.994126us | -| 16 | 100 | 1 | 56.341000ms | 161.694560us | 24.831180us | 10.105910us | 9.820111us | 10.434540us | -| 32 | 100 | 1 | 63.006200ms | 227.084960us | 34.662485us | 7.096405us | 6.898562us | 7.324986us | -| 64 | 100 | 1 | 63.869900ms | 351.955840us | 59.636536us | 5.499310us | 5.327976us | 5.696484us | -| 128 | 100 | 1 | 98.411600ms | 603.601010us | 106.869974us | 4.715633us | 4.564790us | 4.893425us | -| 256 | 100 | 1 | 263.308800ms | 1.078165ms | 197.179455us | 4.211581us | 4.071308us | 4.375636us | -| 512 | 100 | 1 | 359.279300ms | 2.046414ms | 427.359327us | 3.996901us | 3.848762us | 4.180319us | -| 1024 | 100 | 1 | 684.829900ms | 4.406205ms | 795.068710us | 4.302935us | 4.162017us | 4.466622us | -| 2048 | 100 | 1 | 1297.154700ms | 9.296353ms | 1.612059ms | 4.539235us | 4.397210us | 4.707502us | -| 4096 | 100 | 1 | 3364.166400ms | 19.691454ms | 3.492430ms | 4.807484us | 4.654046us | 4.988932us | -| 8192 | 100 | 1 | 5100.140200ms | 43.124689ms | 7.475893ms | 5.264244us | 5.096281us | 5.454490us | +| 1 | 100 | 1 | 39.401900ms | 69.775570us | 15.242533us | 69.775570us | 67.603040us | 74.277860us | +| 2 | 100 | 1 | 40.723300ms | 81.764080us | 23.091738us | 40.882040us | 39.080140us | 43.850095us | +| 4 | 100 | 1 | 21.094000ms | 88.442230us | 17.540218us | 22.110557us | 21.344088us | 23.091542us | +| 8 | 100 | 1 | 23.049400ms | 100.226080us | 17.369087us | 12.528260us | 12.131202us | 12.987146us | +| 16 | 100 | 1 | 28.561600ms | 132.754090us | 23.070978us | 8.297131us | 8.026684us | 8.595362us | +| 32 | 100 | 1 | 35.910100ms | 187.447140us | 34.838916us | 5.857723us | 5.657430us | 6.085657us | +| 64 | 100 | 1 | 41.132000ms | 285.835970us | 55.768171us | 4.466187us | 4.307419us | 4.651452us | +| 128 | 100 | 1 | 80.300500ms | 493.863030us | 102.170992us | 3.858305us | 3.714999us | 4.030069us | +| 256 | 100 | 1 | 146.491800ms | 905.556250us | 191.684431us | 3.537329us | 3.402852us | 3.698916us | +| 512 | 100 | 1 | 207.973600ms | 1.725032ms | 398.365074us | 3.369203us | 3.230805us | 3.538621us | +| 1024 | 100 | 1 | 422.287700ms | 3.901228ms | 806.019504us | 3.809793us | 3.667448us | 3.975807us | +| 2048 | 100 | 1 | 740.515300ms | 8.141478ms | 1.544992ms | 3.975331us | 3.840598us | 4.139308us | +| 4096 | 100 | 1 | 2410.261200ms | 18.345825ms | 3.689362ms | 4.478961us | 4.317502us | 4.673209us | +| 8192 | 100 | 1 | 3555.841500ms | 40.126644ms | 7.205912ms | 4.898272us | 4.735302us | 5.081697us | ## SV-SingleBattle-MonteCarlo-SimulateTurn-RandomInputs-OneRandomBattle-ManyRandomInputs | Inputs | Samples | Iterations / Sample | Estimated Completion Time | Mean of Samples | Standard Deviation | Mean / Input Count | Mean Lower Bound / Input Count | Mean Upper Bound / Input Count | | --- | --- | --- | --- | --- | --- | --- | --- | --- | -| 1 | 100 | 1 | 44.172700ms | 78.016830us | 14.970407us | 78.016830us | 75.815100us | 82.219330us | -| 2 | 100 | 1 | 45.395400ms | 90.666780us | 20.197585us | 45.333390us | 43.755865us | 47.919100us | -| 4 | 100 | 1 | 47.162400ms | 101.746670us | 18.740616us | 25.436667us | 24.644245us | 26.517238us | -| 8 | 100 | 1 | 50.010800ms | 120.391130us | 19.708817us | 15.048891us | 14.616636us | 15.595474us | -| 16 | 100 | 1 | 55.534800ms | 158.802460us | 24.829820us | 9.925154us | 9.640879us | 10.250862us | -| 32 | 100 | 1 | 47.524600ms | 221.965570us | 35.079377us | 6.936424us | 6.734748us | 7.167315us | -| 64 | 100 | 1 | 79.436400ms | 333.941010us | 60.395976us | 5.217828us | 5.045471us | 5.416305us | -| 128 | 100 | 1 | 81.024600ms | 544.137870us | 102.755635us | 4.251077us | 4.105338us | 4.421129us | -| 256 | 100 | 1 | 156.529000ms | 970.196990us | 190.607183us | 3.789832us | 3.656001us | 3.949333us | -| 512 | 100 | 1 | 184.938200ms | 1.828129ms | 387.025731us | 3.570565us | 3.437439us | 3.736346us | -| 1024 | 100 | 1 | 355.229500ms | 3.502461ms | 722.197595us | 3.420372us | 3.294711us | 3.571806us | -| 2048 | 100 | 1 | 780.599600ms | 6.946692ms | 1.457544ms | 3.391940us | 3.265602us | 3.547280us | -| 4096 | 100 | 1 | 1953.802100ms | 14.110339ms | 2.845674ms | 3.444907us | 3.320733us | 3.593770us | -| 8192 | 100 | 1 | 2685.583900ms | 28.486272ms | 5.553285ms | 3.477328us | 3.356180us | 3.625694us | +| 1 | 100 | 1 | 39.882800ms | 67.974010us | 15.774707us | 67.974010us | 65.767700us | 72.724610us | +| 2 | 100 | 1 | 20.750700ms | 77.956740us | 14.306901us | 38.978370us | 37.761595us | 40.594965us | +| 4 | 100 | 1 | 22.000900ms | 87.526990us | 15.974247us | 21.881748us | 21.169715us | 22.739020us | +| 8 | 100 | 1 | 23.954800ms | 98.051370us | 17.075480us | 12.256421us | 11.869032us | 12.706762us | +| 16 | 100 | 1 | 28.818100ms | 128.537200us | 23.887088us | 8.033575us | 7.759972us | 8.346597us | +| 32 | 100 | 1 | 35.885100ms | 175.949300us | 33.178650us | 5.498416us | 5.306073us | 5.712364us | +| 64 | 100 | 1 | 51.495700ms | 271.993070us | 57.436347us | 4.249892us | 4.086111us | 4.439275us | +| 128 | 100 | 1 | 61.322100ms | 453.440920us | 99.271113us | 3.542507us | 3.403708us | 3.710598us | +| 256 | 100 | 1 | 118.926200ms | 810.248980us | 193.731551us | 3.165035us | 3.033004us | 3.333741us | +| 512 | 100 | 1 | 216.921500ms | 1.551698ms | 354.439556us | 3.030661us | 2.905505us | 3.179568us | +| 1024 | 100 | 1 | 288.946900ms | 2.961041ms | 724.469950us | 2.891641us | 2.765195us | 3.044385us | +| 2048 | 100 | 1 | 591.185500ms | 5.881183ms | 1.449835ms | 2.871671us | 2.745729us | 3.026303us | +| 4096 | 100 | 1 | 1735.572000ms | 11.976956ms | 2.828582ms | 2.924062us | 2.800914us | 3.074693us | +| 8192 | 100 | 1 | 3483.277600ms | 24.239579ms | 5.663264ms | 2.958933us | 2.835426us | 3.108876us | ## SV-SingleBattle-MonteCarlo-SimulateTurn-RandomInputs-ManyRandomBattles-ManyRandomInputs | Inputs | Samples | Iterations / Sample | Estimated Completion Time | Mean of Samples | Standard Deviation | Mean / Input Count | Mean Lower Bound / Input Count | Mean Upper Bound / Input Count | | --- | --- | --- | --- | --- | --- | --- | --- | --- | -| 1 | 100 | 1 | 44.350700ms | 79.280220us | 14.863259us | 79.280220us | 77.078570us | 83.424630us | -| 2 | 100 | 1 | 59.263700ms | 102.893420us | 20.752582us | 51.446710us | 49.902635us | 54.274035us | -| 4 | 100 | 1 | 47.299000ms | 130.159240us | 14.882032us | 32.539810us | 31.935445us | 33.455637us | -| 8 | 100 | 1 | 61.590700ms | 171.155920us | 19.147598us | 21.394490us | 21.051524us | 22.099784us | -| 16 | 100 | 1 | 71.854700ms | 231.175730us | 15.241935us | 14.448483us | 14.302148us | 14.695795us | -| 32 | 100 | 1 | 84.490700ms | 325.754940us | 19.604681us | 10.179842us | 10.084138us | 10.336732us | -| 64 | 100 | 1 | 152.661100ms | 514.238980us | 33.377494us | 8.034984us | 7.957928us | 8.180535us | -| 128 | 100 | 1 | 204.914600ms | 845.242230us | 31.787673us | 6.603455us | 6.561696us | 6.661246us | -| 256 | 100 | 1 | 299.229600ms | 1.476414ms | 44.344621us | 5.767243us | 5.741107us | 5.813123us | -| 512 | 100 | 1 | 504.133100ms | 2.910029ms | 210.376642us | 5.683650us | 5.623060us | 5.797441us | -| 1024 | 100 | 1 | 930.603400ms | 6.770211ms | 296.594928us | 6.611534us | 6.557519us | 6.671112us | -| 2048 | 100 | 1 | 1591.099400ms | 14.853675ms | 491.609485us | 7.252771us | 7.221395us | 7.334117us | -| 4096 | 100 | 1 | 3220.324100ms | 32.515516ms | 975.204450us | 7.938358us | 7.902066us | 8.001254us | -| 8192 | 100 | 1 | 7407.308800ms | 74.064953ms | 1.217278ms | 9.041132us | 9.015344us | 9.074915us | +| 1 | 100 | 1 | 40.167400ms | 71.933050us | 15.987010us | 71.933050us | 69.623610us | 76.539640us | +| 2 | 100 | 1 | 37.147800ms | 91.000250us | 18.907879us | 45.500125us | 44.076190us | 48.102335us | +| 4 | 100 | 1 | 38.060400ms | 113.851680us | 15.463859us | 28.462920us | 27.845942us | 29.435112us | +| 8 | 100 | 1 | 52.784500ms | 150.026580us | 18.117413us | 18.753322us | 18.430381us | 19.408321us | +| 16 | 100 | 1 | 63.802200ms | 203.049280us | 19.461356us | 12.690580us | 12.505216us | 13.015988us | +| 32 | 100 | 1 | 42.568400ms | 282.256460us | 18.844979us | 8.820514us | 8.727397us | 8.969911us | +| 64 | 100 | 1 | 62.528700ms | 423.456210us | 22.428506us | 6.616503us | 6.562883us | 6.708878us | +| 128 | 100 | 1 | 101.470200ms | 704.342670us | 29.545113us | 5.502677us | 5.466069us | 5.560536us | +| 256 | 100 | 1 | 188.950000ms | 1.259363ms | 35.894178us | 4.919385us | 4.896783us | 4.953830us | +| 512 | 100 | 1 | 342.633900ms | 2.507324ms | 184.831045us | 4.897117us | 4.841500us | 4.990218us | +| 1024 | 100 | 1 | 678.414400ms | 6.167870ms | 310.286520us | 6.023311us | 5.971273us | 6.091365us | +| 2048 | 100 | 1 | 1412.938400ms | 13.177922ms | 440.269363us | 6.434532us | 6.403204us | 6.495902us | +| 4096 | 100 | 1 | 2961.421800ms | 30.026930ms | 1.727276ms | 7.330793us | 7.273366us | 7.465384us | +| 8192 | 100 | 1 | 6961.891800ms | 70.259047ms | 2.770357ms | 8.576544us | 8.526369us | 8.670238us | ## SV-SingleBattle-CalcDamage-RandomInputs-OneRandomBattle-OneRandomInput | Inputs | Samples | Iterations / Sample | Estimated Completion Time | Mean of Samples | Standard Deviation | Mean / Input Count | Mean Lower Bound / Input Count | Mean Upper Bound / Input Count | | --- | --- | --- | --- | --- | --- | --- | --- | --- | -| 1 | 100 | 1 | 10.885700ms | 13.023680us | 5.360867us | 13.023680us | 12.237980us | 14.509220us | -| 2 | 100 | 1 | 11.328900ms | 14.545580us | 5.644011us | 7.272790us | 6.810920us | 7.954235us | -| 4 | 100 | 1 | 11.855300ms | 17.365920us | 7.457153us | 4.341480us | 4.051250us | 4.817092us | -| 8 | 100 | 1 | 12.877700ms | 29.465730us | 84.045493us | 3.683216us | 2.568861us | 8.848460us | -| 16 | 100 | 1 | 9.987000ms | 29.102010us | 12.550676us | 1.818876us | 1.683224us | 1.995805us | -| 32 | 100 | 1 | 10.997500ms | 44.600700us | 18.977112us | 1.393772us | 1.279217us | 1.511385us | -| 64 | 100 | 1 | 19.734200ms | 77.126350us | 35.031509us | 1.205099us | 1.096004us | 1.310331us | -| 128 | 100 | 1 | 50.200500ms | 138.862750us | 68.993258us | 1.084865us | 980.245937ns | 1.190858us | -| 256 | 100 | 1 | 89.694500ms | 263.799160us | 132.376104us | 1.030465us | 928.616211ns | 1.131438us | -| 512 | 100 | 1 | 138.071100ms | 482.072280us | 277.483157us | 941.547422ns | 835.541484ns | 1.048033us | -| 1024 | 100 | 1 | 334.627800ms | 1.134894ms | 629.448801us | 1.108295us | 986.455508ns | 1.227796us | -| 2048 | 100 | 1 | 664.551700ms | 2.408694ms | 1.288489ms | 1.176120us | 1.051202us | 1.297532us | -| 4096 | 100 | 1 | 1356.431100ms | 5.177013ms | 2.762448ms | 1.263919us | 1.128595us | 1.392412us | -| 8192 | 100 | 1 | 2743.122500ms | 11.395473ms | 6.283325ms | 1.391049us | 1.239030us | 1.538802us | +| 1 | 100 | 1 | 10.503300ms | 12.986410us | 5.293295us | 12.986410us | 12.209320us | 14.465700us | +| 2 | 100 | 1 | 10.824200ms | 14.746290us | 6.064821us | 7.373145us | 6.875465us | 8.098570us | +| 4 | 100 | 1 | 11.489100ms | 17.079760us | 8.083822us | 4.269940us | 3.978465us | 4.845750us | +| 8 | 100 | 1 | 12.435400ms | 20.897470us | 7.421681us | 2.612184us | 2.437195us | 2.800774us | +| 16 | 100 | 1 | 14.075800ms | 29.918820us | 13.432799us | 1.869926us | 1.725176us | 2.060694us | +| 32 | 100 | 1 | 11.185100ms | 44.703410us | 18.026728us | 1.396982us | 1.285885us | 1.506267us | +| 64 | 100 | 1 | 19.374000ms | 78.670060us | 35.872859us | 1.229220us | 1.119067us | 1.338802us | +| 128 | 100 | 1 | 50.372700ms | 137.380310us | 66.984331us | 1.073284us | 969.357266ns | 1.174444us | +| 256 | 100 | 1 | 89.713200ms | 264.253750us | 133.383746us | 1.032241us | 929.214805ns | 1.132935us | +| 512 | 100 | 1 | 79.700800ms | 483.440180us | 277.605476us | 944.219102ns | 837.342363ns | 1.049328us | +| 1024 | 100 | 1 | 202.068000ms | 1.160484ms | 650.396954us | 1.133285us | 1.008675us | 1.256587us | +| 2048 | 100 | 1 | 418.010600ms | 2.422718ms | 1.296583ms | 1.182968us | 1.056856us | 1.304135us | +| 4096 | 100 | 1 | 1350.352400ms | 5.253974ms | 2.799750ms | 1.282708us | 1.145026us | 1.413052us | +| 8192 | 100 | 1 | 1765.055200ms | 11.554693ms | 6.356125ms | 1.410485us | 1.255873us | 1.560985us | ## SV-SingleBattle-CalcDamage-RandomInputs-OneRandomBattle-ManyRandomInputs | Inputs | Samples | Iterations / Sample | Estimated Completion Time | Mean of Samples | Standard Deviation | Mean / Input Count | Mean Lower Bound / Input Count | Mean Upper Bound / Input Count | | --- | --- | --- | --- | --- | --- | --- | --- | --- | -| 1 | 100 | 1 | 10.943800ms | 12.623740us | 5.243837us | 12.623740us | 11.864660us | 14.127200us | -| 2 | 100 | 1 | 11.337400ms | 14.772880us | 4.276678us | 7.386440us | 7.078165us | 8.000790us | -| 4 | 100 | 1 | 10.846000ms | 17.300540us | 4.500536us | 4.325135us | 4.172220us | 4.696385us | -| 8 | 100 | 1 | 11.958800ms | 21.285660us | 4.117113us | 2.660708us | 2.585742us | 2.807474us | -| 16 | 100 | 1 | 12.627800ms | 28.616300us | 4.644829us | 1.788519us | 1.745676us | 1.868897us | -| 32 | 100 | 1 | 14.889800ms | 42.749720us | 4.808821us | 1.335929us | 1.311697us | 1.373036us | -| 64 | 100 | 1 | 17.184400ms | 69.797250us | 5.417010us | 1.090582us | 1.075365us | 1.108725us | -| 128 | 100 | 1 | 22.569200ms | 120.122130us | 7.321975us | 938.454141ns | 928.162266ns | 950.796250ns | -| 256 | 100 | 1 | 24.206300ms | 223.222050us | 8.823904us | 871.961133ns | 865.487266ns | 879.049336ns | -| 512 | 100 | 1 | 40.945100ms | 430.501190us | 11.386416us | 840.822637ns | 836.631719ns | 845.323887ns | -| 1024 | 100 | 1 | 86.115200ms | 848.545020us | 20.575394us | 828.657246ns | 824.851660ns | 832.765654ns | -| 2048 | 100 | 1 | 175.542300ms | 1.668391ms | 35.510391us | 814.643911ns | 811.421245ns | 818.230176ns | -| 4096 | 100 | 1 | 340.274600ms | 3.311948ms | 56.847568us | 808.581099ns | 805.921772ns | 811.391860ns | -| 8192 | 100 | 1 | 675.003300ms | 6.661506ms | 240.507742us | 813.172140ns | 808.808228ns | 821.172601ns | +| 1 | 100 | 1 | 10.486300ms | 12.551690us | 4.939969us | 12.551690us | 11.801650us | 13.871330us | +| 2 | 100 | 1 | 10.251100ms | 16.148960us | 14.948720us | 8.074480us | 7.203045us | 11.255105us | +| 4 | 100 | 1 | 10.529700ms | 16.982840us | 4.147787us | 4.245710us | 4.102212us | 4.570988us | +| 8 | 100 | 1 | 11.666800ms | 22.372840us | 6.536909us | 2.796605us | 2.678155us | 3.027106us | +| 16 | 100 | 1 | 12.657900ms | 29.524580us | 5.918105us | 1.845286us | 1.790352us | 1.946733us | +| 32 | 100 | 1 | 12.943100ms | 43.148950us | 5.900709us | 1.348405us | 1.321441us | 1.399747us | +| 64 | 100 | 1 | 16.287900ms | 70.857670us | 20.982800us | 1.107151us | 1.069266us | 1.242705us | +| 128 | 100 | 1 | 13.552400ms | 120.446930us | 6.255118us | 940.991641ns | 931.771016ns | 950.975391ns | +| 256 | 100 | 1 | 24.253500ms | 224.412720us | 9.096472us | 876.612188ns | 869.818047ns | 883.737500ns | +| 512 | 100 | 1 | 41.019400ms | 435.918390us | 11.144644us | 851.403105ns | 847.286445ns | 855.842754ns | +| 1024 | 100 | 1 | 85.887700ms | 844.569810us | 17.442670us | 824.775205ns | 821.479180ns | 828.173994ns | +| 2048 | 100 | 1 | 172.343800ms | 1.665941ms | 34.921042us | 813.447744ns | 810.211313ns | 816.931372ns | +| 4096 | 100 | 1 | 343.441300ms | 3.341975ms | 64.850353us | 815.911941ns | 812.891006ns | 819.115823ns | +| 8192 | 100 | 1 | 693.842000ms | 6.652714ms | 114.358000us | 812.098854ns | 809.449589ns | 814.914109ns | ## SV-SingleBattle-CalcDamage-RandomInputs-ManyRandomBattles-ManyRandomInputs | Inputs | Samples | Iterations / Sample | Estimated Completion Time | Mean of Samples | Standard Deviation | Mean / Input Count | Mean Lower Bound / Input Count | Mean Upper Bound / Input Count | | --- | --- | --- | --- | --- | --- | --- | --- | --- | -| 1 | 100 | 1 | 10.885400ms | 12.730850us | 5.333069us | 12.730850us | 11.945180us | 14.205860us | -| 2 | 100 | 1 | 10.611300ms | 15.400500us | 6.750125us | 7.700250us | 7.278590us | 8.917625us | -| 4 | 100 | 1 | 11.256300ms | 19.967080us | 21.812035us | 4.991770us | 4.371118us | 7.451420us | -| 8 | 100 | 1 | 11.835400ms | 22.809720us | 4.413965us | 2.851215us | 2.772016us | 3.014874us | -| 16 | 100 | 1 | 13.989300ms | 32.923970us | 8.317577us | 2.057748us | 1.990988us | 2.238971us | -| 32 | 100 | 1 | 17.305500ms | 50.609170us | 5.495759us | 1.581537us | 1.555028us | 1.625850us | -| 64 | 100 | 1 | 30.371200ms | 91.775770us | 8.231954us | 1.433996us | 1.414762us | 1.469135us | -| 128 | 100 | 1 | 52.489400ms | 166.287000us | 10.230215us | 1.299117us | 1.285692us | 1.317701us | -| 256 | 100 | 1 | 91.738800ms | 317.455980us | 15.625760us | 1.240062us | 1.229526us | 1.253931us | -| 512 | 100 | 1 | 174.965000ms | 614.993990us | 43.923817us | 1.201160us | 1.187735us | 1.223135us | -| 1024 | 100 | 1 | 334.579400ms | 1.625687ms | 102.791709us | 1.587585us | 1.568603us | 1.608085us | -| 2048 | 100 | 1 | 686.323300ms | 3.496694ms | 110.529614us | 1.707370us | 1.698168us | 1.719733us | -| 4096 | 100 | 1 | 1362.766500ms | 8.144074ms | 249.390141us | 1.988299us | 1.978093us | 2.002597us | -| 8192 | 100 | 1 | 2763.587300ms | 18.215632ms | 477.500313us | 2.223588us | 2.213595us | 2.236758us | +| 1 | 100 | 1 | 10.573200ms | 12.586110us | 5.108926us | 12.586110us | 11.839100us | 14.015100us | +| 2 | 100 | 1 | 10.191300ms | 14.575170us | 2.885422us | 7.287585us | 7.085605us | 7.718375us | +| 4 | 100 | 1 | 11.220800ms | 17.198410us | 3.130222us | 4.299602us | 4.193195us | 4.540258us | +| 8 | 100 | 1 | 11.667900ms | 22.914080us | 4.434858us | 2.864260us | 2.778139us | 3.007777us | +| 16 | 100 | 1 | 13.743300ms | 32.541930us | 5.740254us | 2.033871us | 1.982355us | 2.137364us | +| 32 | 100 | 1 | 17.037900ms | 50.834080us | 5.067979us | 1.588565us | 1.562143us | 1.625536us | +| 64 | 100 | 1 | 30.270700ms | 91.906530us | 6.799488us | 1.436040us | 1.417862us | 1.460146us | +| 128 | 100 | 1 | 51.069400ms | 167.077270us | 20.953359us | 1.305291us | 1.284772us | 1.366927us | +| 256 | 100 | 1 | 91.714200ms | 319.043760us | 16.154517us | 1.246265us | 1.234959us | 1.259990us | +| 512 | 100 | 1 | 175.181500ms | 625.206870us | 34.427402us | 1.221107us | 1.208910us | 1.235469us | +| 1024 | 100 | 1 | 340.909800ms | 1.632427ms | 117.765488us | 1.594167us | 1.573571us | 1.618825us | +| 2048 | 100 | 1 | 670.482200ms | 3.513888ms | 151.470290us | 1.715766us | 1.704956us | 1.736527us | +| 4096 | 100 | 1 | 1371.315400ms | 8.161003ms | 245.204999us | 1.992432us | 1.983293us | 2.008385us | +| 8192 | 100 | 1 | 2816.055500ms | 18.236383ms | 771.140995us | 2.226121us | 2.213929us | 2.259067us | ## SV-SingleBattle-AnalyzeEffect-RandomInputs-OneRandomBattle-OneRandomInput | Inputs | Samples | Iterations / Sample | Estimated Completion Time | Mean of Samples | Standard Deviation | Mean / Input Count | Mean Lower Bound / Input Count | Mean Upper Bound / Input Count | | --- | --- | --- | --- | --- | --- | --- | --- | --- | -| 1 | 100 | 1 | 43.591600ms | 108.285200us | 38.731774us | 108.285200us | 99.725520us | 115.118170us | -| 2 | 100 | 1 | 23.415200ms | 158.196510us | 52.664378us | 79.098255us | 72.945295us | 83.516100us | -| 4 | 100 | 1 | 35.543300ms | 249.117430us | 83.320921us | 62.279357us | 57.424265us | 65.776995us | -| 8 | 100 | 1 | 58.211500ms | 437.555690us | 147.291787us | 54.694461us | 50.380781us | 57.765912us | -| 16 | 100 | 1 | 118.101100ms | 760.751360us | 269.949380us | 47.546960us | 43.548988us | 50.367970us | -| 32 | 100 | 1 | 182.829400ms | 1.432708ms | 508.588968us | 44.772116us | 41.090812us | 47.424588us | -| 64 | 100 | 1 | 375.551400ms | 2.745539ms | 977.356217us | 42.899052us | 39.322933us | 45.454265us | -| 128 | 100 | 1 | 770.291100ms | 5.292082ms | 1.888443ms | 41.344388us | 37.885477us | 43.815027us | -| 256 | 100 | 1 | 1458.293400ms | 10.554769ms | 3.816437ms | 41.229566us | 37.781704us | 43.744190us | -| 512 | 100 | 1 | 3189.390500ms | 22.064758ms | 7.950388ms | 43.095230us | 39.462909us | 45.697807us | -| 1024 | 100 | 1 | 7569.623900ms | 55.932451ms | 20.112797ms | 54.621534us | 50.025606us | 57.918972us | -| 2048 | 100 | 1 | 13627.369100ms | 129.944972ms | 46.618195ms | 63.449693us | 58.141108us | 67.257946us | -| 4096 | 100 | 1 | 29794.170400ms | 272.698801ms | 97.612132ms | 66.576856us | 61.067262us | 70.592252us | +| 1 | 100 | 1 | 33.126900ms | 108.594680us | 39.011286us | 108.594680us | 100.036410us | 115.428000us | +| 2 | 100 | 1 | 23.791200ms | 165.673300us | 55.368324us | 82.836650us | 76.384410us | 87.492895us | +| 4 | 100 | 1 | 37.155800ms | 253.683100us | 86.513999us | 63.420775us | 58.438990us | 67.089988us | +| 8 | 100 | 1 | 61.125600ms | 432.589020us | 145.415484us | 54.073628us | 49.845821us | 57.102587us | +| 16 | 100 | 1 | 119.923900ms | 773.254780us | 274.480340us | 48.328424us | 44.242379us | 51.185137us | +| 32 | 100 | 1 | 187.779600ms | 1.451295ms | 515.577338us | 45.352969us | 41.563927us | 48.027449us | +| 64 | 100 | 1 | 384.340800ms | 2.802276ms | 997.272598us | 43.785558us | 40.133617us | 46.378973us | +| 128 | 100 | 1 | 788.478900ms | 5.422997ms | 1.931317ms | 42.367161us | 38.837549us | 44.885699us | +| 256 | 100 | 1 | 1537.586200ms | 11.104276ms | 4.185046ms | 43.376076us | 39.743385us | 46.203731us | +| 512 | 100 | 1 | 3200.025200ms | 22.839449ms | 8.361439ms | 44.608299us | 40.862477us | 47.357241us | +| 1024 | 100 | 1 | 7629.959000ms | 57.586646ms | 20.727829ms | 56.236959us | 51.503488us | 59.629876us | +| 2048 | 100 | 1 | 15787.804100ms | 132.957534ms | 47.460905ms | 64.920671us | 59.440702us | 68.782190us | +| 4096 | 100 | 1 | 30088.424000ms | 284.363911ms | 101.106038ms | 69.424783us | 63.673265us | 73.518571us | ## SV-SingleBattle-AnalyzeEffect-RandomInputs-OneRandomBattle-ManyRandomInputs | Inputs | Samples | Iterations / Sample | Estimated Completion Time | Mean of Samples | Standard Deviation | Mean / Input Count | Mean Lower Bound / Input Count | Mean Upper Bound / Input Count | | --- | --- | --- | --- | --- | --- | --- | --- | --- | -| 1 | 100 | 1 | 43.805000ms | 107.682730us | 37.940697us | 107.682730us | 99.142050us | 114.249060us | -| 2 | 100 | 1 | 22.914200ms | 145.722520us | 25.883703us | 72.861260us | 69.705865us | 74.933810us | -| 4 | 100 | 1 | 22.872800ms | 196.400050us | 21.786657us | 49.100012us | 47.967067us | 50.109355us | -| 8 | 100 | 1 | 41.466800ms | 292.795070us | 25.758554us | 36.599384us | 35.939329us | 37.205430us | -| 16 | 100 | 1 | 60.384100ms | 491.428930us | 43.523201us | 30.714308us | 30.220280us | 31.293265us | -| 32 | 100 | 1 | 100.121500ms | 866.004590us | 53.158362us | 27.062643us | 26.740362us | 27.394822us | -| 64 | 100 | 1 | 180.733800ms | 1.676862ms | 89.771185us | 26.200975us | 25.922456us | 26.475137us | -| 128 | 100 | 1 | 381.520300ms | 3.338994ms | 147.201763us | 26.085890us | 25.865024us | 26.317284us | -| 256 | 100 | 1 | 744.055200ms | 7.466083ms | 298.289411us | 29.164387us | 28.937321us | 29.391978us | -| 512 | 100 | 1 | 1817.041700ms | 18.076781ms | 618.995588us | 35.306212us | 35.075279us | 35.550953us | -| 1024 | 100 | 1 | 4434.491600ms | 45.812513ms | 1.603833ms | 44.738782us | 44.439832us | 45.056952us | -| 2048 | 100 | 1 | 10218.129200ms | 105.525469ms | 2.359154ms | 51.526108us | 51.300149us | 51.752544us | -| 4096 | 100 | 1 | 22527.083700ms | 231.658337ms | 3.508841ms | 56.557211us | 56.388921us | 56.726056us | +| 1 | 100 | 1 | 37.039800ms | 115.186210us | 38.370384us | 115.186210us | 106.291040us | 121.708490us | +| 2 | 100 | 1 | 48.269900ms | 152.048240us | 26.779043us | 76.024120us | 72.629995us | 78.139190us | +| 4 | 100 | 1 | 48.460700ms | 205.175680us | 23.503953us | 51.293920us | 50.107005us | 52.403845us | +| 8 | 100 | 1 | 42.277600ms | 298.240060us | 26.669709us | 37.280007us | 36.576654us | 37.888817us | +| 16 | 100 | 1 | 61.411600ms | 491.602270us | 38.821624us | 30.725142us | 30.262903us | 31.215497us | +| 32 | 100 | 1 | 100.536400ms | 888.648320us | 52.099702us | 27.770260us | 27.453797us | 28.094234us | +| 64 | 100 | 1 | 187.910400ms | 1.715868ms | 88.623265us | 26.810445us | 26.540436us | 27.083040us | +| 128 | 100 | 1 | 392.012400ms | 3.515188ms | 156.645862us | 27.462406us | 27.225916us | 27.702186us | +| 256 | 100 | 1 | 766.318200ms | 7.770418ms | 316.026056us | 30.353196us | 30.111644us | 30.594028us | +| 512 | 100 | 1 | 1849.965300ms | 18.454113ms | 630.134239us | 36.043190us | 35.807204us | 36.288816us | +| 1024 | 100 | 1 | 4495.795000ms | 44.478068ms | 1.195794ms | 43.435614us | 43.214701us | 43.673463us | +| 2048 | 100 | 1 | 10164.869600ms | 103.854560ms | 2.096449ms | 50.710235us | 50.513058us | 50.912677us | +| 4096 | 100 | 1 | 22429.277700ms | 228.235605ms | 3.924056ms | 55.721583us | 55.536874us | 55.911998us | ## SV-SingleBattle-AnalyzeEffect-RandomInputs-ManyRandomBattles-ManyRandomInputs | Inputs | Samples | Iterations / Sample | Estimated Completion Time | Mean of Samples | Standard Deviation | Mean / Input Count | Mean Lower Bound / Input Count | Mean Upper Bound / Input Count | | --- | --- | --- | --- | --- | --- | --- | --- | --- | -| 1 | 100 | 1 | 43.808400ms | 109.729750us | 39.737339us | 109.729750us | 101.066410us | 116.786340us | -| 2 | 100 | 1 | 29.159500ms | 176.413970us | 33.365178us | 88.206985us | 84.593470us | 91.186590us | -| 4 | 100 | 1 | 44.416300ms | 295.160720us | 34.305714us | 73.790180us | 72.034122us | 75.406830us | -| 8 | 100 | 1 | 66.406500ms | 513.303290us | 46.555725us | 64.162911us | 62.933192us | 65.229374us | -| 16 | 100 | 1 | 121.231500ms | 935.822010us | 66.560784us | 58.488876us | 57.665650us | 59.290429us | -| 32 | 100 | 1 | 225.893200ms | 1.767799ms | 88.633458us | 55.243708us | 54.690923us | 55.775292us | -| 64 | 100 | 1 | 441.074300ms | 3.392927ms | 156.086210us | 53.014485us | 52.511374us | 53.474113us | -| 128 | 100 | 1 | 830.162200ms | 6.404093ms | 262.769055us | 50.031976us | 49.644054us | 50.454197us | -| 256 | 100 | 1 | 1749.350900ms | 12.800394ms | 626.011419us | 50.001538us | 49.563752us | 50.527258us | -| 512 | 100 | 1 | 3622.799800ms | 29.105960ms | 2.464750ms | 56.847579us | 55.988435us | 57.886970us | -| 1024 | 100 | 1 | 7630.856400ms | 75.554737ms | 3.369076ms | 73.783923us | 73.157216us | 74.444369us | -| 2048 | 100 | 1 | 16385.363300ms | 168.364389ms | 3.348663ms | 82.209174us | 81.889092us | 82.532414us | -| 4096 | 100 | 1 | 34579.310400ms | 349.481038ms | 2.962684ms | 85.322519us | 85.182537us | 85.466953us | +| 1 | 100 | 1 | 36.739600ms | 110.236210us | 37.455895us | 110.236210us | 101.888810us | 116.751880us | +| 2 | 100 | 1 | 54.466600ms | 187.357070us | 39.240035us | 93.678535us | 89.702365us | 97.377240us | +| 4 | 100 | 1 | 46.245400ms | 294.211470us | 33.413648us | 73.552867us | 71.813570us | 75.112048us | +| 8 | 100 | 1 | 69.442900ms | 516.531790us | 45.920835us | 64.566474us | 63.379519us | 65.628651us | +| 16 | 100 | 1 | 125.471600ms | 952.455210us | 65.114844us | 59.528451us | 58.699794us | 60.289632us | +| 32 | 100 | 1 | 226.989000ms | 1.771526ms | 88.525549us | 55.360199us | 54.819406us | 55.905271us | +| 64 | 100 | 1 | 432.894500ms | 3.392463ms | 133.859650us | 53.007233us | 52.579567us | 53.402356us | +| 128 | 100 | 1 | 843.839800ms | 6.655653ms | 348.016934us | 51.997287us | 51.543584us | 52.644190us | +| 256 | 100 | 1 | 1738.336100ms | 13.220246ms | 386.816245us | 51.641586us | 51.351825us | 51.945617us | +| 512 | 100 | 1 | 3513.729500ms | 29.670437ms | 2.458783ms | 57.950072us | 57.227794us | 59.255054us | +| 1024 | 100 | 1 | 7991.449300ms | 76.510354ms | 2.776718ms | 74.717143us | 74.303276us | 75.425311us | +| 2048 | 100 | 1 | 17027.708100ms | 171.009105ms | 3.847366ms | 83.500540us | 83.176029us | 83.922312us | +| 4096 | 100 | 1 | 36599.551800ms | 360.978848ms | 4.369305ms | 88.129602us | 87.937018us | 88.359820us | diff --git a/src/Battle/Clone/Clone.cpp b/src/Battle/Clone/Clone.cpp index 451fae8..658dd50 100644 --- a/src/Battle/Clone/Clone.cpp +++ b/src/Battle/Clone/Clone.cpp @@ -5,10 +5,10 @@ #include #include #include -#include #include #include #include +#include #include #include #include @@ -42,20 +42,18 @@ void traverseBattle(types::registry& registry, VisitEntity visitEntity = nullptr const static bool ForCloning = !std::is_same_v; using Tag = std::conditional_t; - for (const auto [entity, sides, actionQueue] : registry.view().each()) { + for (const auto [entity, sides] : registry.view().each()) { for (auto side : sides.val) { registry.emplace(side); } - for (auto queueItem : actionQueue.val) { - registry.emplace(queueItem); - } if constexpr (ForCloning) { visitEntity(entity); } } - for (const auto [entity, currentAction] : registry.view().each()) { - registry.emplace(currentAction.val); + + for (const auto [entity, recycledAction] : registry.view().each()) { + registry.emplace(recycledAction.val); } } @@ -80,8 +78,8 @@ void traverseAction(types::registry& registry, VisitEntity visitEntity = nullptr const static bool ForCloning = !std::is_same_v; using Tag = std::conditional_t; - if constexpr (ForCloning) { - for (types::entity entity : registry.view()) { + for (types::entity entity : registry.view()) { + if constexpr (ForCloning) { visitEntity(entity); } } @@ -289,7 +287,6 @@ types::ClonedEntityMap clone(types::registry& registry, std::optional(registry, entityMap); remapComponentEntities(registry, entityMap); remapComponentEntities(registry, entityMap); remapComponentEntities(registry, entityMap); @@ -309,8 +306,8 @@ types::ClonedEntityMap clone(types::registry& registry, std::optional(registry, entityMap); remapComponentEntities(registry, entityMap); remapComponentEntities(registry, entityMap); - remapComponentEntities(registry, entityMap); remapComponentEntities(registry, entityMap); + remapComponentEntities(registry, entityMap); remapComponentEntities(registry, entityMap); remapComponentEntities(registry, entityMap); remapComponentEntities(registry, entityMap); diff --git a/src/Battle/ManageBattleState.cpp b/src/Battle/ManageBattleState.cpp index 35f2cd1..6d8e19a 100644 --- a/src/Battle/ManageBattleState.cpp +++ b/src/Battle/ManageBattleState.cpp @@ -175,7 +175,10 @@ void clearCurrentAction(Simulation& simulation) { auto currentActions = registry.view(); registry.destroy(actionMoves.begin(), actionMoves.end()); registry.destroy(failedActionMoves.begin(), failedActionMoves.end()); - registry.destroy(currentActions.begin(), currentActions.end()); + + registry.remove( + currentActions.begin(), + currentActions.end()); auto battles = simulation.battleEntities(); registry.remove< diff --git a/src/Battle/Setup/BattleStateSetup.cpp b/src/Battle/Setup/BattleStateSetup.cpp index 1344021..3d58291 100644 --- a/src/Battle/Setup/BattleStateSetup.cpp +++ b/src/Battle/Setup/BattleStateSetup.cpp @@ -1,7 +1,8 @@ #include "BattleStateSetup.hpp" -#include +#include #include +#include #include #include #include @@ -9,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -28,6 +30,9 @@ BattleStateSetup::BattleStateSetup(types::registry& registry, types::entity enti if (!handle.any_of()) { handle.emplace(); handle.emplace(); + + types::entity recycledAction = handle.emplace(registry.create()).val; + registry.emplace(recycledAction); } } @@ -70,7 +75,7 @@ void BattleStateSetup::setRNGSeed(std::optional seed) { handle.emplace(seed.value()); } -void BattleStateSetup::setActionQueue(const std::vector& queue) { +void BattleStateSetup::setActionQueue(const std::vector& queue) { handle.emplace(queue); } diff --git a/src/Battle/Setup/BattleStateSetup.hpp b/src/Battle/Setup/BattleStateSetup.hpp index 9ecf303..53217a7 100644 --- a/src/Battle/Setup/BattleStateSetup.hpp +++ b/src/Battle/Setup/BattleStateSetup.hpp @@ -14,6 +14,7 @@ namespace pokesim { struct SimulateTurnOptions; struct CalculateDamageOptions; struct AnalyzeEffectOptions; +struct ActionQueueItem; // Tool to set properties of a battle's state to an entity. struct BattleStateSetup : internal::StateSetupBase { @@ -39,7 +40,7 @@ struct BattleStateSetup : internal::StateSetupBase { // If a seed is not provided, the seed is set to a random number based on the current time in nanoseconds. void setRNGSeed(std::optional seed = std::nullopt); - void setActionQueue(const std::vector& queue); + void setActionQueue(const std::vector& queue); void setTurn(types::battleTurn turn); void setCurrentActionTarget(types::targets actionTargets); void setCurrentActionSource(types::entity actionSource); diff --git a/src/Components/ActionQueue.hpp b/src/Components/ActionQueue.hpp new file mode 100644 index 0000000..45f778d --- /dev/null +++ b/src/Components/ActionQueue.hpp @@ -0,0 +1,58 @@ +#pragma once + +#include +#include +#include +#include +#include +#include +#include + +namespace pokesim { +struct ActionQueueItem { + // Order of the types of actions (lower first). + ActionOrder order = ActionOrder::NONE; + // Priority of the action (higher first). + types::priority priority = Constants::MovePriority::DEFAULT; + // Whether negative fractional priority is active for the action (false first). + types::fractionalPriority fractionalPriority = false; + // Speed of Pokemon using move (higher first if priority tie). + types::stat speed = Constants::PokemonEffectiveStat::DEFAULT; + + // The decision that created this action queue item. + types::slotDecision decision{}; + + constexpr bool operator==(const ActionQueueItem& other) const { + return isSameSpeed(other) && decision == other.decision; + } + + constexpr bool isSameSpeed(const ActionQueueItem& other) const { + return order == other.order && priority == other.priority && fractionalPriority == other.fractionalPriority && + speed == other.speed; + } + + constexpr bool isFasterThan(const ActionQueueItem& other) const { + if (order != other.order) { + return order < other.order; + } + + if (priority != other.priority) { + return priority > other.priority; + } + + if (fractionalPriority != other.fractionalPriority) { + return !fractionalPriority; + } + + if (speed != other.speed) { + return speed > other.speed; + } + + return false; + } +}; + +struct ActionQueue { + internal::maxSizedVector val{}; +}; +} // namespace pokesim diff --git a/src/Components/EntityHolders/ActionQueue.hpp b/src/Components/EntityHolders/ActionQueue.hpp deleted file mode 100644 index 3e3fed8..0000000 --- a/src/Components/EntityHolders/ActionQueue.hpp +++ /dev/null @@ -1,12 +0,0 @@ -#pragma once - -#include -#include -#include - -namespace pokesim { -// Contains the list of action entities queued up to be simulated for a battle's current turn. -struct ActionQueue { - internal::maxSizedVector val{}; -}; -} // namespace pokesim diff --git a/src/Components/EntityHolders/Current.hpp b/src/Components/EntityHolders/Current.hpp index 2f68fbc..9ce25c9 100644 --- a/src/Components/EntityHolders/Current.hpp +++ b/src/Components/EntityHolders/Current.hpp @@ -9,10 +9,6 @@ struct CurrentAction { types::entity val{}; }; -struct NextAction { - types::entity val{}; -}; - struct CurrentActionTargets { types::targets val{}; }; diff --git a/src/Components/EntityHolders/RecycledEntities.hpp b/src/Components/EntityHolders/RecycledEntities.hpp new file mode 100644 index 0000000..eaede1d --- /dev/null +++ b/src/Components/EntityHolders/RecycledEntities.hpp @@ -0,0 +1,9 @@ +#pragma once + +#include + +namespace pokesim { +struct RecycledAction { + types::entity val{}; +}; +} // namespace pokesim diff --git a/src/Components/EntityHolders/headers.hpp b/src/Components/EntityHolders/headers.hpp index bc13f21..bc9aabb 100644 --- a/src/Components/EntityHolders/headers.hpp +++ b/src/Components/EntityHolders/headers.hpp @@ -2,7 +2,6 @@ #pragma once -#include "ActionQueue.hpp" #include "Battle.hpp" #include "BattleTree.hpp" #include "ChoiceLock.hpp" @@ -12,6 +11,7 @@ #include "LastUsedMove.hpp" #include "MoveSlots.hpp" #include "Pokemon.hpp" +#include "RecycledEntities.hpp" #include "Side.hpp" #include "Sides.hpp" #include "Team.hpp" diff --git a/src/Components/SpeedSort.hpp b/src/Components/SpeedSort.hpp deleted file mode 100644 index 775ef26..0000000 --- a/src/Components/SpeedSort.hpp +++ /dev/null @@ -1,26 +0,0 @@ -#pragma once - -#include -#include -#include -#include -#include - -namespace pokesim { -// Data that determines the order actions take place -struct SpeedSort { - // Order of the types of actions (lower first) - ActionOrder order = ActionOrder::NONE; - // Priority of the action (higher first) - types::priority priority = Constants::MovePriority::DEFAULT; - // Whether negative fractional priority is active for the action (false first) - types::fractionalPriority fractionalPriority = false; - // Speed of Pokemon using move (higher first if priority tie) - types::stat speed = Constants::PokemonEffectiveStat::DEFAULT; - - bool operator==(const SpeedSort& other) const { - return order == other.order && priority == other.priority && fractionalPriority == other.fractionalPriority && - speed == other.speed; - } -}; -} // namespace pokesim diff --git a/src/Components/Tags/RecycledEntities.hpp b/src/Components/Tags/RecycledEntities.hpp new file mode 100644 index 0000000..2af36e9 --- /dev/null +++ b/src/Components/Tags/RecycledEntities.hpp @@ -0,0 +1,5 @@ +#pragma once + +namespace pokesim::tags { +struct RecycledAction {}; +} // namespace pokesim::tags diff --git a/src/Components/Tags/headers.hpp b/src/Components/Tags/headers.hpp index bca4e2e..ee5c241 100644 --- a/src/Components/Tags/headers.hpp +++ b/src/Components/Tags/headers.hpp @@ -11,6 +11,7 @@ #include "MoveTags.hpp" #include "NatureTags.hpp" #include "PokemonTags.hpp" +#include "RecycledEntities.hpp" #include "RunEventTags.hpp" #include "Selection.hpp" #include "SimulationTags.hpp" diff --git a/src/Components/headers.hpp b/src/Components/headers.hpp index 44747c6..9069d09 100644 --- a/src/Components/headers.hpp +++ b/src/Components/headers.hpp @@ -3,6 +3,7 @@ #pragma once #include "Accuracy.hpp" +#include "ActionQueue.hpp" #include "AddedTargets.hpp" #include "AnalyzeEffect/Aliases.hpp" #include "AnalyzeEffect/AnalyzeEffectInputs.hpp" @@ -19,7 +20,6 @@ #include "CloneFromCloneTo.hpp" #include "Damage.hpp" #include "EVsIVs.hpp" -#include "EntityHolders/ActionQueue.hpp" #include "EntityHolders/Battle.hpp" #include "EntityHolders/BattleTree.hpp" #include "EntityHolders/ChoiceLock.hpp" @@ -29,6 +29,7 @@ #include "EntityHolders/LastUsedMove.hpp" #include "EntityHolders/MoveSlots.hpp" #include "EntityHolders/Pokemon.hpp" +#include "EntityHolders/RecycledEntities.hpp" #include "EntityHolders/Side.hpp" #include "EntityHolders/Sides.hpp" #include "EntityHolders/Team.hpp" @@ -70,7 +71,6 @@ #include "SimulateTurn/TeamAction.hpp" #include "SimulationResults.hpp" #include "SpeciesTypes.hpp" -#include "SpeedSort.hpp" #include "Stats.hpp" #include "Tags/AbilityTags.hpp" #include "Tags/BattleTags.hpp" @@ -81,6 +81,7 @@ #include "Tags/MoveTags.hpp" #include "Tags/NatureTags.hpp" #include "Tags/PokemonTags.hpp" +#include "Tags/RecycledEntities.hpp" #include "Tags/RunEventTags.hpp" #include "Tags/Selection.hpp" #include "Tags/SimulationTags.hpp" diff --git a/src/SimulateTurn/ManageActionQueue.cpp b/src/SimulateTurn/ManageActionQueue.cpp index 0e895a6..5058924 100644 --- a/src/SimulateTurn/ManageActionQueue.cpp +++ b/src/SimulateTurn/ManageActionQueue.cpp @@ -1,9 +1,10 @@ #include "ManageActionQueue.hpp" #include -#include +#include #include #include +#include #include #include #include @@ -14,7 +15,6 @@ #include #include #include -#include #include #include #include @@ -33,78 +33,59 @@ namespace pokesim::simulate_turn { namespace { template -void resolveSlotDecision( - types::handle actionHandle, types::entity sideEntity, const types::slotDecision& slotDecision, - ActionQueue& actionQueue) { +void resolveSlotDecision(types::handle sideHandle, const types::slotDecision& slotDecision, ActionQueue& actionQueue) { if (!slotDecision.holds()) { return; } - types::registry& registry = *actionHandle.registry(); + types::registry& registry = *sideHandle.registry(); const auto& decision = slotDecision.get(); POKESIM_REQUIRE(decision.sourceSlot != Slot::NONE, "Source slot must be assigned."); POKESIM_REQUIRE(decision.targetSlot != Slot::NONE, "Target slot must be assigned."); - actionHandle.emplace(decision.sourceSlot); - actionHandle.emplace(decision.targetSlot); + ActionQueueItem actionQueueItem; + actionQueueItem.decision = decision; - SpeedSort speedSort; - types::entity sourceEntity = slotToPokemonEntity(registry, sideEntity, decision.sourceSlot); - speedSort.speed = registry.get(sourceEntity).val; + types::entity sourceEntity = slotToPokemonEntity(registry, sideHandle.entity(), decision.sourceSlot); + actionQueueItem.speed = registry.get(sourceEntity).val; if constexpr (std::is_base_of_v) { - speedSort.order = ActionOrder::MOVE; - speedSort.priority = Constants::MovePriority::DEFAULT; // TODO (aed3): Move priority + modify priority - speedSort.fractionalPriority = false; // TODO (aed3): get fractionalPriority - - actionHandle.emplace(); - actionHandle.emplace(decision.move); + actionQueueItem.order = ActionOrder::MOVE; + actionQueueItem.priority = Constants::MovePriority::DEFAULT; // TODO (aed3): Move priority + modify priority + actionQueueItem.fractionalPriority = false; // TODO (aed3): get fractionalPriority if constexpr (!std::is_same_v) { POKESIM_REQUIRE_FAIL(std::string(entt::type_name().value()) + " is not yet supported."); } } else if constexpr (std::is_same_v) { - speedSort.order = ActionOrder::SWITCH; - - actionHandle.emplace(); + actionQueueItem.order = ActionOrder::SWITCH; } else if constexpr (std::is_same_v) { - speedSort.order = ActionOrder::ITEM; - - actionHandle.emplace(); - actionHandle.emplace(decision.item); + actionQueueItem.order = ActionOrder::ITEM; } else { POKESIM_REQUIRE_FAIL(std::string(entt::type_name().value()) + " is not yet supported."); } - actionHandle.emplace(speedSort); - actionQueue.val.push_back(actionHandle.entity()); + actionQueue.val.push_back(actionQueueItem); } void resolveSlotDecisions(types::handle sideHandle, const types::slotDecisions& decisions, ActionQueue& actionQueue) { - types::registry& registry = *sideHandle.registry(); for (const types::slotDecision& decision : decisions) { - types::handle actionHandle = {registry, registry.create()}; - - resolveSlotDecision(actionHandle, sideHandle.entity(), decision, actionQueue); - resolveSlotDecision(actionHandle, sideHandle.entity(), decision, actionQueue); - resolveSlotDecision(actionHandle, sideHandle.entity(), decision, actionQueue); - resolveSlotDecision(actionHandle, sideHandle.entity(), decision, actionQueue); - resolveSlotDecision(actionHandle, sideHandle.entity(), decision, actionQueue); - resolveSlotDecision(actionHandle, sideHandle.entity(), decision, actionQueue); - resolveSlotDecision(actionHandle, sideHandle.entity(), decision, actionQueue); + resolveSlotDecision(sideHandle, decision, actionQueue); + resolveSlotDecision(sideHandle, decision, actionQueue); + resolveSlotDecision(sideHandle, decision, actionQueue); + resolveSlotDecision(sideHandle, decision, actionQueue); + resolveSlotDecision(sideHandle, decision, actionQueue); + resolveSlotDecision(sideHandle, decision, actionQueue); + resolveSlotDecision(sideHandle, decision, actionQueue); } } void resolveTeamDecision(types::registry& registry, const types::teamOrder& teamOrder, ActionQueue& battleActionQueue) { - types::handle actionHandle = {registry, registry.create()}; - - actionHandle.emplace(teamOrder); - battleActionQueue.val.push_back(actionHandle.entity()); } } // namespace @@ -114,7 +95,7 @@ void resolveDecision(types::handle sideHandle, const SideDecision& sideDecision) const Battle& battle = sideHandle.get(); types::registry& registry = *sideHandle.registry(); - ActionQueue& battleActionQueue = registry.get(battle.val); + ActionQueue& actionQueue = registry.get(battle.val); if (sideDecision.decisions.holds()) { POKESIM_REQUIRE( @@ -138,7 +119,7 @@ void resolveDecision(types::handle sideHandle, const SideDecision& sideDecision) } #endif - resolveSlotDecisions(sideHandle, decisions, battleActionQueue); + resolveSlotDecisions(sideHandle, decisions, actionQueue); } else if (sideDecision.decisions.holds()) { POKESIM_REQUIRE( @@ -150,7 +131,7 @@ void resolveDecision(types::handle sideHandle, const SideDecision& sideDecision) POKESIM_REQUIRE( sideHandle.get().val.size() == teamOrder.size(), "Must pick a placement for each Pokemon on the team."); - resolveTeamDecision(*sideHandle.registry(), teamOrder, battleActionQueue); + resolveTeamDecision(*sideHandle.registry(), teamOrder, actionQueue); } else { POKESIM_REQUIRE_FAIL( @@ -159,51 +140,23 @@ void resolveDecision(types::handle sideHandle, const SideDecision& sideDecision) } void speedSort(types::handle handle, ActionQueue& actionQueue) { - auto& entityList = actionQueue.val; - - if (entityList.size() == 1U) return; - const types::registry* registry = handle.registry(); - - internal::maxSizedVector, Constants::ActionQueueLength::MAX> speedSortList; - speedSortList.reserve(entityList.size()); + auto& actionQueueItems = actionQueue.val; - for (types::entity entity : entityList) { - speedSortList.push_back({registry->get(entity), entity}); + if (actionQueueItems.size() == 1U) { + return; } // TODO(aed3): Test how different sorting algorithms affect speed - std::sort(speedSortList.begin(), speedSortList.end(), [](const auto& pairA, const auto& pairB) { - if (pairA.first.order != pairB.first.order) { - return pairA.first.order < pairB.first.order; - } - - if (pairA.first.priority != pairB.first.priority) { - return pairB.first.priority < pairA.first.priority; - } - - if (pairA.first.fractionalPriority != pairB.first.fractionalPriority) { - return pairB.first.fractionalPriority; - } - - if (pairA.first.speed != pairB.first.speed) { - return pairB.first.speed < pairA.first.speed; - } - - return false; - }); + std::sort( + actionQueueItems.begin(), + actionQueueItems.end(), + [](const ActionQueueItem& itemA, const ActionQueueItem& itemB) { return itemA.isFasterThan(itemB); }); SpeedTieIndexes speedTies; types::activePokemonIndex lastEqual = 0U, tieCount = 1U; - auto speedSortEqual = [](const SpeedSort& speedSortA, const SpeedSort& speedSortB) { - return speedSortA.order == speedSortB.order && speedSortA.priority == speedSortB.priority && - speedSortA.speed == speedSortB.speed && speedSortA.fractionalPriority == speedSortB.fractionalPriority; - }; - - for (types::activePokemonIndex i = 0U; i < speedSortList.size(); i++) { - entityList[i] = speedSortList[i].second; - - if (i > 0U && speedSortEqual(speedSortList[i].first, speedSortList[i - 1].first)) { + for (types::activePokemonIndex i = 1U; i < actionQueueItems.size(); i++) { + if (actionQueueItems[i].isSameSpeed(actionQueueItems[i - 1U])) { tieCount++; } else { @@ -224,54 +177,51 @@ void speedSort(types::handle handle, ActionQueue& actionQueue) { } } -void addBeforeTurnAction(types::registry& registry, ActionQueue& actionQueue) { - types::handle actionHandle{registry, registry.create()}; - SpeedSort speedSort{ActionOrder::BEFORE_TURN}; - - actionHandle.emplace(); - actionHandle.emplace(speedSort); - actionQueue.val.push_back(actionHandle.entity()); +void addBeforeTurnAction(ActionQueue& actionQueue) { + actionQueue.val.push_back({ActionOrder::BEFORE_TURN}); } -void addResidualAction(types::registry& registry, ActionQueue& actionQueue) { - types::handle actionHandle{registry, registry.create()}; - SpeedSort speedSort{ActionOrder::RESIDUAL}; - - actionHandle.emplace(); - actionHandle.emplace(speedSort); - actionQueue.val.push_back(actionHandle.entity()); +void addResidualAction(ActionQueue& actionQueue) { + actionQueue.val.push_back({ActionOrder::RESIDUAL}); } -void setCurrentAction(types::handle battleHandle, ActionQueue& actionQueue) { +void setCurrentAction(types::handle battleHandle, ActionQueue& actionQueue, RecycledAction& action) { types::registry& registry = *battleHandle.registry(); if (actionQueue.val.empty()) return; - types::entity newCurrentAction = actionQueue.val.front(); - registry.emplace(newCurrentAction); - - if (registry.all_of(newCurrentAction)) { - battleHandle.emplace(); - } - else if (registry.all_of(newCurrentAction)) { - battleHandle.emplace(); - } - else { - POKESIM_REQUIRE_FAIL("Action kind not implemented yet."); + ActionQueueItem nextActon = actionQueue.val.front(); + registry.emplace(action.val); + + switch (nextActon.order) { + case ActionOrder::MOVE: { + battleHandle.emplace(); + const MoveDecision& decision = nextActon.decision.get(); + registry.emplace(action.val, decision.sourceSlot); + registry.emplace(action.val, decision.targetSlot); + registry.emplace(action.val, decision.move); + break; + } + case ActionOrder::RESIDUAL: { + battleHandle.emplace(); + break; + } + case ActionOrder::BEFORE_TURN: { + battleHandle.emplace(); + break; + } + default: { + POKESIM_REQUIRE_FAIL("Action kind not implemented yet."); + break; + } } actionQueue.val.erase(actionQueue.val.begin()); - battleHandle.remove(); - battleHandle.emplace(newCurrentAction); - if (!actionQueue.val.empty()) { - battleHandle.emplace(actionQueue.val[0]); - } + battleHandle.emplace(action.val); } -void clearActionQueue(types::handle battleHandle, ActionQueue& actionQueue) { - battleHandle.remove(); - battleHandle.registry()->destroy(actionQueue.val.begin(), actionQueue.val.end()); +void clearActionQueue(ActionQueue& actionQueue) { actionQueue.val.clear(); } } // namespace pokesim::simulate_turn diff --git a/src/SimulateTurn/ManageActionQueue.hpp b/src/SimulateTurn/ManageActionQueue.hpp index b875f4c..dcaf7a4 100644 --- a/src/SimulateTurn/ManageActionQueue.hpp +++ b/src/SimulateTurn/ManageActionQueue.hpp @@ -6,14 +6,15 @@ namespace pokesim { struct SideDecision; struct ActionQueue; +struct RecycledAction; namespace simulate_turn { void resolveDecision(types::handle sideHandle, const SideDecision& sideDecision); void speedSort(types::handle handle, ActionQueue& actionQueue); -void addBeforeTurnAction(types::registry& registry, ActionQueue& actionQueue); -void addResidualAction(types::registry& registry, ActionQueue& actionQueue); -void setCurrentAction(types::handle battleHandle, ActionQueue& actionQueue); -void clearActionQueue(types::handle battleHandle, ActionQueue& actionQueue); +void addBeforeTurnAction(ActionQueue& actionQueue); +void addResidualAction(ActionQueue& actionQueue); +void setCurrentAction(types::handle battleHandle, ActionQueue& actionQueue, RecycledAction& action); +void clearActionQueue(ActionQueue& actionQueue); } // namespace simulate_turn } // namespace pokesim diff --git a/src/SimulateTurn/SimulateTurn.cpp b/src/SimulateTurn/SimulateTurn.cpp index 96c844e..9b890c6 100644 --- a/src/SimulateTurn/SimulateTurn.cpp +++ b/src/SimulateTurn/SimulateTurn.cpp @@ -6,14 +6,15 @@ #include #include #include +#include #include #include -#include #include #include #include #include #include +#include #include #include #include @@ -22,7 +23,6 @@ #include #include #include -#include #include #include #include @@ -189,7 +189,7 @@ void checkWin(types::handle battleHandle, const Sides& sides) { types::teamPositionIndex pokemonLeft = foeSidePokemonLeft(registry, sideEntity); if (!pokemonLeft) { battleHandle.emplace(registry.get(sideEntity).val); - clearActionQueue(battleHandle, battleHandle.get()); + clearActionQueue(battleHandle.get()); return; } } @@ -293,8 +293,11 @@ void simulateTurn(Simulation& simulation) { simulation.addToEntities(); const auto entityMap = clone(simulation.registry, 1U); for (const auto& inputBattleMapping : entityMap) { - simulation.registry.emplace(inputBattleMapping.first); - simulation.registry.remove(inputBattleMapping.first); + types::entity original = inputBattleMapping.first; + if (simulation.registry.all_of(original)) { + simulation.registry.emplace(original); + simulation.registry.remove(original); + } } } diff --git a/src/SimulateTurn/SimulateTurnDebugChecks.hpp b/src/SimulateTurn/SimulateTurnDebugChecks.hpp index 33f63bc..afee333 100644 --- a/src/SimulateTurn/SimulateTurnDebugChecks.hpp +++ b/src/SimulateTurn/SimulateTurnDebugChecks.hpp @@ -6,12 +6,15 @@ #include #include +#include #include #include #include #include #include +#include #include +#include #include #include #include @@ -45,6 +48,7 @@ struct Checks : pokesim::debug::Checks { void copyBattles() { for (types::entity entity : getBattleView()) { copyEntity(entity); + copyEntity(registry->get(entity).val); } } @@ -53,25 +57,40 @@ struct Checks : pokesim::debug::Checks { typesToIgnore.add(); pokesim::debug::TypesToIgnore typesIgnoredOnConstants = typesToIgnore; - typesToIgnore.add(); + typesToIgnore.add(); if (!simulateTurnOptionsOnInput.getMakeBranchesOnRandomEvents()) { typesToIgnore.add(); } - for (types::entity entity : getBattleView()) { - types::entity original = pokesim::debug::findCopyParent(currentEntitiesToInitial, *registry, entity); - bool shouldNotChange = !simulateTurnOptionsOnInput.getApplyChangesToInputBattle() && original == entity; + for (types::entity currentEntity : getBattleView()) { + types::entity original = pokesim::debug::findCopyParent(currentEntitiesToInitial, *registry, currentEntity); + bool shouldNotChange = !simulateTurnOptionsOnInput.getApplyChangesToInputBattle() && original == currentEntity; if (!registryOnInput.all_of(original)) { typesToIgnore.add(); } + types::entity initialEntity = getInitialEntity(currentEntity); pokesim::debug::areEntitiesEqual( *registry, - entity, + currentEntity, registryOnInput, - getInitialEntity(entity), + initialEntity, shouldNotChange ? typesIgnoredOnConstants : typesToIgnore); + + bool initialIsMidTurn = registryOnInput.all_of(initialEntity); + bool currentIsMidTurn = registry->all_of(currentEntity); + types::entity currAction = registry->get(currentEntity).val; + if (!initialIsMidTurn && !currentIsMidTurn) { + pokesim::debug::areEntitiesEqual(*registry, currAction, registryOnInput, getInitialEntity(currAction)); + } + + if (!currentIsMidTurn) { + types::registry blankRegistry; + types::entity idealRecycledAction = blankRegistry.create(); + blankRegistry.emplace(idealRecycledAction); + pokesim::debug::hasSameComponents(*registry, currAction, blankRegistry, idealRecycledAction); + } } } diff --git a/src/Simulation/SimulationSetup.cpp b/src/Simulation/SimulationSetup.cpp index 0322bf7..e64f46b 100644 --- a/src/Simulation/SimulationSetup.cpp +++ b/src/Simulation/SimulationSetup.cpp @@ -6,7 +6,6 @@ #include #include #include -#include #include #include #include diff --git a/src/Simulation/SimulationSetupDebugChecks.hpp b/src/Simulation/SimulationSetupDebugChecks.hpp index 8b61f00..2c37892 100644 --- a/src/Simulation/SimulationSetupDebugChecks.hpp +++ b/src/Simulation/SimulationSetupDebugChecks.hpp @@ -7,11 +7,11 @@ #include #include #include +#include #include #include #include #include -#include #include #include #include diff --git a/src/Utilities/ArgumentChecks.cpp b/src/Utilities/ArgumentChecks.cpp index 7927d2e..ee4552e 100644 --- a/src/Utilities/ArgumentChecks.cpp +++ b/src/Utilities/ArgumentChecks.cpp @@ -107,23 +107,18 @@ void checkAction(types::entity actionEntity, const types::registry& registry) { POKESIM_REQUIRE_NM(!has(actionEntity, registry)); POKESIM_REQUIRE_NM(!has(actionEntity, registry)); POKESIM_REQUIRE_NM(!has(actionEntity, registry)); - POKESIM_REQUIRE_NM(!has(actionEntity, registry)); checkTeamOrder(registry.get(actionEntity).val); } - else { - POKESIM_REQUIRE_NM(has(actionEntity, registry)); - } if (registry.any_of(actionEntity)) { POKESIM_REQUIRE_NM(has(actionEntity, registry)); POKESIM_REQUIRE_NM(has(actionEntity, registry)); POKESIM_REQUIRE_NM(!has(actionEntity, registry)); - const auto& [source, target, speedSort] = registry.get(actionEntity); + const auto& [source, target] = registry.get(actionEntity); check(source); check(target); - check(speedSort); if (has(actionEntity, registry)) { check(registry.get(actionEntity)); @@ -327,6 +322,25 @@ void check(const Accuracy& accuracy) { checkBounds(accuracy.val); } +template <> +void check(const ActionQueueItem& actionQueueItem) { + POKESIM_REQUIRE_NM(listContains(VALID_ACTION_ORDERS, actionQueueItem.order)); + checkBounds(actionQueueItem.priority); + checkStat(actionQueueItem.speed); + + if (actionQueueItem.order == ActionOrder::MOVE || actionQueueItem.order == ActionOrder::SWITCH) { + check(actionQueueItem.decision); + } +} + +template <> +void check(const ActionQueue& actionQueue) { + checkBounds(actionQueue.val.size()); + for (const ActionQueueItem& actionQueueItem : actionQueue.val) { + check(actionQueueItem); + } +} + template <> void check(const AddedTargets& addedTargets) { POKESIM_REQUIRE_NM(listContains(VALID_ADDED_TARGET_OPTIONS, addedTargets.val)); @@ -551,14 +565,6 @@ void check(const Ivs& ivs) { checkIv(ivs.spe); } -template <> -void check(const ActionQueue& actionQueue, const types::registry& registry) { - checkBounds(actionQueue.val.size()); - for (types::entity entity : actionQueue.val) { - checkAction(entity, registry); - } -} - template <> void check(const Battle& battle, const types::registry& registry) { checkBattle(battle.val, registry); @@ -589,11 +595,6 @@ void check(const CurrentAction& currentAction, const types::registry& registry) checkAction(currentAction.val, registry); } -template <> -void check(const NextAction& nextAction, const types::registry& registry) { - checkAction(nextAction.val, registry); -} - template <> void check(const CurrentActionTargets& targets, const types::registry& registry) { checkBounds(targets.val.size()); @@ -699,6 +700,12 @@ void check(const Pokemon& pokemon, const types::registry& registry) { checkPokemon(pokemon.val, registry); } +template <> +void check(const RecycledAction& recycledAction, const types::registry& registry) { + types::registry::checkEntity(recycledAction.val, registry); + POKESIM_REQUIRE_NM(has(recycledAction.val, registry)); +} + template <> void check(const Side& side, const types::registry& registry) { checkSide(side.val, registry); @@ -1062,13 +1069,6 @@ void check(const SpeciesTypes& speciesTypes) { } } -template <> -void check(const SpeedSort& speedSort) { - POKESIM_REQUIRE_NM(listContains(VALID_ACTION_ORDERS, speedSort.order)); - checkBounds(speedSort.priority); - checkStat(speedSort.speed); -} - template <> void check(const stat::Hp& hp) { checkStat(hp.val, true); @@ -1141,9 +1141,6 @@ void check(const Winner& winner) { winner.val == PlayerSideId::P1 || winner.val == PlayerSideId::P2 || winner.val == PlayerSideId::NONE); } -template <> -void check(const ActionQueue2&) {} - template <> void check(const types::slotDecision& slotDecision) { checkSlot(slotDecision.sourceSlot()); diff --git a/src/Utilities/ArgumentChecks.hpp b/src/Utilities/ArgumentChecks.hpp index 3d3aa61..2c9e661 100644 --- a/src/Utilities/ArgumentChecks.hpp +++ b/src/Utilities/ArgumentChecks.hpp @@ -12,6 +12,8 @@ namespace pokesim { struct Accuracy; +struct ActionQueueItem; +struct ActionQueue; struct AddedTargets; struct BaseEffectChance; struct BasePower; @@ -26,14 +28,12 @@ struct DamageRollModifiers; struct DamageRolls; struct Evs; struct Ivs; -struct ActionQueue; struct Battle; struct ParentBattle; struct RootBattle; struct ParentEntity; struct ChoiceLock; struct CurrentAction; -struct NextAction; struct CurrentActionTargets; struct CurrentActionSource; struct CurrentActionTarget; @@ -51,6 +51,7 @@ struct FoeSide; struct LastUsedMove; struct MoveSlots; struct Pokemon; +struct RecycledAction; struct Side; struct Sides; struct Team; @@ -88,7 +89,6 @@ struct RngSeed; struct SideDecision; struct SpeedTieIndexes; struct SpeciesTypes; -struct SpeedSort; struct Turn; struct Winner; namespace analyze_effect { @@ -164,6 +164,12 @@ void checkPercentChance(types::percentChance); template <> void check(const Accuracy&); +template <> +void check(const ActionQueueItem&); + +template <> +void check(const ActionQueue&); + template <> void check(const AddedTargets&); @@ -247,9 +253,6 @@ void check(const Evs&); template <> void check(const Ivs&); -template <> -void check(const ActionQueue&, const types::registry&); - template <> void check(const Battle&, const types::registry&); @@ -268,9 +271,6 @@ void check(const ChoiceLock&, const types::registry&); template <> void check(const CurrentAction&, const types::registry&); -template <> -void check(const NextAction&, const types::registry&); - template <> void check(const CurrentActionTargets&, const types::registry&); @@ -322,6 +322,9 @@ void check(const MoveSlots&, const types::registry&); template <> void check(const Pokemon&, const types::registry&); +template <> +void check(const RecycledAction&, const types::registry&); + template <> void check(const Side&, const types::registry&); @@ -490,9 +493,6 @@ void check(const analyze_effect::EffectMultiplier&); template <> void check(const SpeciesTypes&); -template <> -void check(const SpeedSort&); - template <> void check(const stat::Hp&); diff --git a/src/Utilities/Variant.hpp b/src/Utilities/Variant.hpp index c1b3498..97ab3f9 100644 --- a/src/Utilities/Variant.hpp +++ b/src/Utilities/Variant.hpp @@ -34,12 +34,12 @@ class variant : public std::variant { template constexpr auto get_if() const { - return std::forward_as_tuple(std::get_if(this)...); + return std::make_tuple(std::get_if(this)...); } template constexpr auto get_if() { - return std::forward_as_tuple(std::get_if(this)...); + return std::make_tuple(std::get_if(this)...); } }; } // namespace pokesim::internal diff --git a/tests/SimulateTurnsTest.cpp b/tests/SimulateTurnsTest.cpp index 0a77126..1e32c31 100644 --- a/tests/SimulateTurnsTest.cpp +++ b/tests/SimulateTurnsTest.cpp @@ -2,47 +2,41 @@ namespace pokesim { namespace { -using SpeedSortList = std::vector; +using ActionQueueList = std::vector; -void runSpeedSortTest( - const SpeedSortList& speedSortList, const SpeedSortList& idealSortedList, +void runQueueOrderTest( + const ActionQueueList& actionQueueList, const ActionQueueList& idealActionQueueList, const SpeedTieIndexes& idealSpeedTies = {}) { - types::registry registry; - ActionQueue initialQueue; - - for (const SpeedSort& speedSort : speedSortList) { - types::entity entity = registry.create(); - registry.emplace(entity, speedSort); - initialQueue.val.push_back(entity); - } + ActionQueue initialQueue{actionQueueList}; + types::registry registry; types::handle handle{registry, registry.create()}; ActionQueue sortedQueue = initialQueue; simulate_turn::speedSort(handle, sortedQueue); REQUIRE(initialQueue.val.size() == sortedQueue.val.size()); - for (types::entity entity : initialQueue.val) { - bool entityFound = false; - for (types::entity sortedEntity : sortedQueue.val) { - if (sortedEntity == entity) { - entityFound = true; + for (const ActionQueueItem& initialItem : initialQueue.val) { + bool itemFound = false; + for (const ActionQueueItem& sortedItem : sortedQueue.val) { + if (sortedItem == initialItem) { + itemFound = true; break; } } - REQUIRE(entityFound); + REQUIRE(itemFound); } - for (std::size_t i = 0U; i < idealSortedList.size(); i++) { + for (std::size_t i = 0U; i < idealActionQueueList.size(); i++) { INFO(std::to_string(i)); - const SpeedSort& idealSpeedSort = idealSortedList[i]; - const SpeedSort& trueSpeedSort = registry.get(sortedQueue.val[i]); + const ActionQueueItem& idealQueueItem = idealActionQueueList[i]; + const ActionQueueItem& trueQueueItem = sortedQueue.val[i]; - REQUIRE(trueSpeedSort.order == idealSpeedSort.order); - REQUIRE(trueSpeedSort.priority == idealSpeedSort.priority); - REQUIRE(trueSpeedSort.fractionalPriority == idealSpeedSort.fractionalPriority); - REQUIRE(trueSpeedSort.speed == idealSpeedSort.speed); + REQUIRE(trueQueueItem.order == idealQueueItem.order); + REQUIRE(trueQueueItem.priority == idealQueueItem.priority); + REQUIRE(trueQueueItem.fractionalPriority == idealQueueItem.fractionalPriority); + REQUIRE(trueQueueItem.speed == idealQueueItem.speed); } if (idealSpeedTies.val.empty()) { @@ -65,33 +59,33 @@ void runSpeedSortTest( }; } // namespace -TEST_CASE("Simulate Turn: SpeedSort", "[Simulation][SimulateTurn]") { +TEST_CASE("Simulate Turn: Action Queue Order", "[Simulation][SimulateTurn]") { SECTION("One Queue Item") { - SpeedSort emptySpeedSort{}; - runSpeedSortTest({emptySpeedSort}, {emptySpeedSort}); + ActionQueueItem emptyQueueItem{}; + runQueueOrderTest({emptyQueueItem}, {emptyQueueItem}); } SECTION("Two Identical Items") { - SpeedSort emptySpeedSort{}; - runSpeedSortTest( - {emptySpeedSort, emptySpeedSort}, - {emptySpeedSort, emptySpeedSort}, + ActionQueueItem emptyQueueItem{}; + runQueueOrderTest( + {emptyQueueItem, emptyQueueItem}, + {emptyQueueItem, emptyQueueItem}, SpeedTieIndexes{ {SpeedTieIndexes::Span{0U, 2U}}, }); } SECTION("Sort By Order") { - SpeedSortList idealList = { - SpeedSort{ActionOrder::TEAM}, - SpeedSort{ActionOrder::START}, - SpeedSort{ActionOrder::BEFORE_TURN}, - SpeedSort{ActionOrder::SWITCH}, - SpeedSort{ActionOrder::MOVE}, - SpeedSort{ActionOrder::NONE}, + ActionQueueList idealList = { + ActionQueueItem{ActionOrder::TEAM}, + ActionQueueItem{ActionOrder::START}, + ActionQueueItem{ActionOrder::BEFORE_TURN}, + ActionQueueItem{ActionOrder::SWITCH}, + ActionQueueItem{ActionOrder::MOVE}, + ActionQueueItem{ActionOrder::NONE}, }; - runSpeedSortTest( + runQueueOrderTest( { idealList[2], idealList[0], @@ -104,17 +98,17 @@ TEST_CASE("Simulate Turn: SpeedSort", "[Simulation][SimulateTurn]") { } SECTION("Sort By Priority") { - SpeedSortList idealList = { - SpeedSort{ActionOrder::MOVE, 5}, - SpeedSort{ActionOrder::MOVE, 3}, - SpeedSort{ActionOrder::MOVE, 1}, - SpeedSort{ActionOrder::MOVE, 0}, - SpeedSort{ActionOrder::MOVE, -2}, - SpeedSort{ActionOrder::MOVE, -3}, - SpeedSort{ActionOrder::MOVE, -7}, + ActionQueueList idealList = { + ActionQueueItem{ActionOrder::MOVE, 5}, + ActionQueueItem{ActionOrder::MOVE, 3}, + ActionQueueItem{ActionOrder::MOVE, 1}, + ActionQueueItem{ActionOrder::MOVE, 0}, + ActionQueueItem{ActionOrder::MOVE, -2}, + ActionQueueItem{ActionOrder::MOVE, -3}, + ActionQueueItem{ActionOrder::MOVE, -7}, }; - runSpeedSortTest( + runQueueOrderTest( { idealList[1], idealList[0], @@ -128,16 +122,16 @@ TEST_CASE("Simulate Turn: SpeedSort", "[Simulation][SimulateTurn]") { } SECTION("Sort By Priority and Fractional Priority") { - SpeedSortList idealList = { - SpeedSort{ActionOrder::MOVE, 5, false}, - SpeedSort{ActionOrder::MOVE, 3, true}, - SpeedSort{ActionOrder::MOVE, 0, false}, - SpeedSort{ActionOrder::MOVE, 0, true}, - SpeedSort{ActionOrder::MOVE, -3, false}, - SpeedSort{ActionOrder::MOVE, -7, true}, + ActionQueueList idealList = { + ActionQueueItem{ActionOrder::MOVE, 5, false}, + ActionQueueItem{ActionOrder::MOVE, 3, true}, + ActionQueueItem{ActionOrder::MOVE, 0, false}, + ActionQueueItem{ActionOrder::MOVE, 0, true}, + ActionQueueItem{ActionOrder::MOVE, -3, false}, + ActionQueueItem{ActionOrder::MOVE, -7, true}, }; - runSpeedSortTest( + runQueueOrderTest( { idealList[5], idealList[4], @@ -150,27 +144,27 @@ TEST_CASE("Simulate Turn: SpeedSort", "[Simulation][SimulateTurn]") { } SECTION("Sort By Fractional Priority") { - SpeedSortList idealList = { - SpeedSort{ActionOrder::MOVE, 0, false}, - SpeedSort{ActionOrder::MOVE, 0, true}, + ActionQueueList idealList = { + ActionQueueItem{ActionOrder::MOVE, 0, false}, + ActionQueueItem{ActionOrder::MOVE, 0, true}, }; - runSpeedSortTest({idealList[1], idealList[0]}, idealList); + runQueueOrderTest({idealList[1], idealList[0]}, idealList); } SECTION("Sort By Speed") { - SpeedSortList idealList = { - SpeedSort{ActionOrder::MOVE, 0, false, 772U}, - SpeedSort{ActionOrder::MOVE, 0, false, 621U}, - SpeedSort{ActionOrder::MOVE, 0, false, 584U}, - SpeedSort{ActionOrder::MOVE, 0, false, 444U}, - SpeedSort{ActionOrder::MOVE, 0, false, 305U}, - SpeedSort{ActionOrder::MOVE, 0, false, 152U}, - SpeedSort{ActionOrder::MOVE, 0, false, 90U}, - SpeedSort{ActionOrder::MOVE, 0, false, 11U}, + ActionQueueList idealList = { + ActionQueueItem{ActionOrder::MOVE, 0, false, 772U}, + ActionQueueItem{ActionOrder::MOVE, 0, false, 621U}, + ActionQueueItem{ActionOrder::MOVE, 0, false, 584U}, + ActionQueueItem{ActionOrder::MOVE, 0, false, 444U}, + ActionQueueItem{ActionOrder::MOVE, 0, false, 305U}, + ActionQueueItem{ActionOrder::MOVE, 0, false, 152U}, + ActionQueueItem{ActionOrder::MOVE, 0, false, 90U}, + ActionQueueItem{ActionOrder::MOVE, 0, false, 11U}, }; - runSpeedSortTest( + runQueueOrderTest( { idealList[1], idealList[0], @@ -185,19 +179,19 @@ TEST_CASE("Simulate Turn: SpeedSort", "[Simulation][SimulateTurn]") { } SECTION("Sort Combination") { - SpeedSortList idealList = { - SpeedSort{ActionOrder::TEAM}, - SpeedSort{ActionOrder::START}, - SpeedSort{ActionOrder::BEFORE_TURN, 0, false, 584U}, - SpeedSort{ActionOrder::BEFORE_TURN, 0, false, 444U}, - SpeedSort{ActionOrder::SWITCH, 0, false, 52U}, - SpeedSort{ActionOrder::SWITCH, 0, false, 40U}, - SpeedSort{ActionOrder::MOVE, 1, false, 152U}, - SpeedSort{ActionOrder::MOVE, 0, false, 315U}, - SpeedSort{ActionOrder::MOVE, -3, true, 700U}, + ActionQueueList idealList = { + ActionQueueItem{ActionOrder::TEAM}, + ActionQueueItem{ActionOrder::START}, + ActionQueueItem{ActionOrder::BEFORE_TURN, 0, false, 584U}, + ActionQueueItem{ActionOrder::BEFORE_TURN, 0, false, 444U}, + ActionQueueItem{ActionOrder::SWITCH, 0, false, 52U}, + ActionQueueItem{ActionOrder::SWITCH, 0, false, 40U}, + ActionQueueItem{ActionOrder::MOVE, 1, false, 152U}, + ActionQueueItem{ActionOrder::MOVE, 0, false, 315U}, + ActionQueueItem{ActionOrder::MOVE, -3, true, 700U}, }; - runSpeedSortTest( + runQueueOrderTest( { idealList[8], idealList[7], @@ -234,9 +228,8 @@ TEST_CASE("Simulate Turn: Battle ends on faint", "[Simulation][SimulateTurn]") { MoveDecision p2MoveDecision{Slot::P2A, Slot::P1A, dex::Move::THUNDERBOLT}; p1Decision.decisions = types::slotDecisions{p1MoveDecision}; p2Decision.decisions = types::slotDecisions{p2MoveDecision}; - sizeof(types::slotDecision) - battleCreationInfo.decisionsToSimulate = {{p1Decision, p2Decision}}; + battleCreationInfo.decisionsToSimulate = {{p1Decision, p2Decision}}; simulation.createInitialStates({battleCreationInfo}); auto& options = simulation.simulateTurnOptions; diff --git a/tests/SimulationSetupTest.cpp b/tests/SimulationSetupTest.cpp index 601ecec..9dd7271 100644 --- a/tests/SimulationSetupTest.cpp +++ b/tests/SimulationSetupTest.cpp @@ -106,50 +106,49 @@ TEST_CASE("Simulation Setup: Simulate Turn", "[Simulation][SimulateTurn][Setup]" const auto id = registry.get(group[i]).val; REQUIRE(queue.size() == 2U); - auto p1DecisionEntity = *std::find_if(queue.begin(), queue.end(), [&](types::entity entity) { - return registry.get(entity).val == Slot::P1A; + auto p1DecisionItem = *std::find_if(queue.begin(), queue.end(), [&](const ActionQueueItem& item) { + return item.decision.sourceSlot() == Slot::P1A; }); - auto p2DecisionEntity = *std::find_if(queue.begin(), queue.end(), [&](types::entity entity) { - return registry.get(entity).val == Slot::P2A; + auto p2DecisionItem = *std::find_if(queue.begin(), queue.end(), [&](const ActionQueueItem& item) { + return item.decision.sourceSlot() == Slot::P2A; }); auto checkDecision = - [&](types::entity decisionEntity, const types::slotDecision& decision, const PokemonCreationInfo& pokemon) { + [&](ActionQueueItem actionQueueItem, const types::slotDecision& decision, const PokemonCreationInfo& pokemon) { if (decision.holds()) { - const auto [target, move, speedSort] = registry.get(decisionEntity); - const auto& moveDecision = decision.get(); - - REQUIRE(target.val == moveDecision.targetSlot); - REQUIRE(move.val == moveDecision.move); - REQUIRE(speedSort.speed == pokemon.stats.spe); - REQUIRE(speedSort.order == ActionOrder::MOVE); - REQUIRE(speedSort.priority == 0); - REQUIRE(speedSort.fractionalPriority == false); + const auto& trueMoveDecision = actionQueueItem.decision.get(); + const auto& idealMoveDecision = decision.get(); + + REQUIRE(trueMoveDecision == idealMoveDecision); + + REQUIRE(actionQueueItem.speed == pokemon.stats.spe); + REQUIRE(actionQueueItem.order == ActionOrder::MOVE); + REQUIRE(actionQueueItem.priority == 0); + REQUIRE(actionQueueItem.fractionalPriority == false); } else if (decision.holds()) { - REQUIRE(registry.all_of(decisionEntity)); - const auto [target, speedSort] = registry.get(decisionEntity); - const auto& switchDecision = decision.get(); - - REQUIRE(target.val == switchDecision.targetSlot); - REQUIRE(speedSort.speed == pokemon.stats.spe); - REQUIRE(speedSort.order == ActionOrder::SWITCH); - REQUIRE(speedSort.priority == 0); - REQUIRE(speedSort.fractionalPriority == false); + const auto& trueSwitchDecision = actionQueueItem.decision.get(); + const auto& idealSwitchDecision = decision.get(); + + REQUIRE(trueSwitchDecision == idealSwitchDecision); + REQUIRE(actionQueueItem.speed == pokemon.stats.spe); + REQUIRE(actionQueueItem.order == ActionOrder::SWITCH); + REQUIRE(actionQueueItem.priority == 0); + REQUIRE(actionQueueItem.fractionalPriority == false); } }; { INFO("P1 Action"); const auto& decision = battleInfo.decisionsToSimulate[id].p1().decisions.get()[0]; - checkDecision(p1DecisionEntity, decision, battleInfo.sides.p1().team[0]); + checkDecision(p1DecisionItem, decision, battleInfo.sides.p1().team[0]); } { INFO("P2 Action"); const auto& decision = battleInfo.decisionsToSimulate[id].p2().decisions.get()[0]; - checkDecision(p2DecisionEntity, decision, battleInfo.sides.p2().team[0]); + checkDecision(p2DecisionItem, decision, battleInfo.sides.p2().team[0]); } } }; From 2de79dd1977e806edf4dfbdc0e68ae48635dcc82 Mon Sep 17 00:00:00 2001 From: aed3 <32887801+aed3@users.noreply.github.com> Date: Fri, 12 Jun 2026 22:04:32 -0500 Subject: [PATCH 04/10] No more move slot entities MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The idea for this change came from me noticing the size of the components a move slot entity kept track of (a move name, pp, and max pp value) were the same size as an entity itself. The reason I’m making this change, especially now, is because move slots were a majority of the entities used per battle and I wanted to increase the max input count on the benchmarks. That’s important since I knew this entity decrease change was going to happen and I wanted to make sure the changes I make now would not worsen performance on large input counts with four moves per Pokemon. Move slots are now referenced in other components by their index in the Pokemon’s `MoveSlots` component. Since the one advantage of having a move slot be an entity, using a tag to mark if it’s disabled, is now not possible, there’s now a component that can be added to a Pokemon that stores what move slot indexes are disabled if any are. Reducing the number of entities this much led to some big performance wins. The main one is when simulation branching is enabled as those benchmarks are now 1.5 times faster. Analyze Effect also saw big improvements, in some cases 2.7 times faster. The turn simulations for random inputs also sped up by 1.6 times. --- CMakeLists.txt | 1 - benchmarks/Benchmarks.hpp | 1 - benchmarks/RandomInputs.cpp | 18 +- benchmarks/VerticalSlices.cpp | 6 +- extras/PokeSim.cpp | 255 ++++------ extras/PokeSim.hpp | 256 +++++----- extras/RecentBenchmarkResults.md | 447 +++++++++--------- src/Battle/Clone/Clone.cpp | 39 +- src/Battle/Helpers/Helpers.cpp | 14 +- src/Battle/Helpers/Helpers.hpp | 3 +- src/Battle/ManageBattleState.cpp | 10 +- src/Battle/Pokemon/ManagePokemonState.cpp | 18 +- src/Battle/Pokemon/ManagePokemonState.hpp | 5 +- src/Battle/Setup/MoveStateSetup.cpp | 25 - src/Battle/Setup/MoveStateSetup.hpp | 29 -- src/Battle/Setup/PokemonStateSetup.cpp | 14 +- src/Battle/Setup/PokemonStateSetup.hpp | 9 +- src/Battle/Setup/headers.hpp | 1 - src/Battle/headers.hpp | 1 - src/CalcDamage/CalcDamageDebugChecks.hpp | 2 - .../{EntityHolders => }/ChoiceLock.hpp | 4 +- src/Components/Current.hpp | 10 + src/Components/DisabledMoveSlots.hpp | 9 + src/Components/EntityHolders/Current.hpp | 4 - src/Components/EntityHolders/MoveSlots.hpp | 11 - src/Components/EntityHolders/headers.hpp | 3 - .../{EntityHolders => }/LastUsedMove.hpp | 4 +- src/Components/MoveSlots.hpp | 22 + src/Components/{ => Pokedex}/PP.hpp | 4 - src/Components/Pokedex/headers.hpp | 1 + src/Components/Tags/MovePropertyTags.hpp | 2 - src/Components/headers.hpp | 10 +- src/Pokedex/Events/EffectEvents.cpp | 19 +- src/Pokedex/Events/ItemEvents.cpp | 3 +- src/Pokedex/Setup/MoveDexDataSetup.cpp | 2 +- src/SimulateTurn/SimulateTurn.cpp | 15 +- src/SimulateTurn/SimulateTurnDebugChecks.hpp | 5 +- src/Simulation/RunEvent.cpp | 4 +- src/Simulation/Simulation.hpp | 1 - src/Simulation/SimulationSetup.cpp | 43 +- src/Simulation/SimulationSetupDebugChecks.hpp | 25 +- src/Types/Constants.hpp | 2 + src/Utilities/ArgumentChecks.cpp | 91 ++-- src/Utilities/ArgumentChecks.hpp | 53 ++- src/Utilities/DebugChecks.hpp | 5 +- src/Utilities/FixedMemoryVector.hpp | 6 + tests/BattleStateTest.cpp | 16 +- tests/Effects/ChoiceLock.cpp | 44 +- tests/Effects/Paralysis.cpp | 19 +- tests/Moves/KnockOff.cpp | 25 +- tests/SimulateTurnsTest.cpp | 14 +- tests/SimulationSetupTest.cpp | 4 +- tests/Tests.hpp | 9 +- tests/VerticalSlices.cpp | 54 ++- 54 files changed, 780 insertions(+), 917 deletions(-) delete mode 100644 src/Battle/Setup/MoveStateSetup.cpp delete mode 100644 src/Battle/Setup/MoveStateSetup.hpp rename src/Components/{EntityHolders => }/ChoiceLock.hpp (58%) create mode 100644 src/Components/Current.hpp create mode 100644 src/Components/DisabledMoveSlots.hpp delete mode 100644 src/Components/EntityHolders/MoveSlots.hpp rename src/Components/{EntityHolders => }/LastUsedMove.hpp (59%) create mode 100644 src/Components/MoveSlots.hpp rename src/Components/{ => Pokedex}/PP.hpp (72%) diff --git a/CMakeLists.txt b/CMakeLists.txt index bddf207..9d677a0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -188,7 +188,6 @@ setup_target( src/Battle/Pokemon/ManagePokemonState.cpp src/Battle/Setup/BattleStateSetup.cpp src/Battle/Setup/EmplaceTagFromEnum.cpp - src/Battle/Setup/MoveStateSetup.cpp src/Battle/Setup/PokemonStateSetup.cpp src/Battle/Setup/SideStateSetup.cpp src/Battle/Side/ManageSideState.cpp diff --git a/benchmarks/Benchmarks.hpp b/benchmarks/Benchmarks.hpp index 2b04592..7fd7bf6 100644 --- a/benchmarks/Benchmarks.hpp +++ b/benchmarks/Benchmarks.hpp @@ -89,7 +89,6 @@ struct CreateSingleBattleSimulation : BenchmarkInputHolder { struct CreateDoubleBattleSimulation : BenchmarkInputHolder { inline static const std::vector TAGS = {"DoubleBattle"}; - static constexpr types::entityIndex MAX_INPUTS = 1U << 13U; static Simulation run(types::rngState&, Pokedex& pokedex) { return Simulation{pokedex, BattleFormat::DOUBLES}; } }; diff --git a/benchmarks/RandomInputs.cpp b/benchmarks/RandomInputs.cpp index 29d547b..322683e 100644 --- a/benchmarks/RandomInputs.cpp +++ b/benchmarks/RandomInputs.cpp @@ -314,33 +314,33 @@ struct Random { public: struct AssignSimulateTurnOneBattleOneInput : Assign { - static constexpr types::entityIndex MAX_INPUTS = 1U << 14U; + static constexpr types::entityIndex MAX_INPUTS = 1U << 16U; }; struct AssignSimulateTurnOneBattleManyInputs : Assign { - static constexpr types::entityIndex MAX_INPUTS = 1U << 14U; + static constexpr types::entityIndex MAX_INPUTS = 1U << 16U; }; struct AssignSimulateTurnManyBattlesManyInputs : Assign { - static constexpr types::entityIndex MAX_INPUTS = 1U << 14U; + static constexpr types::entityIndex MAX_INPUTS = 1U << 16U; }; struct AssignCalcDamageOneBattleOneInput : Assign { - static constexpr types::entityIndex MAX_INPUTS = 1U << 14U; + static constexpr types::entityIndex MAX_INPUTS = 1U << 16U; }; struct AssignCalcDamageOneBattleManyInputs : Assign { - static constexpr types::entityIndex MAX_INPUTS = 1U << 14U; + static constexpr types::entityIndex MAX_INPUTS = 1U << 16U; }; struct AssignCalcDamageManyBattlesManyInputs : Assign { - static constexpr types::entityIndex MAX_INPUTS = 1U << 14U; + static constexpr types::entityIndex MAX_INPUTS = 1U << 16U; }; struct AssignAnalyzeEffectOneBattleOneInput : Assign { - static constexpr types::entityIndex MAX_INPUTS = 1U << 13U; + static constexpr types::entityIndex MAX_INPUTS = 1U << 15U; }; struct AssignAnalyzeEffectOneBattleManyInputs : Assign { - static constexpr types::entityIndex MAX_INPUTS = 1U << 13U; + static constexpr types::entityIndex MAX_INPUTS = 1U << 15U; }; struct AssignAnalyzeEffectManyBattlesManyInputs : Assign { - static constexpr types::entityIndex MAX_INPUTS = 1U << 13U; + static constexpr types::entityIndex MAX_INPUTS = 1U << 15U; }; }; } // namespace diff --git a/benchmarks/VerticalSlices.cpp b/benchmarks/VerticalSlices.cpp index 8e562f7..a81ef7e 100644 --- a/benchmarks/VerticalSlices.cpp +++ b/benchmarks/VerticalSlices.cpp @@ -154,7 +154,6 @@ struct VerticalSlice { struct AssignAnalyzeEffectSingleBattleInputs : BenchmarkInputHolder { inline static const std::vector TAGS = {"AnalyzeEffect", "VerticalSlice1"}; - static constexpr types::entityIndex MAX_INPUTS = 1U << 14U; static void run(types::rngState&, types::entityIndex inputCount, Simulation& simulation, Pokedex& pokedex) { static BattleCreationInfo battleCreationInfo = createSingleBattleTeam(pokedex); pokedex.loadForBattleInfo({battleCreationInfo}); @@ -181,8 +180,11 @@ BENCHMARK_CASE( BENCHMARK_CASE( CreatePokedex, CreateDoubleBattleSimulation, ChooseMonteCarloOptions, VerticalSlice::AssignSimulateTurnDoubleBattleInputs) +struct ChooseRandomDoublesBranchingOptions : ChooseRandomBranchingOptions { + static constexpr types::entityIndex MAX_INPUTS = 1U << 13U; +}; BENCHMARK_CASE( - CreatePokedex, CreateDoubleBattleSimulation, ChooseRandomBranchingOptions, + CreatePokedex, CreateDoubleBattleSimulation, ChooseRandomDoublesBranchingOptions, VerticalSlice::AssignSimulateTurnDoubleBattleInputs) BENCHMARK_CASE( diff --git a/extras/PokeSim.cpp b/extras/PokeSim.cpp index f1b1b72..66bbcec 100644 --- a/extras/PokeSim.cpp +++ b/extras/PokeSim.cpp @@ -33,7 +33,6 @@ * src/Battle/Side/ManageSideState.cpp * src/Battle/Setup/SideStateSetup.cpp * src/Battle/Setup/PokemonStateSetup.cpp - * src/Battle/Setup/MoveStateSetup.cpp * src/Battle/Setup/EmplaceTagFromEnum.cpp * src/Battle/Setup/BattleStateSetup.cpp * src/Battle/Pokemon/ManagePokemonState.cpp @@ -400,20 +399,7 @@ void checkPokemon(types::entity pokemonEntity, const types::registry& registry) if (effectiveSpd) check(*effectiveSpd); if (effectiveSpe) check(*effectiveSpe); - checkBounds(moveSlots.val.size()); -} - -void checkMoveSlot(types::entity moveSlotEntity, const types::registry& registry) { - types::registry::checkEntity(moveSlotEntity, registry); - POKESIM_REQUIRE_NM(has(moveSlotEntity, registry)); - POKESIM_REQUIRE_NM(has(moveSlotEntity, registry)); - POKESIM_REQUIRE_NM(has(moveSlotEntity, registry)); - - const auto& [move, pp, maxPp] = registry.get(moveSlotEntity); - - check(move); - check(pp); - check(maxPp); + check(moveSlots); } void checkActionMove(types::entity moveEntity, const types::registry& registry) { @@ -684,6 +670,16 @@ void check(const calc_damage::Power& power) { checkBounds(power.val); } +template <> +void check(const ChoiceLock& choiceLock) { + POKESIM_REQUIRE_NM(choiceLock.val < Constants::MoveSlots::MAX); +} + +template <> +void check(const CurrentActionMoveSlot& currentActionMoveSlot) { + POKESIM_REQUIRE_NM(currentActionMoveSlot.val < Constants::MoveSlots::MAX); +} + template <> void check(const Damage& damage) { POKESIM_REQUIRE_NM(damage.val <= Constants::Damage::MAX); @@ -703,6 +699,14 @@ void check(const DamageRolls& damageRolls) { } } +template <> +void check(const DisabledMoveSlots& disabledMoveSlots) { + checkBounds(disabledMoveSlots.val.size()); + POKESIM_REQUIRE( + listContains(disabledMoveSlots.val, true), + "The component should be removed if no moves are disabled."); +} + template <> void check(const Evs& evs) { checkEv(evs.hp); @@ -743,11 +747,6 @@ void check(const ParentEntity& parentEntity, const types::registry& registry) { types::registry::checkEntity(parentEntity.val, registry); } -template <> -void check(const ChoiceLock& choiceLock, const types::registry& registry) { - checkMoveSlot(choiceLock.val, registry); -} - template <> void check(const CurrentAction& currentAction, const types::registry& registry) { checkAction(currentAction.val, registry); @@ -797,11 +796,6 @@ void check(const CurrentActionMovesAsTarget& moves, const types::registry& regis } } -template <> -void check(const CurrentActionMoveSlot& move, const types::registry& registry) { - checkMoveSlot(move.val, registry); -} - template <> void check(const CurrentEffectSource& source, const types::registry& registry) { checkPokemon(source.val, registry); @@ -840,19 +834,6 @@ void check(const FoeSide& foeSide, const types::registry& registry) { checkSide(foeSide.val, registry); } -template <> -void check(const LastUsedMove& lastUsedMove, const types::registry& registry) { - checkMoveSlot(lastUsedMove.val, registry); -} - -template <> -void check(const MoveSlots& moveSlots, const types::registry& registry) { - checkBounds(moveSlots.val.size()); - for (types::entity moveEntity : moveSlots.val) { - checkMoveSlot(moveEntity, registry); - } -} - template <> void check(const Pokemon& pokemon, const types::registry& registry) { checkPokemon(pokemon.val, registry); @@ -890,11 +871,31 @@ void check(const HitCount& hitCount) { checkBounds(hitCount.val); } +template <> +void check(const LastUsedMove& lastUsedMove) { + POKESIM_REQUIRE_NM(lastUsedMove.val < Constants::MoveSlots::MAX); +} + template <> void check(const Level& level) { checkBounds(level.val); } +template <> +void check(const MoveSlot& moveSlot) { + check(MoveName{moveSlot.move}); + check(Pp{moveSlot.pp}); + checkBounds(moveSlot.maxPp); +} + +template <> +void check(const MoveSlots& moveSlots) { + checkBounds(moveSlots.val.size()); + for (MoveSlot moveSlot : moveSlots.val) { + check(moveSlot); + } +} + template <> void check(const AbilityName& abilityName) { POKESIM_REQUIRE_NM(abilityName.val != dex::Ability::NO_ABILITY); @@ -1000,16 +1001,6 @@ void check(const WeatherName& weatherName) { POKESIM_REQUIRE_NM((std::underlying_type_t)weatherName.val <= dex::TOTAL_WEATHER_COUNT); } -template <> -void check(const Pp& pp) { - checkBounds(pp.val); -} - -template <> -void check(const MaxPp& maxPp) { - checkBounds(maxPp.val); -} - template <> void check(const PlayerSide& playerSide) { checkPlayerSideId(playerSide.val); @@ -1040,6 +1031,11 @@ void check(const BaseStats& baseStats) { checkBaseStat(baseStats.spe); } +template <> +void check(const Pp& pp) { + checkBounds(pp.val); +} + template <> void check(const Position& position) { checkBounds(position.val); @@ -1473,27 +1469,6 @@ void setPokemonCurrentBoosts(const PokemonCreationInfo& pokemonInfo, PokemonStat } } // namespace -types::entityVector Simulation::createInitialMoves(const std::vector& moveInfoList) { - types::entityVector moveEntities{}; - moveEntities.reserve((types::entityVector::size_type)moveInfoList.size()); - - for (const MoveCreationInfo& moveInfo : moveInfoList) { - MoveStateSetup moveSetup(registry); - moveSetup.setName(moveInfo.name); - types::pp maxPp = Constants::MoveMaxPp::DEFAULT; - if (!moveInfo.pp.has_value() || !moveInfo.maxPp.has_value()) { - maxPp = pokedex().getMoveData(moveInfo.name).val; - } - maxPp = moveInfo.maxPp.value_or(maxPp); - - moveSetup.setPP(moveInfo.pp.value_or(maxPp)); - moveSetup.setMaxPP(maxPp); - moveEntities.push_back(moveSetup.entity()); - } - - return moveEntities; -} - PokemonStateSetup Simulation::createInitialPokemon(const PokemonCreationInfo& pokemonInfo) { PokemonStateSetup pokemonSetup(registry); if (pokemonInfo.id.has_value()) { @@ -1565,19 +1540,18 @@ void Simulation::createInitialSide( pokemonSetup.setProperty(); } - types::entityVector moveEntities = createInitialMoves(pokemonInfo.moves); + std::vector moveSlots; + for (const MoveCreationInfo& moveInfo : pokemonInfo.moves) { + types::pp maxPp = Constants::MoveMaxPp::DEFAULT; + if (!moveInfo.pp.has_value() || !moveInfo.maxPp.has_value()) { + maxPp = pokedex().getMoveData(moveInfo.name).val; + } + maxPp = moveInfo.maxPp.value_or(maxPp); - if (battleInfo.runWithSimulateTurn) { - registry.insert(moveEntities.begin(), moveEntities.end()); - } - if (battleInfo.runWithCalculateDamage) { - registry.insert(moveEntities.begin(), moveEntities.end()); - } - if (battleInfo.runWithAnalyzeEffect) { - registry.insert(moveEntities.begin(), moveEntities.end()); + moveSlots.push_back({moveInfo.name, moveInfo.pp.value_or(maxPp), maxPp}); } - pokemonSetup.setMoves(moveEntities); + pokemonSetup.setMoves(moveSlots); pokemonSetupList.push_back(pokemonSetup); } @@ -2425,8 +2399,8 @@ void runMoveAction(Simulation& simulation) { runBeforeMove(simulation); - simulation.view>(); simulation.view(); + simulation.view>(); useMove(simulation); } @@ -2533,16 +2507,12 @@ void incrementTurn(Turn& turn) { turn.val++; } -void updateActivePokemonPostTurn(types::registry& registry, const pokesim::MoveSlots& moveSlots) { - registry.remove(moveSlots.val.begin(), moveSlots.val.end()); -} - void nextTurn(Simulation& simulation) { getBattleFilter(simulation).view(); pokesim::internal::EntityFilter pokemonFilter{simulation}; if (!pokemonFilter.hasNoneSelected()) { - pokemonFilter.view(); + simulation.removeFromEntities(); pokemonFilter.addToSelected(); runDisableMove(simulation); @@ -4437,16 +4407,12 @@ void choiceLockRemoveWithItem( } void choiceLockOnDisableMove( - types::registry& registry, const pokesim::ChoiceLock& choiceLocked, const MoveSlots& moveSlots) { - POKESIM_REQUIRE( - std::find(moveSlots.val.begin(), moveSlots.val.end(), choiceLocked.val) != moveSlots.val.end(), - "Should skip if the move is no longer present, but when does that happen?"); - - for (types::entity entity : moveSlots.val) { - if (entity != choiceLocked.val) { - registry.emplace(entity); - } + types::handle handle, const pokesim::ChoiceLock& choiceLocked, const MoveSlots& moveSlots) { + if (!handle.all_of()) { + handle.emplace(types::moveSlots(moveSlots.val.size(), false)); } + + handle.get().val[choiceLocked.val] = true; } } // namespace @@ -5225,13 +5191,14 @@ void PokemonStateSetup::setItem(dex::Item item) { item::tags::emplaceTagFromEnum(item, handle); } -void PokemonStateSetup::setMoves(const std::vector& moveSlots) { - MoveSlots& moveEntities = handle.emplace(); +void PokemonStateSetup::setMoves(const std::vector& moveSlots) { + MoveSlots& newMoveSlots = handle.emplace(); POKESIM_REQUIRE( - moveSlots.size() <= moveEntities.val.max_size(), + moveSlots.size() <= newMoveSlots.val.max_size(), "Cannot add more moves to a Pokemon than MAX_MOVE_SLOTS."); - for (types::entity moveSlot : moveSlots) { - moveEntities.val.push_back(moveSlot); + + for (MoveSlot moveSlot : moveSlots) { + newMoveSlots.val.push_back(moveSlot); } } @@ -5270,30 +5237,6 @@ void PokemonStateSetup::setIVs(const Ivs& ivs) { //////////////// END OF src/Battle/Setup/PokemonStateSetup.cpp ///////////////// -///////////////// START OF src/Battle/Setup/MoveStateSetup.cpp ///////////////// - -namespace pokesim { -void MoveStateSetup::initBlank() { - handle.emplace(); - handle.emplace(); - handle.emplace(); -} - -void MoveStateSetup::setName(dex::Move moveName) { - handle.emplace(moveName); -} - -void MoveStateSetup::setPP(types::pp pp) { - handle.emplace(pp); -} - -void MoveStateSetup::setMaxPP(types::pp maxPp) { - handle.emplace(maxPp); -} -} // namespace pokesim - -////////////////// END OF src/Battle/Setup/MoveStateSetup.cpp ////////////////// - /////////////// START OF src/Battle/Setup/EmplaceTagFromEnum.cpp /////////////// namespace pokesim { @@ -5625,9 +5568,13 @@ void clearVolatiles(types::handle pokemonHandle) { pokemonHandle.remove(); } -void deductPp(Pp& pp) { - if (pp.val) { - pp.val -= 1U; // TODO(aed3): Make this into a mechanic constant +void deductPp(types::handle handle, MoveSlots& moveSlots, LastUsedMove lastUsedMove) { + MoveSlot& moveSlot = moveSlots.val[lastUsedMove.val]; + if (moveSlot.pp >= Constants::PP_USE_DEDUCTION) { + moveSlot.pp -= Constants::PP_USE_DEDUCTION; + } + else { + moveSlot.pp = 0U; } } @@ -5879,9 +5826,8 @@ void setCurrentActionMove( createActionMoveForTarget({registry, target}, battleHandle.entity(), source.val, move.val, pokedex); } - types::entity moveSlotEntity = moveToEntity(registry, moveSlots, move.val); - battleHandle.emplace(moveSlotEntity); - registry.emplace(moveSlotEntity); + types::moveSlotIndex moveSlotIndex = moveToMoveSlot(moveSlots, move.val); + battleHandle.emplace(moveSlotIndex); } void setFailedActionMove( @@ -5905,9 +5851,7 @@ void setFailedActionMove( registry.emplace(battle.val, target.val); } - types::entity moveSlotEntity = registry.get(battle.val).val; registry.erase(battle.val); - registry.erase(moveSlotEntity); updateCurrentActionTargets(registry, registry.get(battle.val)); } @@ -6036,15 +5980,15 @@ types::entity slotToAllyPokemonEntity(const types::registry& registry, const Sid return allyEntity; } -types::entity moveToEntity(const types::registry& registry, const MoveSlots& moveSlots, dex::Move move) { - for (types::entity moveSlot : moveSlots.val) { - if (registry.get(moveSlot).val == move) { - return moveSlot; +types::moveSlotIndex moveToMoveSlot(const MoveSlots& moveSlots, dex::Move move) { + for (types::moveSlotIndex i = 0; i < moveSlots.val.size(); i++) { + if (moveSlots.val[i].move == move) { + return i; } } - POKESIM_REQUIRE_FAIL("No move of entity found."); - return entt::null; + POKESIM_REQUIRE_FAIL("No move found."); + return 0U; } types::entity createActionMoveForTarget( @@ -6162,11 +6106,7 @@ void traversePokemon(types::registry& registry, VisitEntity visitEntity = nullpt const static bool ForCloning = !std::is_same_v; using Tag = std::conditional_t; - for (const auto [entity, moveSlots] : registry.view().each()) { - for (auto move : moveSlots.val) { - registry.emplace(move); - } - + for (types::entity entity : registry.view()) { if constexpr (ForCloning) { visitEntity(entity); } @@ -6177,6 +6117,7 @@ void traversePokemon(types::registry& registry, VisitEntity visitEntity = nullpt registry.emplace_or_replace(move); } } + for (const auto [entity, moves] : registry.view().each()) { for (types::entity move : moves.val) { registry.emplace_or_replace(move); @@ -6184,18 +6125,6 @@ void traversePokemon(types::registry& registry, VisitEntity visitEntity = nullpt } } -template -void traverseMove(types::registry& registry, VisitEntity visitEntity = nullptr) { - const static bool ForCloning = !std::is_same_v; - using Tag = std::conditional_t; - - if constexpr (ForCloning) { - for (types::entity entity : registry.view()) { - visitEntity(entity); - } - } -} - void cloneBattle( types::registry& registry, types::ClonedEntityMap& entityMap, entt::dense_map& srcEntityStorages, types::entityIndex cloneCount) { @@ -6236,14 +6165,6 @@ void clonePokemon( }); } -void cloneMove( - types::registry& registry, types::ClonedEntityMap& entityMap, - entt::dense_map& srcEntityStorages, types::entityIndex cloneCount) { - traverseMove(registry, [&](types::entity entity) { - cloneEntity(entity, registry, entityMap, srcEntityStorages, cloneCount); - }); -} - void deleteBattle(types::registry& registry) { traverseBattle(registry); } @@ -6264,10 +6185,6 @@ void deletePokemon(types::registry& registry) { traversePokemon(registry); } -void deleteMove(types::registry& registry) { - traverseMove(registry); -} - void remapEntity(types::entity& entity, const CloneTo& cloneTo, const types::ClonedEntityMap& entityMap) { POKESIM_REQUIRE(entityMap.contains(entity), "Source node was not loaded into the map."); POKESIM_REQUIRE( @@ -6318,7 +6235,6 @@ types::ClonedEntityMap clone(types::registry& registry, std::optional(registry, entityMap); - remapComponentEntities(registry, entityMap); remapComponentEntities(registry, entityMap); remapComponentEntities(registry, entityMap); remapComponentEntities(registry, entityMap); - remapComponentEntities(registry, entityMap); remapComponentEntities(registry, entityMap); remapComponentEntities(registry, entityMap); remapComponentEntities(registry, entityMap); @@ -6364,8 +6278,6 @@ types::ClonedEntityMap clone(types::registry& registry, std::optional(registry, entityMap); remapComponentEntities(registry, entityMap); remapComponentEntities(registry, entityMap); - remapComponentEntities(registry, entityMap); - remapComponentEntities(registry, entityMap); remapComponentEntities(registry, entityMap); remapComponentEntities(registry, entityMap); remapComponentEntities(registry, entityMap); @@ -6395,7 +6307,6 @@ void deleteClones(types::registry& registry) { deleteAction(registry); deletePokemon(registry); deleteCurrentActionMove(registry); - deleteMove(registry); auto remove = registry.view(); registry.destroy(remove.begin(), remove.end()); } diff --git a/extras/PokeSim.hpp b/extras/PokeSim.hpp index c97191d..2cf8b58 100644 --- a/extras/PokeSim.hpp +++ b/extras/PokeSim.hpp @@ -109,13 +109,13 @@ * src/Components/CalcDamage/DamageRollSides.hpp * src/Components/CalcDamage/ModifyingEventRanTags.hpp * src/Components/CalcDamage/TemporaryMoveProperties.hpp + * src/Components/ChoiceLock.hpp * src/Components/CloneFromCloneTo.hpp + * src/Components/Current.hpp + * src/Components/DisabledMoveSlots.hpp * src/Components/EVsIVs.hpp - * src/Components/EntityHolders/ChoiceLock.hpp * src/Components/EntityHolders/FaintQueue.hpp * src/Components/EntityHolders/FoeSide.hpp - * src/Components/EntityHolders/LastUsedMove.hpp - * src/Components/EntityHolders/MoveSlots.hpp * src/Components/EntityHolders/Pokemon.hpp * src/Components/EntityHolders/RecycledEntities.hpp * src/Components/EntityHolders/Side.hpp @@ -124,7 +124,9 @@ * src/Components/EventModifier.hpp * src/Components/HitCount.hpp * src/Components/ID.hpp + * src/Components/LastUsedMove.hpp * src/Components/Level.hpp + * src/Components/MoveSlots.hpp * src/Types/Enums/Ability.hpp * src/Components/Names/AbilityNames.hpp * src/Types/Enums/Gender.hpp @@ -139,11 +141,11 @@ * src/Components/Names/TargetSlotName.hpp * src/Types/Enums/Type.hpp * src/Components/Names/TypeNames.hpp - * src/Components/PP.hpp * src/Types/Enums/PlayerSideId.hpp * src/Components/PlayerSide.hpp * src/Components/Pokedex/Abilities.hpp * src/Components/Pokedex/BaseStats.hpp + * src/Components/Pokedex/PP.hpp * src/Components/Position.hpp * src/Components/Priority.hpp * src/Components/Probability.hpp @@ -191,7 +193,6 @@ * src/Battle/Setup/PokemonStateSetup.hpp * src/Battle/Setup/BattleStateSetup.hpp * src/Battle/Setup/EmplaceTagFromEnum.hpp - * src/Battle/Setup/MoveStateSetup.hpp * src/Battle/Setup/SideStateSetup.hpp * src/CalcDamage/Setup/CalcDamageInputSetup.hpp * src/Pokedex/TypeChart.hpp @@ -17184,6 +17185,8 @@ struct Constants { static constexpr std::uint8_t SIDE_COUNT = 2U; + static constexpr std::uint8_t PP_USE_DEDUCTION = 1U; + struct PokemonLevel { static constexpr std::uint8_t MAX = 100U; static constexpr std::uint8_t MIN = 1U; @@ -17407,6 +17410,12 @@ class fixedMemoryVector : private std::array { "A std::vector for this type and size would be smaller."); } + fixedMemoryVector(std::uint8_t size, const T& value) : fixedMemoryVector() { + for (std::uint8_t i = 0; i < size; i++) { + push_back(value); + } + } + fixedMemoryVector(std::initializer_list list) : fixedMemoryVector() { for (const T& item : list) { push_back(item); @@ -18600,10 +18609,6 @@ struct CurrentActionMovesAsTarget { types::entityVector val{}; }; -struct CurrentActionMoveSlot { - types::entity val{}; -}; - struct CurrentEffectSource { types::entity val{}; }; @@ -18888,6 +18893,16 @@ struct IgnoresDefendingBoost {}; ///////// END OF src/Components/CalcDamage/TemporaryMoveProperties.hpp ///////// +//////////////////// START OF src/Components/ChoiceLock.hpp //////////////////// + +namespace pokesim { +struct ChoiceLock { + types::moveSlotIndex val{}; +}; +} // namespace pokesim + +///////////////////// END OF src/Components/ChoiceLock.hpp ///////////////////// + ///////////////// START OF src/Components/CloneFromCloneTo.hpp ///////////////// namespace pokesim { @@ -18903,6 +18918,27 @@ struct CloneTo { ////////////////// END OF src/Components/CloneFromCloneTo.hpp ////////////////// +///////////////////// START OF src/Components/Current.hpp ////////////////////// + +namespace pokesim { +struct CurrentActionMoveSlot { + types::moveSlotIndex val{}; +}; + +} // namespace pokesim + +////////////////////// END OF src/Components/Current.hpp /////////////////////// + +//////////////// START OF src/Components/DisabledMoveSlots.hpp ///////////////// + +namespace pokesim { +struct DisabledMoveSlots { + types::moveSlots val{}; +}; +} // namespace pokesim + +///////////////// END OF src/Components/DisabledMoveSlots.hpp ////////////////// + ////////////////////// START OF src/Components/EVsIVs.hpp ////////////////////// namespace pokesim { @@ -18937,16 +18973,6 @@ struct Ivs { /////////////////////// END OF src/Components/EVsIVs.hpp /////////////////////// -///////////// START OF src/Components/EntityHolders/ChoiceLock.hpp ///////////// - -namespace pokesim { -struct ChoiceLock { - types::entity val{}; -}; -} // namespace pokesim - -////////////// END OF src/Components/EntityHolders/ChoiceLock.hpp ////////////// - ///////////// START OF src/Components/EntityHolders/FaintQueue.hpp ///////////// namespace pokesim { @@ -18969,27 +18995,6 @@ struct FoeSide { /////////////// END OF src/Components/EntityHolders/FoeSide.hpp //////////////// -//////////// START OF src/Components/EntityHolders/LastUsedMove.hpp //////////// - -namespace pokesim { -struct LastUsedMove { - types::entity val{}; -}; -} // namespace pokesim - -///////////// END OF src/Components/EntityHolders/LastUsedMove.hpp ///////////// - -///////////// START OF src/Components/EntityHolders/MoveSlots.hpp ////////////// - -namespace pokesim { -// Contains a list of entities of the moves a Pokemon known. -struct MoveSlots { - types::moveSlots val{}; -}; -} // namespace pokesim - -////////////// END OF src/Components/EntityHolders/MoveSlots.hpp /////////////// - ////////////// START OF src/Components/EntityHolders/Pokemon.hpp /////////////// namespace pokesim { @@ -19074,6 +19079,16 @@ struct Id { ///////////////////////// END OF src/Components/ID.hpp ///////////////////////// +/////////////////// START OF src/Components/LastUsedMove.hpp /////////////////// + +namespace pokesim { +struct LastUsedMove { + types::moveSlotIndex val{}; +}; +} // namespace pokesim + +//////////////////// END OF src/Components/LastUsedMove.hpp //////////////////// + ////////////////////// START OF src/Components/Level.hpp /////////////////////// namespace pokesim { @@ -19085,6 +19100,26 @@ struct Level { /////////////////////// END OF src/Components/Level.hpp //////////////////////// +//////////////////// START OF src/Components/MoveSlots.hpp ///////////////////// + +namespace pokesim { +struct MoveSlot { + dex::Move move = dex::Move::NO_MOVE; + types::pp pp = Constants::MovePp::DEFAULT; + types::pp maxPp = Constants::MovePp::DEFAULT; + + constexpr bool operator==(const MoveSlot& other) const { + return move == other.move && pp == other.pp && maxPp == other.maxPp; + } +}; + +struct MoveSlots { + types::moveSlots val{}; +}; +} // namespace pokesim + +///////////////////// END OF src/Components/MoveSlots.hpp ////////////////////// + ///////////////////// START OF src/Types/Enums/Ability.hpp ///////////////////// namespace pokesim::dex { @@ -19285,20 +19320,6 @@ struct TypeName { ////////////////// END OF src/Components/Names/TypeNames.hpp /////////////////// -//////////////////////// START OF src/Components/PP.hpp //////////////////////// - -namespace pokesim { -struct Pp { - types::pp val = Constants::MovePp::DEFAULT; -}; - -struct MaxPp { - types::pp val = Constants::MoveMaxPp::DEFAULT; -}; -} // namespace pokesim - -///////////////////////// END OF src/Components/PP.hpp ///////////////////////// - ////////////////// START OF src/Types/Enums/PlayerSideId.hpp /////////////////// namespace pokesim { @@ -19360,6 +19381,16 @@ struct BaseStats { ///////////////// END OF src/Components/Pokedex/BaseStats.hpp ////////////////// +//////////////////// START OF src/Components/Pokedex/PP.hpp //////////////////// + +namespace pokesim { +struct Pp { + types::pp val = Constants::MovePp::DEFAULT; +}; +} // namespace pokesim + +///////////////////// END OF src/Components/Pokedex/PP.hpp ///////////////////// + ///////////////////// START OF src/Components/Position.hpp ///////////////////// namespace pokesim { @@ -19832,8 +19863,6 @@ struct Punch {}; struct VariableHitCount {}; // Move Property Tag: A multi-hit move where each hit checks accuracy (i.e. Triple Kick) struct AccuracyDependentHitCount {}; - -struct Disabled {}; } // namespace tags namespace effect::tags { @@ -20399,17 +20428,19 @@ struct DefBoost; struct SpaBoost; struct SpdBoost; struct SpeBoost; +struct ChoiceLock; struct CloneTo; +struct CurrentActionMoveSlot; struct Damage; struct DamageRollModifiers; struct DamageRolls; +struct DisabledMoveSlots; struct Evs; struct Ivs; struct Battle; struct ParentBattle; struct RootBattle; struct ParentEntity; -struct ChoiceLock; struct CurrentAction; struct CurrentActionTargets; struct CurrentActionSource; @@ -20418,15 +20449,12 @@ struct FailedCurrentActionSource; struct FailedCurrentActionTarget; struct CurrentActionMovesAsSource; struct CurrentActionMovesAsTarget; -struct CurrentActionMoveSlot; struct CurrentEffectSource; struct CurrentEffectTarget; struct CurrentEffectsAsSource; struct CurrentEffectsAsTarget; struct FaintQueue; struct FoeSide; -struct LastUsedMove; -struct MoveSlots; struct Pokemon; struct RecycledAction; struct Side; @@ -20435,7 +20463,10 @@ struct Team; struct EventModifier; struct HitCount; struct Id; +struct LastUsedMove; struct Level; +struct MoveSlot; +struct MoveSlots; struct AbilityName; struct GenderName; struct ItemName; @@ -20452,13 +20483,12 @@ struct TerrainName; struct TypeName; struct VolatileName; struct WeatherName; -struct Pp; -struct MaxPp; struct PlayerSide; struct PrimaryAbility; struct SecondaryAbility; struct HiddenAbility; struct BaseStats; +struct Pp; struct Position; struct MovePriority; struct Probability; @@ -20534,7 +20564,6 @@ void check(const T&) {} void checkBattle(types::entity, const types::registry&); void checkSide(types::entity, const types::registry&); void checkPokemon(types::entity, const types::registry&); -void checkMoveSlot(types::entity, const types::registry&); void checkActionMove(types::entity, const types::registry&); void checkPercentChance(types::percentChance); @@ -20613,8 +20642,14 @@ void check(const calc_damage::RealEffectiveStat&); template <> void check(const calc_damage::Power&); +template <> +void check(const ChoiceLock&); + // template <> void check(const CloneTo&); +template <> +void check(const CurrentActionMoveSlot&); + template <> void check(const Damage&); @@ -20624,6 +20659,9 @@ void check(const DamageRollModifiers&); template <> void check(const DamageRolls&); +template <> +void check(const DisabledMoveSlots&); + template <> void check(const Evs&); @@ -20642,9 +20680,6 @@ void check(const RootBattle&, const types::registry&); template <> void check(const ParentEntity&, const types::registry&); -template <> -void check(const ChoiceLock&, const types::registry&); - template <> void check(const CurrentAction&, const types::registry&); @@ -20669,9 +20704,6 @@ void check(const CurrentActionMovesAsSource&, const types::registry&); template <> void check(const CurrentActionMovesAsTarget&, const types::registry&); -template <> -void check(const CurrentActionMoveSlot&, const types::registry&); - template <> void check(const CurrentEffectSource&, const types::registry&); @@ -20690,12 +20722,6 @@ void check(const FaintQueue&, const types::registry&); template <> void check(const FoeSide&, const types::registry&); -template <> -void check(const LastUsedMove&, const types::registry&); - -template <> -void check(const MoveSlots&, const types::registry&); - template <> void check(const Pokemon&, const types::registry&); @@ -20718,9 +20744,18 @@ void check(const HitCount&); // template <> void check(const Id&); +template <> +void check(const LastUsedMove&); + template <> void check(const Level&); +template <> +void check(const MoveSlot&); + +template <> +void check(const MoveSlots&); + template <> void check(const AbilityName&); @@ -20769,12 +20804,6 @@ void check(const VolatileName&); template <> void check(const WeatherName&); -template <> -void check(const Pp&); - -template <> -void check(const MaxPp&); - template <> void check(const PlayerSide&); @@ -20790,6 +20819,9 @@ void check(const HiddenAbility&); template <> void check(const BaseStats&); +template <> +void check(const Pp&); + template <> void check(const Position&); @@ -21353,7 +21385,7 @@ types::entity slotToSideEntity(const Sides& sides, Slot targetSlot); types::entity slotToPokemonEntity(const types::registry& registry, types::entity sideEntity, Slot targetSlot); types::entity slotToPokemonEntity(const types::registry& registry, const Sides& sides, Slot targetSlot); types::entity slotToAllyPokemonEntity(const types::registry& registry, const Sides& sides, Slot targetSlot); -types::entity moveToEntity(const types::registry& registry, const MoveSlots& moveSlots, dex::Move move); +types::moveSlotIndex moveToMoveSlot(const MoveSlots& moveSlots, dex::Move move); types::entity createActionMoveForTarget( types::handle targetHandle, types::entity battleEntity, types::entity sourceEntity, dex::Move move, @@ -21397,6 +21429,11 @@ struct StateSetupBase { /////////////// START OF src/Battle/Setup/PokemonStateSetup.hpp //////////////// namespace pokesim { +struct Evs; +struct Ivs; +struct SpeciesTypes; +struct MoveSlot; + // Tool to set properties of a Pokemon's state to an entity. struct PokemonStateSetup : internal::StateSetupBase { PokemonStateSetup() : internal::StateSetupBase() {} @@ -21426,7 +21463,7 @@ struct PokemonStateSetup : internal::StateSetupBase { void setGender(dex::Gender gender); void setAbility(dex::Ability ability); void setItem(dex::Item item); - void setMoves(const std::vector& moveSlots); + void setMoves(const std::vector& moveSlots); void setPostion(types::teamPositionIndex position); void setStatus(dex::Status status); @@ -21540,30 +21577,6 @@ void emplaceTagFromEnum(dex::Move move, types::handle handle); //////////////// END OF src/Battle/Setup/EmplaceTagFromEnum.hpp //////////////// -///////////////// START OF src/Battle/Setup/MoveStateSetup.hpp ///////////////// - -namespace pokesim { -// Tool to set properties of a move's state to an entity. -struct MoveStateSetup : internal::StateSetupBase { - MoveStateSetup() : internal::StateSetupBase() {} - MoveStateSetup(types::registry& registry) : MoveStateSetup(registry, registry.create()) {} - MoveStateSetup(types::registry& registry, types::entity entity) : StateSetupBase(registry, entity) {} - - /** - * @brief Applies the defaults to the required properties for a move state. - * - * Some of the required properties are a blank `MoveName`, `Pp`, and `MaxPp` component. - */ - void initBlank(); - - void setName(dex::Move moveName); - void setPP(types::pp pp); - void setMaxPP(types::pp maxPp); -}; -} // namespace pokesim - -////////////////// END OF src/Battle/Setup/MoveStateSetup.hpp ////////////////// - ///////////////// START OF src/Battle/Setup/SideStateSetup.hpp ///////////////// namespace pokesim { @@ -22540,7 +22553,6 @@ struct SimulationSetupChecks; */ class Simulation { private: - types::entityVector createInitialMoves(const std::vector& moveInfoList); PokemonStateSetup createInitialPokemon(const PokemonCreationInfo& pokemonInfo); void createInitialSide( SideStateSetup sideSetup, const SideCreationInfo& sideInfo, const BattleCreationInfo& battleInfo); @@ -22733,7 +22745,6 @@ struct Checks { return finalEntityCount; } - void checkMoveSlot(types::entity moveEntity) const { pokesim::debug::checkMoveSlot(moveEntity, *registry); } void checkPokemon(types::entity pokemonEntity) const { pokesim::debug::checkPokemon(pokemonEntity, *registry); } void checkSide(types::entity sideEntity) const { pokesim::debug::checkSide(sideEntity, *registry); } void checkBattle(types::entity battleEntity) const { pokesim::debug::checkBattle(battleEntity, *registry); } @@ -22965,18 +22976,15 @@ struct SimulationSetupChecks { POKESIM_REQUIRE_NM(moveSlots.val.size() == creationInfo.moves.size()); for (std::size_t i = 0U; i < creationInfo.moves.size(); i++) { - const MoveCreationInfo& move = creationInfo.moves[i]; - types::entity moveEntity = moveSlots.val[(types::moveSlotIndex)i]; - POKESIM_REQUIRE_NM(registry->all_of(moveEntity)); - POKESIM_REQUIRE_NM(registry->all_of(moveEntity)); - POKESIM_REQUIRE_NM(registry->all_of(moveEntity)); - POKESIM_REQUIRE_NM(registry->get(moveEntity).val == move.name); + const MoveCreationInfo& moveInfo = creationInfo.moves[i]; + MoveSlot moveSlot = moveSlots.val[(types::moveSlotIndex)i]; + types::pp idealMaxPp = moveInfo.maxPp.value_or(pokedex->getMoveData(moveInfo.name).val); + types::pp idealPp = moveInfo.pp.value_or(idealMaxPp); - types::pp idealMaxPp = move.maxPp.value_or(pokedex->getMoveData(move.name).val); - types::pp idealPp = move.pp.value_or(idealMaxPp); - POKESIM_REQUIRE_NM(registry->get(moveEntity).val == idealPp); - POKESIM_REQUIRE_NM(registry->get(moveEntity).val == idealMaxPp); - pokesim::debug::checkMoveSlot(moveEntity, *registry); + POKESIM_REQUIRE_NM(moveSlot.move == moveInfo.name); + POKESIM_REQUIRE_NM(moveSlot.pp == idealPp); + POKESIM_REQUIRE_NM(moveSlot.maxPp == idealMaxPp); + pokesim::debug::check(moveSlot); } if (creationInfo.currentHp.has_value()) { @@ -23402,7 +23410,8 @@ struct CurrentActionSource; struct CurrentActionTarget; struct CurrentActionMoveSlot; struct Damage; -struct Pp; +struct LastUsedMove; +struct MoveSlots; namespace stat { struct Atk; @@ -23427,7 +23436,7 @@ void clearStatus(types::handle pokemonHandle); void clearVolatiles(types::handle pokemonHandle); -void deductPp(Pp& pp); +void deductPp(types::handle handle, MoveSlots& moveSlots, LastUsedMove lastUsedMove); void setLastMoveUsed(types::registry& registry, CurrentActionSource source, const CurrentActionMoveSlot& move); void resetEffectiveAtk(types::handle handle, stat::Atk atk); void resetEffectiveDef(types::handle handle, stat::Def def); @@ -24575,9 +24584,6 @@ struct Checks : pokesim::debug::Checks { checkSide(sideEntity); for (types::entity pokemonEntity : registry->get(sideEntity).val) { checkPokemon(pokemonEntity); - for (types::entity moveEntity : registry->get(pokemonEntity).val) { - checkMoveSlot(moveEntity); - } } } } diff --git a/extras/RecentBenchmarkResults.md b/extras/RecentBenchmarkResults.md index 6174da6..e0923e8 100644 --- a/extras/RecentBenchmarkResults.md +++ b/extras/RecentBenchmarkResults.md @@ -7,286 +7,311 @@ ## SV-SingleBattle-MonteCarlo-SimulateTurn-VerticalSlice1 | Inputs | Samples | Iterations / Sample | Estimated Completion Time | Mean of Samples | Standard Deviation | Mean / Input Count | Mean Lower Bound / Input Count | Mean Upper Bound / Input Count | | --- | --- | --- | --- | --- | --- | --- | --- | --- | -| 1 | 100 | 1 | 43.036200ms | 62.889530us | 12.403818us | 62.889530us | 61.373210us | 67.696170us | -| 2 | 100 | 1 | 45.409800ms | 70.657180us | 15.838655us | 35.328590us | 34.392960us | 38.618510us | -| 4 | 100 | 1 | 45.756900ms | 81.255940us | 13.177858us | 20.313985us | 19.925410us | 21.686275us | -| 8 | 100 | 1 | 48.318300ms | 97.743780us | 14.579921us | 12.217973us | 11.965109us | 12.772417us | -| 16 | 100 | 1 | 54.224800ms | 136.766550us | 12.711347us | 8.547909us | 8.433032us | 8.772299us | -| 32 | 100 | 1 | 59.370900ms | 183.914000us | 11.892801us | 5.747312us | 5.692381us | 5.851131us | -| 64 | 100 | 1 | 72.067200ms | 286.457050us | 13.122662us | 4.475891us | 4.446073us | 4.534322us | -| 128 | 100 | 1 | 94.512500ms | 485.950520us | 22.216319us | 3.796488us | 3.771794us | 3.847070us | -| 256 | 100 | 1 | 133.613800ms | 857.680610us | 15.422076us | 3.350315us | 3.341366us | 3.366934us | -| 512 | 100 | 1 | 228.571000ms | 1.617709ms | 24.020018us | 3.159588us | 3.152384us | 3.172014us | -| 1024 | 100 | 1 | 402.123400ms | 3.235419ms | 711.556029us | 3.159589us | 3.086793us | 3.501180us | -| 2048 | 100 | 1 | 762.140600ms | 6.227778ms | 78.084692us | 3.040907us | 3.034186us | 3.049268us | -| 4096 | 100 | 1 | 1486.891200ms | 12.362110ms | 183.011739us | 3.018093us | 3.010493us | 3.028256us | -| 8192 | 100 | 1 | 2605.532300ms | 25.406504ms | 407.273670us | 3.101380us | 3.092766us | 3.112583us | -| 16384 | 100 | 1 | 5230.642200ms | 52.609158ms | 743.212351us | 3.211008us | 3.203707us | 3.222135us | -| 32768 | 100 | 1 | 10825.299900ms | 109.166809ms | 1.155224ms | 3.331507us | 3.325319us | 3.339309us | -| 65536 | 100 | 1 | 25160.138200ms | 226.372002ms | 6.260352ms | 3.454163us | 3.438286us | 3.476467us | +| 1 | 100 | 1 | 42.536700ms | 62.231270us | 11.113151us | 62.231270us | 60.932140us | 66.763930us | +| 2 | 100 | 1 | 43.419400ms | 71.074130us | 12.863451us | 35.537065us | 34.783105us | 38.262205us | +| 4 | 100 | 1 | 45.833100ms | 81.390040us | 15.569806us | 20.347510us | 19.806952us | 21.531792us | +| 8 | 100 | 1 | 46.945300ms | 99.375610us | 19.110356us | 12.421951us | 12.089456us | 13.150538us | +| 16 | 100 | 1 | 51.786800ms | 131.160220us | 14.674538us | 8.197514us | 8.080276us | 8.517334us | +| 32 | 100 | 1 | 57.862900ms | 181.343770us | 13.801070us | 5.666993us | 5.610762us | 5.813761us | +| 64 | 100 | 1 | 69.883500ms | 280.680550us | 13.955913us | 4.385634us | 4.357257us | 4.461054us | +| 128 | 100 | 1 | 91.491700ms | 479.095630us | 16.637239us | 3.742935us | 3.723109us | 3.776863us | +| 256 | 100 | 1 | 104.683300ms | 845.093170us | 20.045639us | 3.301145us | 3.290165us | 3.324612us | +| 512 | 100 | 1 | 167.435600ms | 1.587119ms | 15.056327us | 3.099841us | 3.094350us | 3.105919us | +| 1024 | 100 | 1 | 322.657600ms | 3.091806ms | 45.855768us | 3.019342us | 3.012591us | 3.031477us | +| 2048 | 100 | 1 | 635.560300ms | 6.066456ms | 48.847736us | 2.962137us | 2.957827us | 2.967247us | +| 4096 | 100 | 1 | 1246.255000ms | 12.076220ms | 150.027414us | 2.948296us | 2.941943us | 2.956599us | +| 8192 | 100 | 1 | 2520.486500ms | 24.436971ms | 342.630813us | 2.983029us | 2.976061us | 2.992819us | +| 16384 | 100 | 1 | 5020.253000ms | 50.508387ms | 749.247965us | 3.082787us | 3.074834us | 3.093068us | +| 32768 | 100 | 1 | 10539.320600ms | 105.862918ms | 982.772364us | 3.230680us | 3.225527us | 3.237521us | +| 65536 | 100 | 1 | 21457.442100ms | 215.082182ms | 1.443558ms | 3.281894us | 3.277988us | 3.286691us | ## SV-SingleBattle-Branching-SimulateTurn-VerticalSlice1 | Inputs | Samples | Iterations / Sample | Estimated Completion Time | Mean of Samples | Standard Deviation | Mean / Input Count | Mean Lower Bound / Input Count | Mean Upper Bound / Input Count | | --- | --- | --- | --- | --- | --- | --- | --- | --- | -| 1 | 100 | 1 | 61.803200ms | 192.835480us | 11.253860us | 192.835480us | 191.429580us | 197.058260us | -| 2 | 100 | 1 | 67.671100ms | 264.467440us | 14.015096us | 132.233720us | 131.366635us | 134.846925us | -| 4 | 100 | 1 | 47.368100ms | 390.787340us | 15.046180us | 97.696835us | 97.226195us | 99.065467us | -| 8 | 100 | 1 | 73.527500ms | 631.050580us | 13.110884us | 78.881322us | 78.633827us | 79.322477us | -| 16 | 100 | 1 | 123.333300ms | 1.068295ms | 16.250887us | 66.768413us | 66.626819us | 67.078746us | -| 32 | 100 | 1 | 220.118000ms | 1.957605ms | 31.747182us | 61.175145us | 61.014313us | 61.416214us | -| 64 | 100 | 1 | 398.243400ms | 3.662542ms | 46.111308us | 57.227215us | 57.097696us | 57.381943us | -| 128 | 100 | 1 | 758.389900ms | 7.015844ms | 90.809629us | 54.811284us | 54.684557us | 54.964024us | -| 256 | 100 | 1 | 1425.747200ms | 13.681825ms | 294.658699us | 53.444629us | 53.261856us | 53.733271us | -| 512 | 100 | 1 | 2705.056000ms | 26.150996ms | 313.012744us | 51.076164us | 50.964919us | 51.205398us | -| 1024 | 100 | 1 | 5318.551600ms | 52.000460ms | 1.342433ms | 50.781700us | 50.591750us | 51.151289us | -| 2048 | 100 | 1 | 10629.217200ms | 106.187923ms | 3.247309ms | 51.849572us | 51.621261us | 52.307176us | -| 4096 | 100 | 1 | 23550.384400ms | 233.968907ms | 6.074906ms | 57.121315us | 56.890702us | 57.499744us | -| 8192 | 100 | 1 | 53876.510600ms | 539.534633ms | 6.766069ms | 65.861161us | 65.724456us | 66.058346us | +| 1 | 100 | 1 | 59.451300ms | 180.517900us | 14.983619us | 180.517900us | 178.666590us | 186.057060us | +| 2 | 100 | 1 | 63.493500ms | 240.510670us | 19.041011us | 120.255335us | 119.063350us | 123.693800us | +| 4 | 100 | 1 | 41.218100ms | 337.480470us | 12.459125us | 84.370117us | 83.972065us | 85.476165us | +| 8 | 100 | 1 | 62.137300ms | 527.426440us | 13.618466us | 65.928305us | 65.715754us | 66.553231us | +| 16 | 100 | 1 | 100.652300ms | 886.721420us | 16.497677us | 55.420089us | 55.294364us | 55.821076us | +| 32 | 100 | 1 | 173.599100ms | 1.571108ms | 16.210339us | 49.097116us | 49.003185us | 49.201756us | +| 64 | 100 | 1 | 314.708700ms | 2.908236ms | 33.251838us | 45.441184us | 45.364526us | 45.587180us | +| 128 | 100 | 1 | 611.153000ms | 5.607166ms | 67.999115us | 43.805984us | 43.726668us | 43.951909us | +| 256 | 100 | 1 | 1179.841300ms | 10.889757ms | 93.589132us | 42.538113us | 42.469481us | 42.612721us | +| 512 | 100 | 1 | 2248.266200ms | 21.274400ms | 182.783054us | 41.551562us | 41.484639us | 41.624755us | +| 1024 | 100 | 1 | 4345.571400ms | 42.181767ms | 1.553062ms | 41.193132us | 40.980732us | 41.650444us | +| 2048 | 100 | 1 | 8397.330100ms | 84.108923ms | 3.123932ms | 41.068810us | 40.859731us | 41.545084us | +| 4096 | 100 | 1 | 17443.771300ms | 177.428937ms | 5.015225ms | 43.317612us | 43.135290us | 43.654843us | +| 8192 | 100 | 1 | 39000.674000ms | 393.129357ms | 9.034095ms | 47.989423us | 47.811843us | 48.263243us | ## SV-DoubleBattle-MonteCarlo-SimulateTurn-VerticalSlice1 | Inputs | Samples | Iterations / Sample | Estimated Completion Time | Mean of Samples | Standard Deviation | Mean / Input Count | Mean Lower Bound / Input Count | Mean Upper Bound / Input Count | | --- | --- | --- | --- | --- | --- | --- | --- | --- | -| 1 | 100 | 1 | 27.860300ms | 97.521060us | 11.368638us | 97.521060us | 96.152360us | 101.916280us | -| 2 | 100 | 1 | 27.709100ms | 116.008090us | 13.912843us | 58.004045us | 57.179810us | 60.743165us | -| 4 | 100 | 1 | 29.875800ms | 140.672470us | 17.807832us | 35.168118us | 34.530253us | 36.463730us | -| 8 | 100 | 1 | 35.396500ms | 170.326600us | 13.123529us | 21.290825us | 21.070836us | 21.817425us | -| 16 | 100 | 1 | 43.548300ms | 234.155070us | 12.508275us | 14.634692us | 14.523846us | 14.864514us | -| 32 | 100 | 1 | 43.099900ms | 328.715710us | 14.015457us | 10.272366us | 10.219551us | 10.444704us | -| 64 | 100 | 1 | 62.472800ms | 530.340490us | 14.498173us | 8.286570us | 8.252347us | 8.347303us | -| 128 | 100 | 1 | 104.070800ms | 895.349360us | 15.038206us | 6.994917us | 6.975207us | 7.021926us | -| 256 | 100 | 1 | 175.010100ms | 1.628515ms | 26.773174us | 6.361386us | 6.345407us | 6.389178us | -| 512 | 100 | 1 | 325.172100ms | 3.077679ms | 27.009724us | 6.011093us | 6.001873us | 6.022785us | -| 1024 | 100 | 1 | 621.968600ms | 5.955360ms | 76.706204us | 5.815781us | 5.802122us | 5.831527us | -| 2048 | 100 | 1 | 1213.580700ms | 11.817182ms | 292.695183us | 5.770109us | 5.749164us | 5.809852us | -| 4096 | 100 | 1 | 2441.101800ms | 23.974863ms | 553.315900us | 5.853238us | 5.831414us | 5.885897us | +| 1 | 100 | 1 | 29.162500ms | 99.932110us | 13.225306us | 99.932110us | 98.367660us | 105.305410us | +| 2 | 100 | 1 | 27.673500ms | 117.107930us | 14.622831us | 58.553965us | 57.627850us | 61.204945us | +| 4 | 100 | 1 | 30.667900ms | 136.463990us | 15.428466us | 34.115997us | 33.635852us | 35.561817us | +| 8 | 100 | 1 | 35.049700ms | 171.450960us | 17.813437us | 21.431370us | 21.139739us | 22.189959us | +| 16 | 100 | 1 | 44.094700ms | 232.363320us | 16.553101us | 14.522708us | 14.390809us | 14.883299us | +| 32 | 100 | 1 | 42.288900ms | 333.452470us | 15.894550us | 10.420390us | 10.358411us | 10.603464us | +| 64 | 100 | 1 | 61.549500ms | 525.858100us | 14.467910us | 8.216533us | 8.185976us | 8.289030us | +| 128 | 100 | 1 | 99.783700ms | 901.259440us | 17.347371us | 7.041089us | 7.021297us | 7.078925us | +| 256 | 100 | 1 | 171.109600ms | 1.632284ms | 17.849704us | 6.376108us | 6.365461us | 6.394671us | +| 512 | 100 | 1 | 309.265100ms | 3.040787ms | 43.942043us | 5.939037us | 5.927683us | 5.967412us | +| 1024 | 100 | 1 | 598.947600ms | 5.907157ms | 63.145025us | 5.768708us | 5.758302us | 5.783059us | +| 2048 | 100 | 1 | 1173.511500ms | 11.697478ms | 142.243040us | 5.711659us | 5.699751us | 5.727434us | +| 4096 | 100 | 1 | 2341.729700ms | 23.416173ms | 286.979280us | 5.716839us | 5.705012us | 5.733070us | +| 8192 | 100 | 1 | 4709.867600ms | 47.938132ms | 837.820014us | 5.851823us | 5.836692us | 5.880421us | +| 16384 | 100 | 1 | 10066.857000ms | 101.179667ms | 1.739754ms | 6.175517us | 6.159080us | 6.202960us | +| 32768 | 100 | 1 | 21555.270700ms | 215.142421ms | 2.665011ms | 6.565626us | 6.552818us | 6.586163us | +| 65536 | 100 | 1 | 45729.788400ms | 450.709449ms | 4.727660ms | 6.877280us | 6.865054us | 6.893904us | ## SV-DoubleBattle-Branching-SimulateTurn-VerticalSlice1 | Inputs | Samples | Iterations / Sample | Estimated Completion Time | Mean of Samples | Standard Deviation | Mean / Input Count | Mean Lower Bound / Input Count | Mean Upper Bound / Input Count | | --- | --- | --- | --- | --- | --- | --- | --- | --- | -| 1 | 100 | 1 | 70.096000ms | 451.444420us | 16.651479us | 451.444420us | 449.381530us | 457.721400us | -| 2 | 100 | 1 | 79.649900ms | 686.392640us | 16.611743us | 343.196320us | 341.685375us | 344.962165us | -| 4 | 100 | 1 | 122.288400ms | 1.076258ms | 15.362888us | 269.064597us | 268.559495us | 270.355715us | -| 8 | 100 | 1 | 202.731900ms | 1.836434ms | 20.191596us | 229.554199us | 229.171057us | 230.225214us | -| 16 | 100 | 1 | 364.184900ms | 3.312983ms | 38.543537us | 207.061442us | 206.624725us | 207.576890us | -| 32 | 100 | 1 | 690.164500ms | 6.267243ms | 75.897193us | 195.851357us | 195.439056us | 196.382865us | -| 64 | 100 | 1 | 1265.009300ms | 12.020025ms | 237.493102us | 187.812887us | 187.212349us | 188.715361us | -| 128 | 100 | 1 | 2455.522100ms | 23.229834ms | 339.528672us | 181.483081us | 181.010498us | 182.059185us | -| 256 | 100 | 1 | 5326.020400ms | 46.531433ms | 1.864522ms | 181.763409us | 180.811923us | 184.204321us | -| 512 | 100 | 1 | 9226.963500ms | 91.750585ms | 2.280062ms | 179.200361us | 178.535151us | 180.411474us | -| 1024 | 100 | 1 | 18066.813400ms | 183.308606ms | 3.291548ms | 179.012311us | 178.508519us | 179.823557us | -| 2048 | 100 | 1 | 37282.153900ms | 375.945531ms | 4.748537ms | 183.567154us | 183.208537us | 184.167501us | -| 4096 | 100 | 1 | 80013.517300ms | 804.779567ms | 5.664494ms | 196.479386us | 196.233316us | 196.780551us | +| 1 | 100 | 1 | 65.881100ms | 406.993220us | 18.625175us | 406.993220us | 404.715460us | 414.032310us | +| 2 | 100 | 1 | 70.715900ms | 588.988260us | 15.853121us | 294.494130us | 293.526205us | 297.533285us | +| 4 | 100 | 1 | 106.775700ms | 927.803930us | 18.998869us | 231.950983us | 231.191557us | 233.129437us | +| 8 | 100 | 1 | 169.871100ms | 1.542042ms | 21.647674us | 192.755240us | 192.331214us | 193.444487us | +| 16 | 100 | 1 | 292.657700ms | 2.727508ms | 22.456899us | 170.469238us | 170.199626us | 170.751709us | +| 32 | 100 | 1 | 550.576300ms | 5.079421ms | 46.697691us | 158.731922us | 158.475474us | 159.049588us | +| 64 | 100 | 1 | 1060.993200ms | 9.793381ms | 307.671871us | 153.021575us | 152.253338us | 154.199617us | +| 128 | 100 | 1 | 2013.087000ms | 18.780317ms | 161.390558us | 146.721227us | 146.495869us | 146.991782us | +| 256 | 100 | 1 | 3885.176100ms | 37.786332ms | 1.412906ms | 147.602860us | 146.828850us | 149.255105us | +| 512 | 100 | 1 | 7755.867400ms | 76.322816ms | 2.344005ms | 149.068000us | 148.375303us | 150.306959us | +| 1024 | 100 | 1 | 15050.985300ms | 150.921196ms | 3.384511ms | 147.383980us | 146.897555us | 148.305337us | +| 2048 | 100 | 1 | 30221.116000ms | 304.876982ms | 5.760509ms | 148.865714us | 148.432066us | 149.602153us | +| 4096 | 100 | 1 | 62871.594300ms | 634.325709ms | 7.909586ms | 154.864675us | 154.550361us | 155.334271us | ## SV-SingleBattle-CalcDamage-VerticalSlice1 | Inputs | Samples | Iterations / Sample | Estimated Completion Time | Mean of Samples | Standard Deviation | Mean / Input Count | Mean Lower Bound / Input Count | Mean Upper Bound / Input Count | | --- | --- | --- | --- | --- | --- | --- | --- | --- | -| 1 | 100 | 1 | 7.935200ms | 10.271510us | 3.492715us | 10.271510us | 9.796580us | 11.386720us | -| 2 | 100 | 1 | 8.132600ms | 11.475080us | 4.003053us | 5.737540us | 5.457705us | 6.348635us | -| 4 | 100 | 1 | 8.272000ms | 11.438880us | 3.114085us | 2.859720us | 2.757835us | 3.148250us | -| 8 | 100 | 1 | 8.567600ms | 13.123670us | 2.959634us | 1.640459us | 1.590789us | 1.759091us | -| 16 | 100 | 1 | 8.995800ms | 16.716730us | 3.134768us | 1.044796us | 1.018856us | 1.111584us | -| 32 | 100 | 1 | 9.878500ms | 24.547010us | 3.429815us | 767.094062ns | 752.196563ns | 799.918125ns | -| 64 | 100 | 1 | 11.501900ms | 35.665880us | 3.393685us | 557.279375ns | 549.625469ns | 572.497500ns | -| 128 | 100 | 1 | 13.816400ms | 57.574030us | 3.265106us | 449.797109ns | 445.998672ns | 456.833516ns | -| 256 | 100 | 1 | 18.984900ms | 103.069580us | 3.557387us | 402.615547ns | 400.330586ns | 405.938789ns | -| 512 | 100 | 1 | 35.706300ms | 191.844970us | 4.695318us | 374.697207ns | 373.218691ns | 376.942207ns | -| 1024 | 100 | 1 | 63.726300ms | 367.404660us | 5.191427us | 358.793613ns | 357.951416ns | 359.992520ns | -| 2048 | 100 | 1 | 117.819800ms | 722.662720us | 9.997334us | 352.862656ns | 352.039443ns | 353.996577ns | -| 4096 | 100 | 1 | 235.110000ms | 1.444082ms | 32.761707us | 352.559021ns | 351.339119ns | 354.681978ns | -| 8192 | 100 | 1 | 467.327700ms | 3.048989ms | 56.511266us | 372.191017ns | 370.949302ns | 373.668976ns | -| 16384 | 100 | 1 | 934.852200ms | 6.197596ms | 75.472017us | 378.271249ns | 377.480701ns | 379.309343ns | -| 32768 | 100 | 1 | 1871.845200ms | 12.654959ms | 316.402961us | 386.198692ns | 384.826534ns | 389.051187ns | -| 65536 | 100 | 1 | 3750.665800ms | 26.650461ms | 581.872660us | 406.653769ns | 405.245233ns | 408.862578ns | +| 1 | 100 | 1 | 8.031900ms | 10.420790us | 3.846694us | 10.420790us | 9.890830us | 11.593500us | +| 2 | 100 | 1 | 8.102100ms | 11.859660us | 4.644298us | 5.929830us | 5.593595us | 6.599965us | +| 4 | 100 | 1 | 8.211600ms | 11.771580us | 3.989319us | 2.942895us | 2.806682us | 3.260637us | +| 8 | 100 | 1 | 8.596700ms | 13.125850us | 3.670588us | 1.640731us | 1.576280us | 1.802773us | +| 16 | 100 | 1 | 9.061600ms | 16.305070us | 3.147792us | 1.019067us | 992.463125ns | 1.086014us | +| 32 | 100 | 1 | 9.945200ms | 23.959860us | 6.190851us | 748.745625ns | 724.387187ns | 820.115625ns | +| 64 | 100 | 1 | 11.235300ms | 34.833510us | 4.551819us | 544.273594ns | 535.392344ns | 570.761562ns | +| 128 | 100 | 1 | 14.113200ms | 58.011630us | 3.972332us | 453.215859ns | 448.443672ns | 461.380781ns | +| 256 | 100 | 1 | 19.580900ms | 103.451130us | 4.343980us | 404.105977ns | 401.179648ns | 407.934336ns | +| 512 | 100 | 1 | 29.883800ms | 191.173200us | 5.980051us | 373.385156ns | 371.374434ns | 376.028613ns | +| 1024 | 100 | 1 | 56.919800ms | 366.460360us | 5.507647us | 357.871445ns | 356.924355ns | 359.052949ns | +| 2048 | 100 | 1 | 111.230900ms | 730.971390us | 19.141937us | 356.919624ns | 355.296035ns | 359.007627ns | +| 4096 | 100 | 1 | 200.999900ms | 1.438700ms | 38.095274us | 351.245186ns | 350.101631ns | 354.767322ns | +| 8192 | 100 | 1 | 408.323100ms | 2.927699ms | 39.121336us | 357.385104ns | 356.495109ns | 358.359330ns | +| 16384 | 100 | 1 | 825.387500ms | 5.995157ms | 71.298764us | 365.915336ns | 365.134354ns | 366.849865ns | +| 32768 | 100 | 1 | 1658.646500ms | 12.184089ms | 343.483195us | 371.828902ns | 370.140656ns | 374.402196ns | +| 65536 | 100 | 1 | 3348.926900ms | 25.145254ms | 255.501703us | 383.686127ns | 382.977381ns | 384.510115ns | ## SV-SingleBattle-AnalyzeEffect-VerticalSlice1 | Inputs | Samples | Iterations / Sample | Estimated Completion Time | Mean of Samples | Standard Deviation | Mean / Input Count | Mean Lower Bound / Input Count | Mean Upper Bound / Input Count | | --- | --- | --- | --- | --- | --- | --- | --- | --- | -| 1 | 100 | 1 | 29.577700ms | 56.845370us | 9.599896us | 56.845370us | 55.633660us | 60.344100us | -| 2 | 100 | 1 | 29.938100ms | 67.274570us | 9.665283us | 33.637285us | 33.073770us | 35.644095us | -| 4 | 100 | 1 | 32.162300ms | 89.078570us | 9.641466us | 22.269643us | 21.984057us | 23.234117us | -| 8 | 100 | 1 | 20.991400ms | 128.153110us | 9.278205us | 16.019139us | 15.880005us | 16.479191us | -| 16 | 100 | 1 | 26.424300ms | 200.705280us | 9.698604us | 12.544080us | 12.471436us | 12.780129us | -| 32 | 100 | 1 | 45.014100ms | 341.598700us | 9.843276us | 10.674959us | 10.633213us | 10.772791us | -| 64 | 100 | 1 | 75.472500ms | 623.558710us | 12.541751us | 9.743105us | 9.712173us | 9.792628us | -| 128 | 100 | 1 | 141.624400ms | 1.161219ms | 18.758135us | 9.072022us | 9.045394us | 9.103036us | -| 256 | 100 | 1 | 250.979400ms | 2.196064ms | 28.945251us | 8.578375us | 8.557107us | 8.601465us | -| 512 | 100 | 1 | 486.295700ms | 4.269246ms | 44.574550us | 8.338372us | 8.322439us | 8.356736us | -| 1024 | 100 | 1 | 948.572800ms | 8.500570ms | 104.441338us | 8.301338us | 8.283143us | 8.323425us | -| 2048 | 100 | 1 | 1901.733600ms | 16.847337ms | 208.982061us | 8.226239us | 8.207187us | 8.247207us | -| 4096 | 100 | 1 | 3799.005000ms | 34.323095ms | 1.956298ms | 8.379662us | 8.324359us | 8.578086us | -| 8192 | 100 | 1 | 8744.130500ms | 85.026690ms | 5.510656ms | 10.379235us | 10.281450us | 10.570844us | +| 1 | 100 | 1 | 20.793800ms | 52.037230us | 9.089473us | 52.037230us | 50.903410us | 55.436840us | +| 2 | 100 | 1 | 21.640500ms | 61.634630us | 9.441345us | 30.817315us | 30.261525us | 32.788670us | +| 4 | 100 | 1 | 23.920300ms | 80.375370us | 9.758799us | 20.093842us | 19.805155us | 21.109205us | +| 8 | 100 | 1 | 28.965100ms | 112.937490us | 10.046999us | 14.117186us | 13.965016us | 14.619282us | +| 16 | 100 | 1 | 26.548500ms | 176.185270us | 10.462708us | 11.011579us | 10.930419us | 11.257754us | +| 32 | 100 | 1 | 38.024500ms | 293.591620us | 9.679834us | 9.174738us | 9.136515us | 9.281463us | +| 64 | 100 | 1 | 62.731600ms | 523.082620us | 11.426932us | 8.173166us | 8.144678us | 8.217437us | +| 128 | 100 | 1 | 117.071900ms | 984.788570us | 27.149378us | 7.693661us | 7.662325us | 7.752868us | +| 256 | 100 | 1 | 225.104100ms | 1.888742ms | 27.700708us | 7.377898us | 7.360806us | 7.405290us | +| 512 | 100 | 1 | 426.947700ms | 3.723415ms | 44.862827us | 7.272296us | 7.256678us | 7.291291us | +| 1024 | 100 | 1 | 830.453700ms | 7.450052ms | 466.620272us | 7.275442us | 7.204872us | 7.392989us | +| 2048 | 100 | 1 | 1606.059300ms | 14.472242ms | 156.820552us | 7.066524us | 7.051985us | 7.082003us | +| 4096 | 100 | 1 | 3169.673600ms | 29.219650ms | 1.178657ms | 7.133704us | 7.092137us | 7.216655us | +| 8192 | 100 | 1 | 6728.071700ms | 62.774505ms | 3.787525ms | 7.662903us | 7.594637us | 7.792205us | +| 16384 | 100 | 1 | 15485.021600ms | 155.276142ms | 6.231331ms | 9.477304us | 9.416641us | 9.572681us | +| 32768 | 100 | 1 | 33699.225600ms | 341.030942ms | 5.222577ms | 10.407438us | 10.380658us | 10.444634us | +| 65536 | 100 | 1 | 70766.908200ms | 707.074614ms | 5.048408ms | 10.789102us | 10.775417us | 10.806112us | ## SV-SingleBattle-MonteCarlo-SimulateTurn-RandomInputs-OneRandomBattle-OneRandomInput | Inputs | Samples | Iterations / Sample | Estimated Completion Time | Mean of Samples | Standard Deviation | Mean / Input Count | Mean Lower Bound / Input Count | Mean Upper Bound / Input Count | | --- | --- | --- | --- | --- | --- | --- | --- | --- | -| 1 | 100 | 1 | 39.401900ms | 69.775570us | 15.242533us | 69.775570us | 67.603040us | 74.277860us | -| 2 | 100 | 1 | 40.723300ms | 81.764080us | 23.091738us | 40.882040us | 39.080140us | 43.850095us | -| 4 | 100 | 1 | 21.094000ms | 88.442230us | 17.540218us | 22.110557us | 21.344088us | 23.091542us | -| 8 | 100 | 1 | 23.049400ms | 100.226080us | 17.369087us | 12.528260us | 12.131202us | 12.987146us | -| 16 | 100 | 1 | 28.561600ms | 132.754090us | 23.070978us | 8.297131us | 8.026684us | 8.595362us | -| 32 | 100 | 1 | 35.910100ms | 187.447140us | 34.838916us | 5.857723us | 5.657430us | 6.085657us | -| 64 | 100 | 1 | 41.132000ms | 285.835970us | 55.768171us | 4.466187us | 4.307419us | 4.651452us | -| 128 | 100 | 1 | 80.300500ms | 493.863030us | 102.170992us | 3.858305us | 3.714999us | 4.030069us | -| 256 | 100 | 1 | 146.491800ms | 905.556250us | 191.684431us | 3.537329us | 3.402852us | 3.698916us | -| 512 | 100 | 1 | 207.973600ms | 1.725032ms | 398.365074us | 3.369203us | 3.230805us | 3.538621us | -| 1024 | 100 | 1 | 422.287700ms | 3.901228ms | 806.019504us | 3.809793us | 3.667448us | 3.975807us | -| 2048 | 100 | 1 | 740.515300ms | 8.141478ms | 1.544992ms | 3.975331us | 3.840598us | 4.139308us | -| 4096 | 100 | 1 | 2410.261200ms | 18.345825ms | 3.689362ms | 4.478961us | 4.317502us | 4.673209us | -| 8192 | 100 | 1 | 3555.841500ms | 40.126644ms | 7.205912ms | 4.898272us | 4.735302us | 5.081697us | +| 1 | 100 | 1 | 31.249200ms | 68.176210us | 13.921405us | 68.176210us | 66.073800us | 71.914160us | +| 2 | 100 | 1 | 31.792000ms | 78.073400us | 16.439792us | 39.036700us | 37.681940us | 41.008710us | +| 4 | 100 | 1 | 33.077400ms | 87.768470us | 17.395834us | 21.942118us | 21.182365us | 22.916577us | +| 8 | 100 | 1 | 34.814500ms | 100.649170us | 19.701342us | 12.581146us | 12.140221us | 13.110095us | +| 16 | 100 | 1 | 38.726500ms | 131.291680us | 25.354403us | 8.205730us | 7.919571us | 8.541085us | +| 32 | 100 | 1 | 44.998000ms | 181.614330us | 35.380116us | 5.675448us | 5.470801us | 5.904626us | +| 64 | 100 | 1 | 56.744700ms | 280.739500us | 58.962199us | 4.386555us | 4.219135us | 4.583458us | +| 128 | 100 | 1 | 60.042200ms | 468.535870us | 99.965389us | 3.660436us | 3.520239us | 3.828997us | +| 256 | 100 | 1 | 115.931200ms | 840.623000us | 189.043566us | 3.283684us | 3.152324us | 3.443392us | +| 512 | 100 | 1 | 217.826800ms | 1.520551ms | 362.801559us | 2.969827us | 2.844450us | 3.124442us | +| 1024 | 100 | 1 | 288.942900ms | 3.004078ms | 726.029809us | 2.933670us | 2.806476us | 3.085085us | +| 2048 | 100 | 1 | 603.541200ms | 5.946068ms | 1.425141ms | 2.903354us | 2.779815us | 3.054634us | +| 4096 | 100 | 1 | 1796.983500ms | 12.100915ms | 2.855353ms | 2.954325us | 2.830713us | 3.106571us | +| 8192 | 100 | 1 | 3677.869100ms | 25.114085ms | 5.877660ms | 3.065684us | 2.938172us | 3.221265us | +| 16384 | 100 | 1 | 4794.608900ms | 53.130262ms | 11.732715ms | 3.242814us | 3.114155us | 3.394796us | +| 32768 | 100 | 1 | 10133.915200ms | 110.560213ms | 24.268798ms | 3.374030us | 3.239944us | 3.531722us | ## SV-SingleBattle-MonteCarlo-SimulateTurn-RandomInputs-OneRandomBattle-ManyRandomInputs | Inputs | Samples | Iterations / Sample | Estimated Completion Time | Mean of Samples | Standard Deviation | Mean / Input Count | Mean Lower Bound / Input Count | Mean Upper Bound / Input Count | | --- | --- | --- | --- | --- | --- | --- | --- | --- | -| 1 | 100 | 1 | 39.882800ms | 67.974010us | 15.774707us | 67.974010us | 65.767700us | 72.724610us | -| 2 | 100 | 1 | 20.750700ms | 77.956740us | 14.306901us | 38.978370us | 37.761595us | 40.594965us | -| 4 | 100 | 1 | 22.000900ms | 87.526990us | 15.974247us | 21.881748us | 21.169715us | 22.739020us | -| 8 | 100 | 1 | 23.954800ms | 98.051370us | 17.075480us | 12.256421us | 11.869032us | 12.706762us | -| 16 | 100 | 1 | 28.818100ms | 128.537200us | 23.887088us | 8.033575us | 7.759972us | 8.346597us | -| 32 | 100 | 1 | 35.885100ms | 175.949300us | 33.178650us | 5.498416us | 5.306073us | 5.712364us | -| 64 | 100 | 1 | 51.495700ms | 271.993070us | 57.436347us | 4.249892us | 4.086111us | 4.439275us | -| 128 | 100 | 1 | 61.322100ms | 453.440920us | 99.271113us | 3.542507us | 3.403708us | 3.710598us | -| 256 | 100 | 1 | 118.926200ms | 810.248980us | 193.731551us | 3.165035us | 3.033004us | 3.333741us | -| 512 | 100 | 1 | 216.921500ms | 1.551698ms | 354.439556us | 3.030661us | 2.905505us | 3.179568us | -| 1024 | 100 | 1 | 288.946900ms | 2.961041ms | 724.469950us | 2.891641us | 2.765195us | 3.044385us | -| 2048 | 100 | 1 | 591.185500ms | 5.881183ms | 1.449835ms | 2.871671us | 2.745729us | 3.026303us | -| 4096 | 100 | 1 | 1735.572000ms | 11.976956ms | 2.828582ms | 2.924062us | 2.800914us | 3.074693us | -| 8192 | 100 | 1 | 3483.277600ms | 24.239579ms | 5.663264ms | 2.958933us | 2.835426us | 3.108876us | +| 1 | 100 | 1 | 30.557700ms | 68.372730us | 13.928831us | 68.372730us | 66.275310us | 72.154920us | +| 2 | 100 | 1 | 33.245400ms | 80.267420us | 32.431344us | 40.133710us | 38.078565us | 45.907370us | +| 4 | 100 | 1 | 34.043500ms | 85.042960us | 16.631853us | 21.260740us | 20.549972us | 22.211797us | +| 8 | 100 | 1 | 36.149300ms | 98.823560us | 19.058173us | 12.352945us | 11.929330us | 12.875364us | +| 16 | 100 | 1 | 40.264400ms | 127.843600us | 23.288670us | 7.990225us | 7.721685us | 8.293940us | +| 32 | 100 | 1 | 46.759000ms | 177.488310us | 36.914564us | 5.546510us | 5.339719us | 5.795156us | +| 64 | 100 | 1 | 58.496700ms | 274.776220us | 58.766549us | 4.293378us | 4.126830us | 4.489357us | +| 128 | 100 | 1 | 59.292200ms | 446.697690us | 99.166585us | 3.489826us | 3.350568us | 3.656771us | +| 256 | 100 | 1 | 113.693900ms | 803.682360us | 186.230872us | 3.139384us | 3.008690us | 3.296267us | +| 512 | 100 | 1 | 210.292300ms | 1.503744ms | 358.349663us | 2.937000us | 2.812270us | 3.090857us | +| 1024 | 100 | 1 | 275.421800ms | 2.957591ms | 744.098011us | 2.888273us | 2.759280us | 3.044641us | +| 2048 | 100 | 1 | 562.124400ms | 5.747549ms | 1.419407ms | 2.806420us | 2.682791us | 2.956662us | +| 4096 | 100 | 1 | 1693.808700ms | 11.326214ms | 2.797096ms | 2.765189us | 2.644217us | 2.915280us | +| 8192 | 100 | 1 | 3364.542500ms | 22.820558ms | 5.575147ms | 2.785713us | 2.665295us | 2.933363us | +| 16384 | 100 | 1 | 4111.777600ms | 45.414857ms | 10.786756ms | 2.771903us | 2.654608us | 2.914778us | +| 32768 | 100 | 1 | 8494.286400ms | 91.371677ms | 21.936107ms | 2.788442us | 2.667300us | 2.932452us | ## SV-SingleBattle-MonteCarlo-SimulateTurn-RandomInputs-ManyRandomBattles-ManyRandomInputs | Inputs | Samples | Iterations / Sample | Estimated Completion Time | Mean of Samples | Standard Deviation | Mean / Input Count | Mean Lower Bound / Input Count | Mean Upper Bound / Input Count | | --- | --- | --- | --- | --- | --- | --- | --- | --- | -| 1 | 100 | 1 | 40.167400ms | 71.933050us | 15.987010us | 71.933050us | 69.623610us | 76.539640us | -| 2 | 100 | 1 | 37.147800ms | 91.000250us | 18.907879us | 45.500125us | 44.076190us | 48.102335us | -| 4 | 100 | 1 | 38.060400ms | 113.851680us | 15.463859us | 28.462920us | 27.845942us | 29.435112us | -| 8 | 100 | 1 | 52.784500ms | 150.026580us | 18.117413us | 18.753322us | 18.430381us | 19.408321us | -| 16 | 100 | 1 | 63.802200ms | 203.049280us | 19.461356us | 12.690580us | 12.505216us | 13.015988us | -| 32 | 100 | 1 | 42.568400ms | 282.256460us | 18.844979us | 8.820514us | 8.727397us | 8.969911us | -| 64 | 100 | 1 | 62.528700ms | 423.456210us | 22.428506us | 6.616503us | 6.562883us | 6.708878us | -| 128 | 100 | 1 | 101.470200ms | 704.342670us | 29.545113us | 5.502677us | 5.466069us | 5.560536us | -| 256 | 100 | 1 | 188.950000ms | 1.259363ms | 35.894178us | 4.919385us | 4.896783us | 4.953830us | -| 512 | 100 | 1 | 342.633900ms | 2.507324ms | 184.831045us | 4.897117us | 4.841500us | 4.990218us | -| 1024 | 100 | 1 | 678.414400ms | 6.167870ms | 310.286520us | 6.023311us | 5.971273us | 6.091365us | -| 2048 | 100 | 1 | 1412.938400ms | 13.177922ms | 440.269363us | 6.434532us | 6.403204us | 6.495902us | -| 4096 | 100 | 1 | 2961.421800ms | 30.026930ms | 1.727276ms | 7.330793us | 7.273366us | 7.465384us | -| 8192 | 100 | 1 | 6961.891800ms | 70.259047ms | 2.770357ms | 8.576544us | 8.526369us | 8.670238us | +| 1 | 100 | 1 | 30.889800ms | 68.171290us | 14.045137us | 68.171290us | 66.033220us | 71.879600us | +| 2 | 100 | 1 | 48.788900ms | 90.745810us | 20.227910us | 45.372905us | 43.888005us | 48.179300us | +| 4 | 100 | 1 | 50.354200ms | 115.930270us | 17.465855us | 28.982568us | 28.343640us | 30.206717us | +| 8 | 100 | 1 | 64.934800ms | 150.108110us | 23.781457us | 18.763514us | 18.307310us | 19.538095us | +| 16 | 100 | 1 | 74.951100ms | 203.478570us | 30.933356us | 12.717411us | 12.437267us | 13.259820us | +| 32 | 100 | 1 | 83.468100ms | 274.611200us | 24.495425us | 8.581600us | 8.457474us | 8.769229us | +| 64 | 100 | 1 | 53.202200ms | 408.668520us | 19.570323us | 6.385446us | 6.336113us | 6.461050us | +| 128 | 100 | 1 | 79.423500ms | 658.135150us | 20.904030us | 5.141681us | 5.112777us | 5.177966us | +| 256 | 100 | 1 | 131.916200ms | 1.129139ms | 22.865241us | 4.410700us | 4.394481us | 4.429467us | +| 512 | 100 | 1 | 246.838800ms | 2.043833ms | 47.340451us | 3.991862us | 3.975549us | 4.012183us | +| 1024 | 100 | 1 | 462.143600ms | 3.969365ms | 153.504120us | 3.876333us | 3.852723us | 3.914359us | +| 2048 | 100 | 1 | 914.314200ms | 8.098556ms | 342.368670us | 3.954373us | 3.929257us | 4.000146us | +| 4096 | 100 | 1 | 1856.562300ms | 17.675678ms | 866.946063us | 4.315351us | 4.286540us | 4.381710us | +| 8192 | 100 | 1 | 4226.892900ms | 42.172514ms | 1.138832ms | 5.148012us | 5.125632us | 5.182358us | +| 16384 | 100 | 1 | 11631.590900ms | 97.683856ms | 2.970859ms | 5.962149us | 5.937217us | 6.018479us | +| 32768 | 100 | 1 | 22120.368700ms | 220.859396ms | 6.611173ms | 6.740094us | 6.709016us | 6.793025us | ## SV-SingleBattle-CalcDamage-RandomInputs-OneRandomBattle-OneRandomInput | Inputs | Samples | Iterations / Sample | Estimated Completion Time | Mean of Samples | Standard Deviation | Mean / Input Count | Mean Lower Bound / Input Count | Mean Upper Bound / Input Count | | --- | --- | --- | --- | --- | --- | --- | --- | --- | -| 1 | 100 | 1 | 10.503300ms | 12.986410us | 5.293295us | 12.986410us | 12.209320us | 14.465700us | -| 2 | 100 | 1 | 10.824200ms | 14.746290us | 6.064821us | 7.373145us | 6.875465us | 8.098570us | -| 4 | 100 | 1 | 11.489100ms | 17.079760us | 8.083822us | 4.269940us | 3.978465us | 4.845750us | -| 8 | 100 | 1 | 12.435400ms | 20.897470us | 7.421681us | 2.612184us | 2.437195us | 2.800774us | -| 16 | 100 | 1 | 14.075800ms | 29.918820us | 13.432799us | 1.869926us | 1.725176us | 2.060694us | -| 32 | 100 | 1 | 11.185100ms | 44.703410us | 18.026728us | 1.396982us | 1.285885us | 1.506267us | -| 64 | 100 | 1 | 19.374000ms | 78.670060us | 35.872859us | 1.229220us | 1.119067us | 1.338802us | -| 128 | 100 | 1 | 50.372700ms | 137.380310us | 66.984331us | 1.073284us | 969.357266ns | 1.174444us | -| 256 | 100 | 1 | 89.713200ms | 264.253750us | 133.383746us | 1.032241us | 929.214805ns | 1.132935us | -| 512 | 100 | 1 | 79.700800ms | 483.440180us | 277.605476us | 944.219102ns | 837.342363ns | 1.049328us | -| 1024 | 100 | 1 | 202.068000ms | 1.160484ms | 650.396954us | 1.133285us | 1.008675us | 1.256587us | -| 2048 | 100 | 1 | 418.010600ms | 2.422718ms | 1.296583ms | 1.182968us | 1.056856us | 1.304135us | -| 4096 | 100 | 1 | 1350.352400ms | 5.253974ms | 2.799750ms | 1.282708us | 1.145026us | 1.413052us | -| 8192 | 100 | 1 | 1765.055200ms | 11.554693ms | 6.356125ms | 1.410485us | 1.255873us | 1.560985us | +| 1 | 100 | 1 | 10.554100ms | 13.117300us | 5.556340us | 13.117300us | 12.238470us | 14.527800us | +| 2 | 100 | 1 | 10.828900ms | 14.464530us | 5.645307us | 7.232265us | 6.765135us | 7.906970us | +| 4 | 100 | 1 | 11.348200ms | 17.219910us | 8.387003us | 4.304977us | 3.995883us | 4.897435us | +| 8 | 100 | 1 | 12.204100ms | 20.602410us | 7.095005us | 2.575301us | 2.407225us | 2.755639us | +| 16 | 100 | 1 | 9.913700ms | 29.479850us | 11.084909us | 1.842491us | 1.706307us | 1.978503us | +| 32 | 100 | 1 | 10.822100ms | 43.364710us | 17.349939us | 1.355147us | 1.247713us | 1.460113us | +| 64 | 100 | 1 | 12.669900ms | 72.232020us | 32.170017us | 1.128625us | 1.029201us | 1.226507us | +| 128 | 100 | 1 | 15.885400ms | 128.814330us | 61.444460us | 1.006362us | 911.428750ns | 1.099427us | +| 256 | 100 | 1 | 56.594200ms | 240.844480us | 122.821503us | 940.798750ns | 846.647656ns | 1.035226us | +| 512 | 100 | 1 | 103.087200ms | 404.366160us | 243.435025us | 789.777656ns | 697.650469ns | 883.272949ns | +| 1024 | 100 | 1 | 203.338900ms | 809.226910us | 479.069229us | 790.260654ns | 698.046924ns | 881.454121ns | +| 2048 | 100 | 1 | 330.652000ms | 1.667632ms | 971.367090us | 814.273472ns | 721.436885ns | 905.923735ns | +| 4096 | 100 | 1 | 805.709500ms | 3.488026ms | 1.988139ms | 851.568945ns | 756.016338ns | 946.103794ns | +| 8192 | 100 | 1 | 1615.257700ms | 7.260816ms | 4.071864ms | 886.330038ns | 788.026964ns | 982.472709ns | +| 16384 | 100 | 1 | 3082.711000ms | 15.227668ms | 8.762503ms | 929.423080ns | 822.879848ns | 1.032916us | +| 32768 | 100 | 1 | 5481.318000ms | 33.036341ms | 18.963405ms | 1.008189us | 893.940656ns | 1.120581us | ## SV-SingleBattle-CalcDamage-RandomInputs-OneRandomBattle-ManyRandomInputs | Inputs | Samples | Iterations / Sample | Estimated Completion Time | Mean of Samples | Standard Deviation | Mean / Input Count | Mean Lower Bound / Input Count | Mean Upper Bound / Input Count | | --- | --- | --- | --- | --- | --- | --- | --- | --- | -| 1 | 100 | 1 | 10.486300ms | 12.551690us | 4.939969us | 12.551690us | 11.801650us | 13.871330us | -| 2 | 100 | 1 | 10.251100ms | 16.148960us | 14.948720us | 8.074480us | 7.203045us | 11.255105us | -| 4 | 100 | 1 | 10.529700ms | 16.982840us | 4.147787us | 4.245710us | 4.102212us | 4.570988us | -| 8 | 100 | 1 | 11.666800ms | 22.372840us | 6.536909us | 2.796605us | 2.678155us | 3.027106us | -| 16 | 100 | 1 | 12.657900ms | 29.524580us | 5.918105us | 1.845286us | 1.790352us | 1.946733us | -| 32 | 100 | 1 | 12.943100ms | 43.148950us | 5.900709us | 1.348405us | 1.321441us | 1.399747us | -| 64 | 100 | 1 | 16.287900ms | 70.857670us | 20.982800us | 1.107151us | 1.069266us | 1.242705us | -| 128 | 100 | 1 | 13.552400ms | 120.446930us | 6.255118us | 940.991641ns | 931.771016ns | 950.975391ns | -| 256 | 100 | 1 | 24.253500ms | 224.412720us | 9.096472us | 876.612188ns | 869.818047ns | 883.737500ns | -| 512 | 100 | 1 | 41.019400ms | 435.918390us | 11.144644us | 851.403105ns | 847.286445ns | 855.842754ns | -| 1024 | 100 | 1 | 85.887700ms | 844.569810us | 17.442670us | 824.775205ns | 821.479180ns | 828.173994ns | -| 2048 | 100 | 1 | 172.343800ms | 1.665941ms | 34.921042us | 813.447744ns | 810.211313ns | 816.931372ns | -| 4096 | 100 | 1 | 343.441300ms | 3.341975ms | 64.850353us | 815.911941ns | 812.891006ns | 819.115823ns | -| 8192 | 100 | 1 | 693.842000ms | 6.652714ms | 114.358000us | 812.098854ns | 809.449589ns | 814.914109ns | +| 1 | 100 | 1 | 10.538000ms | 12.912720us | 5.305275us | 12.912720us | 12.073890us | 14.248090us | +| 2 | 100 | 1 | 11.438900ms | 14.612360us | 3.511076us | 7.306180us | 7.052450us | 7.806790us | +| 4 | 100 | 1 | 11.044600ms | 17.408570us | 3.539770us | 4.352143us | 4.226935us | 4.616860us | +| 8 | 100 | 1 | 12.146700ms | 21.279310us | 3.621111us | 2.659914us | 2.597469us | 2.798424us | +| 16 | 100 | 1 | 12.663700ms | 28.855960us | 4.156907us | 1.803497us | 1.764698us | 1.874104us | +| 32 | 100 | 1 | 14.940600ms | 42.661190us | 4.329193us | 1.333162us | 1.310675us | 1.364985us | +| 64 | 100 | 1 | 17.281000ms | 68.893730us | 5.123391us | 1.076465us | 1.061656us | 1.093243us | +| 128 | 100 | 1 | 22.851100ms | 122.301030us | 6.736478us | 955.476797ns | 945.307266ns | 965.960781ns | +| 256 | 100 | 1 | 24.404000ms | 224.218180us | 9.389979us | 875.852266ns | 868.870586ns | 883.299102ns | +| 512 | 100 | 1 | 41.316400ms | 438.166980us | 37.519909us | 855.794883ns | 847.245352ns | 885.507910ns | +| 1024 | 100 | 1 | 86.412700ms | 848.552130us | 20.318059us | 828.664189ns | 824.987148ns | 832.774580ns | +| 2048 | 100 | 1 | 174.216800ms | 1.677681ms | 32.220289us | 819.180254ns | 816.237612ns | 822.408506ns | +| 4096 | 100 | 1 | 342.273900ms | 3.353818ms | 65.053290us | 818.803274ns | 815.994875ns | 822.285818ns | +| 8192 | 100 | 1 | 681.824100ms | 6.685283ms | 118.682143us | 816.074539ns | 813.459924ns | 819.183557ns | +| 16384 | 100 | 1 | 1350.225300ms | 13.496582ms | 217.761960us | 823.766021ns | 821.301966ns | 826.495835ns | +| 32768 | 100 | 1 | 2709.329200ms | 27.295523ms | 563.784328us | 832.993248ns | 829.922355ns | 836.720092ns | ## SV-SingleBattle-CalcDamage-RandomInputs-ManyRandomBattles-ManyRandomInputs | Inputs | Samples | Iterations / Sample | Estimated Completion Time | Mean of Samples | Standard Deviation | Mean / Input Count | Mean Lower Bound / Input Count | Mean Upper Bound / Input Count | | --- | --- | --- | --- | --- | --- | --- | --- | --- | -| 1 | 100 | 1 | 10.573200ms | 12.586110us | 5.108926us | 12.586110us | 11.839100us | 14.015100us | -| 2 | 100 | 1 | 10.191300ms | 14.575170us | 2.885422us | 7.287585us | 7.085605us | 7.718375us | -| 4 | 100 | 1 | 11.220800ms | 17.198410us | 3.130222us | 4.299602us | 4.193195us | 4.540258us | -| 8 | 100 | 1 | 11.667900ms | 22.914080us | 4.434858us | 2.864260us | 2.778139us | 3.007777us | -| 16 | 100 | 1 | 13.743300ms | 32.541930us | 5.740254us | 2.033871us | 1.982355us | 2.137364us | -| 32 | 100 | 1 | 17.037900ms | 50.834080us | 5.067979us | 1.588565us | 1.562143us | 1.625536us | -| 64 | 100 | 1 | 30.270700ms | 91.906530us | 6.799488us | 1.436040us | 1.417862us | 1.460146us | -| 128 | 100 | 1 | 51.069400ms | 167.077270us | 20.953359us | 1.305291us | 1.284772us | 1.366927us | -| 256 | 100 | 1 | 91.714200ms | 319.043760us | 16.154517us | 1.246265us | 1.234959us | 1.259990us | -| 512 | 100 | 1 | 175.181500ms | 625.206870us | 34.427402us | 1.221107us | 1.208910us | 1.235469us | -| 1024 | 100 | 1 | 340.909800ms | 1.632427ms | 117.765488us | 1.594167us | 1.573571us | 1.618825us | -| 2048 | 100 | 1 | 670.482200ms | 3.513888ms | 151.470290us | 1.715766us | 1.704956us | 1.736527us | -| 4096 | 100 | 1 | 1371.315400ms | 8.161003ms | 245.204999us | 1.992432us | 1.983293us | 2.008385us | -| 8192 | 100 | 1 | 2816.055500ms | 18.236383ms | 771.140995us | 2.226121us | 2.213929us | 2.259067us | +| 1 | 100 | 1 | 10.729100ms | 13.068670us | 5.446074us | 13.068670us | 12.206580us | 14.439850us | +| 2 | 100 | 1 | 10.621700ms | 15.442520us | 3.655511us | 7.721260us | 7.439885us | 8.204620us | +| 4 | 100 | 1 | 11.127600ms | 18.475070us | 5.418085us | 4.618767us | 4.432805us | 5.048180us | +| 8 | 100 | 1 | 11.402900ms | 23.585000us | 5.441024us | 2.948125us | 2.849089us | 3.142722us | +| 16 | 100 | 1 | 12.834600ms | 32.961160us | 6.328510us | 2.060073us | 2.002404us | 2.172333us | +| 32 | 100 | 1 | 15.148600ms | 51.316630us | 5.053869us | 1.603645us | 1.576650us | 1.639936us | +| 64 | 100 | 1 | 18.017600ms | 81.612550us | 6.138939us | 1.275196us | 1.259580us | 1.298559us | +| 128 | 100 | 1 | 24.337300ms | 147.009700us | 10.074212us | 1.148513us | 1.136467us | 1.169403us | +| 256 | 100 | 1 | 48.276800ms | 284.590730us | 15.151044us | 1.111683us | 1.100831us | 1.124298us | +| 512 | 100 | 1 | 81.518000ms | 477.152620us | 18.829328us | 931.938711ns | 925.559238ns | 940.201660ns | +| 1024 | 100 | 1 | 158.746300ms | 945.782490us | 30.659633us | 923.615713ns | 918.330264ns | 930.126123ns | +| 2048 | 100 | 1 | 312.796800ms | 1.954374ms | 55.678400us | 954.284092ns | 949.497856ns | 960.242559ns | +| 4096 | 100 | 1 | 638.758100ms | 4.137147ms | 88.799102us | 1.010046us | 1.006234us | 1.014856us | +| 8192 | 100 | 1 | 1251.525700ms | 8.730795ms | 229.171800us | 1.065771us | 1.061466us | 1.073128us | +| 16384 | 100 | 1 | 2566.436500ms | 18.827271ms | 688.261245us | 1.149125us | 1.143205us | 1.161746us | +| 32768 | 100 | 1 | 5576.657400ms | 41.016255ms | 1.219759ms | 1.251717us | 1.246267us | 1.262265us | ## SV-SingleBattle-AnalyzeEffect-RandomInputs-OneRandomBattle-OneRandomInput | Inputs | Samples | Iterations / Sample | Estimated Completion Time | Mean of Samples | Standard Deviation | Mean / Input Count | Mean Lower Bound / Input Count | Mean Upper Bound / Input Count | | --- | --- | --- | --- | --- | --- | --- | --- | --- | -| 1 | 100 | 1 | 33.126900ms | 108.594680us | 39.011286us | 108.594680us | 100.036410us | 115.428000us | -| 2 | 100 | 1 | 23.791200ms | 165.673300us | 55.368324us | 82.836650us | 76.384410us | 87.492895us | -| 4 | 100 | 1 | 37.155800ms | 253.683100us | 86.513999us | 63.420775us | 58.438990us | 67.089988us | -| 8 | 100 | 1 | 61.125600ms | 432.589020us | 145.415484us | 54.073628us | 49.845821us | 57.102587us | -| 16 | 100 | 1 | 119.923900ms | 773.254780us | 274.480340us | 48.328424us | 44.242379us | 51.185137us | -| 32 | 100 | 1 | 187.779600ms | 1.451295ms | 515.577338us | 45.352969us | 41.563927us | 48.027449us | -| 64 | 100 | 1 | 384.340800ms | 2.802276ms | 997.272598us | 43.785558us | 40.133617us | 46.378973us | -| 128 | 100 | 1 | 788.478900ms | 5.422997ms | 1.931317ms | 42.367161us | 38.837549us | 44.885699us | -| 256 | 100 | 1 | 1537.586200ms | 11.104276ms | 4.185046ms | 43.376076us | 39.743385us | 46.203731us | -| 512 | 100 | 1 | 3200.025200ms | 22.839449ms | 8.361439ms | 44.608299us | 40.862477us | 47.357241us | -| 1024 | 100 | 1 | 7629.959000ms | 57.586646ms | 20.727829ms | 56.236959us | 51.503488us | 59.629876us | -| 2048 | 100 | 1 | 15787.804100ms | 132.957534ms | 47.460905ms | 64.920671us | 59.440702us | 68.782190us | -| 4096 | 100 | 1 | 30088.424000ms | 284.363911ms | 101.106038ms | 69.424783us | 63.673265us | 73.518571us | +| 1 | 100 | 1 | 36.671400ms | 81.344940us | 29.032823us | 81.344940us | 75.005200us | 86.517160us | +| 2 | 100 | 1 | 40.707400ms | 111.759160us | 39.953471us | 55.879580us | 51.433835us | 59.365655us | +| 4 | 100 | 1 | 48.143200ms | 159.251620us | 59.072430us | 39.812905us | 36.606325us | 42.442000us | +| 8 | 100 | 1 | 28.755600ms | 244.370230us | 84.936510us | 30.546279us | 28.136359us | 32.363082us | +| 16 | 100 | 1 | 46.708800ms | 412.360210us | 145.539064us | 25.772513us | 23.713184us | 27.329110us | +| 32 | 100 | 1 | 106.215200ms | 727.426240us | 272.457164us | 22.732070us | 20.798157us | 24.196370us | +| 64 | 100 | 1 | 196.995900ms | 1.364235ms | 515.086228us | 21.316174us | 19.509618us | 22.710398us | +| 128 | 100 | 1 | 337.620200ms | 2.643058ms | 1.001600ms | 20.648893us | 18.887709us | 22.002346us | +| 256 | 100 | 1 | 748.184200ms | 5.152363ms | 1.961042ms | 20.126419us | 18.414287us | 21.455897us | +| 512 | 100 | 1 | 1279.857900ms | 10.368929ms | 4.106008ms | 20.251814us | 18.510862us | 21.682885us | +| 1024 | 100 | 1 | 2519.912300ms | 20.637185ms | 7.951448ms | 20.153501us | 18.433115us | 21.506334us | +| 2048 | 100 | 1 | 6426.676000ms | 43.944202ms | 16.982877ms | 21.457130us | 19.613688us | 22.906586us | +| 4096 | 100 | 1 | 14386.745300ms | 102.939655ms | 39.158693ms | 25.131752us | 23.011994us | 26.789883us | +| 8192 | 100 | 1 | 21481.821100ms | 221.872067ms | 84.119247ms | 27.083993us | 24.810718us | 28.875996us | +| 16384 | 100 | 1 | 45772.229200ms | 462.023646ms | 174.934095ms | 28.199685us | 25.784157us | 30.035966us | ## SV-SingleBattle-AnalyzeEffect-RandomInputs-OneRandomBattle-ManyRandomInputs | Inputs | Samples | Iterations / Sample | Estimated Completion Time | Mean of Samples | Standard Deviation | Mean / Input Count | Mean Lower Bound / Input Count | Mean Upper Bound / Input Count | | --- | --- | --- | --- | --- | --- | --- | --- | --- | -| 1 | 100 | 1 | 37.039800ms | 115.186210us | 38.370384us | 115.186210us | 106.291040us | 121.708490us | -| 2 | 100 | 1 | 48.269900ms | 152.048240us | 26.779043us | 76.024120us | 72.629995us | 78.139190us | -| 4 | 100 | 1 | 48.460700ms | 205.175680us | 23.503953us | 51.293920us | 50.107005us | 52.403845us | -| 8 | 100 | 1 | 42.277600ms | 298.240060us | 26.669709us | 37.280007us | 36.576654us | 37.888817us | -| 16 | 100 | 1 | 61.411600ms | 491.602270us | 38.821624us | 30.725142us | 30.262903us | 31.215497us | -| 32 | 100 | 1 | 100.536400ms | 888.648320us | 52.099702us | 27.770260us | 27.453797us | 28.094234us | -| 64 | 100 | 1 | 187.910400ms | 1.715868ms | 88.623265us | 26.810445us | 26.540436us | 27.083040us | -| 128 | 100 | 1 | 392.012400ms | 3.515188ms | 156.645862us | 27.462406us | 27.225916us | 27.702186us | -| 256 | 100 | 1 | 766.318200ms | 7.770418ms | 316.026056us | 30.353196us | 30.111644us | 30.594028us | -| 512 | 100 | 1 | 1849.965300ms | 18.454113ms | 630.134239us | 36.043190us | 35.807204us | 36.288816us | -| 1024 | 100 | 1 | 4495.795000ms | 44.478068ms | 1.195794ms | 43.435614us | 43.214701us | 43.673463us | -| 2048 | 100 | 1 | 10164.869600ms | 103.854560ms | 2.096449ms | 50.710235us | 50.513058us | 50.912677us | -| 4096 | 100 | 1 | 22429.277700ms | 228.235605ms | 3.924056ms | 55.721583us | 55.536874us | 55.911998us | +| 1 | 100 | 1 | 36.725500ms | 81.685720us | 29.438573us | 81.685720us | 75.417840us | 86.990920us | +| 2 | 100 | 1 | 18.399300ms | 107.680390us | 21.366507us | 53.840195us | 51.650185us | 55.868440us | +| 4 | 100 | 1 | 40.946700ms | 145.231800us | 17.671730us | 36.307950us | 35.477235us | 37.215890us | +| 8 | 100 | 1 | 21.485300ms | 206.615590us | 20.947757us | 25.826949us | 25.329959us | 26.358395us | +| 16 | 100 | 1 | 43.091600ms | 339.712910us | 31.730759us | 21.232057us | 20.868899us | 21.647361us | +| 32 | 100 | 1 | 72.251400ms | 588.614550us | 40.669731us | 18.394205us | 18.148724us | 18.647206us | +| 64 | 100 | 1 | 147.132700ms | 1.159463ms | 68.601160us | 18.116604us | 17.905834us | 18.325324us | +| 128 | 100 | 1 | 253.139400ms | 2.547406ms | 117.054769us | 19.901610us | 19.720570us | 20.078795us | +| 256 | 100 | 1 | 664.654600ms | 6.210797ms | 377.568938us | 24.260925us | 23.987121us | 24.568346us | +| 512 | 100 | 1 | 1564.242200ms | 15.738246ms | 556.485988us | 30.738761us | 30.531820us | 30.958934us | +| 1024 | 100 | 1 | 4074.912400ms | 40.678676ms | 1.109544ms | 39.725270us | 39.513187us | 39.937773us | +| 2048 | 100 | 1 | 10127.023300ms | 100.349009ms | 2.091902ms | 48.998540us | 48.796158us | 49.198823us | +| 4096 | 100 | 1 | 23263.046400ms | 227.444640ms | 3.648353ms | 55.528477us | 55.360605us | 55.711593us | +| 8192 | 100 | 1 | 48003.167900ms | 487.220705ms | 7.177495ms | 59.475184us | 59.310396us | 59.654112us | +| 16384 | 100 | 1 | 100444.882600ms | 1020.905302ms | 11.741349ms | 62.311115us | 62.176042us | 62.457279us | ## SV-SingleBattle-AnalyzeEffect-RandomInputs-ManyRandomBattles-ManyRandomInputs | Inputs | Samples | Iterations / Sample | Estimated Completion Time | Mean of Samples | Standard Deviation | Mean / Input Count | Mean Lower Bound / Input Count | Mean Upper Bound / Input Count | | --- | --- | --- | --- | --- | --- | --- | --- | --- | -| 1 | 100 | 1 | 36.739600ms | 110.236210us | 37.455895us | 110.236210us | 101.888810us | 116.751880us | -| 2 | 100 | 1 | 54.466600ms | 187.357070us | 39.240035us | 93.678535us | 89.702365us | 97.377240us | -| 4 | 100 | 1 | 46.245400ms | 294.211470us | 33.413648us | 73.552867us | 71.813570us | 75.112048us | -| 8 | 100 | 1 | 69.442900ms | 516.531790us | 45.920835us | 64.566474us | 63.379519us | 65.628651us | -| 16 | 100 | 1 | 125.471600ms | 952.455210us | 65.114844us | 59.528451us | 58.699794us | 60.289632us | -| 32 | 100 | 1 | 226.989000ms | 1.771526ms | 88.525549us | 55.360199us | 54.819406us | 55.905271us | -| 64 | 100 | 1 | 432.894500ms | 3.392463ms | 133.859650us | 53.007233us | 52.579567us | 53.402356us | -| 128 | 100 | 1 | 843.839800ms | 6.655653ms | 348.016934us | 51.997287us | 51.543584us | 52.644190us | -| 256 | 100 | 1 | 1738.336100ms | 13.220246ms | 386.816245us | 51.641586us | 51.351825us | 51.945617us | -| 512 | 100 | 1 | 3513.729500ms | 29.670437ms | 2.458783ms | 57.950072us | 57.227794us | 59.255054us | -| 1024 | 100 | 1 | 7991.449300ms | 76.510354ms | 2.776718ms | 74.717143us | 74.303276us | 75.425311us | -| 2048 | 100 | 1 | 17027.708100ms | 171.009105ms | 3.847366ms | 83.500540us | 83.176029us | 83.922312us | -| 4096 | 100 | 1 | 36599.551800ms | 360.978848ms | 4.369305ms | 88.129602us | 87.937018us | 88.359820us | +| 1 | 100 | 1 | 37.355400ms | 82.236750us | 29.185043us | 82.236750us | 75.905700us | 87.399180us | +| 2 | 100 | 1 | 41.116800ms | 122.544350us | 20.113241us | 61.272175us | 59.069605us | 63.044365us | +| 4 | 100 | 1 | 24.286300ms | 185.673510us | 19.383570us | 46.418378us | 45.521105us | 47.436475us | +| 8 | 100 | 1 | 29.561300ms | 298.063140us | 25.763323us | 37.257893us | 36.634234us | 37.893652us | +| 16 | 100 | 1 | 63.349200ms | 509.081730us | 33.812344us | 31.817608us | 31.398680us | 32.225256us | +| 32 | 100 | 1 | 107.386100ms | 911.796680us | 48.793263us | 28.493646us | 28.198924us | 28.796039us | +| 64 | 100 | 1 | 199.431100ms | 1.707322ms | 74.445143us | 26.676906us | 26.439242us | 26.896776us | +| 128 | 100 | 1 | 369.371800ms | 3.244154ms | 107.556528us | 25.344953us | 25.176633us | 25.506588us | +| 256 | 100 | 1 | 761.820700ms | 6.314455ms | 141.706411us | 24.665841us | 24.557951us | 24.774593us | +| 512 | 100 | 1 | 1468.177700ms | 12.652643ms | 805.391725us | 24.712193us | 24.483227us | 25.159786us | +| 1024 | 100 | 1 | 2956.285800ms | 26.218907ms | 1.464827ms | 25.604402us | 25.395026us | 26.008409us | +| 2048 | 100 | 1 | 6050.358400ms | 58.820011ms | 3.494198ms | 28.720708us | 28.480211us | 29.232351us | +| 4096 | 100 | 1 | 13853.925000ms | 138.278157ms | 4.001533ms | 33.759316us | 33.603483us | 34.000985us | +| 8192 | 100 | 1 | 29237.777800ms | 295.211390ms | 4.341737ms | 36.036547us | 35.946949us | 36.159639us | +| 16384 | 100 | 1 | 62777.998100ms | 622.595251ms | 7.767672ms | 38.000198us | 37.928546us | 38.128371us | diff --git a/src/Battle/Clone/Clone.cpp b/src/Battle/Clone/Clone.cpp index 658dd50..66d9902 100644 --- a/src/Battle/Clone/Clone.cpp +++ b/src/Battle/Clone/Clone.cpp @@ -3,7 +3,7 @@ #include #include #include -#include +#include #include #include #include @@ -102,11 +102,7 @@ void traversePokemon(types::registry& registry, VisitEntity visitEntity = nullpt const static bool ForCloning = !std::is_same_v; using Tag = std::conditional_t; - for (const auto [entity, moveSlots] : registry.view().each()) { - for (auto move : moveSlots.val) { - registry.emplace(move); - } - + for (types::entity entity : registry.view()) { if constexpr (ForCloning) { visitEntity(entity); } @@ -117,6 +113,7 @@ void traversePokemon(types::registry& registry, VisitEntity visitEntity = nullpt registry.emplace_or_replace(move); } } + for (const auto [entity, moves] : registry.view().each()) { for (types::entity move : moves.val) { registry.emplace_or_replace(move); @@ -124,18 +121,6 @@ void traversePokemon(types::registry& registry, VisitEntity visitEntity = nullpt } } -template -void traverseMove(types::registry& registry, VisitEntity visitEntity = nullptr) { - const static bool ForCloning = !std::is_same_v; - using Tag = std::conditional_t; - - if constexpr (ForCloning) { - for (types::entity entity : registry.view()) { - visitEntity(entity); - } - } -} - void cloneBattle( types::registry& registry, types::ClonedEntityMap& entityMap, entt::dense_map& srcEntityStorages, types::entityIndex cloneCount) { @@ -176,14 +161,6 @@ void clonePokemon( }); } -void cloneMove( - types::registry& registry, types::ClonedEntityMap& entityMap, - entt::dense_map& srcEntityStorages, types::entityIndex cloneCount) { - traverseMove(registry, [&](types::entity entity) { - cloneEntity(entity, registry, entityMap, srcEntityStorages, cloneCount); - }); -} - void deleteBattle(types::registry& registry) { traverseBattle(registry); } @@ -204,10 +181,6 @@ void deletePokemon(types::registry& registry) { traversePokemon(registry); } -void deleteMove(types::registry& registry) { - traverseMove(registry); -} - void remapEntity(types::entity& entity, const CloneTo& cloneTo, const types::ClonedEntityMap& entityMap) { POKESIM_REQUIRE(entityMap.contains(entity), "Source node was not loaded into the map."); POKESIM_REQUIRE( @@ -258,7 +231,6 @@ types::ClonedEntityMap clone(types::registry& registry, std::optional(registry, entityMap); - remapComponentEntities(registry, entityMap); remapComponentEntities(registry, entityMap); remapComponentEntities(registry, entityMap); remapComponentEntities(registry, entityMap); - remapComponentEntities(registry, entityMap); remapComponentEntities(registry, entityMap); remapComponentEntities(registry, entityMap); remapComponentEntities(registry, entityMap); @@ -304,8 +274,6 @@ types::ClonedEntityMap clone(types::registry& registry, std::optional(registry, entityMap); remapComponentEntities(registry, entityMap); remapComponentEntities(registry, entityMap); - remapComponentEntities(registry, entityMap); - remapComponentEntities(registry, entityMap); remapComponentEntities(registry, entityMap); remapComponentEntities(registry, entityMap); remapComponentEntities(registry, entityMap); @@ -335,7 +303,6 @@ void deleteClones(types::registry& registry) { deleteAction(registry); deletePokemon(registry); deleteCurrentActionMove(registry); - deleteMove(registry); auto remove = registry.view(); registry.destroy(remove.begin(), remove.end()); } diff --git a/src/Battle/Helpers/Helpers.cpp b/src/Battle/Helpers/Helpers.cpp index 5f03663..fcdf3b5 100644 --- a/src/Battle/Helpers/Helpers.cpp +++ b/src/Battle/Helpers/Helpers.cpp @@ -2,9 +2,9 @@ #include #include -#include #include #include +#include #include #include #include @@ -89,15 +89,15 @@ types::entity slotToAllyPokemonEntity(const types::registry& registry, const Sid return allyEntity; } -types::entity moveToEntity(const types::registry& registry, const MoveSlots& moveSlots, dex::Move move) { - for (types::entity moveSlot : moveSlots.val) { - if (registry.get(moveSlot).val == move) { - return moveSlot; +types::moveSlotIndex moveToMoveSlot(const MoveSlots& moveSlots, dex::Move move) { + for (types::moveSlotIndex i = 0; i < moveSlots.val.size(); i++) { + if (moveSlots.val[i].move == move) { + return i; } } - POKESIM_REQUIRE_FAIL("No move of entity found."); - return entt::null; + POKESIM_REQUIRE_FAIL("No move found."); + return 0U; } types::entity createActionMoveForTarget( diff --git a/src/Battle/Helpers/Helpers.hpp b/src/Battle/Helpers/Helpers.hpp index 6a678f1..e6ed8a9 100644 --- a/src/Battle/Helpers/Helpers.hpp +++ b/src/Battle/Helpers/Helpers.hpp @@ -4,6 +4,7 @@ #include #include #include +#include namespace pokesim { struct Sides; @@ -14,7 +15,7 @@ types::entity slotToSideEntity(const Sides& sides, Slot targetSlot); types::entity slotToPokemonEntity(const types::registry& registry, types::entity sideEntity, Slot targetSlot); types::entity slotToPokemonEntity(const types::registry& registry, const Sides& sides, Slot targetSlot); types::entity slotToAllyPokemonEntity(const types::registry& registry, const Sides& sides, Slot targetSlot); -types::entity moveToEntity(const types::registry& registry, const MoveSlots& moveSlots, dex::Move move); +types::moveSlotIndex moveToMoveSlot(const MoveSlots& moveSlots, dex::Move move); types::entity createActionMoveForTarget( types::handle targetHandle, types::entity battleEntity, types::entity sourceEntity, dex::Move move, diff --git a/src/Battle/ManageBattleState.cpp b/src/Battle/ManageBattleState.cpp index 6d8e19a..2054381 100644 --- a/src/Battle/ManageBattleState.cpp +++ b/src/Battle/ManageBattleState.cpp @@ -1,10 +1,11 @@ #include "ManageBattleState.hpp" #include +#include #include #include #include -#include +#include #include #include #include @@ -119,9 +120,8 @@ void setCurrentActionMove( createActionMoveForTarget({registry, target}, battleHandle.entity(), source.val, move.val, pokedex); } - types::entity moveSlotEntity = moveToEntity(registry, moveSlots, move.val); - battleHandle.emplace(moveSlotEntity); - registry.emplace(moveSlotEntity); + types::moveSlotIndex moveSlotIndex = moveToMoveSlot(moveSlots, move.val); + battleHandle.emplace(moveSlotIndex); } void setFailedActionMove( @@ -145,9 +145,7 @@ void setFailedActionMove( registry.emplace(battle.val, target.val); } - types::entity moveSlotEntity = registry.get(battle.val).val; registry.erase(battle.val); - registry.erase(moveSlotEntity); updateCurrentActionTargets(registry, registry.get(battle.val)); } diff --git a/src/Battle/Pokemon/ManagePokemonState.cpp b/src/Battle/Pokemon/ManagePokemonState.cpp index cc48432..d58e5a9 100644 --- a/src/Battle/Pokemon/ManagePokemonState.cpp +++ b/src/Battle/Pokemon/ManagePokemonState.cpp @@ -2,16 +2,18 @@ #include #include +#include +#include #include #include -#include #include #include -#include +#include +#include #include #include #include -#include +#include #include #include #include @@ -227,9 +229,13 @@ void clearVolatiles(types::handle pokemonHandle) { pokemonHandle.remove(); } -void deductPp(Pp& pp) { - if (pp.val) { - pp.val -= 1U; // TODO(aed3): Make this into a mechanic constant +void deductPp(types::handle handle, MoveSlots& moveSlots, LastUsedMove lastUsedMove) { + MoveSlot& moveSlot = moveSlots.val[lastUsedMove.val]; + if (moveSlot.pp >= Constants::PP_USE_DEDUCTION) { + moveSlot.pp -= Constants::PP_USE_DEDUCTION; + } + else { + moveSlot.pp = 0U; } } diff --git a/src/Battle/Pokemon/ManagePokemonState.hpp b/src/Battle/Pokemon/ManagePokemonState.hpp index 6c3b4b5..12d0e8d 100644 --- a/src/Battle/Pokemon/ManagePokemonState.hpp +++ b/src/Battle/Pokemon/ManagePokemonState.hpp @@ -12,7 +12,8 @@ struct CurrentActionSource; struct CurrentActionTarget; struct CurrentActionMoveSlot; struct Damage; -struct Pp; +struct LastUsedMove; +struct MoveSlots; namespace stat { struct Atk; @@ -37,7 +38,7 @@ void clearStatus(types::handle pokemonHandle); void clearVolatiles(types::handle pokemonHandle); -void deductPp(Pp& pp); +void deductPp(types::handle handle, MoveSlots& moveSlots, LastUsedMove lastUsedMove); void setLastMoveUsed(types::registry& registry, CurrentActionSource source, const CurrentActionMoveSlot& move); void resetEffectiveAtk(types::handle handle, stat::Atk atk); void resetEffectiveDef(types::handle handle, stat::Def def); diff --git a/src/Battle/Setup/MoveStateSetup.cpp b/src/Battle/Setup/MoveStateSetup.cpp deleted file mode 100644 index f51ae14..0000000 --- a/src/Battle/Setup/MoveStateSetup.cpp +++ /dev/null @@ -1,25 +0,0 @@ -#include "MoveStateSetup.hpp" - -#include -#include -#include - -namespace pokesim { -void MoveStateSetup::initBlank() { - handle.emplace(); - handle.emplace(); - handle.emplace(); -} - -void MoveStateSetup::setName(dex::Move moveName) { - handle.emplace(moveName); -} - -void MoveStateSetup::setPP(types::pp pp) { - handle.emplace(pp); -} - -void MoveStateSetup::setMaxPP(types::pp maxPp) { - handle.emplace(maxPp); -} -} // namespace pokesim diff --git a/src/Battle/Setup/MoveStateSetup.hpp b/src/Battle/Setup/MoveStateSetup.hpp deleted file mode 100644 index 00c9d1c..0000000 --- a/src/Battle/Setup/MoveStateSetup.hpp +++ /dev/null @@ -1,29 +0,0 @@ -#pragma once - -#include -#include -#include -#include -#include - -#include "StateSetupBase.hpp" - -namespace pokesim { -// Tool to set properties of a move's state to an entity. -struct MoveStateSetup : internal::StateSetupBase { - MoveStateSetup() : internal::StateSetupBase() {} - MoveStateSetup(types::registry& registry) : MoveStateSetup(registry, registry.create()) {} - MoveStateSetup(types::registry& registry, types::entity entity) : StateSetupBase(registry, entity) {} - - /** - * @brief Applies the defaults to the required properties for a move state. - * - * Some of the required properties are a blank `MoveName`, `Pp`, and `MaxPp` component. - */ - void initBlank(); - - void setName(dex::Move moveName); - void setPP(types::pp pp); - void setMaxPP(types::pp maxPp); -}; -} // namespace pokesim diff --git a/src/Battle/Setup/PokemonStateSetup.cpp b/src/Battle/Setup/PokemonStateSetup.cpp index 282892e..77b5219 100644 --- a/src/Battle/Setup/PokemonStateSetup.cpp +++ b/src/Battle/Setup/PokemonStateSetup.cpp @@ -3,10 +3,10 @@ #include #include #include -#include #include #include #include +#include #include #include #include @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include @@ -90,13 +91,14 @@ void PokemonStateSetup::setItem(dex::Item item) { item::tags::emplaceTagFromEnum(item, handle); } -void PokemonStateSetup::setMoves(const std::vector& moveSlots) { - MoveSlots& moveEntities = handle.emplace(); +void PokemonStateSetup::setMoves(const std::vector& moveSlots) { + MoveSlots& newMoveSlots = handle.emplace(); POKESIM_REQUIRE( - moveSlots.size() <= moveEntities.val.max_size(), + moveSlots.size() <= newMoveSlots.val.max_size(), "Cannot add more moves to a Pokemon than MAX_MOVE_SLOTS."); - for (types::entity moveSlot : moveSlots) { - moveEntities.val.push_back(moveSlot); + + for (MoveSlot moveSlot : moveSlots) { + newMoveSlots.val.push_back(moveSlot); } } diff --git a/src/Battle/Setup/PokemonStateSetup.hpp b/src/Battle/Setup/PokemonStateSetup.hpp index 6d82aaa..562b20e 100644 --- a/src/Battle/Setup/PokemonStateSetup.hpp +++ b/src/Battle/Setup/PokemonStateSetup.hpp @@ -1,8 +1,6 @@ #pragma once #include -#include -#include #include #include #include @@ -21,6 +19,11 @@ #include "StateSetupBase.hpp" namespace pokesim { +struct Evs; +struct Ivs; +struct SpeciesTypes; +struct MoveSlot; + // Tool to set properties of a Pokemon's state to an entity. struct PokemonStateSetup : internal::StateSetupBase { PokemonStateSetup() : internal::StateSetupBase() {} @@ -50,7 +53,7 @@ struct PokemonStateSetup : internal::StateSetupBase { void setGender(dex::Gender gender); void setAbility(dex::Ability ability); void setItem(dex::Item item); - void setMoves(const std::vector& moveSlots); + void setMoves(const std::vector& moveSlots); void setPostion(types::teamPositionIndex position); void setStatus(dex::Status status); diff --git a/src/Battle/Setup/headers.hpp b/src/Battle/Setup/headers.hpp index e0c976b..af8de34 100644 --- a/src/Battle/Setup/headers.hpp +++ b/src/Battle/Setup/headers.hpp @@ -4,7 +4,6 @@ #include "BattleStateSetup.hpp" #include "EmplaceTagFromEnum.hpp" -#include "MoveStateSetup.hpp" #include "PokemonStateSetup.hpp" #include "SideStateSetup.hpp" #include "StateSetupBase.hpp" diff --git a/src/Battle/headers.hpp b/src/Battle/headers.hpp index 7d62041..a16b66a 100644 --- a/src/Battle/headers.hpp +++ b/src/Battle/headers.hpp @@ -10,7 +10,6 @@ #include "Pokemon/PokemonDataChecks.hpp" #include "Setup/BattleStateSetup.hpp" #include "Setup/EmplaceTagFromEnum.hpp" -#include "Setup/MoveStateSetup.hpp" #include "Setup/PokemonStateSetup.hpp" #include "Setup/SideStateSetup.hpp" #include "Setup/StateSetupBase.hpp" diff --git a/src/CalcDamage/CalcDamageDebugChecks.hpp b/src/CalcDamage/CalcDamageDebugChecks.hpp index f6ede7c..62e8cde 100644 --- a/src/CalcDamage/CalcDamageDebugChecks.hpp +++ b/src/CalcDamage/CalcDamageDebugChecks.hpp @@ -32,8 +32,6 @@ #include #include -#include "Helpers.hpp" - namespace pokesim::calc_damage::debug { struct Checks : pokesim::debug::Checks { Checks(const Simulation& _simulation) : pokesim::debug::Checks(_simulation) {} diff --git a/src/Components/EntityHolders/ChoiceLock.hpp b/src/Components/ChoiceLock.hpp similarity index 58% rename from src/Components/EntityHolders/ChoiceLock.hpp rename to src/Components/ChoiceLock.hpp index 06865c0..8289061 100644 --- a/src/Components/EntityHolders/ChoiceLock.hpp +++ b/src/Components/ChoiceLock.hpp @@ -1,9 +1,9 @@ #pragma once -#include +#include namespace pokesim { struct ChoiceLock { - types::entity val{}; + types::moveSlotIndex val{}; }; } // namespace pokesim diff --git a/src/Components/Current.hpp b/src/Components/Current.hpp new file mode 100644 index 0000000..87e7a2d --- /dev/null +++ b/src/Components/Current.hpp @@ -0,0 +1,10 @@ +#pragma once + +#include + +namespace pokesim { +struct CurrentActionMoveSlot { + types::moveSlotIndex val{}; +}; + +} // namespace pokesim diff --git a/src/Components/DisabledMoveSlots.hpp b/src/Components/DisabledMoveSlots.hpp new file mode 100644 index 0000000..3f90336 --- /dev/null +++ b/src/Components/DisabledMoveSlots.hpp @@ -0,0 +1,9 @@ +#pragma once + +#include + +namespace pokesim { +struct DisabledMoveSlots { + types::moveSlots val{}; +}; +} // namespace pokesim diff --git a/src/Components/EntityHolders/Current.hpp b/src/Components/EntityHolders/Current.hpp index 9ce25c9..f07933e 100644 --- a/src/Components/EntityHolders/Current.hpp +++ b/src/Components/EntityHolders/Current.hpp @@ -37,10 +37,6 @@ struct CurrentActionMovesAsTarget { types::entityVector val{}; }; -struct CurrentActionMoveSlot { - types::entity val{}; -}; - struct CurrentEffectSource { types::entity val{}; }; diff --git a/src/Components/EntityHolders/MoveSlots.hpp b/src/Components/EntityHolders/MoveSlots.hpp deleted file mode 100644 index a47b6c7..0000000 --- a/src/Components/EntityHolders/MoveSlots.hpp +++ /dev/null @@ -1,11 +0,0 @@ -#pragma once - -#include -#include - -namespace pokesim { -// Contains a list of entities of the moves a Pokemon known. -struct MoveSlots { - types::moveSlots val{}; -}; -} // namespace pokesim diff --git a/src/Components/EntityHolders/headers.hpp b/src/Components/EntityHolders/headers.hpp index bc9aabb..885d862 100644 --- a/src/Components/EntityHolders/headers.hpp +++ b/src/Components/EntityHolders/headers.hpp @@ -4,12 +4,9 @@ #include "Battle.hpp" #include "BattleTree.hpp" -#include "ChoiceLock.hpp" #include "Current.hpp" #include "FaintQueue.hpp" #include "FoeSide.hpp" -#include "LastUsedMove.hpp" -#include "MoveSlots.hpp" #include "Pokemon.hpp" #include "RecycledEntities.hpp" #include "Side.hpp" diff --git a/src/Components/EntityHolders/LastUsedMove.hpp b/src/Components/LastUsedMove.hpp similarity index 59% rename from src/Components/EntityHolders/LastUsedMove.hpp rename to src/Components/LastUsedMove.hpp index c0bda2a..5a6215c 100644 --- a/src/Components/EntityHolders/LastUsedMove.hpp +++ b/src/Components/LastUsedMove.hpp @@ -1,9 +1,9 @@ #pragma once -#include +#include namespace pokesim { struct LastUsedMove { - types::entity val{}; + types::moveSlotIndex val{}; }; } // namespace pokesim diff --git a/src/Components/MoveSlots.hpp b/src/Components/MoveSlots.hpp new file mode 100644 index 0000000..c0a8573 --- /dev/null +++ b/src/Components/MoveSlots.hpp @@ -0,0 +1,22 @@ +#pragma once + +#include +#include +#include +#include + +namespace pokesim { +struct MoveSlot { + dex::Move move = dex::Move::NO_MOVE; + types::pp pp = Constants::MovePp::DEFAULT; + types::pp maxPp = Constants::MovePp::DEFAULT; + + constexpr bool operator==(const MoveSlot& other) const { + return move == other.move && pp == other.pp && maxPp == other.maxPp; + } +}; + +struct MoveSlots { + types::moveSlots val{}; +}; +} // namespace pokesim diff --git a/src/Components/PP.hpp b/src/Components/Pokedex/PP.hpp similarity index 72% rename from src/Components/PP.hpp rename to src/Components/Pokedex/PP.hpp index 0528393..affb0a2 100644 --- a/src/Components/PP.hpp +++ b/src/Components/Pokedex/PP.hpp @@ -7,8 +7,4 @@ namespace pokesim { struct Pp { types::pp val = Constants::MovePp::DEFAULT; }; - -struct MaxPp { - types::pp val = Constants::MoveMaxPp::DEFAULT; -}; } // namespace pokesim diff --git a/src/Components/Pokedex/headers.hpp b/src/Components/Pokedex/headers.hpp index 808bc9d..35b5121 100644 --- a/src/Components/Pokedex/headers.hpp +++ b/src/Components/Pokedex/headers.hpp @@ -4,3 +4,4 @@ #include "Abilities.hpp" #include "BaseStats.hpp" +#include "PP.hpp" diff --git a/src/Components/Tags/MovePropertyTags.hpp b/src/Components/Tags/MovePropertyTags.hpp index 9212508..702ad6d 100644 --- a/src/Components/Tags/MovePropertyTags.hpp +++ b/src/Components/Tags/MovePropertyTags.hpp @@ -20,8 +20,6 @@ struct Punch {}; struct VariableHitCount {}; // Move Property Tag: A multi-hit move where each hit checks accuracy (i.e. Triple Kick) struct AccuracyDependentHitCount {}; - -struct Disabled {}; } // namespace tags namespace effect::tags { diff --git a/src/Components/headers.hpp b/src/Components/headers.hpp index 9069d09..953095b 100644 --- a/src/Components/headers.hpp +++ b/src/Components/headers.hpp @@ -17,17 +17,17 @@ #include "CalcDamage/DamageRollSides.hpp" #include "CalcDamage/ModifyingEventRanTags.hpp" #include "CalcDamage/TemporaryMoveProperties.hpp" +#include "ChoiceLock.hpp" #include "CloneFromCloneTo.hpp" +#include "Current.hpp" #include "Damage.hpp" +#include "DisabledMoveSlots.hpp" #include "EVsIVs.hpp" #include "EntityHolders/Battle.hpp" #include "EntityHolders/BattleTree.hpp" -#include "EntityHolders/ChoiceLock.hpp" #include "EntityHolders/Current.hpp" #include "EntityHolders/FaintQueue.hpp" #include "EntityHolders/FoeSide.hpp" -#include "EntityHolders/LastUsedMove.hpp" -#include "EntityHolders/MoveSlots.hpp" #include "EntityHolders/Pokemon.hpp" #include "EntityHolders/RecycledEntities.hpp" #include "EntityHolders/Side.hpp" @@ -36,7 +36,9 @@ #include "EventModifier.hpp" #include "HitCount.hpp" #include "ID.hpp" +#include "LastUsedMove.hpp" #include "Level.hpp" +#include "MoveSlots.hpp" #include "Names/AbilityNames.hpp" #include "Names/GenderNames.hpp" #include "Names/ItemNames.hpp" @@ -53,10 +55,10 @@ #include "Names/TypeNames.hpp" #include "Names/VolatileNames.hpp" #include "Names/WeatherNames.hpp" -#include "PP.hpp" #include "PlayerSide.hpp" #include "Pokedex/Abilities.hpp" #include "Pokedex/BaseStats.hpp" +#include "Pokedex/PP.hpp" #include "Position.hpp" #include "Priority.hpp" #include "Probability.hpp" diff --git a/src/Pokedex/Events/EffectEvents.cpp b/src/Pokedex/Events/EffectEvents.cpp index de412c1..619ed8e 100644 --- a/src/Pokedex/Events/EffectEvents.cpp +++ b/src/Pokedex/Events/EffectEvents.cpp @@ -1,11 +1,12 @@ #include #include #include +#include #include +#include #include -#include #include -#include +#include #include #include #include @@ -60,16 +61,12 @@ void choiceLockRemoveWithItem( } void choiceLockOnDisableMove( - types::registry& registry, const pokesim::ChoiceLock& choiceLocked, const MoveSlots& moveSlots) { - POKESIM_REQUIRE( - std::find(moveSlots.val.begin(), moveSlots.val.end(), choiceLocked.val) != moveSlots.val.end(), - "Should skip if the move is no longer present, but when does that happen?"); - - for (types::entity entity : moveSlots.val) { - if (entity != choiceLocked.val) { - registry.emplace(entity); - } + types::handle handle, const pokesim::ChoiceLock& choiceLocked, const MoveSlots& moveSlots) { + if (!handle.all_of()) { + handle.emplace(types::moveSlots(moveSlots.val.size(), false)); } + + handle.get().val[choiceLocked.val] = true; } } // namespace diff --git a/src/Pokedex/Events/ItemEvents.cpp b/src/Pokedex/Events/ItemEvents.cpp index 54b6bdd..72c7db1 100644 --- a/src/Pokedex/Events/ItemEvents.cpp +++ b/src/Pokedex/Events/ItemEvents.cpp @@ -1,9 +1,10 @@ #include #include #include +#include +#include #include #include -#include #include #include #include diff --git a/src/Pokedex/Setup/MoveDexDataSetup.cpp b/src/Pokedex/Setup/MoveDexDataSetup.cpp index 79ba64f..d695a14 100644 --- a/src/Pokedex/Setup/MoveDexDataSetup.cpp +++ b/src/Pokedex/Setup/MoveDexDataSetup.cpp @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/SimulateTurn/SimulateTurn.cpp b/src/SimulateTurn/SimulateTurn.cpp index 9b890c6..8a15007 100644 --- a/src/SimulateTurn/SimulateTurn.cpp +++ b/src/SimulateTurn/SimulateTurn.cpp @@ -9,18 +9,21 @@ #include #include #include +#include +#include #include #include #include #include -#include #include #include +#include +#include #include #include #include -#include #include +#include #include #include #include @@ -148,8 +151,8 @@ void runMoveAction(Simulation& simulation) { runBeforeMove(simulation); - simulation.view>(); simulation.view(); + simulation.view>(); useMove(simulation); } @@ -256,16 +259,12 @@ void incrementTurn(Turn& turn) { turn.val++; } -void updateActivePokemonPostTurn(types::registry& registry, const pokesim::MoveSlots& moveSlots) { - registry.remove(moveSlots.val.begin(), moveSlots.val.end()); -} - void nextTurn(Simulation& simulation) { getBattleFilter(simulation).view(); pokesim::internal::EntityFilter pokemonFilter{simulation}; if (!pokemonFilter.hasNoneSelected()) { - pokemonFilter.view(); + simulation.removeFromEntities(); pokemonFilter.addToSelected(); runDisableMove(simulation); diff --git a/src/SimulateTurn/SimulateTurnDebugChecks.hpp b/src/SimulateTurn/SimulateTurnDebugChecks.hpp index afee333..f0165fe 100644 --- a/src/SimulateTurn/SimulateTurnDebugChecks.hpp +++ b/src/SimulateTurn/SimulateTurnDebugChecks.hpp @@ -5,10 +5,10 @@ #ifdef POKESIM_DEBUG_CHECK_UTILITIES #include -#include #include #include #include +#include #include #include #include @@ -101,9 +101,6 @@ struct Checks : pokesim::debug::Checks { checkSide(sideEntity); for (types::entity pokemonEntity : registry->get(sideEntity).val) { checkPokemon(pokemonEntity); - for (types::entity moveEntity : registry->get(pokemonEntity).val) { - checkMoveSlot(moveEntity); - } } } } diff --git a/src/Simulation/RunEvent.cpp b/src/Simulation/RunEvent.cpp index eb45d1a..0c05a47 100644 --- a/src/Simulation/RunEvent.cpp +++ b/src/Simulation/RunEvent.cpp @@ -6,11 +6,11 @@ #include #include #include +#include #include -#include #include -#include #include +#include #include #include #include diff --git a/src/Simulation/Simulation.hpp b/src/Simulation/Simulation.hpp index d2bcce1..368f559 100644 --- a/src/Simulation/Simulation.hpp +++ b/src/Simulation/Simulation.hpp @@ -39,7 +39,6 @@ struct SimulationSetupChecks; */ class Simulation { private: - types::entityVector createInitialMoves(const std::vector& moveInfoList); PokemonStateSetup createInitialPokemon(const PokemonCreationInfo& pokemonInfo); void createInitialSide( SideStateSetup sideSetup, const SideCreationInfo& sideInfo, const BattleCreationInfo& battleInfo); diff --git a/src/Simulation/SimulationSetup.cpp b/src/Simulation/SimulationSetup.cpp index e64f46b..6e952fd 100644 --- a/src/Simulation/SimulationSetup.cpp +++ b/src/Simulation/SimulationSetup.cpp @@ -9,9 +9,10 @@ #include #include #include -#include +#include #include #include +#include #include #include #include @@ -148,27 +149,6 @@ void setPokemonCurrentBoosts(const PokemonCreationInfo& pokemonInfo, PokemonStat } } // namespace -types::entityVector Simulation::createInitialMoves(const std::vector& moveInfoList) { - types::entityVector moveEntities{}; - moveEntities.reserve((types::entityVector::size_type)moveInfoList.size()); - - for (const MoveCreationInfo& moveInfo : moveInfoList) { - MoveStateSetup moveSetup(registry); - moveSetup.setName(moveInfo.name); - types::pp maxPp = Constants::MoveMaxPp::DEFAULT; - if (!moveInfo.pp.has_value() || !moveInfo.maxPp.has_value()) { - maxPp = pokedex().getMoveData(moveInfo.name).val; - } - maxPp = moveInfo.maxPp.value_or(maxPp); - - moveSetup.setPP(moveInfo.pp.value_or(maxPp)); - moveSetup.setMaxPP(maxPp); - moveEntities.push_back(moveSetup.entity()); - } - - return moveEntities; -} - PokemonStateSetup Simulation::createInitialPokemon(const PokemonCreationInfo& pokemonInfo) { PokemonStateSetup pokemonSetup(registry); if (pokemonInfo.id.has_value()) { @@ -240,19 +220,18 @@ void Simulation::createInitialSide( pokemonSetup.setProperty(); } - types::entityVector moveEntities = createInitialMoves(pokemonInfo.moves); + std::vector moveSlots; + for (const MoveCreationInfo& moveInfo : pokemonInfo.moves) { + types::pp maxPp = Constants::MoveMaxPp::DEFAULT; + if (!moveInfo.pp.has_value() || !moveInfo.maxPp.has_value()) { + maxPp = pokedex().getMoveData(moveInfo.name).val; + } + maxPp = moveInfo.maxPp.value_or(maxPp); - if (battleInfo.runWithSimulateTurn) { - registry.insert(moveEntities.begin(), moveEntities.end()); - } - if (battleInfo.runWithCalculateDamage) { - registry.insert(moveEntities.begin(), moveEntities.end()); - } - if (battleInfo.runWithAnalyzeEffect) { - registry.insert(moveEntities.begin(), moveEntities.end()); + moveSlots.push_back({moveInfo.name, moveInfo.pp.value_or(maxPp), maxPp}); } - pokemonSetup.setMoves(moveEntities); + pokemonSetup.setMoves(moveSlots); pokemonSetupList.push_back(pokemonSetup); } diff --git a/src/Simulation/SimulationSetupDebugChecks.hpp b/src/Simulation/SimulationSetupDebugChecks.hpp index 2c37892..bc92ea7 100644 --- a/src/Simulation/SimulationSetupDebugChecks.hpp +++ b/src/Simulation/SimulationSetupDebugChecks.hpp @@ -14,12 +14,12 @@ #include #include #include -#include #include #include #include #include #include +#include #include #include #include @@ -32,8 +32,8 @@ #include #include #include -#include #include +#include #include #include #include @@ -274,18 +274,15 @@ struct SimulationSetupChecks { POKESIM_REQUIRE_NM(moveSlots.val.size() == creationInfo.moves.size()); for (std::size_t i = 0U; i < creationInfo.moves.size(); i++) { - const MoveCreationInfo& move = creationInfo.moves[i]; - types::entity moveEntity = moveSlots.val[(types::moveSlotIndex)i]; - POKESIM_REQUIRE_NM(registry->all_of(moveEntity)); - POKESIM_REQUIRE_NM(registry->all_of(moveEntity)); - POKESIM_REQUIRE_NM(registry->all_of(moveEntity)); - POKESIM_REQUIRE_NM(registry->get(moveEntity).val == move.name); - - types::pp idealMaxPp = move.maxPp.value_or(pokedex->getMoveData(move.name).val); - types::pp idealPp = move.pp.value_or(idealMaxPp); - POKESIM_REQUIRE_NM(registry->get(moveEntity).val == idealPp); - POKESIM_REQUIRE_NM(registry->get(moveEntity).val == idealMaxPp); - pokesim::debug::checkMoveSlot(moveEntity, *registry); + const MoveCreationInfo& moveInfo = creationInfo.moves[i]; + MoveSlot moveSlot = moveSlots.val[(types::moveSlotIndex)i]; + types::pp idealMaxPp = moveInfo.maxPp.value_or(pokedex->getMoveData(moveInfo.name).val); + types::pp idealPp = moveInfo.pp.value_or(idealMaxPp); + + POKESIM_REQUIRE_NM(moveSlot.move == moveInfo.name); + POKESIM_REQUIRE_NM(moveSlot.pp == idealPp); + POKESIM_REQUIRE_NM(moveSlot.maxPp == idealMaxPp); + pokesim::debug::check(moveSlot); } if (creationInfo.currentHp.has_value()) { diff --git a/src/Types/Constants.hpp b/src/Types/Constants.hpp index f481a08..40f95fe 100644 --- a/src/Types/Constants.hpp +++ b/src/Types/Constants.hpp @@ -19,6 +19,8 @@ struct Constants { static constexpr std::uint8_t SIDE_COUNT = 2U; + static constexpr std::uint8_t PP_USE_DEDUCTION = 1U; + struct PokemonLevel { static constexpr std::uint8_t MAX = 100U; static constexpr std::uint8_t MIN = 1U; diff --git a/src/Utilities/ArgumentChecks.cpp b/src/Utilities/ArgumentChecks.cpp index ee4552e..9f209ed 100644 --- a/src/Utilities/ArgumentChecks.cpp +++ b/src/Utilities/ArgumentChecks.cpp @@ -242,20 +242,7 @@ void checkPokemon(types::entity pokemonEntity, const types::registry& registry) if (effectiveSpd) check(*effectiveSpd); if (effectiveSpe) check(*effectiveSpe); - checkBounds(moveSlots.val.size()); -} - -void checkMoveSlot(types::entity moveSlotEntity, const types::registry& registry) { - types::registry::checkEntity(moveSlotEntity, registry); - POKESIM_REQUIRE_NM(has(moveSlotEntity, registry)); - POKESIM_REQUIRE_NM(has(moveSlotEntity, registry)); - POKESIM_REQUIRE_NM(has(moveSlotEntity, registry)); - - const auto& [move, pp, maxPp] = registry.get(moveSlotEntity); - - check(move); - check(pp); - check(maxPp); + check(moveSlots); } void checkActionMove(types::entity moveEntity, const types::registry& registry) { @@ -526,6 +513,16 @@ void check(const calc_damage::Power& power) { checkBounds(power.val); } +template <> +void check(const ChoiceLock& choiceLock) { + POKESIM_REQUIRE_NM(choiceLock.val < Constants::MoveSlots::MAX); +} + +template <> +void check(const CurrentActionMoveSlot& currentActionMoveSlot) { + POKESIM_REQUIRE_NM(currentActionMoveSlot.val < Constants::MoveSlots::MAX); +} + template <> void check(const Damage& damage) { POKESIM_REQUIRE_NM(damage.val <= Constants::Damage::MAX); @@ -545,6 +542,14 @@ void check(const DamageRolls& damageRolls) { } } +template <> +void check(const DisabledMoveSlots& disabledMoveSlots) { + checkBounds(disabledMoveSlots.val.size()); + POKESIM_REQUIRE( + listContains(disabledMoveSlots.val, true), + "The component should be removed if no moves are disabled."); +} + template <> void check(const Evs& evs) { checkEv(evs.hp); @@ -585,11 +590,6 @@ void check(const ParentEntity& parentEntity, const types::registry& registry) { types::registry::checkEntity(parentEntity.val, registry); } -template <> -void check(const ChoiceLock& choiceLock, const types::registry& registry) { - checkMoveSlot(choiceLock.val, registry); -} - template <> void check(const CurrentAction& currentAction, const types::registry& registry) { checkAction(currentAction.val, registry); @@ -639,11 +639,6 @@ void check(const CurrentActionMovesAsTarget& moves, const types::registry& regis } } -template <> -void check(const CurrentActionMoveSlot& move, const types::registry& registry) { - checkMoveSlot(move.val, registry); -} - template <> void check(const CurrentEffectSource& source, const types::registry& registry) { checkPokemon(source.val, registry); @@ -682,19 +677,6 @@ void check(const FoeSide& foeSide, const types::registry& registry) { checkSide(foeSide.val, registry); } -template <> -void check(const LastUsedMove& lastUsedMove, const types::registry& registry) { - checkMoveSlot(lastUsedMove.val, registry); -} - -template <> -void check(const MoveSlots& moveSlots, const types::registry& registry) { - checkBounds(moveSlots.val.size()); - for (types::entity moveEntity : moveSlots.val) { - checkMoveSlot(moveEntity, registry); - } -} - template <> void check(const Pokemon& pokemon, const types::registry& registry) { checkPokemon(pokemon.val, registry); @@ -732,11 +714,31 @@ void check(const HitCount& hitCount) { checkBounds(hitCount.val); } +template <> +void check(const LastUsedMove& lastUsedMove) { + POKESIM_REQUIRE_NM(lastUsedMove.val < Constants::MoveSlots::MAX); +} + template <> void check(const Level& level) { checkBounds(level.val); } +template <> +void check(const MoveSlot& moveSlot) { + check(MoveName{moveSlot.move}); + check(Pp{moveSlot.pp}); + checkBounds(moveSlot.maxPp); +} + +template <> +void check(const MoveSlots& moveSlots) { + checkBounds(moveSlots.val.size()); + for (MoveSlot moveSlot : moveSlots.val) { + check(moveSlot); + } +} + template <> void check(const AbilityName& abilityName) { POKESIM_REQUIRE_NM(abilityName.val != dex::Ability::NO_ABILITY); @@ -842,16 +844,6 @@ void check(const WeatherName& weatherName) { POKESIM_REQUIRE_NM((std::underlying_type_t)weatherName.val <= dex::TOTAL_WEATHER_COUNT); } -template <> -void check(const Pp& pp) { - checkBounds(pp.val); -} - -template <> -void check(const MaxPp& maxPp) { - checkBounds(maxPp.val); -} - template <> void check(const PlayerSide& playerSide) { checkPlayerSideId(playerSide.val); @@ -882,6 +874,11 @@ void check(const BaseStats& baseStats) { checkBaseStat(baseStats.spe); } +template <> +void check(const Pp& pp) { + checkBounds(pp.val); +} + template <> void check(const Position& position) { checkBounds(position.val); diff --git a/src/Utilities/ArgumentChecks.hpp b/src/Utilities/ArgumentChecks.hpp index 2c9e661..517b32c 100644 --- a/src/Utilities/ArgumentChecks.hpp +++ b/src/Utilities/ArgumentChecks.hpp @@ -22,17 +22,19 @@ struct DefBoost; struct SpaBoost; struct SpdBoost; struct SpeBoost; +struct ChoiceLock; struct CloneTo; +struct CurrentActionMoveSlot; struct Damage; struct DamageRollModifiers; struct DamageRolls; +struct DisabledMoveSlots; struct Evs; struct Ivs; struct Battle; struct ParentBattle; struct RootBattle; struct ParentEntity; -struct ChoiceLock; struct CurrentAction; struct CurrentActionTargets; struct CurrentActionSource; @@ -41,15 +43,12 @@ struct FailedCurrentActionSource; struct FailedCurrentActionTarget; struct CurrentActionMovesAsSource; struct CurrentActionMovesAsTarget; -struct CurrentActionMoveSlot; struct CurrentEffectSource; struct CurrentEffectTarget; struct CurrentEffectsAsSource; struct CurrentEffectsAsTarget; struct FaintQueue; struct FoeSide; -struct LastUsedMove; -struct MoveSlots; struct Pokemon; struct RecycledAction; struct Side; @@ -58,7 +57,10 @@ struct Team; struct EventModifier; struct HitCount; struct Id; +struct LastUsedMove; struct Level; +struct MoveSlot; +struct MoveSlots; struct AbilityName; struct GenderName; struct ItemName; @@ -75,13 +77,12 @@ struct TerrainName; struct TypeName; struct VolatileName; struct WeatherName; -struct Pp; -struct MaxPp; struct PlayerSide; struct PrimaryAbility; struct SecondaryAbility; struct HiddenAbility; struct BaseStats; +struct Pp; struct Position; struct MovePriority; struct Probability; @@ -157,7 +158,6 @@ void check(const T&) {} void checkBattle(types::entity, const types::registry&); void checkSide(types::entity, const types::registry&); void checkPokemon(types::entity, const types::registry&); -void checkMoveSlot(types::entity, const types::registry&); void checkActionMove(types::entity, const types::registry&); void checkPercentChance(types::percentChance); @@ -236,8 +236,14 @@ void check(const calc_damage::RealEffectiveStat&); template <> void check(const calc_damage::Power&); +template <> +void check(const ChoiceLock&); + // template <> void check(const CloneTo&); +template <> +void check(const CurrentActionMoveSlot&); + template <> void check(const Damage&); @@ -247,6 +253,9 @@ void check(const DamageRollModifiers&); template <> void check(const DamageRolls&); +template <> +void check(const DisabledMoveSlots&); + template <> void check(const Evs&); @@ -265,9 +274,6 @@ void check(const RootBattle&, const types::registry&); template <> void check(const ParentEntity&, const types::registry&); -template <> -void check(const ChoiceLock&, const types::registry&); - template <> void check(const CurrentAction&, const types::registry&); @@ -292,9 +298,6 @@ void check(const CurrentActionMovesAsSource&, const types::registry&); template <> void check(const CurrentActionMovesAsTarget&, const types::registry&); -template <> -void check(const CurrentActionMoveSlot&, const types::registry&); - template <> void check(const CurrentEffectSource&, const types::registry&); @@ -313,12 +316,6 @@ void check(const FaintQueue&, const types::registry&); template <> void check(const FoeSide&, const types::registry&); -template <> -void check(const LastUsedMove&, const types::registry&); - -template <> -void check(const MoveSlots&, const types::registry&); - template <> void check(const Pokemon&, const types::registry&); @@ -341,9 +338,18 @@ void check(const HitCount&); // template <> void check(const Id&); +template <> +void check(const LastUsedMove&); + template <> void check(const Level&); +template <> +void check(const MoveSlot&); + +template <> +void check(const MoveSlots&); + template <> void check(const AbilityName&); @@ -392,12 +398,6 @@ void check(const VolatileName&); template <> void check(const WeatherName&); -template <> -void check(const Pp&); - -template <> -void check(const MaxPp&); - template <> void check(const PlayerSide&); @@ -413,6 +413,9 @@ void check(const HiddenAbility&); template <> void check(const BaseStats&); +template <> +void check(const Pp&); + template <> void check(const Position&); diff --git a/src/Utilities/DebugChecks.hpp b/src/Utilities/DebugChecks.hpp index e549b60..85d1b66 100644 --- a/src/Utilities/DebugChecks.hpp +++ b/src/Utilities/DebugChecks.hpp @@ -8,18 +8,18 @@ #include #include #include -#include #include #include #include #include #include #include +#include #include #include #include -#include #include +#include #include #include #include @@ -109,7 +109,6 @@ struct Checks { return finalEntityCount; } - void checkMoveSlot(types::entity moveEntity) const { pokesim::debug::checkMoveSlot(moveEntity, *registry); } void checkPokemon(types::entity pokemonEntity) const { pokesim::debug::checkPokemon(pokemonEntity, *registry); } void checkSide(types::entity sideEntity) const { pokesim::debug::checkSide(sideEntity, *registry); } void checkBattle(types::entity battleEntity) const { pokesim::debug::checkBattle(battleEntity, *registry); } diff --git a/src/Utilities/FixedMemoryVector.hpp b/src/Utilities/FixedMemoryVector.hpp index 0ca4fc3..1689b34 100644 --- a/src/Utilities/FixedMemoryVector.hpp +++ b/src/Utilities/FixedMemoryVector.hpp @@ -24,6 +24,12 @@ class fixedMemoryVector : private std::array { "A std::vector for this type and size would be smaller."); } + fixedMemoryVector(std::uint8_t size, const T& value) : fixedMemoryVector() { + for (std::uint8_t i = 0; i < size; i++) { + push_back(value); + } + } + fixedMemoryVector(std::initializer_list list) : fixedMemoryVector() { for (const T& item : list) { push_back(item); diff --git a/tests/BattleStateTest.cpp b/tests/BattleStateTest.cpp index b6def94..ede27a3 100644 --- a/tests/BattleStateTest.cpp +++ b/tests/BattleStateTest.cpp @@ -152,26 +152,14 @@ TEST_CASE("Clone Battles", "[Simulation][Setup]") { REQUIRE_FALSE(existingEntities.contains(clonePokemon)); existingEntities.insert(clonePokemon); - const auto& [baseMoveSlots, basePokemonSide, basePokemonBattle] = - registry.get(basePokemon); - const auto& [cloneMoveSlots, clonePokemonSide, clonePokemonBattle] = - registry.get(clonePokemon); + const auto& [basePokemonSide, basePokemonBattle] = registry.get(basePokemon); + const auto& [clonePokemonSide, clonePokemonBattle] = registry.get(clonePokemon); REQUIRE(basePokemonSide.val != clonePokemonSide.val); REQUIRE(cloneSide == clonePokemonSide.val); REQUIRE(basePokemonBattle.val != clonePokemonBattle.val); REQUIRE(battle == clonePokemonBattle.val); - - REQUIRE(baseMoveSlots.val.size() == cloneMoveSlots.val.size()); - - for (types::moveSlotIndex j = 0U; j < baseMoveSlots.val.size(); j++) { - types::entity baseMoveSlot = baseMoveSlots.val[j]; - types::entity cloneMoveSlot = cloneMoveSlots.val[j]; - existingEntities.insert(baseMoveSlot); - REQUIRE_FALSE(existingEntities.contains(cloneMoveSlot)); - existingEntities.insert(cloneMoveSlot); - } } }; diff --git a/tests/Effects/ChoiceLock.cpp b/tests/Effects/ChoiceLock.cpp index f5068ce..e1f3b98 100644 --- a/tests/Effects/ChoiceLock.cpp +++ b/tests/Effects/ChoiceLock.cpp @@ -73,20 +73,26 @@ TEST_CASE("Choice Lock: Choice lock starts", "[Simulation][SimulateTurn][Effect] types::entity p2Side = sides.val.p2(); types::entity p1Pokemon = registry.get(p1Side).val[0]; types::entity p2Pokemon = registry.get(p2Side).val[0]; - types::entity p1Move = registry.get(p1Pokemon).val[0]; - types::entity p2Move = registry.get(p2Pokemon).val[0]; + types::moveSlotIndex p1MoveIndex = 0U; + types::moveSlotIndex p2MoveIndex = 0U; - checks.checkEntityForChanges(p1Pokemon); - checks.checkEntityForChanges(p2Pokemon); + checks.checkEntityForChanges(p1Pokemon); + checks.checkEntityForChanges(p2Pokemon); auto p1PokemonLastUsedMove = registry.get(p1Pokemon); - REQUIRE(p1PokemonLastUsedMove.val == p1Move); + REQUIRE(p1PokemonLastUsedMove.val == p1MoveIndex); auto p2PokemonLastUsedMove = registry.get(p2Pokemon); - REQUIRE(p2PokemonLastUsedMove.val == p2Move); + REQUIRE(p2PokemonLastUsedMove.val == p2MoveIndex); auto choiceLock = registry.get(p2Pokemon); - REQUIRE(choiceLock.val == p2Move); + REQUIRE(choiceLock.val == p2MoveIndex); + + auto disabledMoveSlots = registry.get(p2Pokemon); + REQUIRE(disabledMoveSlots.val[p2MoveIndex] == true); + + checks.checkMovePpUsage(p1Pokemon, p1MoveIndex); + checks.checkMovePpUsage(p2Pokemon, p2MoveIndex); } TEST_CASE( @@ -165,20 +171,28 @@ TEST_CASE( types::entity p2Side = sides.val.p2(); types::entity p1Pokemon = registry.get(p1Side).val[0]; types::entity p2Pokemon = registry.get(p2Side).val[0]; - types::entity p1Move = registry.get(p1Pokemon).val[1]; - types::entity p2Move = registry.get(p2Pokemon).val[0]; - - checks.checkEntityForChanges(p1Pokemon); - checks.checkEntityForChanges( - p2Pokemon); + types::moveSlotIndex p1MoveIndex = 1U; + types::moveSlotIndex p2MoveIndex = 0U; + + checks.checkEntityForChanges(p1Pokemon); + checks.checkEntityForChanges< + LastUsedMove, + ItemName, + item::tags::ChoiceScarf, + stat::EffectiveSpe, + stat::CurrentHp, + MoveSlots>(p2Pokemon); auto p1PokemonLastUsedMove = registry.get(p1Pokemon); - REQUIRE(p1PokemonLastUsedMove.val == p1Move); + REQUIRE(p1PokemonLastUsedMove.val == p1MoveIndex); auto p2PokemonLastUsedMove = registry.get(p2Pokemon); - REQUIRE(p2PokemonLastUsedMove.val == p2Move); + REQUIRE(p2PokemonLastUsedMove.val == p2MoveIndex); REQUIRE_FALSE(registry.all_of(p2Pokemon)); REQUIRE_FALSE(registry.all_of(p2Pokemon)); + + checks.checkMovePpUsage(p1Pokemon, p1MoveIndex); + checks.checkMovePpUsage(p2Pokemon, p2MoveIndex); } } // namespace pokesim diff --git a/tests/Effects/Paralysis.cpp b/tests/Effects/Paralysis.cpp index 845bb89..30734bc 100644 --- a/tests/Effects/Paralysis.cpp +++ b/tests/Effects/Paralysis.cpp @@ -80,8 +80,8 @@ TEST_CASE("Paralysis: Can cause move failure", "[Simulation][SimulateTurn][Effec types::entity p2Side = sides.val.p2(); types::entity p1Pokemon = registry.get(p1Side).val[0]; types::entity p2Pokemon = registry.get(p2Side).val[0]; - types::entity p1Move = registry.get(p1Pokemon).val[1]; - types::entity p2Move = registry.get(p2Pokemon).val[0]; + types::moveSlotIndex p1MoveIndex = 1U; + types::moveSlotIndex p2MoveIndex = 0U; REQUIRE(turn.val == 2U); auto initialRngSeed = checks.getInitialComponents(battle); @@ -95,19 +95,18 @@ TEST_CASE("Paralysis: Can cause move failure", "[Simulation][SimulateTurn][Effec if (paralysisStoppedP1Move) { checks.checkEntityForChanges<>(p1Pokemon); - checks.checkEntityForChanges<>(p1Move); - checks.checkEntityForChanges(p2Pokemon); + checks.checkEntityForChanges(p2Pokemon); } if (p1Moved) { - checks.checkEntityForChanges(p1Pokemon); - checks.checkMovePpUsage(p1Move); + checks.checkEntityForChanges(p1Pokemon); + checks.checkMovePpUsage(p1Pokemon, p1MoveIndex); - checks.checkEntityForChanges(p2Pokemon); + checks.checkEntityForChanges(p2Pokemon); auto p1PokemonLastUsedMove = registry.get(p1Pokemon); - REQUIRE(p1PokemonLastUsedMove.val == p1Move); + REQUIRE(p1PokemonLastUsedMove.val == p1MoveIndex); auto p2PokemonHp = registry.get(p2Pokemon); auto initialP2PokemonHp = checks.getInitialComponents(p2Pokemon); @@ -115,9 +114,9 @@ TEST_CASE("Paralysis: Can cause move failure", "[Simulation][SimulateTurn][Effec } auto p2PokemonLastUsedMove = registry.get(p2Pokemon); - REQUIRE(p2PokemonLastUsedMove.val == p2Move); + REQUIRE(p2PokemonLastUsedMove.val == p2MoveIndex); - checks.checkMovePpUsage(p2Move); + checks.checkMovePpUsage(p2Pokemon, p2MoveIndex); foundProbabilities.insert(probability.val); } diff --git a/tests/Moves/KnockOff.cpp b/tests/Moves/KnockOff.cpp index 29e9241..53093f6 100644 --- a/tests/Moves/KnockOff.cpp +++ b/tests/Moves/KnockOff.cpp @@ -79,25 +79,30 @@ TEST_CASE("Knock Off: Remove Most Items", "[Simulation][SimulateTurn][Move][Knoc types::entity p2Side = sides.val.p2(); types::entity p1Pokemon = registry.get(p1Side).val[0]; types::entity p2Pokemon = registry.get(p2Side).val[0]; - types::entity p1Move = registry.get(p1Pokemon).val[1]; - types::entity p2Move = registry.get(p2Pokemon).val[0]; - - checks.checkEntityForChanges(p1Pokemon); - checks.checkEntityForChanges( - p2Pokemon); + types::moveSlotIndex p1MoveIndex = 1U; + types::moveSlotIndex p2MoveIndex = 0U; + + checks.checkEntityForChanges(p1Pokemon); + checks.checkEntityForChanges< + stat::CurrentHp, + LastUsedMove, + ItemName, + item::tags::AssaultVest, + stat::EffectiveSpd, + MoveSlots>(p2Pokemon); auto p1PokemonLastUsedMove = registry.get(p1Pokemon); - REQUIRE(p1PokemonLastUsedMove.val == p1Move); + REQUIRE(p1PokemonLastUsedMove.val == p1MoveIndex); auto p2PokemonLastUsedMove = registry.get(p2Pokemon); - REQUIRE(p2PokemonLastUsedMove.val == p2Move); + REQUIRE(p2PokemonLastUsedMove.val == p2MoveIndex); auto p2PokemonHp = registry.get(p2Pokemon); auto initialP2PokemonHp = checks.getInitialComponents(p2Pokemon); REQUIRE(p2PokemonHp.val < initialP2PokemonHp.val); - checks.checkMovePpUsage(p1Move); - checks.checkMovePpUsage(p2Move); + checks.checkMovePpUsage(p1Pokemon, p1MoveIndex); + checks.checkMovePpUsage(p2Pokemon, p2MoveIndex); REQUIRE_FALSE(registry.all_of(p2Pokemon)); REQUIRE_FALSE(registry.all_of(p2Pokemon)); diff --git a/tests/SimulateTurnsTest.cpp b/tests/SimulateTurnsTest.cpp index 1e32c31..23730cb 100644 --- a/tests/SimulateTurnsTest.cpp +++ b/tests/SimulateTurnsTest.cpp @@ -281,22 +281,22 @@ TEST_CASE("Simulate Turn: Battle ends on faint", "[Simulation][SimulateTurn]") { types::entity p2Side = sides.val.p2(); types::entity p1Pokemon = registry.get(p1Side).val[0]; types::entity p2Pokemon = registry.get(p2Side).val[0]; - types::entity p1Move = registry.get(p1Pokemon).val[0]; - types::entity p2Move = registry.get(p2Pokemon).val[0]; + types::moveSlotIndex p1MoveIndex = 0U; + types::moveSlotIndex p2MoveIndex = 0U; - checks.checkEntityForChanges(p1Pokemon); - checks.checkEntityForChanges(p2Pokemon); + checks.checkEntityForChanges(p1Pokemon); + checks.checkEntityForChanges(p2Pokemon); auto p2PokemonLastUsedMove = registry.get(p2Pokemon); - REQUIRE(p2PokemonLastUsedMove.val == p2Move); + REQUIRE(p2PokemonLastUsedMove.val == p2MoveIndex); auto p1PokemonHp = registry.get(p1Pokemon); REQUIRE(p1PokemonHp.val == Constants::PokemonCurrentHpStat::MIN); REQUIRE(registry.all_of(p1Pokemon)); REQUIRE_FALSE(registry.all_of(p1Pokemon)); - checks.checkMovePpUsage(p1Move); - checks.checkMovePpUsage(p2Move); + checks.checkMovePpUsage(p1Pokemon, p1MoveIndex); + checks.checkMovePpUsage(p1Pokemon, p2MoveIndex); REQUIRE(winner.val == PlayerSideId::P2); } diff --git a/tests/SimulationSetupTest.cpp b/tests/SimulationSetupTest.cpp index 9dd7271..e15f513 100644 --- a/tests/SimulationSetupTest.cpp +++ b/tests/SimulationSetupTest.cpp @@ -257,7 +257,6 @@ TEST_CASE("Simulation Setup: Calc Damage", "[Simulation][CalculateDamage][Setup] std::size_t idealCalcDamageTagCount = 1U + // Battle 2U + // Sides 6U + // Pokemon - 6U + // Moves 6U; // Damage calculation move inputs REQUIRE(calcDamageTagCount == idealCalcDamageTagCount); @@ -296,8 +295,7 @@ TEST_CASE("Simulation Setup: Analyze Effect", "[Simulation][AnalyzeEffect][Setup std::size_t analyzeEffectTagCount = registry.view().size(); std::size_t idealAnalyzeEffectTagCount = 1U + // Battle 2U + // Sides - 6U + // Pokemon - 6U; // Moves + 6U; // Pokemon REQUIRE(analyzeEffectTagCount == idealAnalyzeEffectTagCount); } diff --git a/tests/Tests.hpp b/tests/Tests.hpp index 96c9e60..8cd55fb 100644 --- a/tests/Tests.hpp +++ b/tests/Tests.hpp @@ -207,11 +207,10 @@ struct TestChecks : debug::Checks { return registryOnInput.get(getInitialEntity(entity)); } - void checkMovePpUsage(types::entity moveSlot) { - checkEntityForChanges(moveSlot); - auto movePp = registry->get(moveSlot); - auto initialMovePp = getInitialComponents(moveSlot); - REQUIRE(movePp.val == initialMovePp.val - 1U); + void checkMovePpUsage(types::entity entity, types::moveSlotIndex moveSlotIndex) { + auto movePp = registry->get(entity).val[moveSlotIndex].pp; + auto initialMovePp = getInitialComponents(entity).val[moveSlotIndex].pp; + REQUIRE(movePp == initialMovePp - Constants::PP_USE_DEDUCTION); } TestChecks(const Simulation& _simulation, const types::entityVector& specificallyCheckedEntities = {}) diff --git a/tests/VerticalSlices.cpp b/tests/VerticalSlices.cpp index a0d7134..eb94978 100644 --- a/tests/VerticalSlices.cpp +++ b/tests/VerticalSlices.cpp @@ -314,6 +314,7 @@ TEST_CASE( tags::Pokemon, stat::CurrentHp, LastUsedMove, + MoveSlots, StatusName, status::tags::Paralysis, stat::EffectiveSpe>(); @@ -513,8 +514,8 @@ TEST_CASE( types::entity p2Side = sides.val.p2(); types::entity p1Pokemon = registry.get(p1Side).val[0]; types::entity p2Pokemon = registry.get(p2Side).val[0]; - types::entity p1Move = registry.get(p1Pokemon).val[1]; - types::entity p2Move = registry.get(p2Pokemon).val[0]; + types::moveSlotIndex p1MoveIndex = 1U; + types::moveSlotIndex p2MoveIndex = 0U; bool p1Paralyzed = registry.all_of(p1Pokemon); const auto& [p1Hp, p1LastUsedMove, p1Speed] = @@ -544,10 +545,10 @@ TEST_CASE( REQUIRE_FALSE(registry.all_of(p1Side)); REQUIRE_FALSE(registry.all_of(p2Side)); - REQUIRE(p1LastUsedMove.val == p1Move); - REQUIRE(p2LastUsedMove.val == p2Move); - checks.checkMovePpUsage(p1Move); - checks.checkMovePpUsage(p2Move); + REQUIRE(p1LastUsedMove.val == p1MoveIndex); + REQUIRE(p2LastUsedMove.val == p2MoveIndex); + checks.checkMovePpUsage(p1Pokemon, p1MoveIndex); + checks.checkMovePpUsage(p2Pokemon, p2MoveIndex); if (!p2DamageInfo.mightCauseParalysis() || !p1Paralyzed) { REQUIRE_FALSE(registry.all_of(p1Pokemon)); @@ -885,17 +886,17 @@ TEST_CASE( types::entity p1BPokemon = registry.get(p1Side).val[1]; types::entity p2APokemon = registry.get(p2Side).val[0]; types::entity p2BPokemon = registry.get(p2Side).val[1]; - types::entity p1AMove = registry.get(p1APokemon).val[0]; - types::entity p1BMove = registry.get(p1BPokemon).val[0]; - types::entity p2AMove = registry.get(p2APokemon).val[0]; - types::entity p2BMove = registry.get(p2BPokemon).val[0]; + types::moveSlotIndex p1AMoveIndex = 0U; + types::moveSlotIndex p1BMoveIndex = 0U; + types::moveSlotIndex p2AMoveIndex = 0U; + types::moveSlotIndex p2BMoveIndex = 0U; bool p2ABurned = registry.all_of(p2APokemon); bool p2BFainted = registry.all_of(p2BPokemon); bool p2BSpaBoosted = registry.all_of(p2BPokemon); - const auto& [p1AHp, p1AChoiceLock, p1ALastUsedMove] = - registry.get(p1APokemon); + const auto& [p1AHp, p1AChoiceLock, p1ALastUsedMove, p1ADisabledMoveSlots] = + registry.get(p1APokemon); const auto& [p1BHp, p1BLastUsedMove] = registry.get(p1BPokemon); const auto& [p2AHp, p2ALastUsedMove, effectiveAtk] = registry.get(p2APokemon); @@ -904,22 +905,23 @@ TEST_CASE( CAPTURE(p1AHp.val, p1BHp.val, p2AHp.val, p2BHp.val, p2ABurned, p2BFainted, p2BSpaBoosted, probability.val); - checks.checkEntityForChanges(p1APokemon); - checks.checkEntityForChanges(p1BPokemon); - checks.checkEntityForChanges(p2APokemon); + checks.checkEntityForChanges(p1APokemon); + checks.checkEntityForChanges(p1BPokemon); + checks.checkEntityForChanges(p2APokemon); - checks.checkMovePpUsage(p1AMove); - checks.checkMovePpUsage(p1BMove); - checks.checkMovePpUsage(p2AMove); + checks.checkMovePpUsage(p1APokemon, p1AMoveIndex); + checks.checkMovePpUsage(p1BPokemon, p1BMoveIndex); + checks.checkMovePpUsage(p2APokemon, p2AMoveIndex); - REQUIRE(p1ALastUsedMove.val == p1AMove); - REQUIRE(p1BLastUsedMove.val == p1BMove); - REQUIRE(p2ALastUsedMove.val == p2AMove); + REQUIRE(p1ALastUsedMove.val == p1AMoveIndex); + REQUIRE(p1BLastUsedMove.val == p1BMoveIndex); + REQUIRE(p2ALastUsedMove.val == p2AMoveIndex); // P1A (Gardevoir) Specific Checks types::stat p1ABurnHpDecrease = p1AInfo.stats.hp.value() / dex::Burn::onResidualHpDecreaseDivisor(TestMechanic); REQUIRE(p1AHp.val == p1AInfo.stats.hp.value() - p1ABurnHpDecrease); - REQUIRE(p1AChoiceLock.val == p1AMove); + REQUIRE(p1AChoiceLock.val == p1AMoveIndex); + REQUIRE(p1ADisabledMoveSlots.val[p1AMoveIndex] == true); // P1B (Dragapult) Specific Checks REQUIRE_FALSE(registry.all_of(p1BPokemon)); @@ -958,7 +960,6 @@ TEST_CASE( REQUIRE(expectedP2BHp.contains(p2BHp.val)); if (p2BFainted) { checks.checkEntityForChanges(p2BPokemon); - checks.checkEntityForChanges<>(p2BMove); REQUIRE_FALSE(registry.all_of(p2BPokemon)); REQUIRE_FALSE(p2BSpaBoosted); REQUIRE(p2BHp.val == MIN_HP); @@ -973,7 +974,8 @@ TEST_CASE( stat::EffectiveSpa, stat::EffectiveSpd, stat::EffectiveSpe, - LastUsedMove>(p2BPokemon); + LastUsedMove, + MoveSlots>(p2BPokemon); const auto& [p2BLastUsedMove, p2BSpdBoost, p2BSpeBoost] = registry.get(p2BPokemon); const auto& [p2BInitialSpa, p2BInitialSpd, p2BInitialSpe] = @@ -981,8 +983,8 @@ TEST_CASE( REQUIRE_FALSE(p2BHp.val == MIN_HP); - checks.checkMovePpUsage(p2BMove); - REQUIRE(p2BLastUsedMove.val == p2BMove); + checks.checkMovePpUsage(p2BPokemon, p2BMoveIndex); + REQUIRE(p2BLastUsedMove.val == p2BMoveIndex); using Effects = dex::QuiverDance::targetPrimaryEffect; REQUIRE(p2BSpdBoost.val == Effects::spdBoost(TestMechanic)); From c3f001779853b4b0585bf4ec4ee071b300149d9a Mon Sep 17 00:00:00 2001 From: aed3 <32887801+aed3@users.noreply.github.com> Date: Sat, 20 Jun 2026 14:14:09 -0500 Subject: [PATCH 05/10] RNG state wasn't updating properly in benchmarks Turns out a reference was missing in the random input creation code, so the benchmarks for that were not as random as they ought to be. This commit updates the numbers with now more random inputs. There were no substancial differences except the simulate turn, one random battle, many random inputs test getting slower. --- benchmarks/RandomInputs.cpp | 3 +- extras/RecentBenchmarkResults.md | 472 +++++++++++++++---------------- src/Pokedex/Pokedex.cpp | 8 + 3 files changed, 246 insertions(+), 237 deletions(-) diff --git a/benchmarks/RandomInputs.cpp b/benchmarks/RandomInputs.cpp index 322683e..5f12831 100644 --- a/benchmarks/RandomInputs.cpp +++ b/benchmarks/RandomInputs.cpp @@ -49,7 +49,7 @@ struct Random { }; template - static auto pickFromList(const T& list, types::rngState rngState) { + static auto pickFromList(const T& list, types::rngState& rngState) { return list[internal::nextBoundedRandomValue(rngState, (types::rngResult)list.size())]; } @@ -307,6 +307,7 @@ struct Random { } } + pokedex.loadForBattleInfo(battleInfoList); simulation.createInitialStates(battleInfoList); updateAllStats(simulation); } diff --git a/extras/RecentBenchmarkResults.md b/extras/RecentBenchmarkResults.md index e0923e8..3731012 100644 --- a/extras/RecentBenchmarkResults.md +++ b/extras/RecentBenchmarkResults.md @@ -7,311 +7,311 @@ ## SV-SingleBattle-MonteCarlo-SimulateTurn-VerticalSlice1 | Inputs | Samples | Iterations / Sample | Estimated Completion Time | Mean of Samples | Standard Deviation | Mean / Input Count | Mean Lower Bound / Input Count | Mean Upper Bound / Input Count | | --- | --- | --- | --- | --- | --- | --- | --- | --- | -| 1 | 100 | 1 | 42.536700ms | 62.231270us | 11.113151us | 62.231270us | 60.932140us | 66.763930us | -| 2 | 100 | 1 | 43.419400ms | 71.074130us | 12.863451us | 35.537065us | 34.783105us | 38.262205us | -| 4 | 100 | 1 | 45.833100ms | 81.390040us | 15.569806us | 20.347510us | 19.806952us | 21.531792us | -| 8 | 100 | 1 | 46.945300ms | 99.375610us | 19.110356us | 12.421951us | 12.089456us | 13.150538us | -| 16 | 100 | 1 | 51.786800ms | 131.160220us | 14.674538us | 8.197514us | 8.080276us | 8.517334us | -| 32 | 100 | 1 | 57.862900ms | 181.343770us | 13.801070us | 5.666993us | 5.610762us | 5.813761us | -| 64 | 100 | 1 | 69.883500ms | 280.680550us | 13.955913us | 4.385634us | 4.357257us | 4.461054us | -| 128 | 100 | 1 | 91.491700ms | 479.095630us | 16.637239us | 3.742935us | 3.723109us | 3.776863us | -| 256 | 100 | 1 | 104.683300ms | 845.093170us | 20.045639us | 3.301145us | 3.290165us | 3.324612us | -| 512 | 100 | 1 | 167.435600ms | 1.587119ms | 15.056327us | 3.099841us | 3.094350us | 3.105919us | -| 1024 | 100 | 1 | 322.657600ms | 3.091806ms | 45.855768us | 3.019342us | 3.012591us | 3.031477us | -| 2048 | 100 | 1 | 635.560300ms | 6.066456ms | 48.847736us | 2.962137us | 2.957827us | 2.967247us | -| 4096 | 100 | 1 | 1246.255000ms | 12.076220ms | 150.027414us | 2.948296us | 2.941943us | 2.956599us | -| 8192 | 100 | 1 | 2520.486500ms | 24.436971ms | 342.630813us | 2.983029us | 2.976061us | 2.992819us | -| 16384 | 100 | 1 | 5020.253000ms | 50.508387ms | 749.247965us | 3.082787us | 3.074834us | 3.093068us | -| 32768 | 100 | 1 | 10539.320600ms | 105.862918ms | 982.772364us | 3.230680us | 3.225527us | 3.237521us | -| 65536 | 100 | 1 | 21457.442100ms | 215.082182ms | 1.443558ms | 3.281894us | 3.277988us | 3.286691us | +| 1 | 100 | 1 | 41.579100ms | 63.429530us | 9.509649us | 63.429530us | 62.039830us | 66.099610us | +| 2 | 100 | 1 | 42.198400ms | 74.741050us | 12.510411us | 37.370525us | 36.505560us | 39.282075us | +| 4 | 100 | 1 | 43.467500ms | 80.745220us | 13.262154us | 20.186305us | 19.683880us | 21.071395us | +| 8 | 100 | 1 | 46.156600ms | 96.913360us | 13.234323us | 12.114170us | 11.854730us | 12.533791us | +| 16 | 100 | 1 | 51.853000ms | 131.059840us | 16.956060us | 8.191240us | 8.040601us | 8.501952us | +| 32 | 100 | 1 | 56.454600ms | 181.320260us | 14.451182us | 5.666258us | 5.599112us | 5.789598us | +| 64 | 100 | 1 | 67.206500ms | 275.435010us | 13.751382us | 4.303672us | 4.276800us | 4.384274us | +| 128 | 100 | 1 | 87.593200ms | 465.923920us | 14.424395us | 3.640031us | 3.624341us | 3.674280us | +| 256 | 100 | 1 | 102.727700ms | 841.092380us | 13.885214us | 3.285517us | 3.276864us | 3.298951us | +| 512 | 100 | 1 | 168.902600ms | 1.588512ms | 21.969476us | 3.102562us | 3.094484us | 3.111399us | +| 1024 | 100 | 1 | 323.553100ms | 3.080763ms | 37.581602us | 3.008558us | 3.002031us | 3.016512us | +| 2048 | 100 | 1 | 618.944500ms | 5.984909ms | 77.918391us | 2.922319us | 2.915810us | 2.931042us | +| 4096 | 100 | 1 | 1209.759500ms | 11.829342ms | 138.673378us | 2.888023us | 2.882064us | 2.895420us | +| 8192 | 100 | 1 | 2420.074400ms | 23.816536ms | 262.427743us | 2.907292us | 2.901542us | 2.914193us | +| 16384 | 100 | 1 | 4918.713300ms | 49.087176ms | 700.293550us | 2.996043us | 2.989257us | 3.006727us | +| 32768 | 100 | 1 | 10077.118900ms | 101.228403ms | 761.523912us | 3.089246us | 3.084961us | 3.094108us | +| 65536 | 100 | 1 | 20764.869700ms | 206.473722ms | 1.133217ms | 3.150539us | 3.147338us | 3.154144us | ## SV-SingleBattle-Branching-SimulateTurn-VerticalSlice1 | Inputs | Samples | Iterations / Sample | Estimated Completion Time | Mean of Samples | Standard Deviation | Mean / Input Count | Mean Lower Bound / Input Count | Mean Upper Bound / Input Count | | --- | --- | --- | --- | --- | --- | --- | --- | --- | -| 1 | 100 | 1 | 59.451300ms | 180.517900us | 14.983619us | 180.517900us | 178.666590us | 186.057060us | -| 2 | 100 | 1 | 63.493500ms | 240.510670us | 19.041011us | 120.255335us | 119.063350us | 123.693800us | -| 4 | 100 | 1 | 41.218100ms | 337.480470us | 12.459125us | 84.370117us | 83.972065us | 85.476165us | -| 8 | 100 | 1 | 62.137300ms | 527.426440us | 13.618466us | 65.928305us | 65.715754us | 66.553231us | -| 16 | 100 | 1 | 100.652300ms | 886.721420us | 16.497677us | 55.420089us | 55.294364us | 55.821076us | -| 32 | 100 | 1 | 173.599100ms | 1.571108ms | 16.210339us | 49.097116us | 49.003185us | 49.201756us | -| 64 | 100 | 1 | 314.708700ms | 2.908236ms | 33.251838us | 45.441184us | 45.364526us | 45.587180us | -| 128 | 100 | 1 | 611.153000ms | 5.607166ms | 67.999115us | 43.805984us | 43.726668us | 43.951909us | -| 256 | 100 | 1 | 1179.841300ms | 10.889757ms | 93.589132us | 42.538113us | 42.469481us | 42.612721us | -| 512 | 100 | 1 | 2248.266200ms | 21.274400ms | 182.783054us | 41.551562us | 41.484639us | 41.624755us | -| 1024 | 100 | 1 | 4345.571400ms | 42.181767ms | 1.553062ms | 41.193132us | 40.980732us | 41.650444us | -| 2048 | 100 | 1 | 8397.330100ms | 84.108923ms | 3.123932ms | 41.068810us | 40.859731us | 41.545084us | -| 4096 | 100 | 1 | 17443.771300ms | 177.428937ms | 5.015225ms | 43.317612us | 43.135290us | 43.654843us | -| 8192 | 100 | 1 | 39000.674000ms | 393.129357ms | 9.034095ms | 47.989423us | 47.811843us | 48.263243us | +| 1 | 100 | 1 | 58.777400ms | 173.837830us | 14.096320us | 173.837830us | 171.829090us | 177.969950us | +| 2 | 100 | 1 | 62.815400ms | 232.660250us | 16.405877us | 116.330125us | 115.265130us | 119.180250us | +| 4 | 100 | 1 | 39.757800ms | 332.280990us | 13.464069us | 83.070247us | 82.657737us | 84.361833us | +| 8 | 100 | 1 | 60.155500ms | 522.850340us | 31.961562us | 65.356293us | 64.747308us | 66.403758us | +| 16 | 100 | 1 | 98.641100ms | 873.117850us | 10.080035us | 54.569866us | 54.477282us | 54.747185us | +| 32 | 100 | 1 | 169.569600ms | 1.558562ms | 11.196824us | 48.705071us | 48.641043us | 48.778413us | +| 64 | 100 | 1 | 313.022300ms | 2.913635ms | 35.163386us | 45.525541us | 45.427912us | 45.645105us | +| 128 | 100 | 1 | 604.217700ms | 5.598821ms | 52.991884us | 43.740788us | 43.666879us | 43.829881us | +| 256 | 100 | 1 | 1152.209400ms | 10.843975ms | 105.338364us | 42.359276us | 42.285156us | 42.447634us | +| 512 | 100 | 1 | 2247.700200ms | 21.186711ms | 224.922674us | 41.380296us | 41.302782us | 41.476162us | +| 1024 | 100 | 1 | 4311.243400ms | 41.464090ms | 475.648445us | 40.492275us | 40.411104us | 40.595234us | +| 2048 | 100 | 1 | 8352.562100ms | 82.691045ms | 806.079092us | 40.376487us | 40.306968us | 40.462067us | +| 4096 | 100 | 1 | 17344.227900ms | 174.189338ms | 896.630282us | 42.526694us | 42.485183us | 42.571140us | +| 8192 | 100 | 1 | 38285.011500ms | 385.837980ms | 2.321682ms | 47.099363us | 47.045254us | 47.156506us | ## SV-DoubleBattle-MonteCarlo-SimulateTurn-VerticalSlice1 | Inputs | Samples | Iterations / Sample | Estimated Completion Time | Mean of Samples | Standard Deviation | Mean / Input Count | Mean Lower Bound / Input Count | Mean Upper Bound / Input Count | | --- | --- | --- | --- | --- | --- | --- | --- | --- | -| 1 | 100 | 1 | 29.162500ms | 99.932110us | 13.225306us | 99.932110us | 98.367660us | 105.305410us | -| 2 | 100 | 1 | 27.673500ms | 117.107930us | 14.622831us | 58.553965us | 57.627850us | 61.204945us | -| 4 | 100 | 1 | 30.667900ms | 136.463990us | 15.428466us | 34.115997us | 33.635852us | 35.561817us | -| 8 | 100 | 1 | 35.049700ms | 171.450960us | 17.813437us | 21.431370us | 21.139739us | 22.189959us | -| 16 | 100 | 1 | 44.094700ms | 232.363320us | 16.553101us | 14.522708us | 14.390809us | 14.883299us | -| 32 | 100 | 1 | 42.288900ms | 333.452470us | 15.894550us | 10.420390us | 10.358411us | 10.603464us | -| 64 | 100 | 1 | 61.549500ms | 525.858100us | 14.467910us | 8.216533us | 8.185976us | 8.289030us | -| 128 | 100 | 1 | 99.783700ms | 901.259440us | 17.347371us | 7.041089us | 7.021297us | 7.078925us | -| 256 | 100 | 1 | 171.109600ms | 1.632284ms | 17.849704us | 6.376108us | 6.365461us | 6.394671us | -| 512 | 100 | 1 | 309.265100ms | 3.040787ms | 43.942043us | 5.939037us | 5.927683us | 5.967412us | -| 1024 | 100 | 1 | 598.947600ms | 5.907157ms | 63.145025us | 5.768708us | 5.758302us | 5.783059us | -| 2048 | 100 | 1 | 1173.511500ms | 11.697478ms | 142.243040us | 5.711659us | 5.699751us | 5.727434us | -| 4096 | 100 | 1 | 2341.729700ms | 23.416173ms | 286.979280us | 5.716839us | 5.705012us | 5.733070us | -| 8192 | 100 | 1 | 4709.867600ms | 47.938132ms | 837.820014us | 5.851823us | 5.836692us | 5.880421us | -| 16384 | 100 | 1 | 10066.857000ms | 101.179667ms | 1.739754ms | 6.175517us | 6.159080us | 6.202960us | -| 32768 | 100 | 1 | 21555.270700ms | 215.142421ms | 2.665011ms | 6.565626us | 6.552818us | 6.586163us | -| 65536 | 100 | 1 | 45729.788400ms | 450.709449ms | 4.727660ms | 6.877280us | 6.865054us | 6.893904us | +| 1 | 100 | 1 | 27.729100ms | 101.523170us | 15.705023us | 101.523170us | 99.228800us | 105.960290us | +| 2 | 100 | 1 | 27.080700ms | 118.033260us | 18.861481us | 59.016630us | 57.697490us | 61.872350us | +| 4 | 100 | 1 | 30.042600ms | 143.136680us | 18.457267us | 35.784170us | 35.038488us | 36.919942us | +| 8 | 100 | 1 | 34.820700ms | 169.327890us | 14.455146us | 21.165986us | 20.879646us | 21.616838us | +| 16 | 100 | 1 | 42.357200ms | 225.576480us | 13.315040us | 14.098530us | 13.977849us | 14.334689us | +| 32 | 100 | 1 | 42.010000ms | 321.774230us | 12.526661us | 10.055445us | 10.006604us | 10.200827us | +| 64 | 100 | 1 | 60.169900ms | 507.333410us | 11.668030us | 7.927085us | 7.902762us | 7.987494us | +| 128 | 100 | 1 | 98.479400ms | 884.146020us | 18.079982us | 6.907391us | 6.880567us | 6.936014us | +| 256 | 100 | 1 | 168.201100ms | 1.580103ms | 30.617953us | 6.172277us | 6.155873us | 6.209277us | +| 512 | 100 | 1 | 302.652200ms | 2.927718ms | 54.274347us | 5.718199us | 5.701677us | 5.745255us | +| 1024 | 100 | 1 | 579.348100ms | 5.689773ms | 63.807797us | 5.556419us | 5.545255us | 5.569841us | +| 2048 | 100 | 1 | 1144.752800ms | 11.215307ms | 121.242334us | 5.476224us | 5.465866us | 5.489279us | +| 4096 | 100 | 1 | 2281.014200ms | 22.341452ms | 222.725909us | 5.454456us | 5.444807us | 5.466274us | +| 8192 | 100 | 1 | 4612.834500ms | 45.583350ms | 514.184411us | 5.564374us | 5.553213us | 5.577984us | +| 16384 | 100 | 1 | 9544.904800ms | 95.968194ms | 837.453700us | 5.857434us | 5.848044us | 5.868305us | +| 32768 | 100 | 1 | 20405.352600ms | 205.006195ms | 1.605314ms | 6.256293us | 6.249235us | 6.270404us | +| 65536 | 100 | 1 | 43003.729200ms | 431.689494ms | 1.549578ms | 6.587059us | 6.583108us | 6.592673us | ## SV-DoubleBattle-Branching-SimulateTurn-VerticalSlice1 | Inputs | Samples | Iterations / Sample | Estimated Completion Time | Mean of Samples | Standard Deviation | Mean / Input Count | Mean Lower Bound / Input Count | Mean Upper Bound / Input Count | | --- | --- | --- | --- | --- | --- | --- | --- | --- | -| 1 | 100 | 1 | 65.881100ms | 406.993220us | 18.625175us | 406.993220us | 404.715460us | 414.032310us | -| 2 | 100 | 1 | 70.715900ms | 588.988260us | 15.853121us | 294.494130us | 293.526205us | 297.533285us | -| 4 | 100 | 1 | 106.775700ms | 927.803930us | 18.998869us | 231.950983us | 231.191557us | 233.129437us | -| 8 | 100 | 1 | 169.871100ms | 1.542042ms | 21.647674us | 192.755240us | 192.331214us | 193.444487us | -| 16 | 100 | 1 | 292.657700ms | 2.727508ms | 22.456899us | 170.469238us | 170.199626us | 170.751709us | -| 32 | 100 | 1 | 550.576300ms | 5.079421ms | 46.697691us | 158.731922us | 158.475474us | 159.049588us | -| 64 | 100 | 1 | 1060.993200ms | 9.793381ms | 307.671871us | 153.021575us | 152.253338us | 154.199617us | -| 128 | 100 | 1 | 2013.087000ms | 18.780317ms | 161.390558us | 146.721227us | 146.495869us | 146.991782us | -| 256 | 100 | 1 | 3885.176100ms | 37.786332ms | 1.412906ms | 147.602860us | 146.828850us | 149.255105us | -| 512 | 100 | 1 | 7755.867400ms | 76.322816ms | 2.344005ms | 149.068000us | 148.375303us | 150.306959us | -| 1024 | 100 | 1 | 15050.985300ms | 150.921196ms | 3.384511ms | 147.383980us | 146.897555us | 148.305337us | -| 2048 | 100 | 1 | 30221.116000ms | 304.876982ms | 5.760509ms | 148.865714us | 148.432066us | 149.602153us | -| 4096 | 100 | 1 | 62871.594300ms | 634.325709ms | 7.909586ms | 154.864675us | 154.550361us | 155.334271us | +| 1 | 100 | 1 | 64.560700ms | 416.794910us | 14.716872us | 416.794910us | 414.578540us | 420.757400us | +| 2 | 100 | 1 | 69.132800ms | 581.412670us | 14.183965us | 290.706335us | 289.700090us | 292.792770us | +| 4 | 100 | 1 | 103.847200ms | 912.976180us | 17.445613us | 228.244045us | 227.645465us | 229.588347us | +| 8 | 100 | 1 | 169.645300ms | 1.530592ms | 17.464651us | 191.323951us | 191.017310us | 191.985100us | +| 16 | 100 | 1 | 292.642800ms | 2.716110ms | 34.155778us | 169.756866us | 169.381930us | 170.225704us | +| 32 | 100 | 1 | 538.856000ms | 5.084671ms | 56.755839us | 158.895959us | 158.578251us | 159.275925us | +| 64 | 100 | 1 | 1062.195100ms | 9.686727ms | 122.012744us | 151.355116us | 151.029713us | 151.792405us | +| 128 | 100 | 1 | 1971.735800ms | 18.677560ms | 183.398616us | 145.918434us | 145.666437us | 146.234228us | +| 256 | 100 | 1 | 3891.252600ms | 36.847038ms | 469.537022us | 143.933742us | 143.618103us | 144.348488us | +| 512 | 100 | 1 | 7506.870400ms | 74.238304ms | 978.070303us | 144.996688us | 144.656953us | 145.414853us | +| 1024 | 100 | 1 | 14710.730700ms | 148.646569ms | 1.249675ms | 145.162665us | 144.938029us | 145.417561us | +| 2048 | 100 | 1 | 30120.379900ms | 301.901460ms | 1.495201ms | 147.412822us | 147.271008us | 147.559018us | +| 4096 | 100 | 1 | 62459.154500ms | 627.977074ms | 2.407528ms | 153.314715us | 153.213956us | 153.449634us | ## SV-SingleBattle-CalcDamage-VerticalSlice1 | Inputs | Samples | Iterations / Sample | Estimated Completion Time | Mean of Samples | Standard Deviation | Mean / Input Count | Mean Lower Bound / Input Count | Mean Upper Bound / Input Count | | --- | --- | --- | --- | --- | --- | --- | --- | --- | -| 1 | 100 | 1 | 8.031900ms | 10.420790us | 3.846694us | 10.420790us | 9.890830us | 11.593500us | -| 2 | 100 | 1 | 8.102100ms | 11.859660us | 4.644298us | 5.929830us | 5.593595us | 6.599965us | -| 4 | 100 | 1 | 8.211600ms | 11.771580us | 3.989319us | 2.942895us | 2.806682us | 3.260637us | -| 8 | 100 | 1 | 8.596700ms | 13.125850us | 3.670588us | 1.640731us | 1.576280us | 1.802773us | -| 16 | 100 | 1 | 9.061600ms | 16.305070us | 3.147792us | 1.019067us | 992.463125ns | 1.086014us | -| 32 | 100 | 1 | 9.945200ms | 23.959860us | 6.190851us | 748.745625ns | 724.387187ns | 820.115625ns | -| 64 | 100 | 1 | 11.235300ms | 34.833510us | 4.551819us | 544.273594ns | 535.392344ns | 570.761562ns | -| 128 | 100 | 1 | 14.113200ms | 58.011630us | 3.972332us | 453.215859ns | 448.443672ns | 461.380781ns | -| 256 | 100 | 1 | 19.580900ms | 103.451130us | 4.343980us | 404.105977ns | 401.179648ns | 407.934336ns | -| 512 | 100 | 1 | 29.883800ms | 191.173200us | 5.980051us | 373.385156ns | 371.374434ns | 376.028613ns | -| 1024 | 100 | 1 | 56.919800ms | 366.460360us | 5.507647us | 357.871445ns | 356.924355ns | 359.052949ns | -| 2048 | 100 | 1 | 111.230900ms | 730.971390us | 19.141937us | 356.919624ns | 355.296035ns | 359.007627ns | -| 4096 | 100 | 1 | 200.999900ms | 1.438700ms | 38.095274us | 351.245186ns | 350.101631ns | 354.767322ns | -| 8192 | 100 | 1 | 408.323100ms | 2.927699ms | 39.121336us | 357.385104ns | 356.495109ns | 358.359330ns | -| 16384 | 100 | 1 | 825.387500ms | 5.995157ms | 71.298764us | 365.915336ns | 365.134354ns | 366.849865ns | -| 32768 | 100 | 1 | 1658.646500ms | 12.184089ms | 343.483195us | 371.828902ns | 370.140656ns | 374.402196ns | -| 65536 | 100 | 1 | 3348.926900ms | 25.145254ms | 255.501703us | 383.686127ns | 382.977381ns | 384.510115ns | +| 1 | 100 | 1 | 7.847400ms | 10.443770us | 3.823323us | 10.443770us | 9.904480us | 11.585860us | +| 2 | 100 | 1 | 7.947200ms | 11.866450us | 4.235469us | 5.933225us | 5.621605us | 6.529155us | +| 4 | 100 | 1 | 8.099200ms | 11.564300us | 3.583755us | 2.891075us | 2.769335us | 3.203220us | +| 8 | 100 | 1 | 8.426900ms | 13.195760us | 3.179415us | 1.649470us | 1.594344us | 1.772236us | +| 16 | 100 | 1 | 9.032400ms | 16.662110us | 3.360866us | 1.041382us | 1.012417us | 1.114736us | +| 32 | 100 | 1 | 9.866400ms | 23.464560us | 3.238578us | 733.267500ns | 719.393438ns | 764.897187ns | +| 64 | 100 | 1 | 11.039600ms | 34.100810us | 3.126090us | 532.825156ns | 526.076563ns | 548.174375ns | +| 128 | 100 | 1 | 13.748900ms | 56.113490us | 2.611600us | 438.386641ns | 435.761563ns | 445.416250ns | +| 256 | 100 | 1 | 18.869600ms | 100.651390us | 3.703876us | 393.169492ns | 390.771367ns | 396.583516ns | +| 512 | 100 | 1 | 28.964200ms | 186.502340us | 4.181849us | 364.262383ns | 362.877676ns | 366.123652ns | +| 1024 | 100 | 1 | 55.048500ms | 365.712740us | 31.374828us | 357.141348ns | 353.731064ns | 370.444570ns | +| 2048 | 100 | 1 | 109.154800ms | 716.746080us | 13.850446us | 349.973672ns | 348.846455ns | 351.576445ns | +| 4096 | 100 | 1 | 197.605800ms | 1.418791ms | 21.765609us | 346.384512ns | 345.454932ns | 347.568303ns | +| 8192 | 100 | 1 | 401.633700ms | 2.859921ms | 32.118747us | 349.111404ns | 348.421692ns | 349.977070ns | +| 16384 | 100 | 1 | 806.154000ms | 5.891554ms | 124.720155us | 359.591904ns | 358.410314ns | 361.556517ns | +| 32768 | 100 | 1 | 1643.100500ms | 11.836926ms | 158.020474us | 361.234306ns | 360.417718ns | 362.353408ns | +| 65536 | 100 | 1 | 3320.950600ms | 24.633022ms | 234.619800us | 375.870091ns | 375.261547ns | 376.688845ns | ## SV-SingleBattle-AnalyzeEffect-VerticalSlice1 | Inputs | Samples | Iterations / Sample | Estimated Completion Time | Mean of Samples | Standard Deviation | Mean / Input Count | Mean Lower Bound / Input Count | Mean Upper Bound / Input Count | | --- | --- | --- | --- | --- | --- | --- | --- | --- | -| 1 | 100 | 1 | 20.793800ms | 52.037230us | 9.089473us | 52.037230us | 50.903410us | 55.436840us | -| 2 | 100 | 1 | 21.640500ms | 61.634630us | 9.441345us | 30.817315us | 30.261525us | 32.788670us | -| 4 | 100 | 1 | 23.920300ms | 80.375370us | 9.758799us | 20.093842us | 19.805155us | 21.109205us | -| 8 | 100 | 1 | 28.965100ms | 112.937490us | 10.046999us | 14.117186us | 13.965016us | 14.619282us | -| 16 | 100 | 1 | 26.548500ms | 176.185270us | 10.462708us | 11.011579us | 10.930419us | 11.257754us | -| 32 | 100 | 1 | 38.024500ms | 293.591620us | 9.679834us | 9.174738us | 9.136515us | 9.281463us | -| 64 | 100 | 1 | 62.731600ms | 523.082620us | 11.426932us | 8.173166us | 8.144678us | 8.217437us | -| 128 | 100 | 1 | 117.071900ms | 984.788570us | 27.149378us | 7.693661us | 7.662325us | 7.752868us | -| 256 | 100 | 1 | 225.104100ms | 1.888742ms | 27.700708us | 7.377898us | 7.360806us | 7.405290us | -| 512 | 100 | 1 | 426.947700ms | 3.723415ms | 44.862827us | 7.272296us | 7.256678us | 7.291291us | -| 1024 | 100 | 1 | 830.453700ms | 7.450052ms | 466.620272us | 7.275442us | 7.204872us | 7.392989us | -| 2048 | 100 | 1 | 1606.059300ms | 14.472242ms | 156.820552us | 7.066524us | 7.051985us | 7.082003us | -| 4096 | 100 | 1 | 3169.673600ms | 29.219650ms | 1.178657ms | 7.133704us | 7.092137us | 7.216655us | -| 8192 | 100 | 1 | 6728.071700ms | 62.774505ms | 3.787525ms | 7.662903us | 7.594637us | 7.792205us | -| 16384 | 100 | 1 | 15485.021600ms | 155.276142ms | 6.231331ms | 9.477304us | 9.416641us | 9.572681us | -| 32768 | 100 | 1 | 33699.225600ms | 341.030942ms | 5.222577ms | 10.407438us | 10.380658us | 10.444634us | -| 65536 | 100 | 1 | 70766.908200ms | 707.074614ms | 5.048408ms | 10.789102us | 10.775417us | 10.806112us | +| 1 | 100 | 1 | 20.609000ms | 52.394150us | 7.266337us | 52.394150us | 51.330150us | 54.451420us | +| 2 | 100 | 1 | 21.385400ms | 62.772780us | 10.477193us | 31.386390us | 30.704070us | 33.186765us | +| 4 | 100 | 1 | 23.353500ms | 80.880220us | 8.260131us | 20.220055us | 19.932480us | 20.848278us | +| 8 | 100 | 1 | 27.759300ms | 112.743440us | 9.167874us | 14.092930us | 13.940308us | 14.465160us | +| 16 | 100 | 1 | 26.120700ms | 173.593620us | 7.808093us | 10.849601us | 10.779628us | 10.990123us | +| 32 | 100 | 1 | 37.909200ms | 286.992020us | 9.050281us | 8.968501us | 8.932751us | 9.071006us | +| 64 | 100 | 1 | 61.907200ms | 511.962890us | 7.627243us | 7.999420us | 7.981075us | 8.030930us | +| 128 | 100 | 1 | 113.191000ms | 957.410610us | 8.335534us | 7.479770us | 7.468054us | 7.493701us | +| 256 | 100 | 1 | 218.548900ms | 1.858691ms | 25.573626us | 7.260512us | 7.242223us | 7.281537us | +| 512 | 100 | 1 | 420.148400ms | 3.608374ms | 38.948577us | 7.047606us | 7.034156us | 7.064127us | +| 1024 | 100 | 1 | 808.429600ms | 7.102671ms | 76.380950us | 6.936202us | 6.923624us | 6.953625us | +| 2048 | 100 | 1 | 1555.114700ms | 14.027403ms | 183.286859us | 6.849318us | 6.834034us | 6.869912us | +| 4096 | 100 | 1 | 3152.944000ms | 27.807456ms | 380.097175us | 6.788930us | 6.772924us | 6.809970us | +| 8192 | 100 | 1 | 6420.758600ms | 58.597307ms | 767.341212us | 7.152992us | 7.137164us | 7.174422us | +| 16384 | 100 | 1 | 14493.468400ms | 145.370468ms | 1.926958ms | 8.872709us | 8.850193us | 8.896405us | +| 32768 | 100 | 1 | 32783.522500ms | 328.563214ms | 2.316242ms | 10.026954us | 10.013545us | 10.041319us | +| 65536 | 100 | 1 | 68429.657200ms | 687.266881ms | 3.126973ms | 10.486860us | 10.477592us | 10.496354us | ## SV-SingleBattle-MonteCarlo-SimulateTurn-RandomInputs-OneRandomBattle-OneRandomInput | Inputs | Samples | Iterations / Sample | Estimated Completion Time | Mean of Samples | Standard Deviation | Mean / Input Count | Mean Lower Bound / Input Count | Mean Upper Bound / Input Count | | --- | --- | --- | --- | --- | --- | --- | --- | --- | -| 1 | 100 | 1 | 31.249200ms | 68.176210us | 13.921405us | 68.176210us | 66.073800us | 71.914160us | -| 2 | 100 | 1 | 31.792000ms | 78.073400us | 16.439792us | 39.036700us | 37.681940us | 41.008710us | -| 4 | 100 | 1 | 33.077400ms | 87.768470us | 17.395834us | 21.942118us | 21.182365us | 22.916577us | -| 8 | 100 | 1 | 34.814500ms | 100.649170us | 19.701342us | 12.581146us | 12.140221us | 13.110095us | -| 16 | 100 | 1 | 38.726500ms | 131.291680us | 25.354403us | 8.205730us | 7.919571us | 8.541085us | -| 32 | 100 | 1 | 44.998000ms | 181.614330us | 35.380116us | 5.675448us | 5.470801us | 5.904626us | -| 64 | 100 | 1 | 56.744700ms | 280.739500us | 58.962199us | 4.386555us | 4.219135us | 4.583458us | -| 128 | 100 | 1 | 60.042200ms | 468.535870us | 99.965389us | 3.660436us | 3.520239us | 3.828997us | -| 256 | 100 | 1 | 115.931200ms | 840.623000us | 189.043566us | 3.283684us | 3.152324us | 3.443392us | -| 512 | 100 | 1 | 217.826800ms | 1.520551ms | 362.801559us | 2.969827us | 2.844450us | 3.124442us | -| 1024 | 100 | 1 | 288.942900ms | 3.004078ms | 726.029809us | 2.933670us | 2.806476us | 3.085085us | -| 2048 | 100 | 1 | 603.541200ms | 5.946068ms | 1.425141ms | 2.903354us | 2.779815us | 3.054634us | -| 4096 | 100 | 1 | 1796.983500ms | 12.100915ms | 2.855353ms | 2.954325us | 2.830713us | 3.106571us | -| 8192 | 100 | 1 | 3677.869100ms | 25.114085ms | 5.877660ms | 3.065684us | 2.938172us | 3.221265us | -| 16384 | 100 | 1 | 4794.608900ms | 53.130262ms | 11.732715ms | 3.242814us | 3.114155us | 3.394796us | -| 32768 | 100 | 1 | 10133.915200ms | 110.560213ms | 24.268798ms | 3.374030us | 3.239944us | 3.531722us | +| 1 | 100 | 1 | 30.753600ms | 68.905790us | 15.025936us | 68.905790us | 66.420710us | 72.459340us | +| 2 | 100 | 1 | 32.395800ms | 76.889880us | 15.928868us | 38.444940us | 37.093160us | 40.273970us | +| 4 | 100 | 1 | 33.448300ms | 85.054450us | 16.221708us | 21.263613us | 20.547260us | 22.152215us | +| 8 | 100 | 1 | 34.995300ms | 98.816350us | 19.282152us | 12.352044us | 11.926161us | 12.875525us | +| 16 | 100 | 1 | 38.567500ms | 127.837520us | 23.734093us | 7.989845us | 7.719094us | 8.303329us | +| 32 | 100 | 1 | 43.458400ms | 174.887730us | 32.503057us | 5.465242us | 5.280412us | 5.679264us | +| 64 | 100 | 1 | 53.571500ms | 267.542780us | 48.233697us | 4.180356us | 4.044463us | 4.343130us | +| 128 | 100 | 1 | 43.766600ms | 445.846180us | 86.011980us | 3.483173us | 3.364245us | 3.631925us | +| 256 | 100 | 1 | 104.796400ms | 783.720690us | 159.224522us | 3.061409us | 2.952892us | 3.199125us | +| 512 | 100 | 1 | 192.694200ms | 1.417110ms | 300.442521us | 2.767793us | 2.664495us | 2.896559us | +| 1024 | 100 | 1 | 480.441400ms | 2.766190ms | 601.270269us | 2.701357us | 2.597925us | 2.831878us | +| 2048 | 100 | 1 | 860.908900ms | 5.529385ms | 1.275704ms | 2.699895us | 2.590909us | 2.837667us | +| 4096 | 100 | 1 | 1699.477000ms | 11.413801ms | 2.501990ms | 2.786573us | 2.678697us | 2.920266us | +| 8192 | 100 | 1 | 1887.544300ms | 23.477073ms | 5.244666ms | 2.865854us | 2.753073us | 3.005796us | +| 16384 | 100 | 1 | 4050.766400ms | 49.734435ms | 10.892095ms | 3.035549us | 2.916060us | 3.178559us | +| 32768 | 100 | 1 | 9956.711100ms | 104.012092ms | 22.432585ms | 3.174197us | 3.051262us | 3.321891us | ## SV-SingleBattle-MonteCarlo-SimulateTurn-RandomInputs-OneRandomBattle-ManyRandomInputs | Inputs | Samples | Iterations / Sample | Estimated Completion Time | Mean of Samples | Standard Deviation | Mean / Input Count | Mean Lower Bound / Input Count | Mean Upper Bound / Input Count | | --- | --- | --- | --- | --- | --- | --- | --- | --- | -| 1 | 100 | 1 | 30.557700ms | 68.372730us | 13.928831us | 68.372730us | 66.275310us | 72.154920us | -| 2 | 100 | 1 | 33.245400ms | 80.267420us | 32.431344us | 40.133710us | 38.078565us | 45.907370us | -| 4 | 100 | 1 | 34.043500ms | 85.042960us | 16.631853us | 21.260740us | 20.549972us | 22.211797us | -| 8 | 100 | 1 | 36.149300ms | 98.823560us | 19.058173us | 12.352945us | 11.929330us | 12.875364us | -| 16 | 100 | 1 | 40.264400ms | 127.843600us | 23.288670us | 7.990225us | 7.721685us | 8.293940us | -| 32 | 100 | 1 | 46.759000ms | 177.488310us | 36.914564us | 5.546510us | 5.339719us | 5.795156us | -| 64 | 100 | 1 | 58.496700ms | 274.776220us | 58.766549us | 4.293378us | 4.126830us | 4.489357us | -| 128 | 100 | 1 | 59.292200ms | 446.697690us | 99.166585us | 3.489826us | 3.350568us | 3.656771us | -| 256 | 100 | 1 | 113.693900ms | 803.682360us | 186.230872us | 3.139384us | 3.008690us | 3.296267us | -| 512 | 100 | 1 | 210.292300ms | 1.503744ms | 358.349663us | 2.937000us | 2.812270us | 3.090857us | -| 1024 | 100 | 1 | 275.421800ms | 2.957591ms | 744.098011us | 2.888273us | 2.759280us | 3.044641us | -| 2048 | 100 | 1 | 562.124400ms | 5.747549ms | 1.419407ms | 2.806420us | 2.682791us | 2.956662us | -| 4096 | 100 | 1 | 1693.808700ms | 11.326214ms | 2.797096ms | 2.765189us | 2.644217us | 2.915280us | -| 8192 | 100 | 1 | 3364.542500ms | 22.820558ms | 5.575147ms | 2.785713us | 2.665295us | 2.933363us | -| 16384 | 100 | 1 | 4111.777600ms | 45.414857ms | 10.786756ms | 2.771903us | 2.654608us | 2.914778us | -| 32768 | 100 | 1 | 8494.286400ms | 91.371677ms | 21.936107ms | 2.788442us | 2.667300us | 2.932452us | +| 1 | 100 | 1 | 31.897000ms | 72.196160us | 14.201346us | 72.196160us | 69.740500us | 75.371120us | +| 2 | 100 | 1 | 38.035700ms | 87.273460us | 20.626747us | 43.636730us | 41.954590us | 46.124130us | +| 4 | 100 | 1 | 48.667100ms | 107.736030us | 17.659553us | 26.934007us | 26.185147us | 27.949033us | +| 8 | 100 | 1 | 50.189100ms | 131.569040us | 21.044058us | 16.446130us | 15.993065us | 17.034903us | +| 16 | 100 | 1 | 54.853200ms | 165.939570us | 22.789545us | 10.371223us | 10.120729us | 10.684394us | +| 32 | 100 | 1 | 61.983900ms | 217.718930us | 27.751916us | 6.803717us | 6.645771us | 6.986395us | +| 64 | 100 | 1 | 42.022900ms | 315.029260us | 35.865143us | 4.922332us | 4.818838us | 5.038686us | +| 128 | 100 | 1 | 57.015400ms | 523.583090us | 66.808201us | 4.090493us | 3.998662us | 4.205521us | +| 256 | 100 | 1 | 101.260000ms | 853.692700us | 102.605577us | 3.334737us | 3.261018us | 3.418803us | +| 512 | 100 | 1 | 165.171800ms | 1.609157ms | 196.283013us | 3.142884us | 3.070535us | 3.220310us | +| 1024 | 100 | 1 | 423.276600ms | 2.968877ms | 411.106285us | 2.899294us | 2.824338us | 2.982944us | +| 2048 | 100 | 1 | 629.272900ms | 5.917046ms | 724.943336us | 2.889182us | 2.821328us | 2.960880us | +| 4096 | 100 | 1 | 1506.641900ms | 12.061530ms | 1.701691ms | 2.944709us | 2.867055us | 3.030241us | +| 8192 | 100 | 1 | 2272.593700ms | 24.211965ms | 3.621395ms | 2.955562us | 2.876130us | 3.050675us | +| 16384 | 100 | 1 | 3705.159900ms | 49.396681ms | 5.817867ms | 3.014934us | 2.948022us | 3.086380us | +| 32768 | 100 | 1 | 10801.925900ms | 100.011817ms | 13.081144ms | 3.052118us | 2.975324us | 3.131664us | ## SV-SingleBattle-MonteCarlo-SimulateTurn-RandomInputs-ManyRandomBattles-ManyRandomInputs | Inputs | Samples | Iterations / Sample | Estimated Completion Time | Mean of Samples | Standard Deviation | Mean / Input Count | Mean Lower Bound / Input Count | Mean Upper Bound / Input Count | | --- | --- | --- | --- | --- | --- | --- | --- | --- | -| 1 | 100 | 1 | 30.889800ms | 68.171290us | 14.045137us | 68.171290us | 66.033220us | 71.879600us | -| 2 | 100 | 1 | 48.788900ms | 90.745810us | 20.227910us | 45.372905us | 43.888005us | 48.179300us | -| 4 | 100 | 1 | 50.354200ms | 115.930270us | 17.465855us | 28.982568us | 28.343640us | 30.206717us | -| 8 | 100 | 1 | 64.934800ms | 150.108110us | 23.781457us | 18.763514us | 18.307310us | 19.538095us | -| 16 | 100 | 1 | 74.951100ms | 203.478570us | 30.933356us | 12.717411us | 12.437267us | 13.259820us | -| 32 | 100 | 1 | 83.468100ms | 274.611200us | 24.495425us | 8.581600us | 8.457474us | 8.769229us | -| 64 | 100 | 1 | 53.202200ms | 408.668520us | 19.570323us | 6.385446us | 6.336113us | 6.461050us | -| 128 | 100 | 1 | 79.423500ms | 658.135150us | 20.904030us | 5.141681us | 5.112777us | 5.177966us | -| 256 | 100 | 1 | 131.916200ms | 1.129139ms | 22.865241us | 4.410700us | 4.394481us | 4.429467us | -| 512 | 100 | 1 | 246.838800ms | 2.043833ms | 47.340451us | 3.991862us | 3.975549us | 4.012183us | -| 1024 | 100 | 1 | 462.143600ms | 3.969365ms | 153.504120us | 3.876333us | 3.852723us | 3.914359us | -| 2048 | 100 | 1 | 914.314200ms | 8.098556ms | 342.368670us | 3.954373us | 3.929257us | 4.000146us | -| 4096 | 100 | 1 | 1856.562300ms | 17.675678ms | 866.946063us | 4.315351us | 4.286540us | 4.381710us | -| 8192 | 100 | 1 | 4226.892900ms | 42.172514ms | 1.138832ms | 5.148012us | 5.125632us | 5.182358us | -| 16384 | 100 | 1 | 11631.590900ms | 97.683856ms | 2.970859ms | 5.962149us | 5.937217us | 6.018479us | -| 32768 | 100 | 1 | 22120.368700ms | 220.859396ms | 6.611173ms | 6.740094us | 6.709016us | 6.793025us | +| 1 | 100 | 1 | 31.327700ms | 69.056010us | 16.435710us | 69.056010us | 66.401000us | 73.108300us | +| 2 | 100 | 1 | 42.203100ms | 90.512730us | 17.764058us | 45.256365us | 43.907510us | 47.624435us | +| 4 | 100 | 1 | 56.230200ms | 113.585160us | 18.427813us | 28.396290us | 27.700940us | 29.635967us | +| 8 | 100 | 1 | 65.483000ms | 143.844170us | 21.357594us | 17.980521us | 17.585966us | 18.716349us | +| 16 | 100 | 1 | 71.066800ms | 191.662450us | 26.728285us | 11.978903us | 11.726458us | 12.428418us | +| 32 | 100 | 1 | 80.064800ms | 269.577890us | 23.457392us | 8.424309us | 8.310602us | 8.614932us | +| 64 | 100 | 1 | 52.197600ms | 402.392850us | 17.893173us | 6.287388us | 6.241242us | 6.354775us | +| 128 | 100 | 1 | 79.431300ms | 647.881210us | 16.209853us | 5.061572us | 5.038559us | 5.088649us | +| 256 | 100 | 1 | 126.770000ms | 1.105309ms | 26.142662us | 4.317614us | 4.300159us | 4.340903us | +| 512 | 100 | 1 | 232.431900ms | 1.991041ms | 42.680522us | 3.888752us | 3.874789us | 3.908350us | +| 1024 | 100 | 1 | 451.137800ms | 3.828657ms | 55.970617us | 3.738923us | 3.729029us | 3.750572us | +| 2048 | 100 | 1 | 888.573900ms | 7.738454ms | 184.770813us | 3.778542us | 3.763231us | 3.799440us | +| 4096 | 100 | 1 | 1815.545200ms | 16.826030ms | 283.893253us | 4.107917us | 4.096437us | 4.124350us | +| 8192 | 100 | 1 | 4021.840000ms | 40.182194ms | 602.458670us | 4.905053us | 4.892273us | 4.921421us | +| 16384 | 100 | 1 | 9351.226800ms | 94.104771ms | 825.250442us | 5.743699us | 5.734590us | 5.754395us | +| 32768 | 100 | 1 | 21380.286900ms | 212.838397ms | 1.319312ms | 6.495312us | 6.487772us | 6.503556us | ## SV-SingleBattle-CalcDamage-RandomInputs-OneRandomBattle-OneRandomInput | Inputs | Samples | Iterations / Sample | Estimated Completion Time | Mean of Samples | Standard Deviation | Mean / Input Count | Mean Lower Bound / Input Count | Mean Upper Bound / Input Count | | --- | --- | --- | --- | --- | --- | --- | --- | --- | -| 1 | 100 | 1 | 10.554100ms | 13.117300us | 5.556340us | 13.117300us | 12.238470us | 14.527800us | -| 2 | 100 | 1 | 10.828900ms | 14.464530us | 5.645307us | 7.232265us | 6.765135us | 7.906970us | -| 4 | 100 | 1 | 11.348200ms | 17.219910us | 8.387003us | 4.304977us | 3.995883us | 4.897435us | -| 8 | 100 | 1 | 12.204100ms | 20.602410us | 7.095005us | 2.575301us | 2.407225us | 2.755639us | -| 16 | 100 | 1 | 9.913700ms | 29.479850us | 11.084909us | 1.842491us | 1.706307us | 1.978503us | -| 32 | 100 | 1 | 10.822100ms | 43.364710us | 17.349939us | 1.355147us | 1.247713us | 1.460113us | -| 64 | 100 | 1 | 12.669900ms | 72.232020us | 32.170017us | 1.128625us | 1.029201us | 1.226507us | -| 128 | 100 | 1 | 15.885400ms | 128.814330us | 61.444460us | 1.006362us | 911.428750ns | 1.099427us | -| 256 | 100 | 1 | 56.594200ms | 240.844480us | 122.821503us | 940.798750ns | 846.647656ns | 1.035226us | -| 512 | 100 | 1 | 103.087200ms | 404.366160us | 243.435025us | 789.777656ns | 697.650469ns | 883.272949ns | -| 1024 | 100 | 1 | 203.338900ms | 809.226910us | 479.069229us | 790.260654ns | 698.046924ns | 881.454121ns | -| 2048 | 100 | 1 | 330.652000ms | 1.667632ms | 971.367090us | 814.273472ns | 721.436885ns | 905.923735ns | -| 4096 | 100 | 1 | 805.709500ms | 3.488026ms | 1.988139ms | 851.568945ns | 756.016338ns | 946.103794ns | -| 8192 | 100 | 1 | 1615.257700ms | 7.260816ms | 4.071864ms | 886.330038ns | 788.026964ns | 982.472709ns | -| 16384 | 100 | 1 | 3082.711000ms | 15.227668ms | 8.762503ms | 929.423080ns | 822.879848ns | 1.032916us | -| 32768 | 100 | 1 | 5481.318000ms | 33.036341ms | 18.963405ms | 1.008189us | 893.940656ns | 1.120581us | +| 1 | 100 | 1 | 9.427500ms | 12.772540us | 4.766567us | 12.772540us | 12.062280us | 14.104720us | +| 2 | 100 | 1 | 9.716700ms | 14.543410us | 5.550827us | 7.271705us | 6.819335us | 7.942115us | +| 4 | 100 | 1 | 10.162300ms | 16.966940us | 8.039360us | 4.241735us | 3.947790us | 4.807375us | +| 8 | 100 | 1 | 10.945300ms | 19.993310us | 6.745731us | 2.499164us | 2.341569us | 2.671768us | +| 16 | 100 | 1 | 11.973900ms | 28.591990us | 9.923712us | 1.786999us | 1.664187us | 1.907266us | +| 32 | 100 | 1 | 10.633500ms | 43.559210us | 16.292563us | 1.361225us | 1.260054us | 1.458609us | +| 64 | 100 | 1 | 12.610400ms | 73.297510us | 29.679516us | 1.145274us | 1.053499us | 1.235262us | +| 128 | 100 | 1 | 20.901500ms | 132.214450us | 57.674473us | 1.032925us | 944.116484ns | 1.120071us | +| 256 | 100 | 1 | 41.989600ms | 250.149470us | 111.379755us | 977.146367ns | 891.264336ns | 1.062006us | +| 512 | 100 | 1 | 73.988400ms | 424.524700us | 223.335963us | 829.149805ns | 743.856191ns | 914.683223ns | +| 1024 | 100 | 1 | 139.218600ms | 840.353410us | 444.645373us | 820.657627ns | 735.491143ns | 904.967861ns | +| 2048 | 100 | 1 | 202.640200ms | 1.694822ms | 885.187054us | 827.549639ns | 743.034277ns | 912.044238ns | +| 4096 | 100 | 1 | 737.117500ms | 3.473251ms | 1.769531ms | 847.961563ns | 762.398416ns | 932.186313ns | +| 8192 | 100 | 1 | 1487.981400ms | 7.221780ms | 3.627676ms | 881.564973ns | 794.029716ns | 968.059497ns | +| 16384 | 100 | 1 | 2985.467200ms | 15.395756ms | 7.774023ms | 939.682402ns | 845.671621ns | 1.031238us | +| 32768 | 100 | 1 | 2846.103000ms | 32.794798ms | 16.679221ms | 1.000818us | 900.911011ns | 1.099839us | ## SV-SingleBattle-CalcDamage-RandomInputs-OneRandomBattle-ManyRandomInputs | Inputs | Samples | Iterations / Sample | Estimated Completion Time | Mean of Samples | Standard Deviation | Mean / Input Count | Mean Lower Bound / Input Count | Mean Upper Bound / Input Count | | --- | --- | --- | --- | --- | --- | --- | --- | --- | -| 1 | 100 | 1 | 10.538000ms | 12.912720us | 5.305275us | 12.912720us | 12.073890us | 14.248090us | -| 2 | 100 | 1 | 11.438900ms | 14.612360us | 3.511076us | 7.306180us | 7.052450us | 7.806790us | -| 4 | 100 | 1 | 11.044600ms | 17.408570us | 3.539770us | 4.352143us | 4.226935us | 4.616860us | -| 8 | 100 | 1 | 12.146700ms | 21.279310us | 3.621111us | 2.659914us | 2.597469us | 2.798424us | -| 16 | 100 | 1 | 12.663700ms | 28.855960us | 4.156907us | 1.803497us | 1.764698us | 1.874104us | -| 32 | 100 | 1 | 14.940600ms | 42.661190us | 4.329193us | 1.333162us | 1.310675us | 1.364985us | -| 64 | 100 | 1 | 17.281000ms | 68.893730us | 5.123391us | 1.076465us | 1.061656us | 1.093243us | -| 128 | 100 | 1 | 22.851100ms | 122.301030us | 6.736478us | 955.476797ns | 945.307266ns | 965.960781ns | -| 256 | 100 | 1 | 24.404000ms | 224.218180us | 9.389979us | 875.852266ns | 868.870586ns | 883.299102ns | -| 512 | 100 | 1 | 41.316400ms | 438.166980us | 37.519909us | 855.794883ns | 847.245352ns | 885.507910ns | -| 1024 | 100 | 1 | 86.412700ms | 848.552130us | 20.318059us | 828.664189ns | 824.987148ns | 832.774580ns | -| 2048 | 100 | 1 | 174.216800ms | 1.677681ms | 32.220289us | 819.180254ns | 816.237612ns | 822.408506ns | -| 4096 | 100 | 1 | 342.273900ms | 3.353818ms | 65.053290us | 818.803274ns | 815.994875ns | 822.285818ns | -| 8192 | 100 | 1 | 681.824100ms | 6.685283ms | 118.682143us | 816.074539ns | 813.459924ns | 819.183557ns | -| 16384 | 100 | 1 | 1350.225300ms | 13.496582ms | 217.761960us | 823.766021ns | 821.301966ns | 826.495835ns | -| 32768 | 100 | 1 | 2709.329200ms | 27.295523ms | 563.784328us | 832.993248ns | 829.922355ns | 836.720092ns | +| 1 | 100 | 1 | 9.430400ms | 16.755070us | 34.071150us | 16.755070us | 13.052470us | 32.974120us | +| 2 | 100 | 1 | 10.818600ms | 15.023930us | 3.638523us | 7.511965us | 7.234205us | 7.991620us | +| 4 | 100 | 1 | 10.342600ms | 17.139180us | 4.269421us | 4.284795us | 4.125420us | 4.576397us | +| 8 | 100 | 1 | 11.032300ms | 21.423150us | 4.710177us | 2.677894us | 2.593932us | 2.850830us | +| 16 | 100 | 1 | 12.279300ms | 30.841100us | 14.976680us | 1.927569us | 1.814159us | 2.298358us | +| 32 | 100 | 1 | 13.006000ms | 43.072450us | 5.108678us | 1.346014us | 1.318967us | 1.382825us | +| 64 | 100 | 1 | 16.471200ms | 69.760670us | 7.439668us | 1.090010us | 1.071569us | 1.119367us | +| 128 | 100 | 1 | 23.925900ms | 122.220590us | 7.092478us | 954.848359ns | 944.866406ns | 966.704531ns | +| 256 | 100 | 1 | 33.706400ms | 222.176800us | 8.703923us | 867.878125ns | 861.740586ns | 875.106211ns | +| 512 | 100 | 1 | 41.991400ms | 429.916030us | 12.177064us | 839.679746ns | 835.061426ns | 844.411602ns | +| 1024 | 100 | 1 | 86.744300ms | 838.901180us | 15.529242us | 819.239434ns | 816.265264ns | 822.204355ns | +| 2048 | 100 | 1 | 169.149000ms | 1.647902ms | 30.854856us | 804.639692ns | 801.749067ns | 807.655498ns | +| 4096 | 100 | 1 | 336.697800ms | 3.300692ms | 55.914602us | 805.832920ns | 803.189849ns | 808.532412ns | +| 8192 | 100 | 1 | 680.327000ms | 6.610150ms | 116.109797us | 806.903021ns | 804.291775ns | 809.861029ns | +| 16384 | 100 | 1 | 1374.183900ms | 13.206136ms | 205.186348us | 806.038583ns | 803.725987ns | 808.646936ns | +| 32768 | 100 | 1 | 2706.056500ms | 26.761323ms | 356.293919us | 816.690758ns | 814.723896ns | 819.012583ns | ## SV-SingleBattle-CalcDamage-RandomInputs-ManyRandomBattles-ManyRandomInputs | Inputs | Samples | Iterations / Sample | Estimated Completion Time | Mean of Samples | Standard Deviation | Mean / Input Count | Mean Lower Bound / Input Count | Mean Upper Bound / Input Count | | --- | --- | --- | --- | --- | --- | --- | --- | --- | -| 1 | 100 | 1 | 10.729100ms | 13.068670us | 5.446074us | 13.068670us | 12.206580us | 14.439850us | -| 2 | 100 | 1 | 10.621700ms | 15.442520us | 3.655511us | 7.721260us | 7.439885us | 8.204620us | -| 4 | 100 | 1 | 11.127600ms | 18.475070us | 5.418085us | 4.618767us | 4.432805us | 5.048180us | -| 8 | 100 | 1 | 11.402900ms | 23.585000us | 5.441024us | 2.948125us | 2.849089us | 3.142722us | -| 16 | 100 | 1 | 12.834600ms | 32.961160us | 6.328510us | 2.060073us | 2.002404us | 2.172333us | -| 32 | 100 | 1 | 15.148600ms | 51.316630us | 5.053869us | 1.603645us | 1.576650us | 1.639936us | -| 64 | 100 | 1 | 18.017600ms | 81.612550us | 6.138939us | 1.275196us | 1.259580us | 1.298559us | -| 128 | 100 | 1 | 24.337300ms | 147.009700us | 10.074212us | 1.148513us | 1.136467us | 1.169403us | -| 256 | 100 | 1 | 48.276800ms | 284.590730us | 15.151044us | 1.111683us | 1.100831us | 1.124298us | -| 512 | 100 | 1 | 81.518000ms | 477.152620us | 18.829328us | 931.938711ns | 925.559238ns | 940.201660ns | -| 1024 | 100 | 1 | 158.746300ms | 945.782490us | 30.659633us | 923.615713ns | 918.330264ns | 930.126123ns | -| 2048 | 100 | 1 | 312.796800ms | 1.954374ms | 55.678400us | 954.284092ns | 949.497856ns | 960.242559ns | -| 4096 | 100 | 1 | 638.758100ms | 4.137147ms | 88.799102us | 1.010046us | 1.006234us | 1.014856us | -| 8192 | 100 | 1 | 1251.525700ms | 8.730795ms | 229.171800us | 1.065771us | 1.061466us | 1.073128us | -| 16384 | 100 | 1 | 2566.436500ms | 18.827271ms | 688.261245us | 1.149125us | 1.143205us | 1.161746us | -| 32768 | 100 | 1 | 5576.657400ms | 41.016255ms | 1.219759ms | 1.251717us | 1.246267us | 1.262265us | +| 1 | 100 | 1 | 9.410800ms | 12.391250us | 4.631724us | 12.391250us | 11.703160us | 13.664200us | +| 2 | 100 | 1 | 10.070700ms | 15.662830us | 6.662086us | 7.831415us | 7.370270us | 8.850540us | +| 4 | 100 | 1 | 11.226800ms | 18.575570us | 6.209557us | 4.643892us | 4.425002us | 5.106615us | +| 8 | 100 | 1 | 11.081100ms | 23.099440us | 6.853719us | 2.887430us | 2.765324us | 3.138923us | +| 16 | 100 | 1 | 12.310700ms | 32.069950us | 5.647544us | 2.004372us | 1.949994us | 2.096262us | +| 32 | 100 | 1 | 15.017100ms | 49.289750us | 6.275435us | 1.540305us | 1.509453us | 1.590419us | +| 64 | 100 | 1 | 17.692500ms | 80.444580us | 6.954876us | 1.256947us | 1.240516us | 1.285911us | +| 128 | 100 | 1 | 24.543300ms | 143.348730us | 6.399327us | 1.119912us | 1.110490us | 1.130090us | +| 256 | 100 | 1 | 46.458600ms | 272.824110us | 10.953516us | 1.065719us | 1.057738us | 1.074556us | +| 512 | 100 | 1 | 82.421200ms | 468.621860us | 14.046294us | 915.277070ns | 909.847715ns | 920.599785ns | +| 1024 | 100 | 1 | 153.306900ms | 921.746300us | 20.361062us | 900.142871ns | 896.402197ns | 904.215479ns | +| 2048 | 100 | 1 | 309.202700ms | 1.912236ms | 43.099458us | 933.709121ns | 929.928853ns | 938.241963ns | +| 4096 | 100 | 1 | 598.450700ms | 4.022879ms | 52.097047us | 982.148191ns | 979.906123ns | 984.953628ns | +| 8192 | 100 | 1 | 1142.686200ms | 8.563117ms | 121.235522us | 1.045302us | 1.042703us | 1.048586us | +| 16384 | 100 | 1 | 2336.702500ms | 18.468461ms | 279.635291us | 1.127225us | 1.124317us | 1.131109us | +| 32768 | 100 | 1 | 5009.104300ms | 40.219191ms | 1.034866ms | 1.227392us | 1.222487us | 1.235546us | ## SV-SingleBattle-AnalyzeEffect-RandomInputs-OneRandomBattle-OneRandomInput | Inputs | Samples | Iterations / Sample | Estimated Completion Time | Mean of Samples | Standard Deviation | Mean / Input Count | Mean Lower Bound / Input Count | Mean Upper Bound / Input Count | | --- | --- | --- | --- | --- | --- | --- | --- | --- | -| 1 | 100 | 1 | 36.671400ms | 81.344940us | 29.032823us | 81.344940us | 75.005200us | 86.517160us | -| 2 | 100 | 1 | 40.707400ms | 111.759160us | 39.953471us | 55.879580us | 51.433835us | 59.365655us | -| 4 | 100 | 1 | 48.143200ms | 159.251620us | 59.072430us | 39.812905us | 36.606325us | 42.442000us | -| 8 | 100 | 1 | 28.755600ms | 244.370230us | 84.936510us | 30.546279us | 28.136359us | 32.363082us | -| 16 | 100 | 1 | 46.708800ms | 412.360210us | 145.539064us | 25.772513us | 23.713184us | 27.329110us | -| 32 | 100 | 1 | 106.215200ms | 727.426240us | 272.457164us | 22.732070us | 20.798157us | 24.196370us | -| 64 | 100 | 1 | 196.995900ms | 1.364235ms | 515.086228us | 21.316174us | 19.509618us | 22.710398us | -| 128 | 100 | 1 | 337.620200ms | 2.643058ms | 1.001600ms | 20.648893us | 18.887709us | 22.002346us | -| 256 | 100 | 1 | 748.184200ms | 5.152363ms | 1.961042ms | 20.126419us | 18.414287us | 21.455897us | -| 512 | 100 | 1 | 1279.857900ms | 10.368929ms | 4.106008ms | 20.251814us | 18.510862us | 21.682885us | -| 1024 | 100 | 1 | 2519.912300ms | 20.637185ms | 7.951448ms | 20.153501us | 18.433115us | 21.506334us | -| 2048 | 100 | 1 | 6426.676000ms | 43.944202ms | 16.982877ms | 21.457130us | 19.613688us | 22.906586us | -| 4096 | 100 | 1 | 14386.745300ms | 102.939655ms | 39.158693ms | 25.131752us | 23.011994us | 26.789883us | -| 8192 | 100 | 1 | 21481.821100ms | 221.872067ms | 84.119247ms | 27.083993us | 24.810718us | 28.875996us | -| 16384 | 100 | 1 | 45772.229200ms | 462.023646ms | 174.934095ms | 28.199685us | 25.784157us | 30.035966us | +| 1 | 100 | 1 | 29.499400ms | 85.618360us | 28.644596us | 85.618360us | 79.398630us | 90.783900us | +| 2 | 100 | 1 | 31.498800ms | 110.655450us | 35.505335us | 55.327725us | 51.278945us | 58.356775us | +| 4 | 100 | 1 | 22.102600ms | 159.304450us | 51.391702us | 39.826113us | 36.843887us | 41.968180us | +| 8 | 100 | 1 | 32.962200ms | 245.931990us | 80.726062us | 30.741499us | 28.405127us | 32.440909us | +| 16 | 100 | 1 | 45.390500ms | 420.316220us | 140.627852us | 26.269764us | 24.257575us | 27.742123us | +| 32 | 100 | 1 | 90.853100ms | 739.328940us | 239.257547us | 23.104029us | 21.383572us | 24.372590us | +| 64 | 100 | 1 | 216.871900ms | 1.380479ms | 453.134666us | 21.569991us | 19.952184us | 22.778061us | +| 128 | 100 | 1 | 414.653300ms | 2.665873ms | 881.046210us | 20.827132us | 19.287963us | 22.014610us | +| 256 | 100 | 1 | 538.169000ms | 5.204039ms | 1.727341ms | 20.328278us | 18.796776us | 21.480745us | +| 512 | 100 | 1 | 1019.588700ms | 10.166267ms | 3.372184ms | 19.855990us | 18.354082us | 20.972683us | +| 1024 | 100 | 1 | 2148.205300ms | 20.249648ms | 6.778206ms | 19.775047us | 18.276304us | 20.920836us | +| 2048 | 100 | 1 | 4099.403200ms | 43.069893ms | 14.615285ms | 21.030221us | 19.414999us | 22.264203us | +| 4096 | 100 | 1 | 12520.054600ms | 100.234076ms | 32.981112ms | 24.471210us | 22.619758us | 25.832082us | +| 8192 | 100 | 1 | 27044.834300ms | 217.309403ms | 71.229983ms | 26.527027us | 24.539122us | 27.989662us | +| 16384 | 100 | 1 | 56166.202800ms | 456.504541ms | 148.827497ms | 27.862826us | 25.767089us | 29.404688us | ## SV-SingleBattle-AnalyzeEffect-RandomInputs-OneRandomBattle-ManyRandomInputs | Inputs | Samples | Iterations / Sample | Estimated Completion Time | Mean of Samples | Standard Deviation | Mean / Input Count | Mean Lower Bound / Input Count | Mean Upper Bound / Input Count | | --- | --- | --- | --- | --- | --- | --- | --- | --- | -| 1 | 100 | 1 | 36.725500ms | 81.685720us | 29.438573us | 81.685720us | 75.417840us | 86.990920us | -| 2 | 100 | 1 | 18.399300ms | 107.680390us | 21.366507us | 53.840195us | 51.650185us | 55.868440us | -| 4 | 100 | 1 | 40.946700ms | 145.231800us | 17.671730us | 36.307950us | 35.477235us | 37.215890us | -| 8 | 100 | 1 | 21.485300ms | 206.615590us | 20.947757us | 25.826949us | 25.329959us | 26.358395us | -| 16 | 100 | 1 | 43.091600ms | 339.712910us | 31.730759us | 21.232057us | 20.868899us | 21.647361us | -| 32 | 100 | 1 | 72.251400ms | 588.614550us | 40.669731us | 18.394205us | 18.148724us | 18.647206us | -| 64 | 100 | 1 | 147.132700ms | 1.159463ms | 68.601160us | 18.116604us | 17.905834us | 18.325324us | -| 128 | 100 | 1 | 253.139400ms | 2.547406ms | 117.054769us | 19.901610us | 19.720570us | 20.078795us | -| 256 | 100 | 1 | 664.654600ms | 6.210797ms | 377.568938us | 24.260925us | 23.987121us | 24.568346us | -| 512 | 100 | 1 | 1564.242200ms | 15.738246ms | 556.485988us | 30.738761us | 30.531820us | 30.958934us | -| 1024 | 100 | 1 | 4074.912400ms | 40.678676ms | 1.109544ms | 39.725270us | 39.513187us | 39.937773us | -| 2048 | 100 | 1 | 10127.023300ms | 100.349009ms | 2.091902ms | 48.998540us | 48.796158us | 49.198823us | -| 4096 | 100 | 1 | 23263.046400ms | 227.444640ms | 3.648353ms | 55.528477us | 55.360605us | 55.711593us | -| 8192 | 100 | 1 | 48003.167900ms | 487.220705ms | 7.177495ms | 59.475184us | 59.310396us | 59.654112us | -| 16384 | 100 | 1 | 100444.882600ms | 1020.905302ms | 11.741349ms | 62.311115us | 62.176042us | 62.457279us | +| 1 | 100 | 1 | 37.582600ms | 83.784130us | 27.237963us | 83.784130us | 77.734540us | 88.548860us | +| 2 | 100 | 1 | 41.134500ms | 111.066050us | 15.540625us | 55.533025us | 54.293975us | 57.510500us | +| 4 | 100 | 1 | 43.723000ms | 142.692090us | 15.344749us | 35.673023us | 34.934908us | 36.439040us | +| 8 | 100 | 1 | 56.821700ms | 206.503140us | 23.109708us | 25.812893us | 25.306722us | 26.452365us | +| 16 | 100 | 1 | 46.182600ms | 328.926490us | 30.288227us | 20.557906us | 20.193273us | 20.936718us | +| 32 | 100 | 1 | 66.870800ms | 580.395230us | 35.950953us | 18.137351us | 17.915257us | 18.353711us | +| 64 | 100 | 1 | 135.845200ms | 1.138838ms | 57.356078us | 17.794349us | 17.617712us | 17.968519us | +| 128 | 100 | 1 | 261.592200ms | 2.493957ms | 131.021699us | 19.484041us | 19.284729us | 19.686235us | +| 256 | 100 | 1 | 646.743600ms | 5.964894ms | 260.326067us | 23.300369us | 23.107462us | 23.505130us | +| 512 | 100 | 1 | 1511.864200ms | 15.446910ms | 517.601956us | 30.169747us | 29.968271us | 30.367106us | +| 1024 | 100 | 1 | 4054.961000ms | 39.976410ms | 1.153015ms | 39.039462us | 38.827844us | 39.271967us | +| 2048 | 100 | 1 | 10025.808900ms | 99.035796ms | 2.244221ms | 48.357322us | 48.135314us | 48.564832us | +| 4096 | 100 | 1 | 22517.608700ms | 225.192648ms | 3.840167ms | 54.978674us | 54.797276us | 55.165651us | +| 8192 | 100 | 1 | 48038.315200ms | 484.788639ms | 5.869198ms | 59.178301us | 59.041347us | 59.322729us | +| 16384 | 100 | 1 | 100303.524300ms | 1010.469198ms | 9.401500ms | 61.674145us | 61.561431us | 61.787268us | ## SV-SingleBattle-AnalyzeEffect-RandomInputs-ManyRandomBattles-ManyRandomInputs | Inputs | Samples | Iterations / Sample | Estimated Completion Time | Mean of Samples | Standard Deviation | Mean / Input Count | Mean Lower Bound / Input Count | Mean Upper Bound / Input Count | | --- | --- | --- | --- | --- | --- | --- | --- | --- | -| 1 | 100 | 1 | 37.355400ms | 82.236750us | 29.185043us | 82.236750us | 75.905700us | 87.399180us | -| 2 | 100 | 1 | 41.116800ms | 122.544350us | 20.113241us | 61.272175us | 59.069605us | 63.044365us | -| 4 | 100 | 1 | 24.286300ms | 185.673510us | 19.383570us | 46.418378us | 45.521105us | 47.436475us | -| 8 | 100 | 1 | 29.561300ms | 298.063140us | 25.763323us | 37.257893us | 36.634234us | 37.893652us | -| 16 | 100 | 1 | 63.349200ms | 509.081730us | 33.812344us | 31.817608us | 31.398680us | 32.225256us | -| 32 | 100 | 1 | 107.386100ms | 911.796680us | 48.793263us | 28.493646us | 28.198924us | 28.796039us | -| 64 | 100 | 1 | 199.431100ms | 1.707322ms | 74.445143us | 26.676906us | 26.439242us | 26.896776us | -| 128 | 100 | 1 | 369.371800ms | 3.244154ms | 107.556528us | 25.344953us | 25.176633us | 25.506588us | -| 256 | 100 | 1 | 761.820700ms | 6.314455ms | 141.706411us | 24.665841us | 24.557951us | 24.774593us | -| 512 | 100 | 1 | 1468.177700ms | 12.652643ms | 805.391725us | 24.712193us | 24.483227us | 25.159786us | -| 1024 | 100 | 1 | 2956.285800ms | 26.218907ms | 1.464827ms | 25.604402us | 25.395026us | 26.008409us | -| 2048 | 100 | 1 | 6050.358400ms | 58.820011ms | 3.494198ms | 28.720708us | 28.480211us | 29.232351us | -| 4096 | 100 | 1 | 13853.925000ms | 138.278157ms | 4.001533ms | 33.759316us | 33.603483us | 34.000985us | -| 8192 | 100 | 1 | 29237.777800ms | 295.211390ms | 4.341737ms | 36.036547us | 35.946949us | 36.159639us | -| 16384 | 100 | 1 | 62777.998100ms | 622.595251ms | 7.767672ms | 38.000198us | 37.928546us | 38.128371us | +| 1 | 100 | 1 | 37.614700ms | 83.123810us | 26.951295us | 83.123810us | 77.167990us | 87.864500us | +| 2 | 100 | 1 | 41.612400ms | 124.585230us | 21.122230us | 62.292615us | 60.095920us | 64.248605us | +| 4 | 100 | 1 | 49.940600ms | 184.568460us | 18.986097us | 46.142115us | 45.136910us | 47.005385us | +| 8 | 100 | 1 | 40.498900ms | 292.349880us | 26.513383us | 36.543735us | 35.834039us | 37.144251us | +| 16 | 100 | 1 | 59.946500ms | 503.944720us | 37.870419us | 31.496545us | 31.023408us | 31.947833us | +| 32 | 100 | 1 | 113.259900ms | 910.186450us | 44.819627us | 28.443327us | 28.166674us | 28.716360us | +| 64 | 100 | 1 | 197.142400ms | 1.687464ms | 82.660086us | 26.366631us | 26.126584us | 26.630827us | +| 128 | 100 | 1 | 365.854700ms | 3.206103ms | 100.136523us | 25.047682us | 24.895564us | 25.203430us | +| 256 | 100 | 1 | 708.553300ms | 6.220076ms | 160.255161us | 24.297174us | 24.177553us | 24.423058us | +| 512 | 100 | 1 | 1421.605000ms | 12.226544ms | 224.806939us | 23.879968us | 23.795175us | 23.966526us | +| 1024 | 100 | 1 | 2823.507000ms | 24.889896ms | 403.895135us | 24.306539us | 24.236567us | 24.392412us | +| 2048 | 100 | 1 | 5879.109000ms | 54.964453ms | 1.196715ms | 26.838112us | 26.728506us | 26.956841us | +| 4096 | 100 | 1 | 13272.695500ms | 132.592859ms | 1.956914ms | 32.371303us | 32.281397us | 32.468228us | +| 8192 | 100 | 1 | 28451.461400ms | 284.063659ms | 2.035177ms | 34.675740us | 34.628071us | 34.725474us | +| 16384 | 100 | 1 | 60147.016900ms | 598.955993ms | 7.988140ms | 36.557373us | 36.500351us | 36.756461us | diff --git a/src/Pokedex/Pokedex.cpp b/src/Pokedex/Pokedex.cpp index 086b505..4d24902 100644 --- a/src/Pokedex/Pokedex.cpp +++ b/src/Pokedex/Pokedex.cpp @@ -62,6 +62,14 @@ void Pokedex::loadForBattleInfo(const std::vector& battleInf } } } + + for (const auto& damageCalculation : battleCreationInfo.damageCalculations) { + moveSet.insert(damageCalculation.moves.begin(), damageCalculation.moves.end()); + } + + for (const auto& effectToAnalyze : battleCreationInfo.effectsToAnalyze) { + moveSet.insert(effectToAnalyze.moves.begin(), effectToAnalyze.moves.end()); + } } loadSpecies(speciesSet); From 13e805ff213a8ebdeb54a7d85a72e9e01a526edd Mon Sep 17 00:00:00 2001 From: aed3 <32887801+aed3@users.noreply.github.com> Date: Thu, 25 Jun 2026 08:33:04 -0500 Subject: [PATCH 06/10] Reusing Action Move Entities Part 1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It's been so long between commits this time because, once I implemented the reuse of action move entities, there was a slowdown only in the many random battle and inputs simulate turn benchmark that I couldn't explain. Turns out it had nothing to do with the new code I wrote but rather how the battles were being created. Before this commit, using many simulate turn inputs with one battle used the cloning code to create a battle per input. That code create entities for all the clones of an original entity in order, keeping entities that would be in almost the same way close to each other. When many battles with one simulate turn input each was used, the code created all the entities for a battle before moving to the next one. This meant that, for example, all the Pokemon entities were spaced out between the battle, side, and action entities. The action move entities used to be created after the battle was set up, resulting in no other kind of entity being created in between them and them appearing sequentially. Because my first attempt at this change moved action move entity creation to battle setup and using many battles with different inputs didn’t use cloning to create those action move entities sequentially, the performance benefit from having data used at similar time close together was lost and the benchmark performed worse. I spent most of my time checking if the new code I wrote was the problem rather than if problems with old code were now more evident. Once I considered the benchmark itself could be wrong did I find my way to the solution. Because changing how battle setup works to improve entity data locality makes improvements on its own to performance, I’m splitting this change into two commits. This one changes the battle setup to create the entities for each kind of object all at once and set them up so entities that are clones of each other are also sequential. --- extras/PokeSim.cpp | 492 ++++++++++-------- extras/PokeSim.hpp | 57 +- extras/RecentBenchmarkResults.md | 472 ++++++++--------- src/AnalyzeEffect/AnalyzeEffect.cpp | 9 +- .../Setup/AnalyzeEffectInputSetup.hpp | 1 - src/Battle/Helpers/Helpers.cpp | 4 +- src/Battle/Helpers/Helpers.hpp | 2 +- src/Battle/ManageBattleState.cpp | 8 +- src/Battle/Setup/BattleStateSetup.cpp | 38 +- src/Battle/Setup/BattleStateSetup.hpp | 5 +- src/Battle/Setup/PokemonStateSetup.hpp | 1 - src/Battle/Setup/SideStateSetup.cpp | 9 +- src/Battle/Setup/SideStateSetup.hpp | 6 +- src/CalcDamage/Setup/CalcDamageInputSetup.cpp | 16 +- src/CalcDamage/Setup/CalcDamageInputSetup.hpp | 7 +- src/Pokedex/Pokedex.cpp | 6 +- src/Pokedex/Pokedex.hpp | 5 +- src/Pokedex/Setup/DexDataSetup.hpp | 1 + src/Pokedex/Setup/GetMoveBuild.cpp | 27 +- src/Pokedex/Setup/MoveDexDataSetup.cpp | 2 +- src/Pokedex/Setup/MoveDexDataSetup.hpp | 2 +- src/SimulateTurn/SimulateTurn.cpp | 3 +- src/Simulation/Simulation.hpp | 21 - src/Simulation/SimulationSetup.cpp | 363 ++++++++----- src/Types/Decisions.hpp | 6 +- 25 files changed, 840 insertions(+), 723 deletions(-) diff --git a/extras/PokeSim.cpp b/extras/PokeSim.cpp index 66bbcec..0bda17f 100644 --- a/extras/PokeSim.cpp +++ b/extras/PokeSim.cpp @@ -1350,11 +1350,82 @@ void check(const DamageRollOptions& damageRollOptions) { ///////////////// START OF src/Simulation/SimulationSetup.cpp ////////////////// +#include #include #include namespace pokesim { namespace { +types::entityIndex getBattleCreationCount(const BattleCreationInfo& battleInfo) { + return std::max(1UL, battleInfo.decisionsToSimulate.size()); +} + +struct EntityLists { + struct EntityList { + private: + types::entityVector list{}; + types::entityIndex index = 0U; + + public: + EntityList() {} + EntityList(types::registry& registry, types::entityIndex size) : list(size) { + registry.create(list.begin(), list.end()); + } + + types::entity getNext() { + POKESIM_REQUIRE(index < list.size(), "More entities are being asked for than were created."); + types::entity nextEntity = list[index]; + index++; + return nextEntity; + } + }; + + EntityList battles; + EntityList sides; + EntityList pokemon; + EntityList recycledActions; + EntityList calcDamageInputs; + EntityList analyzeEffectInputs; + + EntityLists(Simulation* simulation, const std::vector& battleInfoList) { + types::entityIndex battleCount = 0; + types::entityIndex pokemonCount = 0; + types::entityIndex calcDamageInputCount = 0; + types::entityIndex analyzeEffectInputCount = 0; + for (const BattleCreationInfo& battleInfo : battleInfoList) { + types::entityIndex battleCountIncrease = getBattleCreationCount(battleInfo); + battleCount += battleCountIncrease; + + for (const SideCreationInfo& side : battleInfo.sides) { + pokemonCount += side.team.size() * battleCountIncrease; + } + + for (const CalcDamageInputInfo& calcDamageInputInfo : battleInfo.damageCalculations) { + calcDamageInputCount += calcDamageInputInfo.moves.size(); + } + for (const AnalyzeEffectInputInfo& analyzeEffectInputInfo : battleInfo.effectsToAnalyze) { + analyzeEffectInputCount += analyzeEffectInputInfo.moves.size(); + } + } + + types::entityIndex sideCount = battleCount * 2; + types::entityIndex recycledActionCount = battleCount; + + POKESIM_REQUIRE( + battleCount + sideCount + recycledActionCount + pokemonCount + calcDamageInputCount + analyzeEffectInputCount < + std::numeric_limits::max(), + "More entities than can be created would be made for this input."); + + types::registry& registry = simulation->registry; + battles = {registry, battleCount}; + sides = {registry, sideCount}; + pokemon = {registry, pokemonCount}; + recycledActions = {registry, recycledActionCount}; + calcDamageInputs = {registry, calcDamageInputCount}; + analyzeEffectInputs = {registry, analyzeEffectInputCount}; + } +}; + void setPokemonAbility( const PokemonCreationInfo& pokemonInfo, PokemonStateSetup& pokemonSetup, const Pokedex& pokedex) { if (pokemonInfo.ability != dex::Ability::NO_ABILITY) { @@ -1467,10 +1538,9 @@ void setPokemonCurrentBoosts(const PokemonCreationInfo& pokemonInfo, PokemonStat if (pokemonInfoBoosts.spd.has_value()) pokemonSetup.setBoost(pokemonInfoBoosts.spd.value()); if (pokemonInfoBoosts.spe.has_value()) pokemonSetup.setBoost(pokemonInfoBoosts.spe.value()); } -} // namespace -PokemonStateSetup Simulation::createInitialPokemon(const PokemonCreationInfo& pokemonInfo) { - PokemonStateSetup pokemonSetup(registry); +void createInitialPokemon( + const PokemonCreationInfo& pokemonInfo, PokemonStateSetup& pokemonSetup, const Pokedex& pokedex) { if (pokemonInfo.id.has_value()) { pokemonSetup.setID(pokemonInfo.id.value()); } @@ -1479,13 +1549,13 @@ PokemonStateSetup Simulation::createInitialPokemon(const PokemonCreationInfo& po } pokemonSetup.setSpecies(pokemonInfo.species); - setPokemonAbility(pokemonInfo, pokemonSetup, pokedex()); + setPokemonAbility(pokemonInfo, pokemonSetup, pokedex); types::level level = pokemonInfo.level.value_or(Constants::PokemonLevel::DEFAULT); dex::Nature nature = setPokemonNature(pokemonInfo, pokemonSetup); Evs evs = setPokemonEvs(pokemonInfo, pokemonSetup); Ivs ivs = setPokemonIvs(pokemonInfo, pokemonSetup); - types::stat hp = setPokemonStats(pokemonInfo, pokemonSetup, pokedex(), level, nature, evs, ivs); + types::stat hp = setPokemonStats(pokemonInfo, pokemonSetup, pokedex, level, nature, evs, ivs); pokemonSetup.setLevel(level); @@ -1493,7 +1563,7 @@ PokemonStateSetup Simulation::createInitialPokemon(const PokemonCreationInfo& po pokemonSetup.setTypes(pokemonInfo.currentTypes.value()); } else { - pokemonSetup.setTypes(pokedex().getSpeciesData(pokemonInfo.species)); + pokemonSetup.setTypes(pokedex.getSpeciesData(pokemonInfo.species)); } if (pokemonInfo.gender.has_value() && pokemonInfo.gender != dex::Gender::NO_GENDER) { @@ -1521,20 +1591,82 @@ PokemonStateSetup Simulation::createInitialPokemon(const PokemonCreationInfo& po pokemonSetup.setProperty(); pokemonSetup.setProperty(); pokemonSetup.setProperty(); +} + +void createCalcDamageInput( + const CalcDamageInputInfo& inputInfo, BattleStateSetup& battleSetup, types::registry& registry, + const Pokedex& pokedex, EntityLists& entityLists, debug::SimulationSetupChecks& debugChecks) { + POKESIM_REQUIRE(inputInfo.attackerSlot != Slot::NONE, "A damage calculation must have a attacker."); + POKESIM_REQUIRE(inputInfo.defenderSlot != Slot::NONE, "A damage calculation must have a defender."); + POKESIM_REQUIRE(!inputInfo.moves.empty(), "A damage calculation must have a move."); + + const Sides& sides = registry.get(battleSetup.entity()); + types::entity attackerEntity = slotToPokemonEntity(registry, sides, inputInfo.attackerSlot); + types::entity defenderEntity = slotToPokemonEntity(registry, sides, inputInfo.defenderSlot); + + for (dex::Move move : inputInfo.moves) { + calc_damage::InputSetup inputSetup{registry, entityLists.calcDamageInputs.getNext()}; + POKESIM_REQUIRE(move != dex::Move::NO_MOVE, "A damage calculation must have a move."); + + inputSetup.setup(battleSetup.entity(), attackerEntity, defenderEntity, move, pokedex); + debugChecks.addToCalcDamageChecklist(battleSetup, inputSetup, inputInfo); + } +} + +void createAnalyzeEffectInput( + const AnalyzeEffectInputInfo& inputInfo, BattleStateSetup& battleSetup, types::registry& registry, + EntityLists& entityLists, debug::SimulationSetupChecks& debugChecks) { + POKESIM_REQUIRE(inputInfo.attackerSlot != Slot::NONE, "An effect analysis must have a attacker."); + POKESIM_REQUIRE(inputInfo.defenderSlot != Slot::NONE, "An effect analysis must have a defender."); + POKESIM_REQUIRE(inputInfo.effectTarget != Slot::NONE, "An effect analysis must have a effect target."); + POKESIM_REQUIRE(!inputInfo.moves.empty(), "An effect analysis must include a move."); + + const auto& effect = inputInfo.effect; + const auto& boostEffect = inputInfo.boostEffect; + POKESIM_REQUIRE( + boostEffect.has_value() || (effect.has_value() && !effect.value().empty()), + "An effect analysis must have an effect."); + + const Sides& sides = registry.get(battleSetup.entity()); + types::entity attackerEntity = slotToPokemonEntity(registry, sides, inputInfo.attackerSlot); + types::entity defenderEntity = slotToPokemonEntity(registry, sides, inputInfo.defenderSlot); + types::entity effectTargetEntity = slotToPokemonEntity(registry, sides, inputInfo.effectTarget); + + for (dex::Move move : inputInfo.moves) { + analyze_effect::InputSetup inputSetup{registry, entityLists.analyzeEffectInputs.getNext()}; + + inputSetup.setAttacker(attackerEntity); + inputSetup.setDefender(defenderEntity); + inputSetup.setEffectTarget(effectTargetEntity); + inputSetup.setEffectMove(move); + inputSetup.setBattle(battleSetup.entity()); - return pokemonSetup; + if (effect.has_value()) { + inputSetup.setEffect(effect.value()); + } + if (boostEffect.has_value()) { + inputSetup.setBoostEffect(boostEffect.value().stat, boostEffect.value().boost); + } + + debugChecks.addToAnalyzeEffectChecklist(battleSetup, inputSetup, inputInfo); + } } -void Simulation::createInitialSide( - SideStateSetup sideSetup, const SideCreationInfo& sideInfo, const BattleCreationInfo& battleInfo) { - internal::maxSizedVector pokemonSetupList; - pokemonSetupList.reserve(sideInfo.team.size()); +void createInitialTurnDecision(const TurnDecisionInfo& turnDecisionInfo, types::sides& sideSetupList) { + for (types::sideIndex i = 0U; i < sideSetupList.size(); i++) { + sideSetupList[i].setSideDecision(turnDecisionInfo[i]); + } +} +void createInitialSide( + const SideCreationInfo& sideInfo, SideStateSetup& sideSetup, const BattleCreationInfo& battleInfo, + Simulation* simulation, internal::maxSizedVector& pokemonSetupList) { for (std::size_t i = 0U; i < sideInfo.team.size(); i++) { + PokemonStateSetup& pokemonSetup = pokemonSetupList[i]; const PokemonCreationInfo& pokemonInfo = sideInfo.team[i]; - PokemonStateSetup pokemonSetup = createInitialPokemon(pokemonInfo); + bool battleStarted = battleInfo.turn > Constants::TurnCount::MIN; - bool inActiveSlot = (isBattleFormat(BattleFormat::SINGLES) ? 1U : 2U) > i; + bool inActiveSlot = (simulation->isBattleFormat(BattleFormat::SINGLES) ? 1U : 2U) > i; bool isFainted = pokemonInfo.currentHp.has_value() && pokemonInfo.currentHp == Constants::PokemonCurrentHpStat::MIN; if (battleStarted && inActiveSlot && !isFainted) { pokemonSetup.setProperty(); @@ -1544,7 +1676,7 @@ void Simulation::createInitialSide( for (const MoveCreationInfo& moveInfo : pokemonInfo.moves) { types::pp maxPp = Constants::MoveMaxPp::DEFAULT; if (!moveInfo.pp.has_value() || !moveInfo.maxPp.has_value()) { - maxPp = pokedex().getMoveData(moveInfo.name).val; + maxPp = simulation->pokedex().getMoveData(moveInfo.name).val; } maxPp = moveInfo.maxPp.value_or(maxPp); @@ -1552,9 +1684,9 @@ void Simulation::createInitialSide( } pokemonSetup.setMoves(moveSlots); - pokemonSetupList.push_back(pokemonSetup); } + types::registry& registry = simulation->registry; if (battleInfo.runWithSimulateTurn) { sideSetup.setProperty(); registry.insert(pokemonSetupList.begin(), pokemonSetupList.end()); @@ -1571,164 +1703,121 @@ void Simulation::createInitialSide( sideSetup.setTeam(pokemonSetupList); } -types::sides Simulation::createInitialBattle( - BattleStateSetup battleStateSetup, const BattleCreationInfo& battleInfo) { - battleStateSetup.setAutoID(); - battleStateSetup.setTurn(battleInfo.turn.value_or(Constants::TurnCount::DEFAULT)); - battleStateSetup.setRNGSeed(battleInfo.rngSeed); - battleStateSetup.setProbability(battleInfo.probability.value_or(Constants::Probability::DEFAULT)); +void createInitialBattle( + const BattleCreationInfo& battleInfo, BattleStateSetup& battleSetup, types::sides& sideSetupList) { + battleSetup.setTurn(battleInfo.turn.value_or(Constants::TurnCount::DEFAULT)); + battleSetup.setRNGSeed(battleInfo.rngSeed); + battleSetup.setProbability(battleInfo.probability.value_or(Constants::Probability::DEFAULT)); if (battleInfo.runWithSimulateTurn) { - battleStateSetup.setProperty(); + battleSetup.setProperty(); } if (battleInfo.runWithCalculateDamage) { - battleStateSetup.setProperty(); + battleSetup.setProperty(); } if (battleInfo.runWithAnalyzeEffect) { - battleStateSetup.setProperty(); + battleSetup.setProperty(); } - SideStateSetup p1SideSetup(registry, PlayerSideId::P1); - SideStateSetup p2SideSetup(registry, PlayerSideId::P2); + SideStateSetup& p1SideSetup = sideSetupList.p1(); + SideStateSetup& p2SideSetup = sideSetupList.p2(); - types::entity battleEntity = battleStateSetup.entity(); + p1SideSetup.setPlayerSide(PlayerSideId::P1); + p2SideSetup.setPlayerSide(PlayerSideId::P2); + + types::entity battleEntity = battleSetup.entity(); types::entity p1Entity = p1SideSetup.entity(); types::entity p2Entity = p2SideSetup.entity(); - battleStateSetup.setSide(p1Entity); - battleStateSetup.setSide(p2Entity); + battleSetup.setSide(p1Entity); + battleSetup.setSide(p2Entity); p1SideSetup.setOpponent(p2Entity); p2SideSetup.setOpponent(p1Entity); p1SideSetup.setBattle(battleEntity); p2SideSetup.setBattle(battleEntity); - - return {p1SideSetup, p2SideSetup}; } -void Simulation::createInitialTurnDecision( - BattleStateSetup battleStateSetup, const TurnDecisionInfo& turnDecisionInfo) { - types::handle battleHandle{registry, battleStateSetup.entity()}; - const Sides& sides = battleHandle.get(); - - for (types::sideIndex i = 0U; i < sides.val.size(); i++) { - registry.emplace(sides.val[i], turnDecisionInfo[i]); - } -} - -void Simulation::createCalcDamageInput( - BattleStateSetup battleStateSetup, const CalcDamageInputInfo& inputInfo, debug::SimulationSetupChecks& debugChecks) { - POKESIM_REQUIRE(inputInfo.attackerSlot != Slot::NONE, "A damage calculation must have a attacker."); - POKESIM_REQUIRE(inputInfo.defenderSlot != Slot::NONE, "A damage calculation must have a defender."); - POKESIM_REQUIRE(!inputInfo.moves.empty(), "A damage calculation must have a move."); +void createInitialState( + const BattleCreationInfo& battleInfo, Simulation* simulation, EntityLists& entityLists, + debug::SimulationSetupChecks& debugChecks) { + internal::maxSizedVector battleSetupList; + internal::maxSizedVector> sideSetupLists; + internal::maxSizedVector>> + pokemonSetupLists; + battleSetupList.resize(getBattleCreationCount(battleInfo)); + sideSetupLists.resize(battleSetupList.size()); + pokemonSetupLists.resize(battleSetupList.size()); - const Sides& sides = registry.get(battleStateSetup.entity()); - types::entity attackerEntity = slotToPokemonEntity(registry, sides, inputInfo.attackerSlot); - types::entity defenderEntity = slotToPokemonEntity(registry, sides, inputInfo.defenderSlot); + const Pokedex& pokedex = simulation->pokedex(); + types::registry& registry = simulation->registry; - for (dex::Move move : inputInfo.moves) { - calc_damage::InputSetup inputSetup(registry); - POKESIM_REQUIRE(move != dex::Move::NO_MOVE, "A damage calculation must have a move."); + for (BattleStateSetup& battleSetup : battleSetupList) { + battleSetup = {registry, entityLists.battles.getNext()}; + } - inputSetup.setup(battleStateSetup.entity(), attackerEntity, defenderEntity, move, pokedex()); - debugChecks.addToCalcDamageChecklist(battleStateSetup, inputSetup, inputInfo); + for (types::sideIndex sideIndex = 0; sideIndex < battleInfo.sides.size(); sideIndex++) { + for (auto& sideSetupList : sideSetupLists) { + sideSetupList[sideIndex] = {registry, entityLists.sides.getNext()}; + } } -} -void Simulation::createAnalyzeEffectInput( - BattleStateSetup battleStateSetup, const AnalyzeEffectInputInfo& inputInfo, - debug::SimulationSetupChecks& debugChecks) { - POKESIM_REQUIRE(inputInfo.attackerSlot != Slot::NONE, "An effect analysis must have a attacker."); - POKESIM_REQUIRE(inputInfo.defenderSlot != Slot::NONE, "An effect analysis must have a defender."); - POKESIM_REQUIRE(inputInfo.effectTarget != Slot::NONE, "An effect analysis must have a effect target."); - POKESIM_REQUIRE(!inputInfo.moves.empty(), "An effect analysis must include a move."); + for (types::entityIndex battleIndex = 0; battleIndex < battleSetupList.size(); battleIndex++) { + BattleStateSetup& battleSetup = battleSetupList[battleIndex]; + createInitialBattle(battleInfo, battleSetup, sideSetupLists[battleIndex]); + battleSetup.setRecycledAction(entityLists.recycledActions.getNext()); + } - const auto& effect = inputInfo.effect; - const auto& boostEffect = inputInfo.boostEffect; - POKESIM_REQUIRE( - boostEffect.has_value() || (effect.has_value() && !effect.value().empty()), - "An effect analysis must have an effect."); + for (types::sideIndex sideIndex = 0; sideIndex < battleInfo.sides.size(); sideIndex++) { + for (const PokemonCreationInfo& pokemonInfo : battleInfo.sides[sideIndex].team) { + for (auto& pokemonSetupList : pokemonSetupLists) { + PokemonStateSetup& pokemonSetup = + pokemonSetupList[sideIndex].emplace_back(registry, entityLists.pokemon.getNext()); + createInitialPokemon(pokemonInfo, pokemonSetup, pokedex); + } + } + } - const Sides& sides = registry.get(battleStateSetup.entity()); - types::entity attackerEntity = slotToPokemonEntity(registry, sides, inputInfo.attackerSlot); - types::entity defenderEntity = slotToPokemonEntity(registry, sides, inputInfo.defenderSlot); - types::entity effectTargetEntity = slotToPokemonEntity(registry, sides, inputInfo.effectTarget); + for (types::entityIndex battleIndex = 0; battleIndex < battleSetupList.size(); battleIndex++) { + BattleStateSetup& battleSetup = battleSetupList[battleIndex]; + auto& sideSetupList = sideSetupLists[battleIndex]; + for (types::sideIndex sideIndex = 0; sideIndex < battleInfo.sides.size(); sideIndex++) { + createInitialSide( + battleInfo.sides[sideIndex], + sideSetupList[sideIndex], + battleInfo, + simulation, + pokemonSetupLists[battleIndex][sideIndex]); + } - for (dex::Move move : inputInfo.moves) { - analyze_effect::InputSetup inputSetup(registry); + if (battleIndex < battleInfo.decisionsToSimulate.size()) { + const TurnDecisionInfo& turnDecisionInfo = battleInfo.decisionsToSimulate[battleIndex]; + createInitialTurnDecision(turnDecisionInfo, sideSetupList); + debugChecks.addToTurnDecisionChecklist(battleSetup, turnDecisionInfo); + } + battleSetup.setID(battleIndex); + debugChecks.addToBattleChecklist(battleSetup, battleInfo); + } - inputSetup.setAttacker(attackerEntity); - inputSetup.setDefender(defenderEntity); - inputSetup.setEffectTarget(effectTargetEntity); - inputSetup.setEffectMove(move); - inputSetup.setBattle(battleStateSetup.entity()); + BattleStateSetup& battleSetup = battleSetupList[0]; + for (const CalcDamageInputInfo& calcDamageInputInfo : battleInfo.damageCalculations) { + createCalcDamageInput(calcDamageInputInfo, battleSetup, registry, pokedex, entityLists, debugChecks); + } - if (effect.has_value()) { - inputSetup.setEffect(effect.value()); - } - if (boostEffect.has_value()) { - inputSetup.setBoostEffect(boostEffect.value().stat, boostEffect.value().boost); - } - debugChecks.addToAnalyzeEffectChecklist(battleStateSetup, inputSetup, inputInfo); + for (const AnalyzeEffectInputInfo& analyzeEffectInputInfo : battleInfo.effectsToAnalyze) { + createAnalyzeEffectInput(analyzeEffectInputInfo, battleSetup, registry, entityLists, debugChecks); } } +} // namespace void Simulation::createInitialStates(const std::vector& battleInfoList) { debug::SimulationSetupChecks debugChecks(this, battleInfoList); - for (const BattleCreationInfo& battleInfo : battleInfoList) { - BattleStateSetup battleStateSetup(registry); - types::sides sideSetup = createInitialBattle(battleStateSetup, battleInfo); - - for (types::sideIndex i = 0U; i < sideSetup.size(); i++) { - createInitialSide(sideSetup[i], battleInfo.sides[i], battleInfo); - } - - debugChecks.addToBattleChecklist(battleStateSetup, battleInfo); - - if (!battleInfo.decisionsToSimulate.empty()) { - POKESIM_REQUIRE( - battleInfo.decisionsToSimulate.size() < std::numeric_limits::max(), - "Cannot make more clones than there are entities available."); - - types::entityIndex cloneCount = (types::entityIndex)(battleInfo.decisionsToSimulate.size() - 1U); - if (cloneCount) { - battleStateSetup.setProperty(); - const types::ClonedEntityMap entityMap = pokesim::clone(registry, cloneCount); - - const auto& clonedBattles = entityMap.at(battleStateSetup.entity()); - internal::maxSizedVector clones; - clones.reserve(clonedBattles.size()); + EntityLists entityLists{this, battleInfoList}; - for (types::entity entity : clonedBattles) { - clones.emplace_back(registry, entity); - } - - for (types::entityIndex i = 0U; i < cloneCount; i++) { - BattleStateSetup& setupClone = clones[i]; - const TurnDecisionInfo& turnDecisionInfo = battleInfo.decisionsToSimulate[i]; - debugChecks.addToBattleChecklist(setupClone, battleInfo); - - createInitialTurnDecision(setupClone, turnDecisionInfo); - setupClone.setID(i); - - debugChecks.addToTurnDecisionChecklist(setupClone, turnDecisionInfo); - } - } - - createInitialTurnDecision(battleStateSetup, battleInfo.decisionsToSimulate.back()); - debugChecks.addToTurnDecisionChecklist(battleStateSetup, battleInfo.decisionsToSimulate.back()); - battleStateSetup.setID(cloneCount); - } - - for (const CalcDamageInputInfo& calcDamageInputInfo : battleInfo.damageCalculations) { - createCalcDamageInput(battleStateSetup, calcDamageInputInfo, debugChecks); - } - - for (const AnalyzeEffectInputInfo& analyzeEffectInputInfo : battleInfo.effectsToAnalyze) { - createAnalyzeEffectInput(battleStateSetup, analyzeEffectInputInfo, debugChecks); - } + for (const BattleCreationInfo& battleInfo : battleInfoList) { + createInitialState(battleInfo, this, entityLists, debugChecks); } debugChecks.checkOutputs(); @@ -2340,7 +2429,8 @@ void createActionMoveForTargets( types::registry& registry = *targetHandle.registry(); dex::Move move = registry.get(registry.get(battle.val).val).val; - types::entity moveEntity = createActionMoveForTarget(targetHandle, battle.val, source.val, move, pokedex); + types::entity moveEntity = + createActionMoveForTarget(targetHandle, battle.val, source.val, move, pokedex, registry.create()); registry.emplace(moveEntity); } @@ -3572,7 +3662,7 @@ void MoveDexDataSetup::setEffectTargetsMoveSource() { void MoveDexDataSetup::setEffectTargetsMoveTarget() { POKESIM_REQUIRE( - !handle.all_of(), + !handle.all_of(), "Moves effects can only affect the source or target, not both."); handle.emplace(); } @@ -3805,8 +3895,9 @@ struct BuildMove { } public: - static types::entity build(types::registry& registry, GameMechanics gameMechanic, bool forActiveMove) { - dex::internal::MoveDexDataSetup move(registry); + static types::entity build( + types::registry& registry, GameMechanics gameMechanic, bool forActiveMove, types::entity entityToUse) { + dex::internal::MoveDexDataSetup move(registry, entityToUse); if (forActiveMove) { move.setNameTag(T::name(gameMechanic)); @@ -3937,17 +4028,18 @@ struct BuildMove { } }; types::entity buildByGameMechanic( - dex::Move move, types::registry& registry, bool forActiveMove, GameMechanics gameMechanic) { + dex::Move move, types::registry& registry, bool forActiveMove, GameMechanics gameMechanic, + types::entity entityToUse) { // Tidy check ignored because "using namespace" is in function using namespace pokesim::dex; // NOLINT(google-build-using-namespace) switch (move) { - case Move::FURY_ATTACK: return BuildMove::build(registry, gameMechanic, forActiveMove); - case Move::KNOCK_OFF: return BuildMove::build(registry, gameMechanic, forActiveMove); - case Move::MOONBLAST: return BuildMove::build(registry, gameMechanic, forActiveMove); - case Move::QUIVER_DANCE: return BuildMove::build(registry, gameMechanic, forActiveMove); - case Move::SPLASH: return BuildMove::build(registry, gameMechanic, forActiveMove); - case Move::THUNDERBOLT: return BuildMove::build(registry, gameMechanic, forActiveMove); - case Move::WILL_O_WISP: return BuildMove::build(registry, gameMechanic, forActiveMove); + case Move::FURY_ATTACK: return BuildMove::build(registry, gameMechanic, forActiveMove, entityToUse); + case Move::KNOCK_OFF: return BuildMove::build(registry, gameMechanic, forActiveMove, entityToUse); + case Move::MOONBLAST: return BuildMove::build(registry, gameMechanic, forActiveMove, entityToUse); + case Move::QUIVER_DANCE: return BuildMove::build(registry, gameMechanic, forActiveMove, entityToUse); + case Move::SPLASH: return BuildMove::build(registry, gameMechanic, forActiveMove, entityToUse); + case Move::THUNDERBOLT: return BuildMove::build(registry, gameMechanic, forActiveMove, entityToUse); + case Move::WILL_O_WISP: return BuildMove::build(registry, gameMechanic, forActiveMove, entityToUse); default: break; } @@ -3957,9 +4049,10 @@ types::entity buildByGameMechanic( } } // namespace -types::entity Pokedex::buildMove(dex::Move move, types::registry& registry, bool forActiveMove) const { +types::entity Pokedex::buildMove( + dex::Move move, types::registry& registry, bool forActiveMove, types::entity entityToUse) const { if (isGameMechanic(GameMechanics::SCARLET_VIOLET)) { - return buildByGameMechanic(move, registry, forActiveMove, GameMechanics::SCARLET_VIOLET); + return buildByGameMechanic(move, registry, forActiveMove, GameMechanics::SCARLET_VIOLET, entityToUse); } POKESIM_REQUIRE_FAIL("Building for a game that is not yet supported."); @@ -4108,15 +4201,15 @@ void Pokedex::loadItems(const entt::dense_set& itemSet) { } void Pokedex::loadMoves(const entt::dense_set& moveSet) { - load(movesMap, moveSet, [this](dex::Move move) { return buildMove(move, dexRegistry, false); }); + load(movesMap, moveSet, [this](dex::Move move) { return buildMove(move, dexRegistry, false, dexRegistry.create()); }); } void Pokedex::loadAbilities(const entt::dense_set& abilitySet) { load(abilitiesMap, abilitySet, [this](dex::Ability ability) { return buildAbility(ability, dexRegistry); }); } -types::entity Pokedex::buildActionMove(dex::Move move, types::registry& registry) const { - return buildMove(move, registry, true); +types::entity Pokedex::buildActionMove(dex::Move move, types::registry& registry, types::entity entityToUse) const { + return buildMove(move, registry, true, entityToUse); } void Pokedex::loadForBattleInfo(const std::vector& battleInfoList) { @@ -4140,6 +4233,14 @@ void Pokedex::loadForBattleInfo(const std::vector& battleInf } } } + + for (const auto& damageCalculation : battleCreationInfo.damageCalculations) { + moveSet.insert(damageCalculation.moves.begin(), damageCalculation.moves.end()); + } + + for (const auto& effectToAnalyze : battleCreationInfo.effectsToAnalyze) { + moveSet.insert(effectToAnalyze.moves.begin(), effectToAnalyze.moves.end()); + } } loadSpecies(speciesSet); @@ -4198,8 +4299,6 @@ void KnockOff::onAfterHit(Simulation& simulation) { ////////////////// START OF src/Pokedex/Events/ItemEvents.cpp ////////////////// -#include - namespace pokesim::dex { namespace { void setChoiceLock(types::handle pokemonHandle, Battle battle) { @@ -4541,23 +4640,19 @@ void Static::onDamagingHit(Simulation& simulation) { //////////// START OF src/CalcDamage/Setup/CalcDamageInputSetup.cpp //////////// namespace pokesim::calc_damage { -InputSetup::InputSetup(types::registry& _registry) : registry(&_registry) {} +InputSetup::InputSetup(types::registry& registry, types::entity moveEntity) : handle(registry, moveEntity) {} void InputSetup::setup( types::entity battleEntity, types::entity sourceEntity, types::entity targetEntity, dex::Move move, const Pokedex& pokedex) { - moveEntity = createActionMoveForTarget({*registry, targetEntity}, battleEntity, sourceEntity, move, pokedex); - types::handle handle{*registry, moveEntity}; + types::registry& registry = *handle.registry(); + + createActionMoveForTarget({registry, targetEntity}, battleEntity, sourceEntity, move, pokedex, entity()); handle.emplace(move); handle.emplace(); - registry->emplace_or_replace(sourceEntity); - registry->emplace_or_replace(targetEntity); -} - -types::entity InputSetup::entity() const { - POKESIM_REQUIRE(moveEntity != entt::null, "Getting move entity before proper setup."); - return moveEntity; + registry.emplace_or_replace(sourceEntity); + registry.emplace_or_replace(targetEntity); } } // namespace pokesim::calc_damage @@ -5088,10 +5183,8 @@ types::teamPositionIndex foeSidePokemonLeft(const types::registry& registry, typ ///////////////// START OF src/Battle/Setup/SideStateSetup.cpp ///////////////// namespace pokesim { -SideStateSetup::SideStateSetup(types::registry& registry, types::entity entity, PlayerSideId playerSideId) - : StateSetupBase(registry, entity) { +SideStateSetup::SideStateSetup(types::registry& registry, types::entity entity) : StateSetupBase(registry, entity) { handle.emplace(); - handle.emplace(playerSideId); } void SideStateSetup::initBlank() { @@ -5124,6 +5217,10 @@ void SideStateSetup::setBattle(types::entity entity) { void SideStateSetup::setPlayerSide(PlayerSideId playerSideId) { handle.emplace(playerSideId); } + +void SideStateSetup::setSideDecision(const SideDecision& sideDecision) { + handle.emplace(sideDecision); +} } // namespace pokesim ////////////////// END OF src/Battle/Setup/SideStateSetup.cpp ////////////////// @@ -5283,9 +5380,6 @@ BattleStateSetup::BattleStateSetup(types::registry& registry, types::entity enti if (!handle.any_of()) { handle.emplace(); handle.emplace(); - - types::entity recycledAction = handle.emplace(registry.create()).val; - registry.emplace(recycledAction); } } @@ -5297,12 +5391,19 @@ void BattleStateSetup::initBlank() { setProbability(Constants::Probability::DEFAULT); } +void BattleStateSetup::setRecycledAction(types::entity recycledAction) { + types::registry& registry = *handle.registry(); + + handle.emplace(recycledAction); + registry.emplace(recycledAction); +} + void BattleStateSetup::setAutoID() { setID((types::stateId)handle.registry()->view().size()); } void BattleStateSetup::setID(types::stateId id) { - handle.emplace_or_replace(id); + handle.emplace(id); } void BattleStateSetup::setSide(types::entity sideEntity) { @@ -5336,32 +5437,6 @@ void BattleStateSetup::setTurn(types::battleTurn turn) { handle.emplace(turn); } -void BattleStateSetup::setCurrentActionTarget(types::targets actionTargets) { - handle.emplace(actionTargets); - for (types::entity entity : actionTargets) { - handle.registry()->emplace(entity); - } -} - -void BattleStateSetup::setCurrentActionSource(types::entity actionSource) { - handle.emplace(actionSource); - handle.registry()->emplace(actionSource); -} - -void BattleStateSetup::setCurrentActionMove(types::entity actionMove) { - handle.registry()->emplace(actionMove); - const auto* source = handle.try_get(); - const auto* targets = handle.try_get(); - if (source) { - handle.registry()->emplace(source->val).val.push_back(actionMove); - } - if (targets) { - for (types::entity target : targets->val) { - handle.registry()->emplace(target).val.push_back(actionMove); - } - } -} - void BattleStateSetup::setProbability(types::probability probability) { handle.emplace(probability); } @@ -5823,7 +5898,13 @@ void setCurrentActionMove( const MoveSlots& moveSlots = registry.get(source.val); for (types::entity target : targets.val) { - createActionMoveForTarget({registry, target}, battleHandle.entity(), source.val, move.val, pokedex); + createActionMoveForTarget( + {registry, target}, + battleHandle.entity(), + source.val, + move.val, + pokedex, + registry.create()); } types::moveSlotIndex moveSlotIndex = moveToMoveSlot(moveSlots, move.val); @@ -5993,9 +6074,9 @@ types::moveSlotIndex moveToMoveSlot(const MoveSlots& moveSlots, dex::Move move) types::entity createActionMoveForTarget( types::handle targetHandle, types::entity battleEntity, types::entity sourceEntity, dex::Move move, - const Pokedex& pokedex) { + const Pokedex& pokedex, types::entity entityToUse) { types::registry& registry = *targetHandle.registry(); - types::entity moveEntity = pokedex.buildActionMove(move, registry); + types::entity moveEntity = pokedex.buildActionMove(move, registry, entityToUse); registry.emplace(moveEntity); registry.emplace(moveEntity, battleEntity); @@ -6630,8 +6711,13 @@ void ignoreBattlesWithEffectActive(Simulation& simulation) { types::entity createAnalyzeEffectMove( types::registry& registry, dex::Move move, types::entity battleEntity, types::entity attackerEntity, types::entity defenderEntity, const Pokedex& pokedex) { - types::entity moveEntity = - createActionMoveForTarget({registry, defenderEntity}, battleEntity, attackerEntity, move, pokedex); + types::entity moveEntity = createActionMoveForTarget( + {registry, defenderEntity}, + battleEntity, + attackerEntity, + move, + pokedex, + registry.create()); registry.emplace(moveEntity, move); registry.emplace(moveEntity); registry.emplace_or_replace(attackerEntity); diff --git a/extras/PokeSim.hpp b/extras/PokeSim.hpp index 2cf8b58..8ca2e2e 100644 --- a/extras/PokeSim.hpp +++ b/extras/PokeSim.hpp @@ -18380,7 +18380,7 @@ struct MoveDecision { dex::Move move = dex::Move::NO_MOVE; - bool operator==(const MoveDecision& other) const { + constexpr bool operator==(const MoveDecision& other) const { return sourceSlot == other.sourceSlot && targetSlot == other.targetSlot && move == other.move; } }; @@ -18394,7 +18394,7 @@ struct SwitchDecision { Slot sourceSlot = Slot::NONE; Slot targetSlot = Slot::NONE; - bool operator==(const SwitchDecision& other) const { + constexpr bool operator==(const SwitchDecision& other) const { return sourceSlot == other.sourceSlot && targetSlot == other.targetSlot; } }; @@ -18405,7 +18405,7 @@ struct ItemDecision { dex::Item item = dex::Item::NO_ITEM; - bool operator==(const ItemDecision& other) const { + constexpr bool operator==(const ItemDecision& other) const { return sourceSlot == other.sourceSlot && targetSlot == other.targetSlot && item == other.item; } }; @@ -21347,7 +21347,6 @@ struct InputSetup { public: InputSetup(types::registry& registry, types::entity entity); - InputSetup(types::registry& registry) : InputSetup(registry, registry.create()) {} void setAttacker(types::entity entity); void setEffectTarget(types::entity entity); @@ -21389,7 +21388,7 @@ types::moveSlotIndex moveToMoveSlot(const MoveSlots& moveSlots, dex::Move move); types::entity createActionMoveForTarget( types::handle targetHandle, types::entity battleEntity, types::entity sourceEntity, dex::Move move, - const Pokedex& pokedex); + const Pokedex& pokedex, types::entity entityToUse); } // namespace pokesim //////////////////// END OF src/Battle/Helpers/Helpers.hpp ///////////////////// @@ -21437,7 +21436,6 @@ struct MoveSlot; // Tool to set properties of a Pokemon's state to an entity. struct PokemonStateSetup : internal::StateSetupBase { PokemonStateSetup() : internal::StateSetupBase() {} - PokemonStateSetup(types::registry& registry) : PokemonStateSetup(registry, registry.create()) {} PokemonStateSetup(types::registry& registry, types::entity entity); operator types::entity() const { return entity(); } @@ -21509,7 +21507,6 @@ struct ActionQueueItem; // Tool to set properties of a battle's state to an entity. struct BattleStateSetup : internal::StateSetupBase { BattleStateSetup() : internal::StateSetupBase() {} - BattleStateSetup(types::registry& registry) : BattleStateSetup(registry, registry.create()) {} BattleStateSetup(types::registry& registry, types::entity entity); /** @@ -21524,6 +21521,7 @@ struct BattleStateSetup : internal::StateSetupBase { */ void initBlank(); + void setRecycledAction(types::entity recycledAction); void setAutoID(); void setID(types::stateId id); void setSide(types::entity sideEntity); @@ -21532,9 +21530,6 @@ struct BattleStateSetup : internal::StateSetupBase { void setRNGSeed(std::optional seed = std::nullopt); void setActionQueue(const std::vector& queue); void setTurn(types::battleTurn turn); - void setCurrentActionTarget(types::targets actionTargets); - void setCurrentActionSource(types::entity actionSource); - void setCurrentActionMove(types::entity actionMove); void setProbability(types::probability probability); }; } // namespace pokesim @@ -21581,13 +21576,12 @@ void emplaceTagFromEnum(dex::Move move, types::handle handle); namespace pokesim { struct PokemonStateSetup; +struct SideDecision; // Tool to set properties of a player's side state to an entity. struct SideStateSetup : internal::StateSetupBase { SideStateSetup() : internal::StateSetupBase() {} - SideStateSetup(types::registry& registry, PlayerSideId playerSideId) - : SideStateSetup(registry, registry.create(), playerSideId) {} - SideStateSetup(types::registry& registry, types::entity entity, PlayerSideId playerSideId); + SideStateSetup(types::registry& registry, types::entity entity); /** * @brief Applies the defaults to the required properties for a player side's state. * @@ -21599,6 +21593,7 @@ struct SideStateSetup : internal::StateSetupBase { void setOpponent(types::entity entity); void setBattle(types::entity entity); void setPlayerSide(PlayerSideId playerSideId); + void setSideDecision(const SideDecision& sideDecision); }; } // namespace pokesim @@ -21612,17 +21607,16 @@ class Pokedex; namespace calc_damage { struct InputSetup { protected: - types::registry* registry; - types::entity moveEntity = entt::null; + types::handle handle; public: - InputSetup(types::registry& registry); + InputSetup(types::registry& registry, types::entity moveEntity); void setup( types::entity battleEntity, types::entity sourceEntity, types::entity targetEntity, dex::Move move, const Pokedex& pokedex); - types::entity entity() const; + types::entity entity() const { return handle.entity(); } }; } // namespace calc_damage } // namespace pokesim @@ -21909,7 +21903,8 @@ class Pokedex { void load(entt::dense_map& map, const entt::dense_set& list, Build build); types::entity buildSpecies(dex::Species species, types::registry& registry) const; - types::entity buildMove(dex::Move move, types::registry& registry, bool forActiveMove) const; + types::entity buildMove( + dex::Move move, types::registry& registry, bool forActiveMove, types::entity entityToUse) const; types::entity buildItem(dex::Item item, types::registry& registry) const; types::entity buildAbility(dex::Ability ability, types::registry& registry) const; @@ -22095,7 +22090,7 @@ class Pokedex { return dexRegistry.all_of(movesMap.at(move)); } - types::entity buildActionMove(dex::Move move, types::registry& registry) const; + types::entity buildActionMove(dex::Move move, types::registry& registry, types::entity entityToUse) const; void loadForBattleInfo(const std::vector& battleInfoList); }; } // namespace pokesim @@ -22527,9 +22522,6 @@ struct RegistryLoop< //////////////////// START OF src/Simulation/Simulation.hpp //////////////////// namespace pokesim { -struct SideStateSetup; -struct PokemonStateSetup; -struct BattleStateSetup; class Pokedex; namespace simulate_turn { @@ -22541,9 +22533,6 @@ struct Results; namespace analyze_effect { struct Results; } // namespace analyze_effect -namespace debug { -struct SimulationSetupChecks; -} /** * @brief The entry point for creating and running simulations. @@ -22552,21 +22541,6 @@ struct SimulationSetupChecks; * for running multiple simulations of the same battle, where each battle state has completed the same number of turns. */ class Simulation { - private: - PokemonStateSetup createInitialPokemon(const PokemonCreationInfo& pokemonInfo); - void createInitialSide( - SideStateSetup sideSetup, const SideCreationInfo& sideInfo, const BattleCreationInfo& battleInfo); - - void createInitialTurnDecision(BattleStateSetup battleStateSetup, const TurnDecisionInfo& turnDecisionInfo); - void createCalcDamageInput( - BattleStateSetup battleStateSetup, const CalcDamageInputInfo& inputInfo, debug::SimulationSetupChecks& debugChecks); - void createAnalyzeEffectInput( - BattleStateSetup battleStateSetup, const AnalyzeEffectInputInfo& inputInfo, - debug::SimulationSetupChecks& debugChecks); - - types::sides createInitialBattle( - BattleStateSetup battleStateSetup, const BattleCreationInfo& battleInfo); - private: struct ConstantValues { ConstantValues(const Pokedex& pokedex_, BattleFormat battleFormat_) @@ -24704,6 +24678,7 @@ struct DexDataSetup { public: DexDataSetup(types::registry& registry) : handle(registry, registry.create()) {} + DexDataSetup(types::registry& registry, types::entity entity) : handle(registry, entity) {} template void setProperty() { @@ -24748,7 +24723,7 @@ struct SpeciesDexDataSetup : DexDataSetup { namespace pokesim::dex::internal { struct MoveDexDataSetup : DexDataSetup { - MoveDexDataSetup(types::registry& registry) : DexDataSetup(registry) {} + MoveDexDataSetup(types::registry& registry, types::entity entity) : DexDataSetup(registry, entity) {} void setName(Move move); void setNameTag(Move move); diff --git a/extras/RecentBenchmarkResults.md b/extras/RecentBenchmarkResults.md index 3731012..ae0ccec 100644 --- a/extras/RecentBenchmarkResults.md +++ b/extras/RecentBenchmarkResults.md @@ -7,311 +7,311 @@ ## SV-SingleBattle-MonteCarlo-SimulateTurn-VerticalSlice1 | Inputs | Samples | Iterations / Sample | Estimated Completion Time | Mean of Samples | Standard Deviation | Mean / Input Count | Mean Lower Bound / Input Count | Mean Upper Bound / Input Count | | --- | --- | --- | --- | --- | --- | --- | --- | --- | -| 1 | 100 | 1 | 41.579100ms | 63.429530us | 9.509649us | 63.429530us | 62.039830us | 66.099610us | -| 2 | 100 | 1 | 42.198400ms | 74.741050us | 12.510411us | 37.370525us | 36.505560us | 39.282075us | -| 4 | 100 | 1 | 43.467500ms | 80.745220us | 13.262154us | 20.186305us | 19.683880us | 21.071395us | -| 8 | 100 | 1 | 46.156600ms | 96.913360us | 13.234323us | 12.114170us | 11.854730us | 12.533791us | -| 16 | 100 | 1 | 51.853000ms | 131.059840us | 16.956060us | 8.191240us | 8.040601us | 8.501952us | -| 32 | 100 | 1 | 56.454600ms | 181.320260us | 14.451182us | 5.666258us | 5.599112us | 5.789598us | -| 64 | 100 | 1 | 67.206500ms | 275.435010us | 13.751382us | 4.303672us | 4.276800us | 4.384274us | -| 128 | 100 | 1 | 87.593200ms | 465.923920us | 14.424395us | 3.640031us | 3.624341us | 3.674280us | -| 256 | 100 | 1 | 102.727700ms | 841.092380us | 13.885214us | 3.285517us | 3.276864us | 3.298951us | -| 512 | 100 | 1 | 168.902600ms | 1.588512ms | 21.969476us | 3.102562us | 3.094484us | 3.111399us | -| 1024 | 100 | 1 | 323.553100ms | 3.080763ms | 37.581602us | 3.008558us | 3.002031us | 3.016512us | -| 2048 | 100 | 1 | 618.944500ms | 5.984909ms | 77.918391us | 2.922319us | 2.915810us | 2.931042us | -| 4096 | 100 | 1 | 1209.759500ms | 11.829342ms | 138.673378us | 2.888023us | 2.882064us | 2.895420us | -| 8192 | 100 | 1 | 2420.074400ms | 23.816536ms | 262.427743us | 2.907292us | 2.901542us | 2.914193us | -| 16384 | 100 | 1 | 4918.713300ms | 49.087176ms | 700.293550us | 2.996043us | 2.989257us | 3.006727us | -| 32768 | 100 | 1 | 10077.118900ms | 101.228403ms | 761.523912us | 3.089246us | 3.084961us | 3.094108us | -| 65536 | 100 | 1 | 20764.869700ms | 206.473722ms | 1.133217ms | 3.150539us | 3.147338us | 3.154144us | +| 1 | 100 | 1 | 40.903200ms | 64.751060us | 13.241984us | 64.751060us | 63.049000us | 69.326680us | +| 2 | 100 | 1 | 45.237200ms | 72.316250us | 11.156965us | 36.158125us | 35.372805us | 37.843155us | +| 4 | 100 | 1 | 45.094700ms | 80.899330us | 15.447007us | 20.224833us | 19.685545us | 21.390310us | +| 8 | 100 | 1 | 47.835100ms | 97.569600us | 14.229048us | 12.196200us | 11.914257us | 12.647726us | +| 16 | 100 | 1 | 51.849600ms | 127.422290us | 13.618114us | 7.963893us | 7.834408us | 8.189355us | +| 32 | 100 | 1 | 58.071700ms | 178.688950us | 13.828511us | 5.584030us | 5.523486us | 5.714057us | +| 64 | 100 | 1 | 70.624300ms | 278.118320us | 13.761318us | 4.345599us | 4.313814us | 4.404643us | +| 128 | 100 | 1 | 91.227300ms | 464.601060us | 13.701615us | 3.629696us | 3.614032us | 3.659708us | +| 256 | 100 | 1 | 130.319400ms | 835.676500us | 13.347904us | 3.264361us | 3.257545us | 3.282041us | +| 512 | 100 | 1 | 210.583900ms | 1.574808ms | 21.690614us | 3.075797us | 3.068069us | 3.084801us | +| 1024 | 100 | 1 | 374.280300ms | 3.029757ms | 38.298986us | 2.958747us | 2.952332us | 2.967172us | +| 2048 | 100 | 1 | 680.023500ms | 5.888828ms | 55.708698us | 2.875404us | 2.870706us | 2.881498us | +| 4096 | 100 | 1 | 1262.550700ms | 11.672139ms | 83.383478us | 2.849643us | 2.845998us | 2.854012us | +| 8192 | 100 | 1 | 2574.567700ms | 23.469941ms | 263.903903us | 2.864983us | 2.859214us | 2.871812us | +| 16384 | 100 | 1 | 5120.421200ms | 47.895666ms | 1.058383ms | 2.923319us | 2.911579us | 2.937005us | +| 32768 | 100 | 1 | 10381.218800ms | 98.949863ms | 2.219354ms | 3.019710us | 3.007257us | 3.033865us | +| 65536 | 100 | 1 | 19693.915600ms | 198.909506ms | 2.398974ms | 3.035118us | 3.028720us | 3.043228us | ## SV-SingleBattle-Branching-SimulateTurn-VerticalSlice1 | Inputs | Samples | Iterations / Sample | Estimated Completion Time | Mean of Samples | Standard Deviation | Mean / Input Count | Mean Lower Bound / Input Count | Mean Upper Bound / Input Count | | --- | --- | --- | --- | --- | --- | --- | --- | --- | -| 1 | 100 | 1 | 58.777400ms | 173.837830us | 14.096320us | 173.837830us | 171.829090us | 177.969950us | -| 2 | 100 | 1 | 62.815400ms | 232.660250us | 16.405877us | 116.330125us | 115.265130us | 119.180250us | -| 4 | 100 | 1 | 39.757800ms | 332.280990us | 13.464069us | 83.070247us | 82.657737us | 84.361833us | -| 8 | 100 | 1 | 60.155500ms | 522.850340us | 31.961562us | 65.356293us | 64.747308us | 66.403758us | -| 16 | 100 | 1 | 98.641100ms | 873.117850us | 10.080035us | 54.569866us | 54.477282us | 54.747185us | -| 32 | 100 | 1 | 169.569600ms | 1.558562ms | 11.196824us | 48.705071us | 48.641043us | 48.778413us | -| 64 | 100 | 1 | 313.022300ms | 2.913635ms | 35.163386us | 45.525541us | 45.427912us | 45.645105us | -| 128 | 100 | 1 | 604.217700ms | 5.598821ms | 52.991884us | 43.740788us | 43.666879us | 43.829881us | -| 256 | 100 | 1 | 1152.209400ms | 10.843975ms | 105.338364us | 42.359276us | 42.285156us | 42.447634us | -| 512 | 100 | 1 | 2247.700200ms | 21.186711ms | 224.922674us | 41.380296us | 41.302782us | 41.476162us | -| 1024 | 100 | 1 | 4311.243400ms | 41.464090ms | 475.648445us | 40.492275us | 40.411104us | 40.595234us | -| 2048 | 100 | 1 | 8352.562100ms | 82.691045ms | 806.079092us | 40.376487us | 40.306968us | 40.462067us | -| 4096 | 100 | 1 | 17344.227900ms | 174.189338ms | 896.630282us | 42.526694us | 42.485183us | 42.571140us | -| 8192 | 100 | 1 | 38285.011500ms | 385.837980ms | 2.321682ms | 47.099363us | 47.045254us | 47.156506us | +| 1 | 100 | 1 | 54.876100ms | 178.060010us | 18.297629us | 178.060010us | 175.504470us | 183.602810us | +| 2 | 100 | 1 | 61.212300ms | 240.747730us | 18.058466us | 120.373865us | 119.218120us | 123.562200us | +| 4 | 100 | 1 | 40.969700ms | 334.056780us | 17.099022us | 83.514195us | 82.959510us | 84.990498us | +| 8 | 100 | 1 | 62.925500ms | 535.426650us | 19.497477us | 66.928331us | 66.578646us | 67.631049us | +| 16 | 100 | 1 | 99.996700ms | 871.374080us | 13.429445us | 54.460880us | 54.344639us | 54.716677us | +| 32 | 100 | 1 | 179.602000ms | 1.580655ms | 42.652504us | 49.395474us | 49.205611us | 49.785527us | +| 64 | 100 | 1 | 323.860000ms | 2.890642ms | 26.003167us | 45.166286us | 45.092701us | 45.252870us | +| 128 | 100 | 1 | 604.189700ms | 5.547036ms | 62.952408us | 43.336218us | 43.246940us | 43.442205us | +| 256 | 100 | 1 | 1156.321800ms | 10.896404ms | 179.564399us | 42.564077us | 42.438766us | 42.714605us | +| 512 | 100 | 1 | 2245.077000ms | 21.023029ms | 234.599486us | 41.060603us | 40.975254us | 41.154729us | +| 1024 | 100 | 1 | 4390.414100ms | 42.083377ms | 1.616417ms | 41.097047us | 40.822062us | 41.452568us | +| 2048 | 100 | 1 | 8363.678300ms | 83.998484ms | 2.794153ms | 41.014885us | 40.760579us | 41.296157us | +| 4096 | 100 | 1 | 16511.960600ms | 172.357422ms | 6.168278ms | 42.079449us | 41.796149us | 42.385056us | +| 8192 | 100 | 1 | 36920.882700ms | 355.223040ms | 3.635322ms | 43.362187us | 43.277478us | 43.451938us | ## SV-DoubleBattle-MonteCarlo-SimulateTurn-VerticalSlice1 | Inputs | Samples | Iterations / Sample | Estimated Completion Time | Mean of Samples | Standard Deviation | Mean / Input Count | Mean Lower Bound / Input Count | Mean Upper Bound / Input Count | | --- | --- | --- | --- | --- | --- | --- | --- | --- | -| 1 | 100 | 1 | 27.729100ms | 101.523170us | 15.705023us | 101.523170us | 99.228800us | 105.960290us | -| 2 | 100 | 1 | 27.080700ms | 118.033260us | 18.861481us | 59.016630us | 57.697490us | 61.872350us | -| 4 | 100 | 1 | 30.042600ms | 143.136680us | 18.457267us | 35.784170us | 35.038488us | 36.919942us | -| 8 | 100 | 1 | 34.820700ms | 169.327890us | 14.455146us | 21.165986us | 20.879646us | 21.616838us | -| 16 | 100 | 1 | 42.357200ms | 225.576480us | 13.315040us | 14.098530us | 13.977849us | 14.334689us | -| 32 | 100 | 1 | 42.010000ms | 321.774230us | 12.526661us | 10.055445us | 10.006604us | 10.200827us | -| 64 | 100 | 1 | 60.169900ms | 507.333410us | 11.668030us | 7.927085us | 7.902762us | 7.987494us | -| 128 | 100 | 1 | 98.479400ms | 884.146020us | 18.079982us | 6.907391us | 6.880567us | 6.936014us | -| 256 | 100 | 1 | 168.201100ms | 1.580103ms | 30.617953us | 6.172277us | 6.155873us | 6.209277us | -| 512 | 100 | 1 | 302.652200ms | 2.927718ms | 54.274347us | 5.718199us | 5.701677us | 5.745255us | -| 1024 | 100 | 1 | 579.348100ms | 5.689773ms | 63.807797us | 5.556419us | 5.545255us | 5.569841us | -| 2048 | 100 | 1 | 1144.752800ms | 11.215307ms | 121.242334us | 5.476224us | 5.465866us | 5.489279us | -| 4096 | 100 | 1 | 2281.014200ms | 22.341452ms | 222.725909us | 5.454456us | 5.444807us | 5.466274us | -| 8192 | 100 | 1 | 4612.834500ms | 45.583350ms | 514.184411us | 5.564374us | 5.553213us | 5.577984us | -| 16384 | 100 | 1 | 9544.904800ms | 95.968194ms | 837.453700us | 5.857434us | 5.848044us | 5.868305us | -| 32768 | 100 | 1 | 20405.352600ms | 205.006195ms | 1.605314ms | 6.256293us | 6.249235us | 6.270404us | -| 65536 | 100 | 1 | 43003.729200ms | 431.689494ms | 1.549578ms | 6.587059us | 6.583108us | 6.592673us | +| 1 | 100 | 1 | 28.714100ms | 104.962920us | 17.976222us | 104.962920us | 102.619560us | 111.165180us | +| 2 | 100 | 1 | 28.330000ms | 124.763580us | 17.802285us | 62.381790us | 61.104500us | 64.947675us | +| 4 | 100 | 1 | 31.304500ms | 142.444740us | 19.905823us | 35.611185us | 34.924790us | 37.139990us | +| 8 | 100 | 1 | 35.143600ms | 175.177470us | 21.779799us | 21.897184us | 21.500566us | 22.678090us | +| 16 | 100 | 1 | 43.965900ms | 234.615280us | 20.592746us | 14.663455us | 14.480136us | 15.040287us | +| 32 | 100 | 1 | 43.517100ms | 335.970680us | 20.827929us | 10.499084us | 10.411548us | 10.710001us | +| 64 | 100 | 1 | 63.162400ms | 523.573160us | 19.988761us | 8.180831us | 8.136326us | 8.272197us | +| 128 | 100 | 1 | 101.953900ms | 891.204950us | 19.527180us | 6.962539us | 6.943172us | 7.016514us | +| 256 | 100 | 1 | 175.450200ms | 1.614418ms | 23.802991us | 6.306319us | 6.290794us | 6.328034us | +| 512 | 100 | 1 | 307.457500ms | 2.961867ms | 27.131545us | 5.784896us | 5.775647us | 5.796738us | +| 1024 | 100 | 1 | 593.358200ms | 5.759731ms | 40.329104us | 5.624737us | 5.618009us | 5.633844us | +| 2048 | 100 | 1 | 1149.987400ms | 11.355884ms | 108.724955us | 5.544865us | 5.537200us | 5.560191us | +| 4096 | 100 | 1 | 2281.714100ms | 22.848709ms | 324.189398us | 5.578298us | 5.564264us | 5.595358us | +| 8192 | 100 | 1 | 4593.361700ms | 45.899082ms | 524.694253us | 5.602915us | 5.592407us | 5.618191us | +| 16384 | 100 | 1 | 9304.722600ms | 93.805094ms | 1.106791ms | 5.725409us | 5.713964us | 5.740917us | +| 32768 | 100 | 1 | 19726.165200ms | 196.523386ms | 2.145987ms | 5.997418us | 5.986755us | 6.013291us | +| 65536 | 100 | 1 | 41235.629100ms | 410.906460ms | 2.312439ms | 6.269935us | 6.263185us | 6.277056us | ## SV-DoubleBattle-Branching-SimulateTurn-VerticalSlice1 | Inputs | Samples | Iterations / Sample | Estimated Completion Time | Mean of Samples | Standard Deviation | Mean / Input Count | Mean Lower Bound / Input Count | Mean Upper Bound / Input Count | | --- | --- | --- | --- | --- | --- | --- | --- | --- | -| 1 | 100 | 1 | 64.560700ms | 416.794910us | 14.716872us | 416.794910us | 414.578540us | 420.757400us | -| 2 | 100 | 1 | 69.132800ms | 581.412670us | 14.183965us | 290.706335us | 289.700090us | 292.792770us | -| 4 | 100 | 1 | 103.847200ms | 912.976180us | 17.445613us | 228.244045us | 227.645465us | 229.588347us | -| 8 | 100 | 1 | 169.645300ms | 1.530592ms | 17.464651us | 191.323951us | 191.017310us | 191.985100us | -| 16 | 100 | 1 | 292.642800ms | 2.716110ms | 34.155778us | 169.756866us | 169.381930us | 170.225704us | -| 32 | 100 | 1 | 538.856000ms | 5.084671ms | 56.755839us | 158.895959us | 158.578251us | 159.275925us | -| 64 | 100 | 1 | 1062.195100ms | 9.686727ms | 122.012744us | 151.355116us | 151.029713us | 151.792405us | -| 128 | 100 | 1 | 1971.735800ms | 18.677560ms | 183.398616us | 145.918434us | 145.666437us | 146.234228us | -| 256 | 100 | 1 | 3891.252600ms | 36.847038ms | 469.537022us | 143.933742us | 143.618103us | 144.348488us | -| 512 | 100 | 1 | 7506.870400ms | 74.238304ms | 978.070303us | 144.996688us | 144.656953us | 145.414853us | -| 1024 | 100 | 1 | 14710.730700ms | 148.646569ms | 1.249675ms | 145.162665us | 144.938029us | 145.417561us | -| 2048 | 100 | 1 | 30120.379900ms | 301.901460ms | 1.495201ms | 147.412822us | 147.271008us | 147.559018us | -| 4096 | 100 | 1 | 62459.154500ms | 627.977074ms | 2.407528ms | 153.314715us | 153.213956us | 153.449634us | +| 1 | 100 | 1 | 66.107800ms | 414.453330us | 22.076304us | 414.453330us | 411.570610us | 421.868570us | +| 2 | 100 | 1 | 72.516700ms | 596.884860us | 23.728353us | 298.442430us | 296.850895us | 302.242510us | +| 4 | 100 | 1 | 106.483600ms | 931.619440us | 23.539098us | 232.904860us | 232.170675us | 235.068085us | +| 8 | 100 | 1 | 174.365900ms | 1.560650ms | 29.308653us | 195.081228us | 194.592926us | 196.282676us | +| 16 | 100 | 1 | 296.685700ms | 2.745969ms | 23.842508us | 171.623037us | 171.370258us | 171.966436us | +| 32 | 100 | 1 | 553.397600ms | 5.127264ms | 55.466924us | 160.227011us | 159.938888us | 160.635965us | +| 64 | 100 | 1 | 1058.857500ms | 9.796736ms | 150.399620us | 153.073994us | 152.688278us | 153.636452us | +| 128 | 100 | 1 | 2054.461900ms | 19.276304ms | 434.636215us | 150.596128us | 149.995849us | 151.338990us | +| 256 | 100 | 1 | 3971.174800ms | 39.845045ms | 921.014433us | 155.644707us | 154.981378us | 156.391337us | +| 512 | 100 | 1 | 8060.438100ms | 81.597698ms | 1.784055ms | 159.370504us | 158.707895us | 160.074355us | +| 1024 | 100 | 1 | 15399.390700ms | 154.391869ms | 1.296459ms | 150.773309us | 150.539930us | 151.039045us | +| 2048 | 100 | 1 | 30595.439800ms | 309.195853ms | 2.499777ms | 150.974538us | 150.744970us | 151.225287us | +| 4096 | 100 | 1 | 61344.375600ms | 616.948103ms | 3.268078ms | 150.622096us | 150.470065us | 150.782217us | ## SV-SingleBattle-CalcDamage-VerticalSlice1 | Inputs | Samples | Iterations / Sample | Estimated Completion Time | Mean of Samples | Standard Deviation | Mean / Input Count | Mean Lower Bound / Input Count | Mean Upper Bound / Input Count | | --- | --- | --- | --- | --- | --- | --- | --- | --- | -| 1 | 100 | 1 | 7.847400ms | 10.443770us | 3.823323us | 10.443770us | 9.904480us | 11.585860us | -| 2 | 100 | 1 | 7.947200ms | 11.866450us | 4.235469us | 5.933225us | 5.621605us | 6.529155us | -| 4 | 100 | 1 | 8.099200ms | 11.564300us | 3.583755us | 2.891075us | 2.769335us | 3.203220us | -| 8 | 100 | 1 | 8.426900ms | 13.195760us | 3.179415us | 1.649470us | 1.594344us | 1.772236us | -| 16 | 100 | 1 | 9.032400ms | 16.662110us | 3.360866us | 1.041382us | 1.012417us | 1.114736us | -| 32 | 100 | 1 | 9.866400ms | 23.464560us | 3.238578us | 733.267500ns | 719.393438ns | 764.897187ns | -| 64 | 100 | 1 | 11.039600ms | 34.100810us | 3.126090us | 532.825156ns | 526.076563ns | 548.174375ns | -| 128 | 100 | 1 | 13.748900ms | 56.113490us | 2.611600us | 438.386641ns | 435.761563ns | 445.416250ns | -| 256 | 100 | 1 | 18.869600ms | 100.651390us | 3.703876us | 393.169492ns | 390.771367ns | 396.583516ns | -| 512 | 100 | 1 | 28.964200ms | 186.502340us | 4.181849us | 364.262383ns | 362.877676ns | 366.123652ns | -| 1024 | 100 | 1 | 55.048500ms | 365.712740us | 31.374828us | 357.141348ns | 353.731064ns | 370.444570ns | -| 2048 | 100 | 1 | 109.154800ms | 716.746080us | 13.850446us | 349.973672ns | 348.846455ns | 351.576445ns | -| 4096 | 100 | 1 | 197.605800ms | 1.418791ms | 21.765609us | 346.384512ns | 345.454932ns | 347.568303ns | -| 8192 | 100 | 1 | 401.633700ms | 2.859921ms | 32.118747us | 349.111404ns | 348.421692ns | 349.977070ns | -| 16384 | 100 | 1 | 806.154000ms | 5.891554ms | 124.720155us | 359.591904ns | 358.410314ns | 361.556517ns | -| 32768 | 100 | 1 | 1643.100500ms | 11.836926ms | 158.020474us | 361.234306ns | 360.417718ns | 362.353408ns | -| 65536 | 100 | 1 | 3320.950600ms | 24.633022ms | 234.619800us | 375.870091ns | 375.261547ns | 376.688845ns | +| 1 | 100 | 1 | 7.960500ms | 10.779060us | 4.071041us | 10.779060us | 10.218340us | 12.052920us | +| 2 | 100 | 1 | 8.020200ms | 11.746130us | 3.946778us | 5.873065us | 5.596080us | 6.466380us | +| 4 | 100 | 1 | 8.286400ms | 12.223240us | 5.013278us | 3.055810us | 2.879605us | 3.430340us | +| 8 | 100 | 1 | 8.434300ms | 13.710250us | 4.823369us | 1.713781us | 1.630554us | 1.904230us | +| 16 | 100 | 1 | 9.001300ms | 16.936540us | 3.448016us | 1.058534us | 1.027827us | 1.121935us | +| 32 | 100 | 1 | 9.814400ms | 23.766000us | 5.205762us | 742.687500ns | 721.337188ns | 799.110625ns | +| 64 | 100 | 1 | 11.143900ms | 35.588780us | 3.978393us | 556.074687ns | 547.390156ns | 574.955938ns | +| 128 | 100 | 1 | 13.752600ms | 58.273120us | 3.910143us | 455.258750ns | 450.826406ns | 463.963672ns | +| 256 | 100 | 1 | 19.002200ms | 103.612730us | 4.269263us | 404.737227ns | 402.123633ns | 409.010195ns | +| 512 | 100 | 1 | 29.949600ms | 191.694220us | 4.894583us | 374.402773ns | 372.979570ns | 377.017207ns | +| 1024 | 100 | 1 | 44.369800ms | 369.140440us | 4.032545us | 360.488711ns | 359.797373ns | 361.349893ns | +| 2048 | 100 | 1 | 92.663100ms | 725.695440us | 14.330368us | 354.343477ns | 353.267144ns | 356.154658ns | +| 4096 | 100 | 1 | 145.460600ms | 1.439496ms | 54.981559us | 351.439575ns | 349.570369ns | 355.652051ns | +| 8192 | 100 | 1 | 338.559000ms | 2.855515ms | 56.203752us | 348.573615ns | 347.648616ns | 350.764313ns | +| 16384 | 100 | 1 | 679.722200ms | 5.690558ms | 94.174423us | 347.324105ns | 346.494338ns | 348.944186ns | +| 32768 | 100 | 1 | 1347.478100ms | 11.409888ms | 126.489080us | 348.202150ns | 347.509778ns | 349.045829ns | +| 65536 | 100 | 1 | 2560.146600ms | 23.142747ms | 533.164743us | 353.130292ns | 351.868316ns | 355.258499ns | ## SV-SingleBattle-AnalyzeEffect-VerticalSlice1 | Inputs | Samples | Iterations / Sample | Estimated Completion Time | Mean of Samples | Standard Deviation | Mean / Input Count | Mean Lower Bound / Input Count | Mean Upper Bound / Input Count | | --- | --- | --- | --- | --- | --- | --- | --- | --- | -| 1 | 100 | 1 | 20.609000ms | 52.394150us | 7.266337us | 52.394150us | 51.330150us | 54.451420us | -| 2 | 100 | 1 | 21.385400ms | 62.772780us | 10.477193us | 31.386390us | 30.704070us | 33.186765us | -| 4 | 100 | 1 | 23.353500ms | 80.880220us | 8.260131us | 20.220055us | 19.932480us | 20.848278us | -| 8 | 100 | 1 | 27.759300ms | 112.743440us | 9.167874us | 14.092930us | 13.940308us | 14.465160us | -| 16 | 100 | 1 | 26.120700ms | 173.593620us | 7.808093us | 10.849601us | 10.779628us | 10.990123us | -| 32 | 100 | 1 | 37.909200ms | 286.992020us | 9.050281us | 8.968501us | 8.932751us | 9.071006us | -| 64 | 100 | 1 | 61.907200ms | 511.962890us | 7.627243us | 7.999420us | 7.981075us | 8.030930us | -| 128 | 100 | 1 | 113.191000ms | 957.410610us | 8.335534us | 7.479770us | 7.468054us | 7.493701us | -| 256 | 100 | 1 | 218.548900ms | 1.858691ms | 25.573626us | 7.260512us | 7.242223us | 7.281537us | -| 512 | 100 | 1 | 420.148400ms | 3.608374ms | 38.948577us | 7.047606us | 7.034156us | 7.064127us | -| 1024 | 100 | 1 | 808.429600ms | 7.102671ms | 76.380950us | 6.936202us | 6.923624us | 6.953625us | -| 2048 | 100 | 1 | 1555.114700ms | 14.027403ms | 183.286859us | 6.849318us | 6.834034us | 6.869912us | -| 4096 | 100 | 1 | 3152.944000ms | 27.807456ms | 380.097175us | 6.788930us | 6.772924us | 6.809970us | -| 8192 | 100 | 1 | 6420.758600ms | 58.597307ms | 767.341212us | 7.152992us | 7.137164us | 7.174422us | -| 16384 | 100 | 1 | 14493.468400ms | 145.370468ms | 1.926958ms | 8.872709us | 8.850193us | 8.896405us | -| 32768 | 100 | 1 | 32783.522500ms | 328.563214ms | 2.316242ms | 10.026954us | 10.013545us | 10.041319us | -| 65536 | 100 | 1 | 68429.657200ms | 687.266881ms | 3.126973ms | 10.486860us | 10.477592us | 10.496354us | +| 1 | 100 | 1 | 28.502600ms | 57.521920us | 20.695152us | 57.521920us | 54.720150us | 64.219140us | +| 2 | 100 | 1 | 29.358000ms | 63.786100us | 11.643967us | 31.893050us | 31.170900us | 34.116410us | +| 4 | 100 | 1 | 32.002800ms | 83.675240us | 12.461537us | 20.918810us | 20.518010us | 22.015625us | +| 8 | 100 | 1 | 36.426100ms | 117.564560us | 15.706368us | 14.695570us | 14.414442us | 15.264501us | +| 16 | 100 | 1 | 29.440700ms | 178.980860us | 12.189376us | 11.186304us | 11.088276us | 11.452200us | +| 32 | 100 | 1 | 39.516300ms | 296.654200us | 13.365405us | 9.270444us | 9.218435us | 9.422427us | +| 64 | 100 | 1 | 66.684000ms | 524.562410us | 9.951665us | 8.196288us | 8.175428us | 8.247296us | +| 128 | 100 | 1 | 119.528100ms | 977.683600us | 12.735385us | 7.638153us | 7.620741us | 7.660310us | +| 256 | 100 | 1 | 227.516700ms | 1.859090ms | 20.048601us | 7.262071us | 7.248634us | 7.279972us | +| 512 | 100 | 1 | 427.644100ms | 3.624145ms | 49.299807us | 7.078409us | 7.061532us | 7.099803us | +| 1024 | 100 | 1 | 836.204900ms | 7.155358ms | 149.048685us | 6.987654us | 6.963059us | 7.021949us | +| 2048 | 100 | 1 | 1538.608200ms | 14.225734ms | 429.621670us | 6.946159us | 6.910752us | 6.995293us | +| 4096 | 100 | 1 | 2907.174300ms | 27.696405ms | 477.573890us | 6.761818us | 6.740579us | 6.786545us | +| 8192 | 100 | 1 | 5815.062500ms | 57.631799ms | 1.510425ms | 7.035132us | 7.001921us | 7.074718us | +| 16384 | 100 | 1 | 12271.001900ms | 121.754162ms | 1.802541ms | 7.431284us | 7.411515us | 7.454978us | +| 32768 | 100 | 1 | 25738.756600ms | 254.501006ms | 2.224772ms | 7.766754us | 7.754215us | 7.781050us | +| 65536 | 100 | 1 | 52133.246400ms | 522.250063ms | 7.833730ms | 7.968904us | 7.949724us | 7.998618us | ## SV-SingleBattle-MonteCarlo-SimulateTurn-RandomInputs-OneRandomBattle-OneRandomInput | Inputs | Samples | Iterations / Sample | Estimated Completion Time | Mean of Samples | Standard Deviation | Mean / Input Count | Mean Lower Bound / Input Count | Mean Upper Bound / Input Count | | --- | --- | --- | --- | --- | --- | --- | --- | --- | -| 1 | 100 | 1 | 30.753600ms | 68.905790us | 15.025936us | 68.905790us | 66.420710us | 72.459340us | -| 2 | 100 | 1 | 32.395800ms | 76.889880us | 15.928868us | 38.444940us | 37.093160us | 40.273970us | -| 4 | 100 | 1 | 33.448300ms | 85.054450us | 16.221708us | 21.263613us | 20.547260us | 22.152215us | -| 8 | 100 | 1 | 34.995300ms | 98.816350us | 19.282152us | 12.352044us | 11.926161us | 12.875525us | -| 16 | 100 | 1 | 38.567500ms | 127.837520us | 23.734093us | 7.989845us | 7.719094us | 8.303329us | -| 32 | 100 | 1 | 43.458400ms | 174.887730us | 32.503057us | 5.465242us | 5.280412us | 5.679264us | -| 64 | 100 | 1 | 53.571500ms | 267.542780us | 48.233697us | 4.180356us | 4.044463us | 4.343130us | -| 128 | 100 | 1 | 43.766600ms | 445.846180us | 86.011980us | 3.483173us | 3.364245us | 3.631925us | -| 256 | 100 | 1 | 104.796400ms | 783.720690us | 159.224522us | 3.061409us | 2.952892us | 3.199125us | -| 512 | 100 | 1 | 192.694200ms | 1.417110ms | 300.442521us | 2.767793us | 2.664495us | 2.896559us | -| 1024 | 100 | 1 | 480.441400ms | 2.766190ms | 601.270269us | 2.701357us | 2.597925us | 2.831878us | -| 2048 | 100 | 1 | 860.908900ms | 5.529385ms | 1.275704ms | 2.699895us | 2.590909us | 2.837667us | -| 4096 | 100 | 1 | 1699.477000ms | 11.413801ms | 2.501990ms | 2.786573us | 2.678697us | 2.920266us | -| 8192 | 100 | 1 | 1887.544300ms | 23.477073ms | 5.244666ms | 2.865854us | 2.753073us | 3.005796us | -| 16384 | 100 | 1 | 4050.766400ms | 49.734435ms | 10.892095ms | 3.035549us | 2.916060us | 3.178559us | -| 32768 | 100 | 1 | 9956.711100ms | 104.012092ms | 22.432585ms | 3.174197us | 3.051262us | 3.321891us | +| 1 | 100 | 1 | 39.152400ms | 71.966390us | 21.240076us | 71.966390us | 68.660040us | 77.335090us | +| 2 | 100 | 1 | 39.257100ms | 77.531170us | 16.593561us | 38.765585us | 37.455915us | 40.861190us | +| 4 | 100 | 1 | 40.162700ms | 85.303190us | 15.355736us | 21.325798us | 20.684115us | 22.219667us | +| 8 | 100 | 1 | 39.867100ms | 101.015580us | 21.384947us | 12.626947us | 12.169011us | 13.235927us | +| 16 | 100 | 1 | 40.824400ms | 128.518980us | 23.942156us | 8.032436us | 7.765429us | 8.356143us | +| 32 | 100 | 1 | 45.895500ms | 178.093580us | 32.967191us | 5.565424us | 5.378011us | 5.783992us | +| 64 | 100 | 1 | 54.154100ms | 270.322090us | 48.500040us | 4.223783us | 4.086947us | 4.384909us | +| 128 | 100 | 1 | 93.914800ms | 451.915300us | 85.846706us | 3.530588us | 3.411611us | 3.676522us | +| 256 | 100 | 1 | 139.929100ms | 791.136960us | 159.221827us | 3.090379us | 2.981330us | 3.226865us | +| 512 | 100 | 1 | 174.181700ms | 1.438921ms | 307.808154us | 2.810392us | 2.705587us | 2.944341us | +| 1024 | 100 | 1 | 542.730300ms | 2.789971ms | 609.913494us | 2.724581us | 2.620520us | 2.856163us | +| 2048 | 100 | 1 | 952.222600ms | 5.540254ms | 1.273100ms | 2.705202us | 2.595927us | 2.842830us | +| 4096 | 100 | 1 | 1817.106300ms | 11.233952ms | 2.562485ms | 2.742664us | 2.632497us | 2.880945us | +| 8192 | 100 | 1 | 2029.802900ms | 22.658225ms | 5.186344ms | 2.765897us | 2.653946us | 2.903587us | +| 16384 | 100 | 1 | 4139.569500ms | 46.289122ms | 10.750544ms | 2.825264us | 2.708987us | 2.969353us | +| 32768 | 100 | 1 | 9018.737400ms | 95.034040ms | 21.824814ms | 2.900209us | 2.781945us | 3.045680us | ## SV-SingleBattle-MonteCarlo-SimulateTurn-RandomInputs-OneRandomBattle-ManyRandomInputs | Inputs | Samples | Iterations / Sample | Estimated Completion Time | Mean of Samples | Standard Deviation | Mean / Input Count | Mean Lower Bound / Input Count | Mean Upper Bound / Input Count | | --- | --- | --- | --- | --- | --- | --- | --- | --- | -| 1 | 100 | 1 | 31.897000ms | 72.196160us | 14.201346us | 72.196160us | 69.740500us | 75.371120us | -| 2 | 100 | 1 | 38.035700ms | 87.273460us | 20.626747us | 43.636730us | 41.954590us | 46.124130us | -| 4 | 100 | 1 | 48.667100ms | 107.736030us | 17.659553us | 26.934007us | 26.185147us | 27.949033us | -| 8 | 100 | 1 | 50.189100ms | 131.569040us | 21.044058us | 16.446130us | 15.993065us | 17.034903us | -| 16 | 100 | 1 | 54.853200ms | 165.939570us | 22.789545us | 10.371223us | 10.120729us | 10.684394us | -| 32 | 100 | 1 | 61.983900ms | 217.718930us | 27.751916us | 6.803717us | 6.645771us | 6.986395us | -| 64 | 100 | 1 | 42.022900ms | 315.029260us | 35.865143us | 4.922332us | 4.818838us | 5.038686us | -| 128 | 100 | 1 | 57.015400ms | 523.583090us | 66.808201us | 4.090493us | 3.998662us | 4.205521us | -| 256 | 100 | 1 | 101.260000ms | 853.692700us | 102.605577us | 3.334737us | 3.261018us | 3.418803us | -| 512 | 100 | 1 | 165.171800ms | 1.609157ms | 196.283013us | 3.142884us | 3.070535us | 3.220310us | -| 1024 | 100 | 1 | 423.276600ms | 2.968877ms | 411.106285us | 2.899294us | 2.824338us | 2.982944us | -| 2048 | 100 | 1 | 629.272900ms | 5.917046ms | 724.943336us | 2.889182us | 2.821328us | 2.960880us | -| 4096 | 100 | 1 | 1506.641900ms | 12.061530ms | 1.701691ms | 2.944709us | 2.867055us | 3.030241us | -| 8192 | 100 | 1 | 2272.593700ms | 24.211965ms | 3.621395ms | 2.955562us | 2.876130us | 3.050675us | -| 16384 | 100 | 1 | 3705.159900ms | 49.396681ms | 5.817867ms | 3.014934us | 2.948022us | 3.086380us | -| 32768 | 100 | 1 | 10801.925900ms | 100.011817ms | 13.081144ms | 3.052118us | 2.975324us | 3.131664us | +| 1 | 100 | 1 | 38.550000ms | 70.864780us | 18.989691us | 70.864780us | 67.960630us | 75.890940us | +| 2 | 100 | 1 | 53.160700ms | 86.408380us | 17.793001us | 43.204190us | 41.786395us | 45.440855us | +| 4 | 100 | 1 | 51.731500ms | 105.910450us | 17.448812us | 26.477612us | 25.833900us | 27.705925us | +| 8 | 100 | 1 | 59.733700ms | 130.855320us | 22.088546us | 16.356915us | 15.908949us | 17.035808us | +| 16 | 100 | 1 | 65.638100ms | 166.742900us | 22.507725us | 10.421431us | 10.180045us | 10.741831us | +| 32 | 100 | 1 | 75.492100ms | 221.428130us | 26.924488us | 6.919629us | 6.765046us | 7.096389us | +| 64 | 100 | 1 | 86.180300ms | 324.470630us | 39.751277us | 5.069854us | 4.954651us | 5.198095us | +| 128 | 100 | 1 | 113.632600ms | 527.080920us | 60.283325us | 4.117820us | 4.028319us | 4.212876us | +| 256 | 100 | 1 | 153.071100ms | 878.530410us | 100.990501us | 3.431759us | 3.357939us | 3.513460us | +| 512 | 100 | 1 | 230.689900ms | 1.755458ms | 1.106471ms | 3.428630us | 3.189907us | 4.358767us | +| 1024 | 100 | 1 | 342.842200ms | 3.061199ms | 441.504407us | 2.989452us | 2.909006us | 3.077915us | +| 2048 | 100 | 1 | 663.412300ms | 6.056251ms | 730.886248us | 2.957154us | 2.888965us | 3.028584us | +| 4096 | 100 | 1 | 1608.509100ms | 12.500449ms | 1.731351ms | 3.051867us | 2.972333us | 3.138331us | +| 8192 | 100 | 1 | 2565.074000ms | 24.901300ms | 3.674289ms | 3.039709us | 2.958392us | 3.134334us | +| 16384 | 100 | 1 | 4236.134700ms | 51.644036ms | 5.951533ms | 3.152102us | 3.082385us | 3.225059us | +| 32768 | 100 | 1 | 11962.172700ms | 108.527915ms | 14.575864ms | 3.312009us | 3.226391us | 3.399926us | ## SV-SingleBattle-MonteCarlo-SimulateTurn-RandomInputs-ManyRandomBattles-ManyRandomInputs | Inputs | Samples | Iterations / Sample | Estimated Completion Time | Mean of Samples | Standard Deviation | Mean / Input Count | Mean Lower Bound / Input Count | Mean Upper Bound / Input Count | | --- | --- | --- | --- | --- | --- | --- | --- | --- | -| 1 | 100 | 1 | 31.327700ms | 69.056010us | 16.435710us | 69.056010us | 66.401000us | 73.108300us | -| 2 | 100 | 1 | 42.203100ms | 90.512730us | 17.764058us | 45.256365us | 43.907510us | 47.624435us | -| 4 | 100 | 1 | 56.230200ms | 113.585160us | 18.427813us | 28.396290us | 27.700940us | 29.635967us | -| 8 | 100 | 1 | 65.483000ms | 143.844170us | 21.357594us | 17.980521us | 17.585966us | 18.716349us | -| 16 | 100 | 1 | 71.066800ms | 191.662450us | 26.728285us | 11.978903us | 11.726458us | 12.428418us | -| 32 | 100 | 1 | 80.064800ms | 269.577890us | 23.457392us | 8.424309us | 8.310602us | 8.614932us | -| 64 | 100 | 1 | 52.197600ms | 402.392850us | 17.893173us | 6.287388us | 6.241242us | 6.354775us | -| 128 | 100 | 1 | 79.431300ms | 647.881210us | 16.209853us | 5.061572us | 5.038559us | 5.088649us | -| 256 | 100 | 1 | 126.770000ms | 1.105309ms | 26.142662us | 4.317614us | 4.300159us | 4.340903us | -| 512 | 100 | 1 | 232.431900ms | 1.991041ms | 42.680522us | 3.888752us | 3.874789us | 3.908350us | -| 1024 | 100 | 1 | 451.137800ms | 3.828657ms | 55.970617us | 3.738923us | 3.729029us | 3.750572us | -| 2048 | 100 | 1 | 888.573900ms | 7.738454ms | 184.770813us | 3.778542us | 3.763231us | 3.799440us | -| 4096 | 100 | 1 | 1815.545200ms | 16.826030ms | 283.893253us | 4.107917us | 4.096437us | 4.124350us | -| 8192 | 100 | 1 | 4021.840000ms | 40.182194ms | 602.458670us | 4.905053us | 4.892273us | 4.921421us | -| 16384 | 100 | 1 | 9351.226800ms | 94.104771ms | 825.250442us | 5.743699us | 5.734590us | 5.754395us | -| 32768 | 100 | 1 | 21380.286900ms | 212.838397ms | 1.319312ms | 6.495312us | 6.487772us | 6.503556us | +| 1 | 100 | 1 | 39.453800ms | 71.778940us | 17.545691us | 71.778940us | 68.873620us | 75.937690us | +| 2 | 100 | 1 | 45.900600ms | 89.815840us | 15.466041us | 44.907920us | 43.615735us | 46.718250us | +| 4 | 100 | 1 | 58.528500ms | 115.318340us | 20.254794us | 28.829585us | 28.066492us | 30.205922us | +| 8 | 100 | 1 | 69.016000ms | 145.702750us | 18.220650us | 18.212844us | 17.839019us | 18.764143us | +| 16 | 100 | 1 | 74.575400ms | 194.834150us | 22.267389us | 12.177134us | 11.949709us | 12.514389us | +| 32 | 100 | 1 | 82.002400ms | 273.665400us | 20.679402us | 8.552044us | 8.444700us | 8.703954us | +| 64 | 100 | 1 | 100.319300ms | 403.298220us | 18.214841us | 6.301535us | 6.254787us | 6.370017us | +| 128 | 100 | 1 | 110.641500ms | 647.775320us | 17.106839us | 5.060745us | 5.035698us | 5.088302us | +| 256 | 100 | 1 | 175.298800ms | 1.092662ms | 24.838740us | 4.268212us | 4.251316us | 4.289878us | +| 512 | 100 | 1 | 275.343600ms | 1.951281ms | 33.373803us | 3.811096us | 3.798978us | 3.824486us | +| 1024 | 100 | 1 | 474.584600ms | 3.730427ms | 52.608457us | 3.642995us | 3.633823us | 3.654191us | +| 2048 | 100 | 1 | 829.782900ms | 7.350746ms | 116.662006us | 3.589231us | 3.578979us | 3.601535us | +| 4096 | 100 | 1 | 1681.412900ms | 15.643075ms | 389.007557us | 3.819110us | 3.802595us | 3.840427us | +| 8192 | 100 | 1 | 3402.742400ms | 33.447362ms | 576.189592us | 4.082930us | 4.070979us | 4.098986us | +| 16384 | 100 | 1 | 7756.883100ms | 78.233052ms | 893.335291us | 4.774967us | 4.765399us | 4.786933us | +| 32768 | 100 | 1 | 17585.275000ms | 176.447347ms | 1.316877ms | 5.384746us | 5.377393us | 5.393136us | ## SV-SingleBattle-CalcDamage-RandomInputs-OneRandomBattle-OneRandomInput | Inputs | Samples | Iterations / Sample | Estimated Completion Time | Mean of Samples | Standard Deviation | Mean / Input Count | Mean Lower Bound / Input Count | Mean Upper Bound / Input Count | | --- | --- | --- | --- | --- | --- | --- | --- | --- | -| 1 | 100 | 1 | 9.427500ms | 12.772540us | 4.766567us | 12.772540us | 12.062280us | 14.104720us | -| 2 | 100 | 1 | 9.716700ms | 14.543410us | 5.550827us | 7.271705us | 6.819335us | 7.942115us | -| 4 | 100 | 1 | 10.162300ms | 16.966940us | 8.039360us | 4.241735us | 3.947790us | 4.807375us | -| 8 | 100 | 1 | 10.945300ms | 19.993310us | 6.745731us | 2.499164us | 2.341569us | 2.671768us | -| 16 | 100 | 1 | 11.973900ms | 28.591990us | 9.923712us | 1.786999us | 1.664187us | 1.907266us | -| 32 | 100 | 1 | 10.633500ms | 43.559210us | 16.292563us | 1.361225us | 1.260054us | 1.458609us | -| 64 | 100 | 1 | 12.610400ms | 73.297510us | 29.679516us | 1.145274us | 1.053499us | 1.235262us | -| 128 | 100 | 1 | 20.901500ms | 132.214450us | 57.674473us | 1.032925us | 944.116484ns | 1.120071us | -| 256 | 100 | 1 | 41.989600ms | 250.149470us | 111.379755us | 977.146367ns | 891.264336ns | 1.062006us | -| 512 | 100 | 1 | 73.988400ms | 424.524700us | 223.335963us | 829.149805ns | 743.856191ns | 914.683223ns | -| 1024 | 100 | 1 | 139.218600ms | 840.353410us | 444.645373us | 820.657627ns | 735.491143ns | 904.967861ns | -| 2048 | 100 | 1 | 202.640200ms | 1.694822ms | 885.187054us | 827.549639ns | 743.034277ns | 912.044238ns | -| 4096 | 100 | 1 | 737.117500ms | 3.473251ms | 1.769531ms | 847.961563ns | 762.398416ns | 932.186313ns | -| 8192 | 100 | 1 | 1487.981400ms | 7.221780ms | 3.627676ms | 881.564973ns | 794.029716ns | 968.059497ns | -| 16384 | 100 | 1 | 2985.467200ms | 15.395756ms | 7.774023ms | 939.682402ns | 845.671621ns | 1.031238us | -| 32768 | 100 | 1 | 2846.103000ms | 32.794798ms | 16.679221ms | 1.000818us | 900.911011ns | 1.099839us | +| 1 | 100 | 1 | 9.275100ms | 12.736680us | 4.891792us | 12.736680us | 12.001200us | 14.063480us | +| 2 | 100 | 1 | 9.491400ms | 14.626970us | 5.242848us | 7.313485us | 6.879315us | 7.930580us | +| 4 | 100 | 1 | 10.024900ms | 21.304610us | 39.138205us | 5.326153us | 4.248230us | 9.614770us | +| 8 | 100 | 1 | 10.734200ms | 21.419060us | 9.056046us | 2.677383us | 2.489170us | 2.944260us | +| 16 | 100 | 1 | 11.741800ms | 28.838340us | 10.518675us | 1.802396us | 1.675553us | 1.932533us | +| 32 | 100 | 1 | 10.438100ms | 44.025660us | 16.446340us | 1.375802us | 1.272505us | 1.474607us | +| 64 | 100 | 1 | 12.223600ms | 72.973950us | 30.140925us | 1.140218us | 1.046936us | 1.231696us | +| 128 | 100 | 1 | 20.515700ms | 131.104720us | 57.229418us | 1.024256us | 935.750156ns | 1.110637us | +| 256 | 100 | 1 | 31.841600ms | 244.326070us | 112.145920us | 954.398711ns | 867.966523ns | 1.039533us | +| 512 | 100 | 1 | 60.550900ms | 412.458600us | 219.899541us | 805.583203ns | 721.993750ns | 889.410410ns | +| 1024 | 100 | 1 | 108.220200ms | 813.149770us | 438.061268us | 794.091572ns | 709.578936ns | 877.507129ns | +| 2048 | 100 | 1 | 212.064800ms | 1.619361ms | 873.346719us | 790.703755ns | 707.387754ns | 874.101626ns | +| 4096 | 100 | 1 | 606.989300ms | 3.257063ms | 1.743999ms | 795.181475ns | 710.896826ns | 878.335769ns | +| 8192 | 100 | 1 | 1206.916300ms | 6.573106ms | 3.475988ms | 802.381097ns | 718.581738ns | 885.608850ns | +| 16384 | 100 | 1 | 2473.049700ms | 13.364027ms | 7.073165ms | 815.675505ns | 731.471935ns | 900.420960ns | +| 32768 | 100 | 1 | 4843.723500ms | 27.126750ms | 14.545292ms | 827.842710ns | 740.814207ns | 914.791726ns | ## SV-SingleBattle-CalcDamage-RandomInputs-OneRandomBattle-ManyRandomInputs | Inputs | Samples | Iterations / Sample | Estimated Completion Time | Mean of Samples | Standard Deviation | Mean / Input Count | Mean Lower Bound / Input Count | Mean Upper Bound / Input Count | | --- | --- | --- | --- | --- | --- | --- | --- | --- | -| 1 | 100 | 1 | 9.430400ms | 16.755070us | 34.071150us | 16.755070us | 13.052470us | 32.974120us | -| 2 | 100 | 1 | 10.818600ms | 15.023930us | 3.638523us | 7.511965us | 7.234205us | 7.991620us | -| 4 | 100 | 1 | 10.342600ms | 17.139180us | 4.269421us | 4.284795us | 4.125420us | 4.576397us | -| 8 | 100 | 1 | 11.032300ms | 21.423150us | 4.710177us | 2.677894us | 2.593932us | 2.850830us | -| 16 | 100 | 1 | 12.279300ms | 30.841100us | 14.976680us | 1.927569us | 1.814159us | 2.298358us | -| 32 | 100 | 1 | 13.006000ms | 43.072450us | 5.108678us | 1.346014us | 1.318967us | 1.382825us | -| 64 | 100 | 1 | 16.471200ms | 69.760670us | 7.439668us | 1.090010us | 1.071569us | 1.119367us | -| 128 | 100 | 1 | 23.925900ms | 122.220590us | 7.092478us | 954.848359ns | 944.866406ns | 966.704531ns | -| 256 | 100 | 1 | 33.706400ms | 222.176800us | 8.703923us | 867.878125ns | 861.740586ns | 875.106211ns | -| 512 | 100 | 1 | 41.991400ms | 429.916030us | 12.177064us | 839.679746ns | 835.061426ns | 844.411602ns | -| 1024 | 100 | 1 | 86.744300ms | 838.901180us | 15.529242us | 819.239434ns | 816.265264ns | 822.204355ns | -| 2048 | 100 | 1 | 169.149000ms | 1.647902ms | 30.854856us | 804.639692ns | 801.749067ns | 807.655498ns | -| 4096 | 100 | 1 | 336.697800ms | 3.300692ms | 55.914602us | 805.832920ns | 803.189849ns | 808.532412ns | -| 8192 | 100 | 1 | 680.327000ms | 6.610150ms | 116.109797us | 806.903021ns | 804.291775ns | 809.861029ns | -| 16384 | 100 | 1 | 1374.183900ms | 13.206136ms | 205.186348us | 806.038583ns | 803.725987ns | 808.646936ns | -| 32768 | 100 | 1 | 2706.056500ms | 26.761323ms | 356.293919us | 816.690758ns | 814.723896ns | 819.012583ns | +| 1 | 100 | 1 | 9.829600ms | 12.762510us | 4.397834us | 12.762510us | 12.069790us | 13.882910us | +| 2 | 100 | 1 | 9.398000ms | 15.009050us | 3.821411us | 7.504525us | 7.205605us | 7.998690us | +| 4 | 100 | 1 | 10.711400ms | 17.129200us | 3.581238us | 4.282300us | 4.148460us | 4.522815us | +| 8 | 100 | 1 | 11.250300ms | 21.644480us | 4.899614us | 2.705560us | 2.619736us | 2.886332us | +| 16 | 100 | 1 | 5.027000ms | 28.159830us | 3.763674us | 1.759989us | 1.724792us | 1.823955us | +| 32 | 100 | 1 | 5.959800ms | 43.152380us | 4.891187us | 1.348512us | 1.323363us | 1.384840us | +| 64 | 100 | 1 | 9.097600ms | 68.718450us | 5.731764us | 1.073726us | 1.057777us | 1.093095us | +| 128 | 100 | 1 | 13.136900ms | 124.857850us | 7.890522us | 975.451953ns | 964.603438ns | 989.102109ns | +| 256 | 100 | 1 | 23.073300ms | 224.279530us | 10.025856us | 876.091914ns | 869.291445ns | 884.806016ns | +| 512 | 100 | 1 | 42.399100ms | 434.395390us | 13.511759us | 848.428496ns | 843.347949ns | 853.670117ns | +| 1024 | 100 | 1 | 88.429500ms | 846.978170us | 17.707498us | 827.127119ns | 823.834844ns | 830.609883ns | +| 2048 | 100 | 1 | 171.223700ms | 1.669469ms | 36.316353us | 815.170410ns | 811.812988ns | 818.801958ns | +| 4096 | 100 | 1 | 343.664900ms | 3.334521ms | 59.124150us | 814.091948ns | 811.431895ns | 817.108096ns | +| 8192 | 100 | 1 | 696.743600ms | 6.655329ms | 121.455215us | 812.418145ns | 809.731576ns | 815.588295ns | +| 16384 | 100 | 1 | 1369.131900ms | 13.285971ms | 185.324610us | 810.911304ns | 808.837743ns | 813.284174ns | +| 32768 | 100 | 1 | 2747.984900ms | 26.914152ms | 347.622687us | 821.354740ns | 819.378907ns | 823.539500ns | ## SV-SingleBattle-CalcDamage-RandomInputs-ManyRandomBattles-ManyRandomInputs | Inputs | Samples | Iterations / Sample | Estimated Completion Time | Mean of Samples | Standard Deviation | Mean / Input Count | Mean Lower Bound / Input Count | Mean Upper Bound / Input Count | | --- | --- | --- | --- | --- | --- | --- | --- | --- | -| 1 | 100 | 1 | 9.410800ms | 12.391250us | 4.631724us | 12.391250us | 11.703160us | 13.664200us | -| 2 | 100 | 1 | 10.070700ms | 15.662830us | 6.662086us | 7.831415us | 7.370270us | 8.850540us | -| 4 | 100 | 1 | 11.226800ms | 18.575570us | 6.209557us | 4.643892us | 4.425002us | 5.106615us | -| 8 | 100 | 1 | 11.081100ms | 23.099440us | 6.853719us | 2.887430us | 2.765324us | 3.138923us | -| 16 | 100 | 1 | 12.310700ms | 32.069950us | 5.647544us | 2.004372us | 1.949994us | 2.096262us | -| 32 | 100 | 1 | 15.017100ms | 49.289750us | 6.275435us | 1.540305us | 1.509453us | 1.590419us | -| 64 | 100 | 1 | 17.692500ms | 80.444580us | 6.954876us | 1.256947us | 1.240516us | 1.285911us | -| 128 | 100 | 1 | 24.543300ms | 143.348730us | 6.399327us | 1.119912us | 1.110490us | 1.130090us | -| 256 | 100 | 1 | 46.458600ms | 272.824110us | 10.953516us | 1.065719us | 1.057738us | 1.074556us | -| 512 | 100 | 1 | 82.421200ms | 468.621860us | 14.046294us | 915.277070ns | 909.847715ns | 920.599785ns | -| 1024 | 100 | 1 | 153.306900ms | 921.746300us | 20.361062us | 900.142871ns | 896.402197ns | 904.215479ns | -| 2048 | 100 | 1 | 309.202700ms | 1.912236ms | 43.099458us | 933.709121ns | 929.928853ns | 938.241963ns | -| 4096 | 100 | 1 | 598.450700ms | 4.022879ms | 52.097047us | 982.148191ns | 979.906123ns | 984.953628ns | -| 8192 | 100 | 1 | 1142.686200ms | 8.563117ms | 121.235522us | 1.045302us | 1.042703us | 1.048586us | -| 16384 | 100 | 1 | 2336.702500ms | 18.468461ms | 279.635291us | 1.127225us | 1.124317us | 1.131109us | -| 32768 | 100 | 1 | 5009.104300ms | 40.219191ms | 1.034866ms | 1.227392us | 1.222487us | 1.235546us | +| 1 | 100 | 1 | 9.900900ms | 12.941710us | 4.667073us | 12.941710us | 12.194250us | 14.099240us | +| 2 | 100 | 1 | 9.223300ms | 14.756860us | 4.691262us | 7.378430us | 7.032175us | 8.030605us | +| 4 | 100 | 1 | 10.278400ms | 18.110090us | 6.469688us | 4.527522us | 4.309630us | 5.045318us | +| 8 | 100 | 1 | 10.956600ms | 23.316040us | 6.383123us | 2.914505us | 2.807905us | 3.172957us | +| 16 | 100 | 1 | 5.375800ms | 31.200470us | 3.817060us | 1.950029us | 1.914774us | 2.016566us | +| 32 | 100 | 1 | 6.523200ms | 48.529540us | 4.805162us | 1.516548us | 1.493081us | 1.554834us | +| 64 | 100 | 1 | 9.810600ms | 80.136840us | 4.686769us | 1.252138us | 1.239204us | 1.268219us | +| 128 | 100 | 1 | 14.705600ms | 142.331320us | 6.661662us | 1.111963us | 1.102068us | 1.122564us | +| 256 | 100 | 1 | 26.466400ms | 265.892510us | 10.690700us | 1.038643us | 1.030819us | 1.047268us | +| 512 | 100 | 1 | 48.147700ms | 452.717020us | 13.857522us | 884.212930ns | 878.900859ns | 889.451504ns | +| 1024 | 100 | 1 | 95.077800ms | 885.777690us | 22.302736us | 865.017275ns | 860.882725ns | 869.434707ns | +| 2048 | 100 | 1 | 193.553600ms | 1.761886ms | 38.919457us | 860.296138ns | 857.089033ns | 864.680005ns | +| 4096 | 100 | 1 | 374.813000ms | 3.635773ms | 65.496612us | 887.639817ns | 884.776279ns | 891.105427ns | +| 8192 | 100 | 1 | 759.019200ms | 7.429843ms | 100.650414us | 906.963289ns | 904.757238ns | 909.604518ns | +| 16384 | 100 | 1 | 1517.567800ms | 15.200369ms | 307.549782us | 927.756917ns | 925.245366ns | 933.694448ns | +| 32768 | 100 | 1 | 3111.234400ms | 30.889677ms | 327.431583us | 942.678135ns | 940.879789ns | 944.822961ns | ## SV-SingleBattle-AnalyzeEffect-RandomInputs-OneRandomBattle-OneRandomInput | Inputs | Samples | Iterations / Sample | Estimated Completion Time | Mean of Samples | Standard Deviation | Mean / Input Count | Mean Lower Bound / Input Count | Mean Upper Bound / Input Count | | --- | --- | --- | --- | --- | --- | --- | --- | --- | -| 1 | 100 | 1 | 29.499400ms | 85.618360us | 28.644596us | 85.618360us | 79.398630us | 90.783900us | -| 2 | 100 | 1 | 31.498800ms | 110.655450us | 35.505335us | 55.327725us | 51.278945us | 58.356775us | -| 4 | 100 | 1 | 22.102600ms | 159.304450us | 51.391702us | 39.826113us | 36.843887us | 41.968180us | -| 8 | 100 | 1 | 32.962200ms | 245.931990us | 80.726062us | 30.741499us | 28.405127us | 32.440909us | -| 16 | 100 | 1 | 45.390500ms | 420.316220us | 140.627852us | 26.269764us | 24.257575us | 27.742123us | -| 32 | 100 | 1 | 90.853100ms | 739.328940us | 239.257547us | 23.104029us | 21.383572us | 24.372590us | -| 64 | 100 | 1 | 216.871900ms | 1.380479ms | 453.134666us | 21.569991us | 19.952184us | 22.778061us | -| 128 | 100 | 1 | 414.653300ms | 2.665873ms | 881.046210us | 20.827132us | 19.287963us | 22.014610us | -| 256 | 100 | 1 | 538.169000ms | 5.204039ms | 1.727341ms | 20.328278us | 18.796776us | 21.480745us | -| 512 | 100 | 1 | 1019.588700ms | 10.166267ms | 3.372184ms | 19.855990us | 18.354082us | 20.972683us | -| 1024 | 100 | 1 | 2148.205300ms | 20.249648ms | 6.778206ms | 19.775047us | 18.276304us | 20.920836us | -| 2048 | 100 | 1 | 4099.403200ms | 43.069893ms | 14.615285ms | 21.030221us | 19.414999us | 22.264203us | -| 4096 | 100 | 1 | 12520.054600ms | 100.234076ms | 32.981112ms | 24.471210us | 22.619758us | 25.832082us | -| 8192 | 100 | 1 | 27044.834300ms | 217.309403ms | 71.229983ms | 26.527027us | 24.539122us | 27.989662us | -| 16384 | 100 | 1 | 56166.202800ms | 456.504541ms | 148.827497ms | 27.862826us | 25.767089us | 29.404688us | +| 1 | 100 | 1 | 13.658000ms | 86.937990us | 27.508978us | 86.937990us | 80.782490us | 91.719020us | +| 2 | 100 | 1 | 16.492800ms | 110.624610us | 35.300006us | 55.312305us | 51.297320us | 58.307610us | +| 4 | 100 | 1 | 23.059500ms | 157.396380us | 50.404870us | 39.349095us | 36.416268us | 41.462758us | +| 8 | 100 | 1 | 35.573100ms | 250.039480us | 82.349078us | 31.254935us | 28.858612us | 33.002032us | +| 16 | 100 | 1 | 47.470800ms | 409.888280us | 138.101655us | 25.618018us | 23.646621us | 27.093143us | +| 32 | 100 | 1 | 95.199700ms | 733.995650us | 238.606511us | 22.937364us | 21.229047us | 24.212768us | +| 64 | 100 | 1 | 224.721600ms | 1.378519ms | 454.099875us | 21.539362us | 19.930441us | 22.759269us | +| 128 | 100 | 1 | 423.130300ms | 2.633007ms | 872.295709us | 20.570363us | 19.014935us | 21.739867us | +| 256 | 100 | 1 | 560.659200ms | 5.142866ms | 1.715764ms | 20.089320us | 18.572685us | 21.242771us | +| 512 | 100 | 1 | 1080.673500ms | 9.915316ms | 3.303158ms | 19.365852us | 17.907720us | 20.470031us | +| 1024 | 100 | 1 | 2119.005700ms | 19.571918ms | 6.535966ms | 19.113201us | 17.664401us | 20.202229us | +| 2048 | 100 | 1 | 4023.828200ms | 40.353653ms | 13.537382ms | 19.703932us | 18.206082us | 20.841866us | +| 4096 | 100 | 1 | 10562.810200ms | 84.980499ms | 28.907028ms | 20.747192us | 19.186023us | 21.976599us | +| 8192 | 100 | 1 | 22519.101500ms | 179.602776ms | 61.029217ms | 21.924167us | 20.257293us | 23.208195us | +| 16384 | 100 | 1 | 46787.618900ms | 372.576724ms | 126.905073ms | 22.740279us | 21.010730us | 24.092928us | ## SV-SingleBattle-AnalyzeEffect-RandomInputs-OneRandomBattle-ManyRandomInputs | Inputs | Samples | Iterations / Sample | Estimated Completion Time | Mean of Samples | Standard Deviation | Mean / Input Count | Mean Lower Bound / Input Count | Mean Upper Bound / Input Count | | --- | --- | --- | --- | --- | --- | --- | --- | --- | -| 1 | 100 | 1 | 37.582600ms | 83.784130us | 27.237963us | 83.784130us | 77.734540us | 88.548860us | -| 2 | 100 | 1 | 41.134500ms | 111.066050us | 15.540625us | 55.533025us | 54.293975us | 57.510500us | -| 4 | 100 | 1 | 43.723000ms | 142.692090us | 15.344749us | 35.673023us | 34.934908us | 36.439040us | -| 8 | 100 | 1 | 56.821700ms | 206.503140us | 23.109708us | 25.812893us | 25.306722us | 26.452365us | -| 16 | 100 | 1 | 46.182600ms | 328.926490us | 30.288227us | 20.557906us | 20.193273us | 20.936718us | -| 32 | 100 | 1 | 66.870800ms | 580.395230us | 35.950953us | 18.137351us | 17.915257us | 18.353711us | -| 64 | 100 | 1 | 135.845200ms | 1.138838ms | 57.356078us | 17.794349us | 17.617712us | 17.968519us | -| 128 | 100 | 1 | 261.592200ms | 2.493957ms | 131.021699us | 19.484041us | 19.284729us | 19.686235us | -| 256 | 100 | 1 | 646.743600ms | 5.964894ms | 260.326067us | 23.300369us | 23.107462us | 23.505130us | -| 512 | 100 | 1 | 1511.864200ms | 15.446910ms | 517.601956us | 30.169747us | 29.968271us | 30.367106us | -| 1024 | 100 | 1 | 4054.961000ms | 39.976410ms | 1.153015ms | 39.039462us | 38.827844us | 39.271967us | -| 2048 | 100 | 1 | 10025.808900ms | 99.035796ms | 2.244221ms | 48.357322us | 48.135314us | 48.564832us | -| 4096 | 100 | 1 | 22517.608700ms | 225.192648ms | 3.840167ms | 54.978674us | 54.797276us | 55.165651us | -| 8192 | 100 | 1 | 48038.315200ms | 484.788639ms | 5.869198ms | 59.178301us | 59.041347us | 59.322729us | -| 16384 | 100 | 1 | 100303.524300ms | 1010.469198ms | 9.401500ms | 61.674145us | 61.561431us | 61.787268us | +| 1 | 100 | 1 | 36.528700ms | 83.118280us | 27.397371us | 83.118280us | 77.206320us | 88.011230us | +| 2 | 100 | 1 | 41.273300ms | 112.780860us | 19.737317us | 56.390430us | 54.838475us | 58.898535us | +| 4 | 100 | 1 | 43.386600ms | 144.912190us | 19.983803us | 36.228048us | 35.366690us | 37.352863us | +| 8 | 100 | 1 | 30.340800ms | 207.507390us | 23.831953us | 25.938424us | 25.440774us | 26.635645us | +| 16 | 100 | 1 | 46.746500ms | 327.844190us | 31.582024us | 20.490262us | 20.131428us | 20.908098us | +| 32 | 100 | 1 | 69.455200ms | 584.719640us | 36.738569us | 18.272489us | 18.046638us | 18.496398us | +| 64 | 100 | 1 | 136.382500ms | 1.147213ms | 58.175008us | 17.925198us | 17.745045us | 18.100007us | +| 128 | 100 | 1 | 263.552000ms | 2.507317ms | 127.167442us | 19.588415us | 19.393584us | 19.784415us | +| 256 | 100 | 1 | 640.707000ms | 5.962921ms | 269.095515us | 23.292658us | 23.093727us | 23.506311us | +| 512 | 100 | 1 | 1523.674100ms | 15.541312ms | 558.643643us | 30.354126us | 30.141994us | 30.568017us | +| 1024 | 100 | 1 | 4130.121200ms | 40.256270ms | 1.135772ms | 39.312764us | 39.101776us | 39.534842us | +| 2048 | 100 | 1 | 10025.652900ms | 99.411265ms | 2.335895ms | 48.540657us | 48.315358us | 48.762062us | +| 4096 | 100 | 1 | 22916.185700ms | 226.119487ms | 4.207797ms | 55.204953us | 55.011237us | 55.413477us | +| 8192 | 100 | 1 | 48779.707400ms | 485.714879ms | 6.631716ms | 59.291367us | 59.135220us | 59.453289us | +| 16384 | 100 | 1 | 101854.708000ms | 1014.495804ms | 11.297657ms | 61.919910us | 61.790603us | 62.061419us | ## SV-SingleBattle-AnalyzeEffect-RandomInputs-ManyRandomBattles-ManyRandomInputs | Inputs | Samples | Iterations / Sample | Estimated Completion Time | Mean of Samples | Standard Deviation | Mean / Input Count | Mean Lower Bound / Input Count | Mean Upper Bound / Input Count | | --- | --- | --- | --- | --- | --- | --- | --- | --- | -| 1 | 100 | 1 | 37.614700ms | 83.123810us | 26.951295us | 83.123810us | 77.167990us | 87.864500us | -| 2 | 100 | 1 | 41.612400ms | 124.585230us | 21.122230us | 62.292615us | 60.095920us | 64.248605us | -| 4 | 100 | 1 | 49.940600ms | 184.568460us | 18.986097us | 46.142115us | 45.136910us | 47.005385us | -| 8 | 100 | 1 | 40.498900ms | 292.349880us | 26.513383us | 36.543735us | 35.834039us | 37.144251us | -| 16 | 100 | 1 | 59.946500ms | 503.944720us | 37.870419us | 31.496545us | 31.023408us | 31.947833us | -| 32 | 100 | 1 | 113.259900ms | 910.186450us | 44.819627us | 28.443327us | 28.166674us | 28.716360us | -| 64 | 100 | 1 | 197.142400ms | 1.687464ms | 82.660086us | 26.366631us | 26.126584us | 26.630827us | -| 128 | 100 | 1 | 365.854700ms | 3.206103ms | 100.136523us | 25.047682us | 24.895564us | 25.203430us | -| 256 | 100 | 1 | 708.553300ms | 6.220076ms | 160.255161us | 24.297174us | 24.177553us | 24.423058us | -| 512 | 100 | 1 | 1421.605000ms | 12.226544ms | 224.806939us | 23.879968us | 23.795175us | 23.966526us | -| 1024 | 100 | 1 | 2823.507000ms | 24.889896ms | 403.895135us | 24.306539us | 24.236567us | 24.392412us | -| 2048 | 100 | 1 | 5879.109000ms | 54.964453ms | 1.196715ms | 26.838112us | 26.728506us | 26.956841us | -| 4096 | 100 | 1 | 13272.695500ms | 132.592859ms | 1.956914ms | 32.371303us | 32.281397us | 32.468228us | -| 8192 | 100 | 1 | 28451.461400ms | 284.063659ms | 2.035177ms | 34.675740us | 34.628071us | 34.725474us | -| 16384 | 100 | 1 | 60147.016900ms | 598.955993ms | 7.988140ms | 36.557373us | 36.500351us | 36.756461us | +| 1 | 100 | 1 | 36.778400ms | 86.106940us | 30.305784us | 86.106940us | 79.880870us | 91.821250us | +| 2 | 100 | 1 | 41.270400ms | 126.500350us | 22.572838us | 63.250175us | 61.080260us | 65.531955us | +| 4 | 100 | 1 | 25.898900ms | 188.552010us | 20.619763us | 47.138002us | 46.080295us | 48.106977us | +| 8 | 100 | 1 | 42.271900ms | 292.080190us | 28.937168us | 36.510024us | 35.757836us | 37.183964us | +| 16 | 100 | 1 | 61.946100ms | 490.845530us | 36.222488us | 30.677846us | 30.221036us | 31.108959us | +| 32 | 100 | 1 | 116.582800ms | 879.302030us | 42.691311us | 27.478188us | 27.209715us | 27.734966us | +| 64 | 100 | 1 | 204.442300ms | 1.639195ms | 71.553253us | 25.612426us | 25.382650us | 25.821756us | +| 128 | 100 | 1 | 375.431900ms | 3.128170ms | 96.976242us | 24.438829us | 24.288528us | 24.584769us | +| 256 | 100 | 1 | 713.694600ms | 6.055232ms | 156.292524us | 23.653248us | 23.532205us | 23.770851us | +| 512 | 100 | 1 | 1440.203600ms | 12.001409ms | 570.580790us | 23.440253us | 23.250112us | 23.692393us | +| 1024 | 100 | 1 | 2738.673800ms | 23.742097ms | 591.884248us | 23.185641us | 23.086220us | 23.314371us | +| 2048 | 100 | 1 | 5365.438200ms | 50.304498ms | 1.195304ms | 24.562743us | 24.454789us | 24.685594us | +| 4096 | 100 | 1 | 10832.505200ms | 106.853324ms | 1.380815ms | 26.087237us | 26.022698us | 26.154889us | +| 8192 | 100 | 1 | 22561.991900ms | 225.428688ms | 1.815967ms | 27.518150us | 27.475845us | 27.563092us | +| 16384 | 100 | 1 | 47330.621000ms | 472.394221ms | 2.401319ms | 28.832655us | 28.804025us | 28.861759us | diff --git a/src/AnalyzeEffect/AnalyzeEffect.cpp b/src/AnalyzeEffect/AnalyzeEffect.cpp index aef9ce6..079891e 100644 --- a/src/AnalyzeEffect/AnalyzeEffect.cpp +++ b/src/AnalyzeEffect/AnalyzeEffect.cpp @@ -275,8 +275,13 @@ void ignoreBattlesWithEffectActive(Simulation& simulation) { types::entity createAnalyzeEffectMove( types::registry& registry, dex::Move move, types::entity battleEntity, types::entity attackerEntity, types::entity defenderEntity, const Pokedex& pokedex) { - types::entity moveEntity = - createActionMoveForTarget({registry, defenderEntity}, battleEntity, attackerEntity, move, pokedex); + types::entity moveEntity = createActionMoveForTarget( + {registry, defenderEntity}, + battleEntity, + attackerEntity, + move, + pokedex, + registry.create()); registry.emplace(moveEntity, move); registry.emplace(moveEntity); registry.emplace_or_replace(attackerEntity); diff --git a/src/AnalyzeEffect/Setup/AnalyzeEffectInputSetup.hpp b/src/AnalyzeEffect/Setup/AnalyzeEffectInputSetup.hpp index c3cf0bd..710ad41 100644 --- a/src/AnalyzeEffect/Setup/AnalyzeEffectInputSetup.hpp +++ b/src/AnalyzeEffect/Setup/AnalyzeEffectInputSetup.hpp @@ -16,7 +16,6 @@ struct InputSetup { public: InputSetup(types::registry& registry, types::entity entity); - InputSetup(types::registry& registry) : InputSetup(registry, registry.create()) {} void setAttacker(types::entity entity); void setEffectTarget(types::entity entity); diff --git a/src/Battle/Helpers/Helpers.cpp b/src/Battle/Helpers/Helpers.cpp index fcdf3b5..9b95521 100644 --- a/src/Battle/Helpers/Helpers.cpp +++ b/src/Battle/Helpers/Helpers.cpp @@ -102,9 +102,9 @@ types::moveSlotIndex moveToMoveSlot(const MoveSlots& moveSlots, dex::Move move) types::entity createActionMoveForTarget( types::handle targetHandle, types::entity battleEntity, types::entity sourceEntity, dex::Move move, - const Pokedex& pokedex) { + const Pokedex& pokedex, types::entity entityToUse) { types::registry& registry = *targetHandle.registry(); - types::entity moveEntity = pokedex.buildActionMove(move, registry); + types::entity moveEntity = pokedex.buildActionMove(move, registry, entityToUse); registry.emplace(moveEntity); registry.emplace(moveEntity, battleEntity); diff --git a/src/Battle/Helpers/Helpers.hpp b/src/Battle/Helpers/Helpers.hpp index e6ed8a9..c26bac0 100644 --- a/src/Battle/Helpers/Helpers.hpp +++ b/src/Battle/Helpers/Helpers.hpp @@ -19,5 +19,5 @@ types::moveSlotIndex moveToMoveSlot(const MoveSlots& moveSlots, dex::Move move); types::entity createActionMoveForTarget( types::handle targetHandle, types::entity battleEntity, types::entity sourceEntity, dex::Move move, - const Pokedex& pokedex); + const Pokedex& pokedex, types::entity entityToUse); } // namespace pokesim diff --git a/src/Battle/ManageBattleState.cpp b/src/Battle/ManageBattleState.cpp index 2054381..43205fb 100644 --- a/src/Battle/ManageBattleState.cpp +++ b/src/Battle/ManageBattleState.cpp @@ -117,7 +117,13 @@ void setCurrentActionMove( const MoveSlots& moveSlots = registry.get(source.val); for (types::entity target : targets.val) { - createActionMoveForTarget({registry, target}, battleHandle.entity(), source.val, move.val, pokedex); + createActionMoveForTarget( + {registry, target}, + battleHandle.entity(), + source.val, + move.val, + pokedex, + registry.create()); } types::moveSlotIndex moveSlotIndex = moveToMoveSlot(moveSlots, move.val); diff --git a/src/Battle/Setup/BattleStateSetup.cpp b/src/Battle/Setup/BattleStateSetup.cpp index 3d58291..ea6f3b5 100644 --- a/src/Battle/Setup/BattleStateSetup.cpp +++ b/src/Battle/Setup/BattleStateSetup.cpp @@ -30,9 +30,6 @@ BattleStateSetup::BattleStateSetup(types::registry& registry, types::entity enti if (!handle.any_of()) { handle.emplace(); handle.emplace(); - - types::entity recycledAction = handle.emplace(registry.create()).val; - registry.emplace(recycledAction); } } @@ -44,12 +41,19 @@ void BattleStateSetup::initBlank() { setProbability(Constants::Probability::DEFAULT); } +void BattleStateSetup::setRecycledAction(types::entity recycledAction) { + types::registry& registry = *handle.registry(); + + handle.emplace(recycledAction); + registry.emplace(recycledAction); +} + void BattleStateSetup::setAutoID() { setID((types::stateId)handle.registry()->view().size()); } void BattleStateSetup::setID(types::stateId id) { - handle.emplace_or_replace(id); + handle.emplace(id); } void BattleStateSetup::setSide(types::entity sideEntity) { @@ -83,32 +87,6 @@ void BattleStateSetup::setTurn(types::battleTurn turn) { handle.emplace(turn); } -void BattleStateSetup::setCurrentActionTarget(types::targets actionTargets) { - handle.emplace(actionTargets); - for (types::entity entity : actionTargets) { - handle.registry()->emplace(entity); - } -} - -void BattleStateSetup::setCurrentActionSource(types::entity actionSource) { - handle.emplace(actionSource); - handle.registry()->emplace(actionSource); -} - -void BattleStateSetup::setCurrentActionMove(types::entity actionMove) { - handle.registry()->emplace(actionMove); - const auto* source = handle.try_get(); - const auto* targets = handle.try_get(); - if (source) { - handle.registry()->emplace(source->val).val.push_back(actionMove); - } - if (targets) { - for (types::entity target : targets->val) { - handle.registry()->emplace(target).val.push_back(actionMove); - } - } -} - void BattleStateSetup::setProbability(types::probability probability) { handle.emplace(probability); } diff --git a/src/Battle/Setup/BattleStateSetup.hpp b/src/Battle/Setup/BattleStateSetup.hpp index 53217a7..6e41eab 100644 --- a/src/Battle/Setup/BattleStateSetup.hpp +++ b/src/Battle/Setup/BattleStateSetup.hpp @@ -19,7 +19,6 @@ struct ActionQueueItem; // Tool to set properties of a battle's state to an entity. struct BattleStateSetup : internal::StateSetupBase { BattleStateSetup() : internal::StateSetupBase() {} - BattleStateSetup(types::registry& registry) : BattleStateSetup(registry, registry.create()) {} BattleStateSetup(types::registry& registry, types::entity entity); /** @@ -34,6 +33,7 @@ struct BattleStateSetup : internal::StateSetupBase { */ void initBlank(); + void setRecycledAction(types::entity recycledAction); void setAutoID(); void setID(types::stateId id); void setSide(types::entity sideEntity); @@ -42,9 +42,6 @@ struct BattleStateSetup : internal::StateSetupBase { void setRNGSeed(std::optional seed = std::nullopt); void setActionQueue(const std::vector& queue); void setTurn(types::battleTurn turn); - void setCurrentActionTarget(types::targets actionTargets); - void setCurrentActionSource(types::entity actionSource); - void setCurrentActionMove(types::entity actionMove); void setProbability(types::probability probability); }; } // namespace pokesim diff --git a/src/Battle/Setup/PokemonStateSetup.hpp b/src/Battle/Setup/PokemonStateSetup.hpp index 562b20e..4d1b42c 100644 --- a/src/Battle/Setup/PokemonStateSetup.hpp +++ b/src/Battle/Setup/PokemonStateSetup.hpp @@ -27,7 +27,6 @@ struct MoveSlot; // Tool to set properties of a Pokemon's state to an entity. struct PokemonStateSetup : internal::StateSetupBase { PokemonStateSetup() : internal::StateSetupBase() {} - PokemonStateSetup(types::registry& registry) : PokemonStateSetup(registry, registry.create()) {} PokemonStateSetup(types::registry& registry, types::entity entity); operator types::entity() const { return entity(); } diff --git a/src/Battle/Setup/SideStateSetup.cpp b/src/Battle/Setup/SideStateSetup.cpp index 17e88af..3898e0f 100644 --- a/src/Battle/Setup/SideStateSetup.cpp +++ b/src/Battle/Setup/SideStateSetup.cpp @@ -4,6 +4,7 @@ #include #include #include +#include #include #include #include @@ -13,10 +14,8 @@ #include "PokemonStateSetup.hpp" namespace pokesim { -SideStateSetup::SideStateSetup(types::registry& registry, types::entity entity, PlayerSideId playerSideId) - : StateSetupBase(registry, entity) { +SideStateSetup::SideStateSetup(types::registry& registry, types::entity entity) : StateSetupBase(registry, entity) { handle.emplace(); - handle.emplace(playerSideId); } void SideStateSetup::initBlank() { @@ -49,4 +48,8 @@ void SideStateSetup::setBattle(types::entity entity) { void SideStateSetup::setPlayerSide(PlayerSideId playerSideId) { handle.emplace(playerSideId); } + +void SideStateSetup::setSideDecision(const SideDecision& sideDecision) { + handle.emplace(sideDecision); +} } // namespace pokesim diff --git a/src/Battle/Setup/SideStateSetup.hpp b/src/Battle/Setup/SideStateSetup.hpp index 1557b02..a16ff6d 100644 --- a/src/Battle/Setup/SideStateSetup.hpp +++ b/src/Battle/Setup/SideStateSetup.hpp @@ -11,13 +11,12 @@ namespace pokesim { struct PokemonStateSetup; +struct SideDecision; // Tool to set properties of a player's side state to an entity. struct SideStateSetup : internal::StateSetupBase { SideStateSetup() : internal::StateSetupBase() {} - SideStateSetup(types::registry& registry, PlayerSideId playerSideId) - : SideStateSetup(registry, registry.create(), playerSideId) {} - SideStateSetup(types::registry& registry, types::entity entity, PlayerSideId playerSideId); + SideStateSetup(types::registry& registry, types::entity entity); /** * @brief Applies the defaults to the required properties for a player side's state. * @@ -29,5 +28,6 @@ struct SideStateSetup : internal::StateSetupBase { void setOpponent(types::entity entity); void setBattle(types::entity entity); void setPlayerSide(PlayerSideId playerSideId); + void setSideDecision(const SideDecision& sideDecision); }; } // namespace pokesim diff --git a/src/CalcDamage/Setup/CalcDamageInputSetup.cpp b/src/CalcDamage/Setup/CalcDamageInputSetup.cpp index 19811d8..aa213d6 100644 --- a/src/CalcDamage/Setup/CalcDamageInputSetup.cpp +++ b/src/CalcDamage/Setup/CalcDamageInputSetup.cpp @@ -13,22 +13,18 @@ #include namespace pokesim::calc_damage { -InputSetup::InputSetup(types::registry& _registry) : registry(&_registry) {} +InputSetup::InputSetup(types::registry& registry, types::entity moveEntity) : handle(registry, moveEntity) {} void InputSetup::setup( types::entity battleEntity, types::entity sourceEntity, types::entity targetEntity, dex::Move move, const Pokedex& pokedex) { - moveEntity = createActionMoveForTarget({*registry, targetEntity}, battleEntity, sourceEntity, move, pokedex); - types::handle handle{*registry, moveEntity}; + types::registry& registry = *handle.registry(); + + createActionMoveForTarget({registry, targetEntity}, battleEntity, sourceEntity, move, pokedex, entity()); handle.emplace(move); handle.emplace(); - registry->emplace_or_replace(sourceEntity); - registry->emplace_or_replace(targetEntity); -} - -types::entity InputSetup::entity() const { - POKESIM_REQUIRE(moveEntity != entt::null, "Getting move entity before proper setup."); - return moveEntity; + registry.emplace_or_replace(sourceEntity); + registry.emplace_or_replace(targetEntity); } } // namespace pokesim::calc_damage diff --git a/src/CalcDamage/Setup/CalcDamageInputSetup.hpp b/src/CalcDamage/Setup/CalcDamageInputSetup.hpp index 1ee1926..f89e98f 100644 --- a/src/CalcDamage/Setup/CalcDamageInputSetup.hpp +++ b/src/CalcDamage/Setup/CalcDamageInputSetup.hpp @@ -12,17 +12,16 @@ class Pokedex; namespace calc_damage { struct InputSetup { protected: - types::registry* registry; - types::entity moveEntity = entt::null; + types::handle handle; public: - InputSetup(types::registry& registry); + InputSetup(types::registry& registry, types::entity moveEntity); void setup( types::entity battleEntity, types::entity sourceEntity, types::entity targetEntity, dex::Move move, const Pokedex& pokedex); - types::entity entity() const; + types::entity entity() const { return handle.entity(); } }; } // namespace calc_damage } // namespace pokesim diff --git a/src/Pokedex/Pokedex.cpp b/src/Pokedex/Pokedex.cpp index 4d24902..ce67c61 100644 --- a/src/Pokedex/Pokedex.cpp +++ b/src/Pokedex/Pokedex.cpp @@ -30,15 +30,15 @@ void Pokedex::loadItems(const entt::dense_set& itemSet) { } void Pokedex::loadMoves(const entt::dense_set& moveSet) { - load(movesMap, moveSet, [this](dex::Move move) { return buildMove(move, dexRegistry, false); }); + load(movesMap, moveSet, [this](dex::Move move) { return buildMove(move, dexRegistry, false, dexRegistry.create()); }); } void Pokedex::loadAbilities(const entt::dense_set& abilitySet) { load(abilitiesMap, abilitySet, [this](dex::Ability ability) { return buildAbility(ability, dexRegistry); }); } -types::entity Pokedex::buildActionMove(dex::Move move, types::registry& registry) const { - return buildMove(move, registry, true); +types::entity Pokedex::buildActionMove(dex::Move move, types::registry& registry, types::entity entityToUse) const { + return buildMove(move, registry, true, entityToUse); } void Pokedex::loadForBattleInfo(const std::vector& battleInfoList) { diff --git a/src/Pokedex/Pokedex.hpp b/src/Pokedex/Pokedex.hpp index 49efafc..6259800 100644 --- a/src/Pokedex/Pokedex.hpp +++ b/src/Pokedex/Pokedex.hpp @@ -39,7 +39,8 @@ class Pokedex { void load(entt::dense_map& map, const entt::dense_set& list, Build build); types::entity buildSpecies(dex::Species species, types::registry& registry) const; - types::entity buildMove(dex::Move move, types::registry& registry, bool forActiveMove) const; + types::entity buildMove( + dex::Move move, types::registry& registry, bool forActiveMove, types::entity entityToUse) const; types::entity buildItem(dex::Item item, types::registry& registry) const; types::entity buildAbility(dex::Ability ability, types::registry& registry) const; @@ -225,7 +226,7 @@ class Pokedex { return dexRegistry.all_of(movesMap.at(move)); } - types::entity buildActionMove(dex::Move move, types::registry& registry) const; + types::entity buildActionMove(dex::Move move, types::registry& registry, types::entity entityToUse) const; void loadForBattleInfo(const std::vector& battleInfoList); }; } // namespace pokesim diff --git a/src/Pokedex/Setup/DexDataSetup.hpp b/src/Pokedex/Setup/DexDataSetup.hpp index aa5af72..078f57d 100644 --- a/src/Pokedex/Setup/DexDataSetup.hpp +++ b/src/Pokedex/Setup/DexDataSetup.hpp @@ -13,6 +13,7 @@ struct DexDataSetup { public: DexDataSetup(types::registry& registry) : handle(registry, registry.create()) {} + DexDataSetup(types::registry& registry, types::entity entity) : handle(registry, entity) {} template void setProperty() { diff --git a/src/Pokedex/Setup/GetMoveBuild.cpp b/src/Pokedex/Setup/GetMoveBuild.cpp index 7b1f94d..961865f 100644 --- a/src/Pokedex/Setup/GetMoveBuild.cpp +++ b/src/Pokedex/Setup/GetMoveBuild.cpp @@ -141,8 +141,9 @@ struct BuildMove { } public: - static types::entity build(types::registry& registry, GameMechanics gameMechanic, bool forActiveMove) { - dex::internal::MoveDexDataSetup move(registry); + static types::entity build( + types::registry& registry, GameMechanics gameMechanic, bool forActiveMove, types::entity entityToUse) { + dex::internal::MoveDexDataSetup move(registry, entityToUse); if (forActiveMove) { move.setNameTag(T::name(gameMechanic)); @@ -273,17 +274,18 @@ struct BuildMove { } }; types::entity buildByGameMechanic( - dex::Move move, types::registry& registry, bool forActiveMove, GameMechanics gameMechanic) { + dex::Move move, types::registry& registry, bool forActiveMove, GameMechanics gameMechanic, + types::entity entityToUse) { // Tidy check ignored because "using namespace" is in function using namespace pokesim::dex; // NOLINT(google-build-using-namespace) switch (move) { - case Move::FURY_ATTACK: return BuildMove::build(registry, gameMechanic, forActiveMove); - case Move::KNOCK_OFF: return BuildMove::build(registry, gameMechanic, forActiveMove); - case Move::MOONBLAST: return BuildMove::build(registry, gameMechanic, forActiveMove); - case Move::QUIVER_DANCE: return BuildMove::build(registry, gameMechanic, forActiveMove); - case Move::SPLASH: return BuildMove::build(registry, gameMechanic, forActiveMove); - case Move::THUNDERBOLT: return BuildMove::build(registry, gameMechanic, forActiveMove); - case Move::WILL_O_WISP: return BuildMove::build(registry, gameMechanic, forActiveMove); + case Move::FURY_ATTACK: return BuildMove::build(registry, gameMechanic, forActiveMove, entityToUse); + case Move::KNOCK_OFF: return BuildMove::build(registry, gameMechanic, forActiveMove, entityToUse); + case Move::MOONBLAST: return BuildMove::build(registry, gameMechanic, forActiveMove, entityToUse); + case Move::QUIVER_DANCE: return BuildMove::build(registry, gameMechanic, forActiveMove, entityToUse); + case Move::SPLASH: return BuildMove::build(registry, gameMechanic, forActiveMove, entityToUse); + case Move::THUNDERBOLT: return BuildMove::build(registry, gameMechanic, forActiveMove, entityToUse); + case Move::WILL_O_WISP: return BuildMove::build(registry, gameMechanic, forActiveMove, entityToUse); default: break; } @@ -293,9 +295,10 @@ types::entity buildByGameMechanic( } } // namespace -types::entity Pokedex::buildMove(dex::Move move, types::registry& registry, bool forActiveMove) const { +types::entity Pokedex::buildMove( + dex::Move move, types::registry& registry, bool forActiveMove, types::entity entityToUse) const { if (isGameMechanic(GameMechanics::SCARLET_VIOLET)) { - return buildByGameMechanic(move, registry, forActiveMove, GameMechanics::SCARLET_VIOLET); + return buildByGameMechanic(move, registry, forActiveMove, GameMechanics::SCARLET_VIOLET, entityToUse); } POKESIM_REQUIRE_FAIL("Building for a game that is not yet supported."); diff --git a/src/Pokedex/Setup/MoveDexDataSetup.cpp b/src/Pokedex/Setup/MoveDexDataSetup.cpp index d695a14..30b4972 100644 --- a/src/Pokedex/Setup/MoveDexDataSetup.cpp +++ b/src/Pokedex/Setup/MoveDexDataSetup.cpp @@ -103,7 +103,7 @@ void MoveDexDataSetup::setEffectTargetsMoveSource() { void MoveDexDataSetup::setEffectTargetsMoveTarget() { POKESIM_REQUIRE( - !handle.all_of(), + !handle.all_of(), "Moves effects can only affect the source or target, not both."); handle.emplace(); } diff --git a/src/Pokedex/Setup/MoveDexDataSetup.hpp b/src/Pokedex/Setup/MoveDexDataSetup.hpp index 8778753..ec814d0 100644 --- a/src/Pokedex/Setup/MoveDexDataSetup.hpp +++ b/src/Pokedex/Setup/MoveDexDataSetup.hpp @@ -17,7 +17,7 @@ namespace pokesim::dex::internal { struct MoveDexDataSetup : DexDataSetup { - MoveDexDataSetup(types::registry& registry) : DexDataSetup(registry) {} + MoveDexDataSetup(types::registry& registry, types::entity entity) : DexDataSetup(registry, entity) {} void setName(Move move); void setNameTag(Move move); diff --git a/src/SimulateTurn/SimulateTurn.cpp b/src/SimulateTurn/SimulateTurn.cpp index 8a15007..3b352dd 100644 --- a/src/SimulateTurn/SimulateTurn.cpp +++ b/src/SimulateTurn/SimulateTurn.cpp @@ -92,7 +92,8 @@ void createActionMoveForTargets( types::registry& registry = *targetHandle.registry(); dex::Move move = registry.get(registry.get(battle.val).val).val; - types::entity moveEntity = createActionMoveForTarget(targetHandle, battle.val, source.val, move, pokedex); + types::entity moveEntity = + createActionMoveForTarget(targetHandle, battle.val, source.val, move, pokedex, registry.create()); registry.emplace(moveEntity); } diff --git a/src/Simulation/Simulation.hpp b/src/Simulation/Simulation.hpp index 368f559..8975418 100644 --- a/src/Simulation/Simulation.hpp +++ b/src/Simulation/Simulation.hpp @@ -13,9 +13,6 @@ #include "SimulationOptions.hpp" namespace pokesim { -struct SideStateSetup; -struct PokemonStateSetup; -struct BattleStateSetup; class Pokedex; namespace simulate_turn { @@ -27,9 +24,6 @@ struct Results; namespace analyze_effect { struct Results; } // namespace analyze_effect -namespace debug { -struct SimulationSetupChecks; -} /** * @brief The entry point for creating and running simulations. @@ -38,21 +32,6 @@ struct SimulationSetupChecks; * for running multiple simulations of the same battle, where each battle state has completed the same number of turns. */ class Simulation { - private: - PokemonStateSetup createInitialPokemon(const PokemonCreationInfo& pokemonInfo); - void createInitialSide( - SideStateSetup sideSetup, const SideCreationInfo& sideInfo, const BattleCreationInfo& battleInfo); - - void createInitialTurnDecision(BattleStateSetup battleStateSetup, const TurnDecisionInfo& turnDecisionInfo); - void createCalcDamageInput( - BattleStateSetup battleStateSetup, const CalcDamageInputInfo& inputInfo, debug::SimulationSetupChecks& debugChecks); - void createAnalyzeEffectInput( - BattleStateSetup battleStateSetup, const AnalyzeEffectInputInfo& inputInfo, - debug::SimulationSetupChecks& debugChecks); - - types::sides createInitialBattle( - BattleStateSetup battleStateSetup, const BattleCreationInfo& battleInfo); - private: struct ConstantValues { ConstantValues(const Pokedex& pokedex_, BattleFormat battleFormat_) diff --git a/src/Simulation/SimulationSetup.cpp b/src/Simulation/SimulationSetup.cpp index 6e952fd..182aebc 100644 --- a/src/Simulation/SimulationSetup.cpp +++ b/src/Simulation/SimulationSetup.cpp @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include @@ -35,6 +36,76 @@ namespace pokesim { namespace { +types::entityIndex getBattleCreationCount(const BattleCreationInfo& battleInfo) { + return std::max(1UL, battleInfo.decisionsToSimulate.size()); +} + +struct EntityLists { + struct EntityList { + private: + types::entityVector list{}; + types::entityIndex index = 0U; + + public: + EntityList() {} + EntityList(types::registry& registry, types::entityIndex size) : list(size) { + registry.create(list.begin(), list.end()); + } + + types::entity getNext() { + POKESIM_REQUIRE(index < list.size(), "More entities are being asked for than were created."); + types::entity nextEntity = list[index]; + index++; + return nextEntity; + } + }; + + EntityList battles; + EntityList sides; + EntityList pokemon; + EntityList recycledActions; + EntityList calcDamageInputs; + EntityList analyzeEffectInputs; + + EntityLists(Simulation* simulation, const std::vector& battleInfoList) { + types::entityIndex battleCount = 0; + types::entityIndex pokemonCount = 0; + types::entityIndex calcDamageInputCount = 0; + types::entityIndex analyzeEffectInputCount = 0; + for (const BattleCreationInfo& battleInfo : battleInfoList) { + types::entityIndex battleCountIncrease = getBattleCreationCount(battleInfo); + battleCount += battleCountIncrease; + + for (const SideCreationInfo& side : battleInfo.sides) { + pokemonCount += side.team.size() * battleCountIncrease; + } + + for (const CalcDamageInputInfo& calcDamageInputInfo : battleInfo.damageCalculations) { + calcDamageInputCount += calcDamageInputInfo.moves.size(); + } + for (const AnalyzeEffectInputInfo& analyzeEffectInputInfo : battleInfo.effectsToAnalyze) { + analyzeEffectInputCount += analyzeEffectInputInfo.moves.size(); + } + } + + types::entityIndex sideCount = battleCount * 2; + types::entityIndex recycledActionCount = battleCount; + + POKESIM_REQUIRE( + battleCount + sideCount + recycledActionCount + pokemonCount + calcDamageInputCount + analyzeEffectInputCount < + std::numeric_limits::max(), + "More entities than can be created would be made for this input."); + + types::registry& registry = simulation->registry; + battles = {registry, battleCount}; + sides = {registry, sideCount}; + pokemon = {registry, pokemonCount}; + recycledActions = {registry, recycledActionCount}; + calcDamageInputs = {registry, calcDamageInputCount}; + analyzeEffectInputs = {registry, analyzeEffectInputCount}; + } +}; + void setPokemonAbility( const PokemonCreationInfo& pokemonInfo, PokemonStateSetup& pokemonSetup, const Pokedex& pokedex) { if (pokemonInfo.ability != dex::Ability::NO_ABILITY) { @@ -147,10 +218,9 @@ void setPokemonCurrentBoosts(const PokemonCreationInfo& pokemonInfo, PokemonStat if (pokemonInfoBoosts.spd.has_value()) pokemonSetup.setBoost(pokemonInfoBoosts.spd.value()); if (pokemonInfoBoosts.spe.has_value()) pokemonSetup.setBoost(pokemonInfoBoosts.spe.value()); } -} // namespace -PokemonStateSetup Simulation::createInitialPokemon(const PokemonCreationInfo& pokemonInfo) { - PokemonStateSetup pokemonSetup(registry); +void createInitialPokemon( + const PokemonCreationInfo& pokemonInfo, PokemonStateSetup& pokemonSetup, const Pokedex& pokedex) { if (pokemonInfo.id.has_value()) { pokemonSetup.setID(pokemonInfo.id.value()); } @@ -159,13 +229,13 @@ PokemonStateSetup Simulation::createInitialPokemon(const PokemonCreationInfo& po } pokemonSetup.setSpecies(pokemonInfo.species); - setPokemonAbility(pokemonInfo, pokemonSetup, pokedex()); + setPokemonAbility(pokemonInfo, pokemonSetup, pokedex); types::level level = pokemonInfo.level.value_or(Constants::PokemonLevel::DEFAULT); dex::Nature nature = setPokemonNature(pokemonInfo, pokemonSetup); Evs evs = setPokemonEvs(pokemonInfo, pokemonSetup); Ivs ivs = setPokemonIvs(pokemonInfo, pokemonSetup); - types::stat hp = setPokemonStats(pokemonInfo, pokemonSetup, pokedex(), level, nature, evs, ivs); + types::stat hp = setPokemonStats(pokemonInfo, pokemonSetup, pokedex, level, nature, evs, ivs); pokemonSetup.setLevel(level); @@ -173,7 +243,7 @@ PokemonStateSetup Simulation::createInitialPokemon(const PokemonCreationInfo& po pokemonSetup.setTypes(pokemonInfo.currentTypes.value()); } else { - pokemonSetup.setTypes(pokedex().getSpeciesData(pokemonInfo.species)); + pokemonSetup.setTypes(pokedex.getSpeciesData(pokemonInfo.species)); } if (pokemonInfo.gender.has_value() && pokemonInfo.gender != dex::Gender::NO_GENDER) { @@ -201,20 +271,82 @@ PokemonStateSetup Simulation::createInitialPokemon(const PokemonCreationInfo& po pokemonSetup.setProperty(); pokemonSetup.setProperty(); pokemonSetup.setProperty(); +} + +void createCalcDamageInput( + const CalcDamageInputInfo& inputInfo, BattleStateSetup& battleSetup, types::registry& registry, + const Pokedex& pokedex, EntityLists& entityLists, debug::SimulationSetupChecks& debugChecks) { + POKESIM_REQUIRE(inputInfo.attackerSlot != Slot::NONE, "A damage calculation must have a attacker."); + POKESIM_REQUIRE(inputInfo.defenderSlot != Slot::NONE, "A damage calculation must have a defender."); + POKESIM_REQUIRE(!inputInfo.moves.empty(), "A damage calculation must have a move."); + + const Sides& sides = registry.get(battleSetup.entity()); + types::entity attackerEntity = slotToPokemonEntity(registry, sides, inputInfo.attackerSlot); + types::entity defenderEntity = slotToPokemonEntity(registry, sides, inputInfo.defenderSlot); - return pokemonSetup; + for (dex::Move move : inputInfo.moves) { + calc_damage::InputSetup inputSetup{registry, entityLists.calcDamageInputs.getNext()}; + POKESIM_REQUIRE(move != dex::Move::NO_MOVE, "A damage calculation must have a move."); + + inputSetup.setup(battleSetup.entity(), attackerEntity, defenderEntity, move, pokedex); + debugChecks.addToCalcDamageChecklist(battleSetup, inputSetup, inputInfo); + } } -void Simulation::createInitialSide( - SideStateSetup sideSetup, const SideCreationInfo& sideInfo, const BattleCreationInfo& battleInfo) { - internal::maxSizedVector pokemonSetupList; - pokemonSetupList.reserve(sideInfo.team.size()); +void createAnalyzeEffectInput( + const AnalyzeEffectInputInfo& inputInfo, BattleStateSetup& battleSetup, types::registry& registry, + EntityLists& entityLists, debug::SimulationSetupChecks& debugChecks) { + POKESIM_REQUIRE(inputInfo.attackerSlot != Slot::NONE, "An effect analysis must have a attacker."); + POKESIM_REQUIRE(inputInfo.defenderSlot != Slot::NONE, "An effect analysis must have a defender."); + POKESIM_REQUIRE(inputInfo.effectTarget != Slot::NONE, "An effect analysis must have a effect target."); + POKESIM_REQUIRE(!inputInfo.moves.empty(), "An effect analysis must include a move."); + const auto& effect = inputInfo.effect; + const auto& boostEffect = inputInfo.boostEffect; + POKESIM_REQUIRE( + boostEffect.has_value() || (effect.has_value() && !effect.value().empty()), + "An effect analysis must have an effect."); + + const Sides& sides = registry.get(battleSetup.entity()); + types::entity attackerEntity = slotToPokemonEntity(registry, sides, inputInfo.attackerSlot); + types::entity defenderEntity = slotToPokemonEntity(registry, sides, inputInfo.defenderSlot); + types::entity effectTargetEntity = slotToPokemonEntity(registry, sides, inputInfo.effectTarget); + + for (dex::Move move : inputInfo.moves) { + analyze_effect::InputSetup inputSetup{registry, entityLists.analyzeEffectInputs.getNext()}; + + inputSetup.setAttacker(attackerEntity); + inputSetup.setDefender(defenderEntity); + inputSetup.setEffectTarget(effectTargetEntity); + inputSetup.setEffectMove(move); + inputSetup.setBattle(battleSetup.entity()); + + if (effect.has_value()) { + inputSetup.setEffect(effect.value()); + } + if (boostEffect.has_value()) { + inputSetup.setBoostEffect(boostEffect.value().stat, boostEffect.value().boost); + } + + debugChecks.addToAnalyzeEffectChecklist(battleSetup, inputSetup, inputInfo); + } +} + +void createInitialTurnDecision(const TurnDecisionInfo& turnDecisionInfo, types::sides& sideSetupList) { + for (types::sideIndex i = 0U; i < sideSetupList.size(); i++) { + sideSetupList[i].setSideDecision(turnDecisionInfo[i]); + } +} + +void createInitialSide( + const SideCreationInfo& sideInfo, SideStateSetup& sideSetup, const BattleCreationInfo& battleInfo, + Simulation* simulation, internal::maxSizedVector& pokemonSetupList) { for (std::size_t i = 0U; i < sideInfo.team.size(); i++) { + PokemonStateSetup& pokemonSetup = pokemonSetupList[i]; const PokemonCreationInfo& pokemonInfo = sideInfo.team[i]; - PokemonStateSetup pokemonSetup = createInitialPokemon(pokemonInfo); + bool battleStarted = battleInfo.turn > Constants::TurnCount::MIN; - bool inActiveSlot = (isBattleFormat(BattleFormat::SINGLES) ? 1U : 2U) > i; + bool inActiveSlot = (simulation->isBattleFormat(BattleFormat::SINGLES) ? 1U : 2U) > i; bool isFainted = pokemonInfo.currentHp.has_value() && pokemonInfo.currentHp == Constants::PokemonCurrentHpStat::MIN; if (battleStarted && inActiveSlot && !isFainted) { pokemonSetup.setProperty(); @@ -224,7 +356,7 @@ void Simulation::createInitialSide( for (const MoveCreationInfo& moveInfo : pokemonInfo.moves) { types::pp maxPp = Constants::MoveMaxPp::DEFAULT; if (!moveInfo.pp.has_value() || !moveInfo.maxPp.has_value()) { - maxPp = pokedex().getMoveData(moveInfo.name).val; + maxPp = simulation->pokedex().getMoveData(moveInfo.name).val; } maxPp = moveInfo.maxPp.value_or(maxPp); @@ -232,9 +364,9 @@ void Simulation::createInitialSide( } pokemonSetup.setMoves(moveSlots); - pokemonSetupList.push_back(pokemonSetup); } + types::registry& registry = simulation->registry; if (battleInfo.runWithSimulateTurn) { sideSetup.setProperty(); registry.insert(pokemonSetupList.begin(), pokemonSetupList.end()); @@ -251,164 +383,121 @@ void Simulation::createInitialSide( sideSetup.setTeam(pokemonSetupList); } -types::sides Simulation::createInitialBattle( - BattleStateSetup battleStateSetup, const BattleCreationInfo& battleInfo) { - battleStateSetup.setAutoID(); - battleStateSetup.setTurn(battleInfo.turn.value_or(Constants::TurnCount::DEFAULT)); - battleStateSetup.setRNGSeed(battleInfo.rngSeed); - battleStateSetup.setProbability(battleInfo.probability.value_or(Constants::Probability::DEFAULT)); +void createInitialBattle( + const BattleCreationInfo& battleInfo, BattleStateSetup& battleSetup, types::sides& sideSetupList) { + battleSetup.setTurn(battleInfo.turn.value_or(Constants::TurnCount::DEFAULT)); + battleSetup.setRNGSeed(battleInfo.rngSeed); + battleSetup.setProbability(battleInfo.probability.value_or(Constants::Probability::DEFAULT)); if (battleInfo.runWithSimulateTurn) { - battleStateSetup.setProperty(); + battleSetup.setProperty(); } if (battleInfo.runWithCalculateDamage) { - battleStateSetup.setProperty(); + battleSetup.setProperty(); } if (battleInfo.runWithAnalyzeEffect) { - battleStateSetup.setProperty(); + battleSetup.setProperty(); } - SideStateSetup p1SideSetup(registry, PlayerSideId::P1); - SideStateSetup p2SideSetup(registry, PlayerSideId::P2); + SideStateSetup& p1SideSetup = sideSetupList.p1(); + SideStateSetup& p2SideSetup = sideSetupList.p2(); - types::entity battleEntity = battleStateSetup.entity(); + p1SideSetup.setPlayerSide(PlayerSideId::P1); + p2SideSetup.setPlayerSide(PlayerSideId::P2); + + types::entity battleEntity = battleSetup.entity(); types::entity p1Entity = p1SideSetup.entity(); types::entity p2Entity = p2SideSetup.entity(); - battleStateSetup.setSide(p1Entity); - battleStateSetup.setSide(p2Entity); + battleSetup.setSide(p1Entity); + battleSetup.setSide(p2Entity); p1SideSetup.setOpponent(p2Entity); p2SideSetup.setOpponent(p1Entity); p1SideSetup.setBattle(battleEntity); p2SideSetup.setBattle(battleEntity); - - return {p1SideSetup, p2SideSetup}; } -void Simulation::createInitialTurnDecision( - BattleStateSetup battleStateSetup, const TurnDecisionInfo& turnDecisionInfo) { - types::handle battleHandle{registry, battleStateSetup.entity()}; - const Sides& sides = battleHandle.get(); - - for (types::sideIndex i = 0U; i < sides.val.size(); i++) { - registry.emplace(sides.val[i], turnDecisionInfo[i]); +void createInitialState( + const BattleCreationInfo& battleInfo, Simulation* simulation, EntityLists& entityLists, + debug::SimulationSetupChecks& debugChecks) { + internal::maxSizedVector battleSetupList; + internal::maxSizedVector> sideSetupLists; + internal::maxSizedVector>> + pokemonSetupLists; + battleSetupList.resize(getBattleCreationCount(battleInfo)); + sideSetupLists.resize(battleSetupList.size()); + pokemonSetupLists.resize(battleSetupList.size()); + + const Pokedex& pokedex = simulation->pokedex(); + types::registry& registry = simulation->registry; + + for (BattleStateSetup& battleSetup : battleSetupList) { + battleSetup = {registry, entityLists.battles.getNext()}; } -} -void Simulation::createCalcDamageInput( - BattleStateSetup battleStateSetup, const CalcDamageInputInfo& inputInfo, debug::SimulationSetupChecks& debugChecks) { - POKESIM_REQUIRE(inputInfo.attackerSlot != Slot::NONE, "A damage calculation must have a attacker."); - POKESIM_REQUIRE(inputInfo.defenderSlot != Slot::NONE, "A damage calculation must have a defender."); - POKESIM_REQUIRE(!inputInfo.moves.empty(), "A damage calculation must have a move."); - - const Sides& sides = registry.get(battleStateSetup.entity()); - types::entity attackerEntity = slotToPokemonEntity(registry, sides, inputInfo.attackerSlot); - types::entity defenderEntity = slotToPokemonEntity(registry, sides, inputInfo.defenderSlot); - - for (dex::Move move : inputInfo.moves) { - calc_damage::InputSetup inputSetup(registry); - POKESIM_REQUIRE(move != dex::Move::NO_MOVE, "A damage calculation must have a move."); - - inputSetup.setup(battleStateSetup.entity(), attackerEntity, defenderEntity, move, pokedex()); - debugChecks.addToCalcDamageChecklist(battleStateSetup, inputSetup, inputInfo); + for (types::sideIndex sideIndex = 0; sideIndex < battleInfo.sides.size(); sideIndex++) { + for (auto& sideSetupList : sideSetupLists) { + sideSetupList[sideIndex] = {registry, entityLists.sides.getNext()}; + } } -} -void Simulation::createAnalyzeEffectInput( - BattleStateSetup battleStateSetup, const AnalyzeEffectInputInfo& inputInfo, - debug::SimulationSetupChecks& debugChecks) { - POKESIM_REQUIRE(inputInfo.attackerSlot != Slot::NONE, "An effect analysis must have a attacker."); - POKESIM_REQUIRE(inputInfo.defenderSlot != Slot::NONE, "An effect analysis must have a defender."); - POKESIM_REQUIRE(inputInfo.effectTarget != Slot::NONE, "An effect analysis must have a effect target."); - POKESIM_REQUIRE(!inputInfo.moves.empty(), "An effect analysis must include a move."); + for (types::entityIndex battleIndex = 0; battleIndex < battleSetupList.size(); battleIndex++) { + BattleStateSetup& battleSetup = battleSetupList[battleIndex]; + createInitialBattle(battleInfo, battleSetup, sideSetupLists[battleIndex]); + battleSetup.setRecycledAction(entityLists.recycledActions.getNext()); + } - const auto& effect = inputInfo.effect; - const auto& boostEffect = inputInfo.boostEffect; - POKESIM_REQUIRE( - boostEffect.has_value() || (effect.has_value() && !effect.value().empty()), - "An effect analysis must have an effect."); + for (types::sideIndex sideIndex = 0; sideIndex < battleInfo.sides.size(); sideIndex++) { + for (const PokemonCreationInfo& pokemonInfo : battleInfo.sides[sideIndex].team) { + for (auto& pokemonSetupList : pokemonSetupLists) { + PokemonStateSetup& pokemonSetup = + pokemonSetupList[sideIndex].emplace_back(registry, entityLists.pokemon.getNext()); + createInitialPokemon(pokemonInfo, pokemonSetup, pokedex); + } + } + } - const Sides& sides = registry.get(battleStateSetup.entity()); - types::entity attackerEntity = slotToPokemonEntity(registry, sides, inputInfo.attackerSlot); - types::entity defenderEntity = slotToPokemonEntity(registry, sides, inputInfo.defenderSlot); - types::entity effectTargetEntity = slotToPokemonEntity(registry, sides, inputInfo.effectTarget); + for (types::entityIndex battleIndex = 0; battleIndex < battleSetupList.size(); battleIndex++) { + BattleStateSetup& battleSetup = battleSetupList[battleIndex]; + auto& sideSetupList = sideSetupLists[battleIndex]; + for (types::sideIndex sideIndex = 0; sideIndex < battleInfo.sides.size(); sideIndex++) { + createInitialSide( + battleInfo.sides[sideIndex], + sideSetupList[sideIndex], + battleInfo, + simulation, + pokemonSetupLists[battleIndex][sideIndex]); + } - for (dex::Move move : inputInfo.moves) { - analyze_effect::InputSetup inputSetup(registry); + if (battleIndex < battleInfo.decisionsToSimulate.size()) { + const TurnDecisionInfo& turnDecisionInfo = battleInfo.decisionsToSimulate[battleIndex]; + createInitialTurnDecision(turnDecisionInfo, sideSetupList); + debugChecks.addToTurnDecisionChecklist(battleSetup, turnDecisionInfo); + } + battleSetup.setID(battleIndex); + debugChecks.addToBattleChecklist(battleSetup, battleInfo); + } - inputSetup.setAttacker(attackerEntity); - inputSetup.setDefender(defenderEntity); - inputSetup.setEffectTarget(effectTargetEntity); - inputSetup.setEffectMove(move); - inputSetup.setBattle(battleStateSetup.entity()); + BattleStateSetup& battleSetup = battleSetupList[0]; + for (const CalcDamageInputInfo& calcDamageInputInfo : battleInfo.damageCalculations) { + createCalcDamageInput(calcDamageInputInfo, battleSetup, registry, pokedex, entityLists, debugChecks); + } - if (effect.has_value()) { - inputSetup.setEffect(effect.value()); - } - if (boostEffect.has_value()) { - inputSetup.setBoostEffect(boostEffect.value().stat, boostEffect.value().boost); - } - debugChecks.addToAnalyzeEffectChecklist(battleStateSetup, inputSetup, inputInfo); + for (const AnalyzeEffectInputInfo& analyzeEffectInputInfo : battleInfo.effectsToAnalyze) { + createAnalyzeEffectInput(analyzeEffectInputInfo, battleSetup, registry, entityLists, debugChecks); } } +} // namespace void Simulation::createInitialStates(const std::vector& battleInfoList) { debug::SimulationSetupChecks debugChecks(this, battleInfoList); - for (const BattleCreationInfo& battleInfo : battleInfoList) { - BattleStateSetup battleStateSetup(registry); - types::sides sideSetup = createInitialBattle(battleStateSetup, battleInfo); + EntityLists entityLists{this, battleInfoList}; - for (types::sideIndex i = 0U; i < sideSetup.size(); i++) { - createInitialSide(sideSetup[i], battleInfo.sides[i], battleInfo); - } - - debugChecks.addToBattleChecklist(battleStateSetup, battleInfo); - - if (!battleInfo.decisionsToSimulate.empty()) { - POKESIM_REQUIRE( - battleInfo.decisionsToSimulate.size() < std::numeric_limits::max(), - "Cannot make more clones than there are entities available."); - - types::entityIndex cloneCount = (types::entityIndex)(battleInfo.decisionsToSimulate.size() - 1U); - if (cloneCount) { - battleStateSetup.setProperty(); - const types::ClonedEntityMap entityMap = pokesim::clone(registry, cloneCount); - - const auto& clonedBattles = entityMap.at(battleStateSetup.entity()); - internal::maxSizedVector clones; - clones.reserve(clonedBattles.size()); - - for (types::entity entity : clonedBattles) { - clones.emplace_back(registry, entity); - } - - for (types::entityIndex i = 0U; i < cloneCount; i++) { - BattleStateSetup& setupClone = clones[i]; - const TurnDecisionInfo& turnDecisionInfo = battleInfo.decisionsToSimulate[i]; - debugChecks.addToBattleChecklist(setupClone, battleInfo); - - createInitialTurnDecision(setupClone, turnDecisionInfo); - setupClone.setID(i); - - debugChecks.addToTurnDecisionChecklist(setupClone, turnDecisionInfo); - } - } - - createInitialTurnDecision(battleStateSetup, battleInfo.decisionsToSimulate.back()); - debugChecks.addToTurnDecisionChecklist(battleStateSetup, battleInfo.decisionsToSimulate.back()); - battleStateSetup.setID(cloneCount); - } - - for (const CalcDamageInputInfo& calcDamageInputInfo : battleInfo.damageCalculations) { - createCalcDamageInput(battleStateSetup, calcDamageInputInfo, debugChecks); - } - - for (const AnalyzeEffectInputInfo& analyzeEffectInputInfo : battleInfo.effectsToAnalyze) { - createAnalyzeEffectInput(battleStateSetup, analyzeEffectInputInfo, debugChecks); - } + for (const BattleCreationInfo& battleInfo : battleInfoList) { + createInitialState(battleInfo, this, entityLists, debugChecks); } debugChecks.checkOutputs(); diff --git a/src/Types/Decisions.hpp b/src/Types/Decisions.hpp index cfe2126..7122eba 100644 --- a/src/Types/Decisions.hpp +++ b/src/Types/Decisions.hpp @@ -13,7 +13,7 @@ struct MoveDecision { dex::Move move = dex::Move::NO_MOVE; - bool operator==(const MoveDecision& other) const { + constexpr bool operator==(const MoveDecision& other) const { return sourceSlot == other.sourceSlot && targetSlot == other.targetSlot && move == other.move; } }; @@ -27,7 +27,7 @@ struct SwitchDecision { Slot sourceSlot = Slot::NONE; Slot targetSlot = Slot::NONE; - bool operator==(const SwitchDecision& other) const { + constexpr bool operator==(const SwitchDecision& other) const { return sourceSlot == other.sourceSlot && targetSlot == other.targetSlot; } }; @@ -38,7 +38,7 @@ struct ItemDecision { dex::Item item = dex::Item::NO_ITEM; - bool operator==(const ItemDecision& other) const { + constexpr bool operator==(const ItemDecision& other) const { return sourceSlot == other.sourceSlot && targetSlot == other.targetSlot && item == other.item; } }; From a774a5cdcbd20dacb5a276b8b569c7c9879b2911 Mon Sep 17 00:00:00 2001 From: aed3 <32887801+aed3@users.noreply.github.com> Date: Thu, 25 Jun 2026 13:43:25 -0500 Subject: [PATCH 07/10] Reusing Action Move Entities Part 2 This commit is the change I made before "part 1" that made the changes in "part 1" required to maintain performance. The main parts of this are creating the action move entities at battle setup, clearing action components instead of destroying the entities, and changing action move creations to happen one move at a time instead of jumping between different moves. That last change is the source of much of the speed up from this change. --- CMakeLists.txt | 1 - extras/PokeSim.cpp | 813 ++++++++++-------- extras/PokeSim.hpp | 99 +-- extras/RecentBenchmarkResults.md | 472 +++++----- src/AnalyzeEffect/AnalyzeEffect.cpp | 34 +- src/Battle/Clone/Clone.cpp | 55 +- src/Battle/Helpers/Helpers.cpp | 37 +- src/Battle/Helpers/Helpers.hpp | 6 +- src/Battle/ManageBattleState.cpp | 148 ++-- src/Battle/ManageBattleState.hpp | 3 - src/Battle/Setup/BattleStateSetup.cpp | 16 +- src/Battle/Setup/BattleStateSetup.hpp | 3 +- src/CalcDamage/Setup/CalcDamageInputSetup.cpp | 6 +- src/CalcDamage/Setup/CalcDamageInputSetup.hpp | 4 +- .../EntityHolders/RecycledEntities.hpp | 12 + src/Components/Tags/RecycledEntities.hpp | 3 + src/Components/Tags/Selection.hpp | 2 + src/Pokedex/Pokedex.cpp | 22 +- src/Pokedex/Pokedex.hpp | 4 +- src/Pokedex/Setup/GetMoveBuild.cpp | 289 ++++--- src/Pokedex/Setup/MoveDexDataSetup.cpp | 110 --- src/Pokedex/Setup/MoveDexDataSetup.hpp | 60 -- src/Pokedex/Setup/headers.hpp | 1 - src/Pokedex/headers.hpp | 1 - src/SimulateTurn/SimulateTurn.cpp | 121 ++- src/Simulation/RunEvent.cpp | 2 + src/Simulation/RunEvent.hpp | 1 + src/Simulation/SimulationSetup.cpp | 24 +- src/Utilities/ArgumentChecks.cpp | 9 + src/Utilities/ArgumentChecks.hpp | 12 + 30 files changed, 1233 insertions(+), 1137 deletions(-) delete mode 100644 src/Pokedex/Setup/MoveDexDataSetup.cpp delete mode 100644 src/Pokedex/Setup/MoveDexDataSetup.hpp diff --git a/CMakeLists.txt b/CMakeLists.txt index 9d677a0..5d8180d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -204,7 +204,6 @@ setup_target( src/Pokedex/Setup/GetMoveBuild.cpp src/Pokedex/Setup/GetSpeciesBuild.cpp src/Pokedex/Setup/ItemDexDataSetup.cpp - src/Pokedex/Setup/MoveDexDataSetup.cpp src/Pokedex/Setup/SpeciesDexDataSetup.cpp src/SimulateTurn/CalcDamageSpecifics.cpp src/SimulateTurn/ManageActionQueue.cpp diff --git a/extras/PokeSim.cpp b/extras/PokeSim.cpp index 0bda17f..db9422b 100644 --- a/extras/PokeSim.cpp +++ b/extras/PokeSim.cpp @@ -16,7 +16,6 @@ * src/SimulateTurn/ManageActionQueue.cpp * src/SimulateTurn/CalcDamageSpecifics.cpp * src/Pokedex/Setup/SpeciesDexDataSetup.cpp - * src/Pokedex/Setup/MoveDexDataSetup.cpp * src/Pokedex/Setup/ItemDexDataSetup.cpp * src/Pokedex/Setup/GetSpeciesBuild.cpp * src/Pokedex/Setup/GetMoveBuild.cpp @@ -845,6 +844,15 @@ void check(const RecycledAction& recycledAction, const types::registry& registry POKESIM_REQUIRE_NM(has(recycledAction.val, registry)); } +template <> +void check(const RecycledActionMove&, const types::registry&) {} + +template <> +void check(const AddedRecycledActionMove1&, const types::registry&) {} + +template <> +void check(const AddedRecycledActionMove2&, const types::registry&) {} + template <> void check(const Side& side, const types::registry& registry) { checkSide(side.val, registry); @@ -1384,6 +1392,8 @@ struct EntityLists { EntityList sides; EntityList pokemon; EntityList recycledActions; + EntityList recycledActionMoves; + EntityList addedRecycledActionMoves; EntityList calcDamageInputs; EntityList analyzeEffectInputs; @@ -1410,6 +1420,9 @@ struct EntityLists { types::entityIndex sideCount = battleCount * 2; types::entityIndex recycledActionCount = battleCount; + types::entityIndex recycledActionMoveCount = battleCount; + types::entityIndex addedRecycledActionMoveCount = + simulation->isBattleFormat(BattleFormat::DOUBLES) ? battleCount * 2 : 0; POKESIM_REQUIRE( battleCount + sideCount + recycledActionCount + pokemonCount + calcDamageInputCount + analyzeEffectInputCount < @@ -1421,6 +1434,8 @@ struct EntityLists { sides = {registry, sideCount}; pokemon = {registry, pokemonCount}; recycledActions = {registry, recycledActionCount}; + recycledActionMoves = {registry, recycledActionMoveCount}; + addedRecycledActionMoves = {registry, addedRecycledActionMoveCount}; calcDamageInputs = {registry, calcDamageInputCount}; analyzeEffectInputs = {registry, analyzeEffectInputCount}; } @@ -1595,7 +1610,7 @@ void createInitialPokemon( void createCalcDamageInput( const CalcDamageInputInfo& inputInfo, BattleStateSetup& battleSetup, types::registry& registry, - const Pokedex& pokedex, EntityLists& entityLists, debug::SimulationSetupChecks& debugChecks) { + EntityLists& entityLists, debug::SimulationSetupChecks& debugChecks) { POKESIM_REQUIRE(inputInfo.attackerSlot != Slot::NONE, "A damage calculation must have a attacker."); POKESIM_REQUIRE(inputInfo.defenderSlot != Slot::NONE, "A damage calculation must have a defender."); POKESIM_REQUIRE(!inputInfo.moves.empty(), "A damage calculation must have a move."); @@ -1608,7 +1623,7 @@ void createCalcDamageInput( calc_damage::InputSetup inputSetup{registry, entityLists.calcDamageInputs.getNext()}; POKESIM_REQUIRE(move != dex::Move::NO_MOVE, "A damage calculation must have a move."); - inputSetup.setup(battleSetup.entity(), attackerEntity, defenderEntity, move, pokedex); + inputSetup.setup(battleSetup.entity(), attackerEntity, defenderEntity, move); debugChecks.addToCalcDamageChecklist(battleSetup, inputSetup, inputInfo); } } @@ -1766,7 +1781,12 @@ void createInitialState( for (types::entityIndex battleIndex = 0; battleIndex < battleSetupList.size(); battleIndex++) { BattleStateSetup& battleSetup = battleSetupList[battleIndex]; createInitialBattle(battleInfo, battleSetup, sideSetupLists[battleIndex]); - battleSetup.setRecycledAction(entityLists.recycledActions.getNext()); + battleSetup.setRecycledAction(entityLists.recycledActions.getNext(), entityLists.recycledActionMoves.getNext()); + if (simulation->isBattleFormat(BattleFormat::DOUBLES)) { + battleSetup.setAddedRecycledActionMoves( + entityLists.addedRecycledActionMoves.getNext(), + entityLists.addedRecycledActionMoves.getNext()); + } } for (types::sideIndex sideIndex = 0; sideIndex < battleInfo.sides.size(); sideIndex++) { @@ -1802,7 +1822,7 @@ void createInitialState( BattleStateSetup& battleSetup = battleSetupList[0]; for (const CalcDamageInputInfo& calcDamageInputInfo : battleInfo.damageCalculations) { - createCalcDamageInput(calcDamageInputInfo, battleSetup, registry, pokedex, entityLists, debugChecks); + createCalcDamageInput(calcDamageInputInfo, battleSetup, registry, entityLists, debugChecks); } for (const AnalyzeEffectInputInfo& analyzeEffectInputInfo : battleInfo.effectsToAnalyze) { @@ -1820,6 +1840,9 @@ void Simulation::createInitialStates(const std::vector& batt createInitialState(battleInfo, this, entityLists, debugChecks); } + pokedex().buildMoves(registry); + registry.clear(); + debugChecks.checkOutputs(); } } // namespace pokesim @@ -2105,6 +2128,8 @@ template void runAfterEachBoostEvent(Simulation&); void runAfterBoostEvent(Simulation&) {} +void runModifyTarget(Simulation& simulation) {} + void runModifyMove(Simulation& simulation) { dex::ChoiceScarf::onSourceModifyMove(simulation); dex::ChoiceSpecs::onSourceModifyMove(simulation); @@ -2390,64 +2415,116 @@ auto getBattleFilter(Simulation& simulation) { return pokesim::internal::EntityFilter{simulation}; } -void addTargetAllyToTargets(types::registry& registry, const Battle& battle) { +void addAddedTarget(types::registry& registry, Battle battle, Slot allySlot) { const Sides& sides = registry.get(battle.val); - const TargetSlotName& targetSlotName = registry.get(registry.get(battle.val).val); - - types::entity allyEntity = slotToAllyPokemonEntity(registry, sides, targetSlotName.val); + types::entity allyEntity = slotToAllyPokemonEntity(registry, sides, allySlot); if (allyEntity == entt::null) { return; } CurrentActionTargets& targets = registry.get(battle.val); + + POKESIM_REQUIRE(!targets.val.empty(), "Added targets should not be the first in the list of targets."); + + if (targets.val.size() == 1U) { + registry.emplace(battle.val); + } + else { + registry.emplace(battle.val); + } + targets.val.push_back(allyEntity); } +void addTargetAllyToTargets(types::registry& registry, Battle battle) { + const TargetSlotName& targetSlotName = registry.get(registry.get(battle.val).val); + addAddedTarget(registry, battle, targetSlotName.val); +} + void addUserAllyToTargets(types::registry& registry, const Battle& battle) { - const Sides& sides = registry.get(battle.val); const SourceSlotName& sourceSlotName = registry.get(registry.get(battle.val).val); + addAddedTarget(registry, battle, sourceSlotName.val); +} - types::entity allyEntity = slotToAllyPokemonEntity(registry, sides, sourceSlotName.val); - if (allyEntity == entt::null) { - return; +void setTargetReferenceComponents( + types::registry& registry, const CurrentActionTargets& targets, CurrentActionSource source) { + for (types::entity target : targets.val) { + registry.emplace(target); + registry.emplace(target, source.val); } - - CurrentActionTargets& targets = registry.get(battle.val); - targets.val.push_back(allyEntity); } -void resolveMoveTargets(types::registry& registry, CurrentActionTargets& targets) { - for (types::entity target : targets.val) { - registry.emplace_or_replace(target); +template +void setActionMoveReferenceComponents( + types::handle battleHandle, CurrentActionSource source, CurrentActionTargets targets, CurrentAction action, + RecycledActionMoveType actionMove) { + types::registry& registry = *battleHandle.registry(); + types::handle actionMoveHandle{registry, actionMove.val}; + types::entity target; + + if constexpr (std::is_same_v) { + target = targets.val[0]; + } + else if constexpr (std::is_same_v) { + target = targets.val[1]; + } + else if constexpr (std::is_same_v) { + target = targets.val[2]; + } + else { + static_assert(false, "Using a RecycledActionMoveType that isn't associated with a target."); } - // More to do... + MoveName move = registry.get(action.val); + setupActionMoveBuild(registry, battleHandle.entity(), source.val, target, actionMove.val, move.val); } -void createActionMoveForTargets( - types::handle targetHandle, Battle battle, CurrentActionSource source, const Pokedex& pokedex) { - types::registry& registry = *targetHandle.registry(); +void setActionMoveData(Simulation& simulation) { + simulation.addToEntities(); + simulation.pokedex().buildMoves(simulation.registry); +} - dex::Move move = registry.get(registry.get(battle.val).val).val; - types::entity moveEntity = - createActionMoveForTarget(targetHandle, battle.val, source.val, move, pokedex, registry.create()); +void setCurrentActionMoveSlot(types::handle handle, CurrentActionSource source, CurrentAction action) { + types::registry& registry = *handle.registry(); + const MoveName& move = registry.get(action.val); + const MoveSlots& moveSlots = registry.get(source.val); - registry.emplace(moveEntity); + types::moveSlotIndex moveSlotIndex = moveToMoveSlot(moveSlots, move.val); + handle.emplace(moveSlotIndex); } -void getMoveTargets(Simulation& simulation) { +void setMoveTargets(Simulation& simulation) { + pokesim::internal::EntityFilter battleFilter{simulation}; + if (battleFilter.hasNoneSelected()) { + return; + } + + battleFilter.view(simulation); + + battleFilter.view>(); + setActionMoveData(simulation); + simulation.removeFromEntities(); + + runModifyTarget(simulation); if (simulation.isBattleFormat(BattleFormat::DOUBLES)) { simulation .view>(); simulation .view>(); + + battleFilter.view< + setActionMoveReferenceComponents, + Tags>(); + battleFilter.view< + setActionMoveReferenceComponents, + Tags>(); + setActionMoveData(simulation); + simulation.removeFromEntities(); + simulation.removeFromEntities(); + simulation.removeFromEntities(); } - simulation.view, entt::exclude_t>(); - simulation.view< - createActionMoveForTargets, - Tags, - entt::exclude_t>(simulation.pokedex()); + battleFilter.view(); } void useMove(Simulation& simulation) { @@ -2455,7 +2532,6 @@ void useMove(Simulation& simulation) { // ModifyType runModifyMove(simulation); - getMoveTargets(simulation); runMoveHitChecks(simulation); runAfterMoveUsedEvent(simulation); } @@ -2484,8 +2560,8 @@ void runMoveAction(Simulation& simulation) { return; } - battleFilter.view(simulation); - battleFilter.view(simulation.pokedex()); + setMoveTargets(simulation); + battleFilter.view(); runBeforeMove(simulation); @@ -2648,7 +2724,7 @@ void simulateTurn(Simulation& simulation) { battleFilter.view(); battleFilter.view, entt::exclude_t>(); - simulation.addToEntities(); + simulation.addToEntities(); battleFilter.view(); using ActionsLimit = Constants::ActionQueueLength; @@ -2665,8 +2741,7 @@ void simulateTurn(Simulation& simulation) { nextTurn(simulation); - simulation - .removeFromEntities(); + simulation.removeFromEntities(); battleFilter.view(); simulation.addToEntities(); @@ -3574,102 +3649,6 @@ void SpeciesDexDataSetup::setHiddenAbility(Ability ability) { /////////////// END OF src/Pokedex/Setup/SpeciesDexDataSetup.cpp /////////////// -/////////////// START OF src/Pokedex/Setup/MoveDexDataSetup.cpp //////////////// - -namespace pokesim::dex::internal { -void MoveDexDataSetup::setName(Move move) { - handle.emplace(move); -} - -void MoveDexDataSetup::setNameTag(Move move) { - move::tags::emplaceTagFromEnum(move, handle); -} - -void MoveDexDataSetup::setType(Type type) { - handle.emplace(type); -} - -void MoveDexDataSetup::addAddedTargets(AddedTargetOptions addedTargets) { - AddedTargets& existingTargets = handle.get_or_emplace(); - existingTargets.val = existingTargets.val | addedTargets; - - switch (addedTargets) { - case AddedTargetOptions::TARGET_ALLY: { - setProperty(); - break; - } - case AddedTargetOptions::USER_ALLY: { - setProperty(); - break; - } - case AddedTargetOptions::TARGET_SIDE: { - setProperty(); - break; - } - case AddedTargetOptions::USER_SIDE: { - setProperty(); - break; - } - case AddedTargetOptions::FIELD: { - setProperty(); - break; - } - default: break; - } -} - -void MoveDexDataSetup::setAccuracy(types::baseAccuracy accuracy) { - handle.emplace(accuracy); -} - -void MoveDexDataSetup::setBasePower(types::basePower basePower) { - handle.emplace(basePower); -} - -void MoveDexDataSetup::setCategoryPhysical() { - POKESIM_REQUIRE(!(handle.any_of()), "A move can only have one category."); - setProperty(); -} - -void MoveDexDataSetup::setCategorySpecial() { - POKESIM_REQUIRE(!(handle.any_of()), "A move can only have one category."); - setProperty(); -} - -void MoveDexDataSetup::setCategoryStatus() { - POKESIM_REQUIRE(!(handle.any_of()), "A move can only have one category."); - setProperty(); -} - -void MoveDexDataSetup::setBasePp(types::pp pp) { - handle.emplace(pp); -} - -void MoveDexDataSetup::setPriority(types::priority priority) { - handle.emplace(priority); -} - -void MoveDexDataSetup::setHitCount(types::moveHits hitCount) { - handle.emplace(hitCount); -} - -void MoveDexDataSetup::setEffectTargetsMoveSource() { - POKESIM_REQUIRE( - !handle.all_of(), - "Moves effects can only affect the target or source, not both."); - handle.emplace(); -} - -void MoveDexDataSetup::setEffectTargetsMoveTarget() { - POKESIM_REQUIRE( - !handle.all_of(), - "Moves effects can only affect the source or target, not both."); - handle.emplace(); -} -} // namespace pokesim::dex::internal - -//////////////// END OF src/Pokedex/Setup/MoveDexDataSetup.cpp ///////////////// - /////////////// START OF src/Pokedex/Setup/ItemDexDataSetup.cpp //////////////// namespace pokesim::dex::internal { @@ -3774,7 +3753,7 @@ types::entity Pokedex::buildSpecies(dex::Species species, types::registry& regis namespace pokesim { namespace { -template +template struct BuildMove { private: enum class Optional : std::uint8_t { @@ -3834,229 +3813,283 @@ struct BuildMove { template struct has> : std::true_type {}; - template - static void setEffect( - dex::internal::MoveDexDataSetup& move, GameMechanics gameMechanic, const EffectValues&... effectValues) { - if constexpr (moveEffectKind == MoveEffectKind::primary) { - static_assert( - !has::value, - "Primary effects cannot have a chance to happen because they always happen if the move is successful."); - move.setPrimaryEffect(effectValues...); + struct EntitySetup { + using EntityList = entt::view>; + types::registry* registry; + const EntityList* list; + std::size_t size; + + EntitySetup(types::registry& registry_, const EntityList& list_) + : registry(®istry_), list(&list_), size(list->size_hint()) {} + + template + void add(const Component& component) { + registry->storage().reserve(size); + registry->insert(list->begin(), list->end(), component); } - else { - types::percentChance chance = Constants::MoveBaseEffectChance::DEFAULT; - if constexpr (has::value) { - chance = EffectData::chance(gameMechanic); - } - move.setSecondaryEffect(chance, effectValues...); + + template + void setProperties(Tags) { + (add(Types{}), ...); } - } - template - static void setEffectTags(dex::internal::MoveDexDataSetup& move, GameMechanics gameMechanic, Tags) { + template + bool any_of() { + return std::any_of(list->begin(), list->end(), [&](types::entity entity) { + return registry->template any_of(entity); + }); + } + }; + + template + static void buildEffect(EntitySetup& setup, GameMechanics gameMechanic) { if constexpr (moveEffectKind == MoveEffectKind::primary) { static_assert( !has::value, "Primary effects cannot have a chance to happen because they always happen if the move is successful."); - (move.setPrimaryEffect(), ...); + + POKESIM_REQUIRE( + !setup.template any_of(), + "Moves can only have primary or secondary effects, not both."); + + setup.add(move::effect::tags::Primary{}); } else { + POKESIM_REQUIRE( + !setup.template any_of(), + "Moves can only have secondary or primary effects, not both."); + types::percentChance chance = Constants::MoveBaseEffectChance::DEFAULT; if constexpr (has::value) { chance = EffectData::chance(gameMechanic); } - (move.setSecondaryEffect(chance), ...); + setup.add(move::effect::tags::Secondary{}); + setup.add(BaseEffectChance{chance}); } - } - template - static void buildEffect(dex::internal::MoveDexDataSetup& move, GameMechanics gameMechanic) { if constexpr (has::value) { - setEffect(move, gameMechanic, EffectData::atkBoost(gameMechanic)); + setup.add(AtkBoost{EffectData::atkBoost(gameMechanic)}); } if constexpr (has::value) { - setEffect(move, gameMechanic, EffectData::defBoost(gameMechanic)); + setup.add(DefBoost{EffectData::defBoost(gameMechanic)}); } if constexpr (has::value) { - setEffect(move, gameMechanic, EffectData::spaBoost(gameMechanic)); + setup.add(SpaBoost{EffectData::spaBoost(gameMechanic)}); } if constexpr (has::value) { - setEffect(move, gameMechanic, EffectData::spdBoost(gameMechanic)); + setup.add(SpdBoost{EffectData::spdBoost(gameMechanic)}); } if constexpr (has::value) { - setEffect(move, gameMechanic, EffectData::speBoost(gameMechanic)); + setup.add(SpeBoost{EffectData::speBoost(gameMechanic)}); } - setEffectTags(move, gameMechanic, EffectData::effectTags); + setup.setProperties(EffectData::effectTags); } public: - static types::entity build( - types::registry& registry, GameMechanics gameMechanic, bool forActiveMove, types::entity entityToUse) { - dex::internal::MoveDexDataSetup move(registry, entityToUse); - - if (forActiveMove) { - move.setNameTag(T::name(gameMechanic)); + static void build(types::registry& registry, GameMechanics gameMechanic) { + auto list = registry.view(); + if (list.begin() == list.end()) { + return; } - else { - move.setName(T::name(gameMechanic)); - move.setBasePp(T::basePp(gameMechanic)); + + EntitySetup setup{registry, list}; + + if (std::is_same_v) { + setup.add(MoveName{Move::name(gameMechanic)}); + setup.add(Pp{Move::basePp(gameMechanic)}); } - move.setType(T::type(gameMechanic)); - switch (T::category(gameMechanic)) { + setup.add(TypeName{Move::type(gameMechanic)}); + switch (Move::category(gameMechanic)) { case dex::MoveCategory::PHYSICAL: { - move.setCategoryPhysical(); + POKESIM_REQUIRE( + !(setup.template any_of()), + "A move can only have one category."); + + setup.add(move::tags::Physical{}); break; } case dex::MoveCategory::SPECIAL: { - move.setCategorySpecial(); + POKESIM_REQUIRE( + !(setup.template any_of()), + "A move can only have one category."); + + setup.add(move::tags::Special{}); break; } case dex::MoveCategory::STATUS: { - move.setCategoryStatus(); + POKESIM_REQUIRE( + !(setup.template any_of()), + "A move can only have one category."); + setup.add(move::tags::Status{}); break; } } - if constexpr (has::value) { - move.setAccuracy(T::accuracy(gameMechanic)); + if constexpr (has::value) { + setup.add(Accuracy{Move::accuracy(gameMechanic)}); } - if constexpr (has::value) { - move.setBasePower(T::basePower(gameMechanic)); + if constexpr (has::value) { + setup.add(BasePower{Move::basePower(gameMechanic)}); } - if constexpr (has::value) { - move.setHitCount(T::hitCount(gameMechanic)); + if constexpr (has::value) { + setup.add(HitCount{Move::hitCount(gameMechanic)}); } - if constexpr (has::value) { - buildEffect(move); - move.setEffectTargetsMoveSource(); + if constexpr (has::value) { + buildEffect(setup); + POKESIM_REQUIRE( + !(setup.template any_of()), + "Moves effects can only affect the target or source, not both."); + setup.add(move::effect::tags::MoveSource{}); } - if constexpr (has::value) { - buildEffect(move, gameMechanic); - move.setEffectTargetsMoveTarget(); + if constexpr (has::value) { + POKESIM_REQUIRE( + !(setup.template any_of()), + "Moves effects can only affect the target or source, not both."); + buildEffect(setup, gameMechanic); + setup.add(move::effect::tags::MoveTarget{}); } - if constexpr (has::value) { - buildEffect(move, gameMechanic); - move.setEffectTargetsMoveSource(); + if constexpr (has::value) { + POKESIM_REQUIRE( + !(setup.template any_of()), + "Moves effects can only affect the target or source, not both."); + buildEffect(setup, gameMechanic); + setup.add(move::effect::tags::MoveSource{}); } - if constexpr (has::value) { - buildEffect(move, gameMechanic); - move.setEffectTargetsMoveTarget(); + if constexpr (has::value) { + POKESIM_REQUIRE( + !(setup.template any_of()), + "Moves effects can only affect the target or source, not both."); + buildEffect(setup, gameMechanic); + setup.add(move::effect::tags::MoveTarget{}); } - move.setProperties(T::moveTags); + setup.setProperties(Move::moveTags); - switch (T::target(gameMechanic)) { + switch (Move::target(gameMechanic)) { case MoveTarget::ANY_SINGLE_TARGET: { - move.setProperty(); + setup.add(move::tags::AnySingleTarget{}); break; } case MoveTarget::ANY_SINGLE_FOE: { - move.setProperty(); + setup.add(move::tags::AnySingleFoe{}); break; } case MoveTarget::ANY_SINGLE_ALLY: { - move.setProperty(); + setup.add(move::tags::AnySingleAlly{}); break; } case MoveTarget::ALLY_OR_SELF: { - move.setProperty(); + setup.add(move::tags::AllyOrSelf{}); break; } case MoveTarget::SELF: { - move.setProperty(); + setup.add(move::tags::Self{}); break; } case MoveTarget::ALL_FOES: { - move.setProperty(); - move.addAddedTargets(AddedTargetOptions::TARGET_ALLY); + setup.add(move::tags::AllFoes{}); + setup.add(move::added_targets::tags::TargetAlly{}); break; } case MoveTarget::ALLIES_AND_FOES: { - move.setProperty(); - move.addAddedTargets(AddedTargetOptions::TARGET_ALLY); - move.addAddedTargets(AddedTargetOptions::USER_ALLY); + setup.add(move::tags::AlliesAndFoes{}); + setup.add(move::added_targets::tags::TargetAlly{}); + setup.add(move::added_targets::tags::UserAlly{}); break; } case MoveTarget::ALLIES_AND_SELF: { - move.setProperty(); + setup.add(move::tags::AlliesAndSelf{}); // Deliberately not USER_ALLY as the target of AlliesAndSelf moves is the user - move.addAddedTargets(AddedTargetOptions::TARGET_ALLY); + setup.add(move::added_targets::tags::TargetAlly{}); break; } case MoveTarget::FOE_SIDE: { - move.setProperty(); - move.addAddedTargets(AddedTargetOptions::TARGET_SIDE); + setup.add(move::tags::FoeSide{}); + setup.add(move::added_targets::tags::TargetSide{}); break; } case MoveTarget::ALLY_SIDE: { - move.setProperty(); - move.addAddedTargets(AddedTargetOptions::USER_SIDE); + setup.add(move::tags::AllySide{}); + setup.add(move::added_targets::tags::UserSide{}); break; } case MoveTarget::FIELD: { - move.setProperty(); - move.addAddedTargets(AddedTargetOptions::FIELD); + setup.add(move::tags::Field{}); + setup.add(move::added_targets::tags::Field{}); break; } case MoveTarget::ALLY_TEAM: { - move.setProperty(); - move.addAddedTargets(AddedTargetOptions::USER_SIDE); + setup.add(move::tags::AllyTeam{}); + setup.add(move::added_targets::tags::UserSide{}); break; } case MoveTarget::RETALIATION: { - move.setProperty(); + setup.add(move::tags::Retaliation{}); break; } case MoveTarget::RANDOM_FOE: { - move.setProperty(); + setup.add(move::tags::RandomFoe{}); break; } default: break; } - return move.entity(); + if (std::is_same_v) { + registry.remove(list.begin(), list.end()); + } } }; -types::entity buildByGameMechanic( - dex::Move move, types::registry& registry, bool forActiveMove, GameMechanics gameMechanic, - types::entity entityToUse) { - // Tidy check ignored because "using namespace" is in function - using namespace pokesim::dex; // NOLINT(google-build-using-namespace) - switch (move) { - case Move::FURY_ATTACK: return BuildMove::build(registry, gameMechanic, forActiveMove, entityToUse); - case Move::KNOCK_OFF: return BuildMove::build(registry, gameMechanic, forActiveMove, entityToUse); - case Move::MOONBLAST: return BuildMove::build(registry, gameMechanic, forActiveMove, entityToUse); - case Move::QUIVER_DANCE: return BuildMove::build(registry, gameMechanic, forActiveMove, entityToUse); - case Move::SPLASH: return BuildMove::build(registry, gameMechanic, forActiveMove, entityToUse); - case Move::THUNDERBOLT: return BuildMove::build(registry, gameMechanic, forActiveMove, entityToUse); - case Move::WILL_O_WISP: return BuildMove::build(registry, gameMechanic, forActiveMove, entityToUse); - default: break; +template +struct BuildMoves { + private: + template + static void buildActionMoveFromView(types::registry& registry, GameMechanics gameMechanics) { + BuildMove::build(registry, gameMechanics); } - POKESIM_REQUIRE_FAIL("Building a move that is not yet supported."); - return types::entity{}; -} + static void buildActionMoveByGameMechanic(types::registry& registry, GameMechanics gameMechanic) { + using namespace pokesim::dex; // NOLINT(google-build-using-namespace) + + buildActionMoveFromView(registry, gameMechanic); + buildActionMoveFromView(registry, gameMechanic); + buildActionMoveFromView(registry, gameMechanic); + buildActionMoveFromView(registry, gameMechanic); + buildActionMoveFromView(registry, gameMechanic); + buildActionMoveFromView(registry, gameMechanic); + buildActionMoveFromView(registry, gameMechanic); + } + + public: + static void build(const Pokedex& pokedex, types::registry& registry) { + if (pokedex.isGameMechanic(GameMechanics::SCARLET_VIOLET)) { + buildActionMoveByGameMechanic(registry, GameMechanics::SCARLET_VIOLET); + return; + } + + POKESIM_REQUIRE_FAIL("Building for a game that is not yet supported."); + } +}; } // namespace -types::entity Pokedex::buildMove( - dex::Move move, types::registry& registry, bool forActiveMove, types::entity entityToUse) const { - if (isGameMechanic(GameMechanics::SCARLET_VIOLET)) { - return buildByGameMechanic(move, registry, forActiveMove, GameMechanics::SCARLET_VIOLET, entityToUse); +void Pokedex::buildMoves(types::registry& registry) const { + if (!registry.view().empty()) { + BuildMoves::build(*this, registry); } - POKESIM_REQUIRE_FAIL("Building for a game that is not yet supported."); - return types::entity{}; + if (!registry.view().empty()) { + BuildMoves::build(*this, registry); + } } } // namespace pokesim @@ -4200,16 +4233,24 @@ void Pokedex::loadItems(const entt::dense_set& itemSet) { load(itemsMap, itemSet, [this](dex::Item item) { return buildItem(item, dexRegistry); }); } -void Pokedex::loadMoves(const entt::dense_set& moveSet) { - load(movesMap, moveSet, [this](dex::Move move) { return buildMove(move, dexRegistry, false, dexRegistry.create()); }); -} - void Pokedex::loadAbilities(const entt::dense_set& abilitySet) { load(abilitiesMap, abilitySet, [this](dex::Ability ability) { return buildAbility(ability, dexRegistry); }); } -types::entity Pokedex::buildActionMove(dex::Move move, types::registry& registry, types::entity entityToUse) const { - return buildMove(move, registry, true, entityToUse); +void Pokedex::loadMoves(const entt::dense_set& moveSet) { + for (dex::Move move : moveSet) { + if (movesMap.contains(move)) { + continue; + } + + types::entity moveEntity = dexRegistry.create(); + movesMap[move] = moveEntity; + move::tags::emplaceTagFromEnum(move, {dexRegistry, moveEntity}); + dexRegistry.emplace(moveEntity); + } + + buildMoves(dexRegistry); + dexRegistry.clear(); } void Pokedex::loadForBattleInfo(const std::vector& battleInfoList) { @@ -4643,14 +4684,14 @@ namespace pokesim::calc_damage { InputSetup::InputSetup(types::registry& registry, types::entity moveEntity) : handle(registry, moveEntity) {} void InputSetup::setup( - types::entity battleEntity, types::entity sourceEntity, types::entity targetEntity, dex::Move move, - const Pokedex& pokedex) { + types::entity battleEntity, types::entity sourceEntity, types::entity targetEntity, dex::Move move) { types::registry& registry = *handle.registry(); - createActionMoveForTarget({registry, targetEntity}, battleEntity, sourceEntity, move, pokedex, entity()); + setupActionMoveBuild(registry, battleEntity, sourceEntity, targetEntity, entity(), move); handle.emplace(move); handle.emplace(); + handle.emplace(); registry.emplace_or_replace(sourceEntity); registry.emplace_or_replace(targetEntity); } @@ -5391,11 +5432,25 @@ void BattleStateSetup::initBlank() { setProbability(Constants::Probability::DEFAULT); } -void BattleStateSetup::setRecycledAction(types::entity recycledAction) { +void BattleStateSetup::setRecycledAction(types::entity recycledAction, types::entity recycledActionMove) { types::registry& registry = *handle.registry(); handle.emplace(recycledAction); registry.emplace(recycledAction); + + handle.emplace(recycledActionMove); + registry.emplace(recycledActionMove); +} + +void BattleStateSetup::setAddedRecycledActionMoves( + types::entity addedRecycledActionMove1, types::entity addedRecycledActionMove2) { + types::registry& registry = *handle.registry(); + + handle.emplace(addedRecycledActionMove1); + registry.emplace(addedRecycledActionMove1); + + handle.emplace(addedRecycledActionMove2); + registry.emplace(addedRecycledActionMove2); } void BattleStateSetup::setAutoID() { @@ -5841,6 +5896,23 @@ void updateCurrentActionTargets(types::registry& registry, CurrentActionTargets& targets.val.pop_count(deleteCount); } + +template +void clearActionMoveComponents(types::registry& registry, const View& view) { + registry.remove< + tags::SimulateTurn, + tags::CalculateDamage, + tags::AnalyzeEffect, + Battle, + TypeName, + AtkBoost, + DefBoost, + SpaBoost, + SpdBoost, + SpeBoost, + status::tags::Paralysis, + status::tags::Burn>(view.begin(), view.end()); +} } // namespace void assignRootBattle(types::handle battleHandle) { @@ -5880,8 +5952,6 @@ void setCurrentActionTarget( if (pickedTarget) { battleHandle.emplace(types::targets{targetEntity}); - registry.emplace(targetEntity); - registry.emplace(targetEntity, source); } else { types::entity sourceEntity = battleHandle.get().val; @@ -5890,27 +5960,6 @@ void setCurrentActionTarget( } } -void setCurrentActionMove( - types::handle battleHandle, CurrentActionSource source, const CurrentActionTargets& targets, CurrentAction action, - const Pokedex& pokedex) { - types::registry& registry = *battleHandle.registry(); - const MoveName& move = registry.get(action.val); - const MoveSlots& moveSlots = registry.get(source.val); - - for (types::entity target : targets.val) { - createActionMoveForTarget( - {registry, target}, - battleHandle.entity(), - source.val, - move.val, - pokedex, - registry.create()); - } - - types::moveSlotIndex moveSlotIndex = moveToMoveSlot(moveSlots, move.val); - battleHandle.emplace(moveSlotIndex); -} - void setFailedActionMove( types::handle moveHandle, Battle battle, CurrentActionSource source, CurrentActionTarget target) { types::registry& registry = *moveHandle.registry(); @@ -5939,38 +5988,55 @@ void setFailedActionMove( void clearCurrentAction(Simulation& simulation) { types::registry& registry = simulation.registry; - registry.clear(); - registry.clear(); - registry.clear(); - registry.clear(); - registry.clear(); - registry.clear(); - registry.clear(); - registry.clear(); - registry.clear(); - - registry.clear(); - registry.clear(); - registry.clear(); - registry.clear(); - registry.clear(); - - auto actionMoves = registry.view(); - auto failedActionMoves = registry.view(); - auto currentActions = registry.view(); - registry.destroy(actionMoves.begin(), actionMoves.end()); - registry.destroy(failedActionMoves.begin(), failedActionMoves.end()); + registry.clear< + CurrentAction, + CurrentActionTargets, + CurrentActionSource, + CurrentActionTarget, + FailedCurrentActionSource, + FailedCurrentActionTarget, + CurrentActionMovesAsSource, + CurrentActionMovesAsTarget, + CurrentActionMoveSlot, + tags::CurrentActionMoveSource, + tags::CurrentActionMoveTarget, + tags::CurrentActionMoveSlot, + tags::CurrentMoveHit, + tags::FailedCurrentMoveHit>(); - registry.remove( - currentActions.begin(), - currentActions.end()); + registry.clear< + move::effect::tags::Primary, + move::effect::tags::Secondary, + move::effect::tags::MoveSource, + move::effect::tags::MoveTarget, + move::tags::FuryAttack, + move::tags::KnockOff, + move::tags::Moonblast, + move::tags::QuiverDance, + move::tags::Splash, + move::tags::Thunderbolt, + move::tags::WillOWisp, + move::tags::Physical, + move::tags::Special, + move::tags::Status, + move::tags::Contact, + move::tags::BypassSubstitute, + move::tags::Punch, + move::tags::VariableHitCount, + BaseEffectChance, + Accuracy, + BasePower, + HitCount, + move::tags::AccuracyDependentHitCount, + move::tags::Self, + move::tags::AnySingleTarget, + move::tags::AnySingleAlly>(); + + registry.clear(); - auto battles = simulation.battleEntities(); - registry.remove< + registry.clear< action::tags::Item, - ItemName, action::tags::Move, - MoveName, action::tags::BeforeTurn, action::tags::Dynamax, action::tags::MegaEvolve, @@ -5983,7 +6049,19 @@ void clearCurrentAction(Simulation& simulation) { action::tags::RevivalBlessing, action::tags::Switch, action::tags::SwitchOut, - action::tags::Terastallize>(battles.begin(), battles.end()); + action::tags::Terastallize>(); + + auto actionMoves = registry.view(); + auto failedActionMoves = registry.view(); + clearActionMoveComponents(registry, actionMoves); + clearActionMoveComponents(registry, failedActionMoves); + registry.clear(); + + simulation.removeFromEntities(); + registry.clear(); + + auto battles = registry.view(); + registry.remove(battles.begin(), battles.end()); } } // namespace pokesim @@ -6072,31 +6150,20 @@ types::moveSlotIndex moveToMoveSlot(const MoveSlots& moveSlots, dex::Move move) return 0U; } -types::entity createActionMoveForTarget( - types::handle targetHandle, types::entity battleEntity, types::entity sourceEntity, dex::Move move, - const Pokedex& pokedex, types::entity entityToUse) { - types::registry& registry = *targetHandle.registry(); - types::entity moveEntity = pokedex.buildActionMove(move, registry, entityToUse); - - registry.emplace(moveEntity); - registry.emplace(moveEntity, battleEntity); - registry.emplace(moveEntity, sourceEntity); - registry.emplace(moveEntity, targetHandle.entity()); +void setupActionMoveBuild( + types::registry& registry, types::entity battleEntity, types::entity sourceEntity, types::entity targetEntity, + types::entity actionMoveEntity, dex::Move move) { + types::handle actionMoveHandle{registry, actionMoveEntity}; - targetHandle.get_or_emplace().val.push_back(moveEntity); - registry.get_or_emplace(sourceEntity).val.push_back(moveEntity); + move::tags::emplaceTagFromEnum(move, actionMoveHandle); + actionMoveHandle.emplace(battleEntity); + actionMoveHandle.emplace(sourceEntity); + actionMoveHandle.emplace(targetEntity); + actionMoveHandle.emplace(); + actionMoveHandle.emplace(); - if (registry.all_of(battleEntity)) { - registry.emplace(moveEntity); - } - if (registry.all_of(battleEntity)) { - registry.emplace(moveEntity); - } - if (registry.all_of(battleEntity)) { - registry.emplace(moveEntity); - } - - return moveEntity; + registry.get_or_emplace(targetEntity).val.push_back(actionMoveEntity); + registry.get_or_emplace(sourceEntity).val.push_back(actionMoveEntity); } } // namespace pokesim @@ -6137,8 +6204,16 @@ void traverseBattle(types::registry& registry, VisitEntity visitEntity = nullptr } } - for (const auto [entity, recycledAction] : registry.view().each()) { + for (const auto [entity, recycledAction, recycledActionMove] : + registry.view().each()) { registry.emplace(recycledAction.val); + registry.emplace(recycledActionMove.val); + } + + for (const auto [entity, addedRecycledActionMove1, addedRecycledActionMove2] : + registry.view().each()) { + registry.emplace(addedRecycledActionMove1.val); + registry.emplace(addedRecycledActionMove2.val); } } @@ -6168,15 +6243,21 @@ void traverseAction(types::registry& registry, VisitEntity visitEntity = nullptr visitEntity(entity); } } -} -template -void traverseCurrentActionMove(types::registry& registry, VisitEntity visitEntity = nullptr) { - const static bool ForCloning = !std::is_same_v; - using Tag = std::conditional_t; + for (types::entity entity : registry.view()) { + if constexpr (ForCloning) { + visitEntity(entity); + } + } - if constexpr (ForCloning) { - for (types::entity entity : registry.view()) { + for (types::entity entity : registry.view()) { + if constexpr (ForCloning) { + visitEntity(entity); + } + } + + for (types::entity entity : registry.view()) { + if constexpr (ForCloning) { visitEntity(entity); } } @@ -6230,14 +6311,6 @@ void cloneAction( }); } -void cloneCurrentActionMove( - types::registry& registry, types::ClonedEntityMap& entityMap, - entt::dense_map& srcEntityStorages, types::entityIndex cloneCount) { - traverseCurrentActionMove(registry, [&](types::entity entity) { - cloneEntity(entity, registry, entityMap, srcEntityStorages, cloneCount); - }); -} - void clonePokemon( types::registry& registry, types::ClonedEntityMap& entityMap, entt::dense_map& srcEntityStorages, types::entityIndex cloneCount) { @@ -6258,10 +6331,6 @@ void deleteAction(types::registry& registry) { traverseAction(registry); } -void deleteCurrentActionMove(types::registry& registry) { - traverseCurrentActionMove(registry); -} - void deletePokemon(types::registry& registry) { traversePokemon(registry); } @@ -6315,7 +6384,6 @@ types::ClonedEntityMap clone(types::registry& registry, std::optional(registry, entityMap); + remapComponentEntities(registry, entityMap); remapComponentEntities(registry, entityMap); remapComponentEntities(registry, entityMap); remapComponentEntities(registry, entityMap); remapComponentEntities(registry, entityMap); remapComponentEntities(registry, entityMap); remapComponentEntities(registry, entityMap); - remapComponentEntities(registry, entityMap); - remapComponentEntities(registry, entityMap); remapComponentEntities(registry, entityMap); - remapComponentEntities(registry, entityMap); - remapComponentEntities(registry, entityMap); remapComponentEntities(registry, entityMap); remapComponentEntities(registry, entityMap); + remapComponentEntities(registry, entityMap); + remapComponentEntities(registry, entityMap); + remapComponentEntities(registry, entityMap); + remapComponentEntities(registry, entityMap); remapComponentEntities(registry, entityMap); remapComponentEntities(registry, entityMap); remapComponentEntities(registry, entityMap); remapComponentEntities(registry, entityMap); + remapComponentEntities(registry, entityMap); remapComponentEntities(registry, entityMap); remapComponentEntities(registry, entityMap); remapComponentEntities(registry, entityMap); @@ -6387,7 +6458,6 @@ void deleteClones(types::registry& registry) { deleteSide(registry); deleteAction(registry); deletePokemon(registry); - deleteCurrentActionMove(registry); auto remove = registry.view(); registry.destroy(remove.begin(), remove.end()); } @@ -6710,16 +6780,14 @@ void ignoreBattlesWithEffectActive(Simulation& simulation) { types::entity createAnalyzeEffectMove( types::registry& registry, dex::Move move, types::entity battleEntity, types::entity attackerEntity, - types::entity defenderEntity, const Pokedex& pokedex) { - types::entity moveEntity = createActionMoveForTarget( - {registry, defenderEntity}, - battleEntity, - attackerEntity, - move, - pokedex, - registry.create()); + types::entity defenderEntity) { + types::entity moveEntity = registry.create(); + + setupActionMoveBuild(registry, battleEntity, attackerEntity, defenderEntity, moveEntity, move); + registry.emplace(moveEntity, move); registry.emplace(moveEntity); + registry.emplace(moveEntity); registry.emplace_or_replace(attackerEntity); registry.emplace_or_replace(defenderEntity); @@ -6727,22 +6795,20 @@ types::entity createAnalyzeEffectMove( } void createOneCalculationMovePair( - types::handle inputHandle, Battle battle, EffectMove move, Attacker attacker, Defender defender, - const Pokedex& pokedex) { + types::handle inputHandle, Battle battle, EffectMove move, Attacker attacker, Defender defender) { entt::entity moveEntity = - createAnalyzeEffectMove(*inputHandle.registry(), move.val, battle.val, attacker.val, defender.val, pokedex); + createAnalyzeEffectMove(*inputHandle.registry(), move.val, battle.val, attacker.val, defender.val); inputHandle.emplace(moveEntity, moveEntity); } void createTwoCalculationsMovePair( types::handle inputHandle, Battle battle, EffectMove move, Attacker attacker, Defender defender, - const OriginalInputEntities& originals, const Pokedex& pokedex) { + const OriginalInputEntities& originals) { types::registry& registry = *inputHandle.registry(); entt::entity originalEntity = - createAnalyzeEffectMove(registry, move.val, originals.battle, originals.attacker, originals.defender, pokedex); - entt::entity copyEntity = - createAnalyzeEffectMove(registry, move.val, battle.val, attacker.val, defender.val, pokedex); + createAnalyzeEffectMove(registry, move.val, originals.battle, originals.attacker, originals.defender); + entt::entity copyEntity = createAnalyzeEffectMove(registry, move.val, battle.val, attacker.val, defender.val); // All active pokemon in should have their stats refreshed in doubles for moves like Beat Up which rely on the stats // of Pokemon outside of the attacker and defender @@ -6856,9 +6922,10 @@ void createAppliedEffectBattles(Simulation& simulation) { } } - simulation.view, entt::exclude_t>( - simulation.pokedex()); - simulation.view(simulation.pokedex()); + simulation.view, entt::exclude_t>(); + simulation.view(); + simulation.pokedex().buildMoves(simulation.registry); + simulation.registry.clear(); } void applyPseudoWeatherEffect(types::handle, Battle, PseudoWeatherName) {} diff --git a/extras/PokeSim.hpp b/extras/PokeSim.hpp index 8ca2e2e..55a0bef 100644 --- a/extras/PokeSim.hpp +++ b/extras/PokeSim.hpp @@ -250,7 +250,6 @@ * src/SimulateTurn/CalcDamageSpecifics.hpp * src/Pokedex/Setup/DexDataSetup.hpp * src/Pokedex/Setup/SpeciesDexDataSetup.hpp - * src/Pokedex/Setup/MoveDexDataSetup.hpp * src/Pokedex/Setup/ItemDexDataSetup.hpp * src/Pokedex/Species/Ampharos.hpp * src/Pokedex/Species/Dragapult.hpp @@ -19012,6 +19011,18 @@ namespace pokesim { struct RecycledAction { types::entity val{}; }; + +struct RecycledActionMove { + types::entity val{}; +}; + +struct AddedRecycledActionMove1 { + types::entity val{}; +}; + +struct AddedRecycledActionMove2 { + types::entity val{}; +}; } // namespace pokesim /////////// END OF src/Components/EntityHolders/RecycledEntities.hpp /////////// @@ -19958,6 +19969,9 @@ struct CanSetStatus {}; namespace pokesim::tags { struct RecycledAction {}; +struct RecycledActionMove {}; +struct AddedRecycledActionMove1 {}; +struct AddedRecycledActionMove2 {}; } // namespace pokesim::tags /////////////// END OF src/Components/Tags/RecycledEntities.hpp //////////////// @@ -19974,6 +19988,8 @@ struct EndItem {}; ////////////////// START OF src/Components/Tags/Selection.hpp ////////////////// namespace pokesim::internal::tags { +struct BuildPokedexMove {}; +struct BuildActionMove {}; struct CloneFromDamageRolls {}; struct ApplySideDamageRollOptions {}; } // namespace pokesim::internal::tags @@ -20457,6 +20473,9 @@ struct FaintQueue; struct FoeSide; struct Pokemon; struct RecycledAction; +struct RecycledActionMove; +struct AddedRecycledActionMove1; +struct AddedRecycledActionMove2; struct Side; struct Sides; struct Team; @@ -20728,6 +20747,15 @@ void check(const Pokemon&, const types::registry&); template <> void check(const RecycledAction&, const types::registry&); +template <> +void check(const RecycledActionMove&, const types::registry&); + +template <> +void check(const AddedRecycledActionMove1&, const types::registry&); + +template <> +void check(const AddedRecycledActionMove2&, const types::registry&); + template <> void check(const Side&, const types::registry&); @@ -21386,9 +21414,9 @@ types::entity slotToPokemonEntity(const types::registry& registry, const Sides& types::entity slotToAllyPokemonEntity(const types::registry& registry, const Sides& sides, Slot targetSlot); types::moveSlotIndex moveToMoveSlot(const MoveSlots& moveSlots, dex::Move move); -types::entity createActionMoveForTarget( - types::handle targetHandle, types::entity battleEntity, types::entity sourceEntity, dex::Move move, - const Pokedex& pokedex, types::entity entityToUse); +void setupActionMoveBuild( + types::registry& registry, types::entity battleEntity, types::entity sourceEntity, types::entity targetEntity, + types::entity actionMoveEntity, dex::Move move); } // namespace pokesim //////////////////// END OF src/Battle/Helpers/Helpers.hpp ///////////////////// @@ -21521,7 +21549,8 @@ struct BattleStateSetup : internal::StateSetupBase { */ void initBlank(); - void setRecycledAction(types::entity recycledAction); + void setRecycledAction(types::entity recycledAction, types::entity recycledActionMove); + void setAddedRecycledActionMoves(types::entity addedRecycledActionMove1, types::entity addedRecycledActionMove2); void setAutoID(); void setID(types::stateId id); void setSide(types::entity sideEntity); @@ -21612,9 +21641,7 @@ struct InputSetup { public: InputSetup(types::registry& registry, types::entity moveEntity); - void setup( - types::entity battleEntity, types::entity sourceEntity, types::entity targetEntity, dex::Move move, - const Pokedex& pokedex); + void setup(types::entity battleEntity, types::entity sourceEntity, types::entity targetEntity, dex::Move move); types::entity entity() const { return handle.entity(); } }; @@ -21903,8 +21930,6 @@ class Pokedex { void load(entt::dense_map& map, const entt::dense_set& list, Build build); types::entity buildSpecies(dex::Species species, types::registry& registry) const; - types::entity buildMove( - dex::Move move, types::registry& registry, bool forActiveMove, types::entity entityToUse) const; types::entity buildItem(dex::Item item, types::registry& registry) const; types::entity buildAbility(dex::Ability ability, types::registry& registry) const; @@ -22090,7 +22115,7 @@ class Pokedex { return dexRegistry.all_of(movesMap.at(move)); } - types::entity buildActionMove(dex::Move move, types::registry& registry, types::entity entityToUse) const; + void buildMoves(types::registry& registry) const; void loadForBattleInfo(const std::vector& battleInfoList); }; } // namespace pokesim @@ -24199,6 +24224,7 @@ void runTryBoostEvent(Simulation& simulation); template void runAfterEachBoostEvent(Simulation& simulation); void runAfterBoostEvent(Simulation& simulation); +void runModifyTarget(Simulation& simulation); // onModifyMove for Curse and Expanding force should go here void runModifyMove(Simulation& simulation); void runDisableMove(Simulation& simulation); @@ -24243,9 +24269,6 @@ void setCurrentActionSource(types::handle battleHandle, const Sides& sides, Curr void setCurrentActionTarget( types::handle battleHandle, const Sides& sides, CurrentAction action, CurrentActionSource source, const Simulation& simulation); -void setCurrentActionMove( - types::handle battleHandle, CurrentActionSource source, const CurrentActionTargets& targets, CurrentAction action, - const Pokedex& pokedex); void setFailedActionMove( types::handle moveHandle, Battle battle, CurrentActionSource source, CurrentActionTarget target); void clearCurrentAction(Simulation& simulation); @@ -24719,54 +24742,6 @@ struct SpeciesDexDataSetup : DexDataSetup { /////////////// END OF src/Pokedex/Setup/SpeciesDexDataSetup.hpp /////////////// -/////////////// START OF src/Pokedex/Setup/MoveDexDataSetup.hpp //////////////// - -namespace pokesim::dex::internal { -struct MoveDexDataSetup : DexDataSetup { - MoveDexDataSetup(types::registry& registry, types::entity entity) : DexDataSetup(registry, entity) {} - - void setName(Move move); - void setNameTag(Move move); - void setType(Type type); - void setAccuracy(types::baseAccuracy accuracy); - void setBasePower(types::basePower basePower); - - void setCategoryPhysical(); - void setCategorySpecial(); - void setCategoryStatus(); - - void setBasePp(types::pp pp); - void setPriority(types::priority priority); - void setHitCount(types::moveHits hitCount); - - void addAddedTargets(AddedTargetOptions addedTargets); - - void setEffectTargetsMoveSource(); - void setEffectTargetsMoveTarget(); - - template - void setPrimaryEffect(const EffectValues&... effectValues) { - POKESIM_REQUIRE( - !handle.all_of(), - "Moves can only have primary or secondary effects, not both."); - handle.emplace_or_replace(); - handle.emplace(effectValues...); - } - - template - void setSecondaryEffect(types::percentChance chance, const EffectValues&... effectValues) { - POKESIM_REQUIRE( - !handle.all_of(), - "Moves can only have secondary or primary effects, not both."); - handle.emplace_or_replace(); - handle.emplace(effectValues...); - handle.emplace(chance); - } -}; -} // namespace pokesim::dex::internal - -//////////////// END OF src/Pokedex/Setup/MoveDexDataSetup.hpp ///////////////// - /////////////// START OF src/Pokedex/Setup/ItemDexDataSetup.hpp //////////////// namespace pokesim::dex::internal { diff --git a/extras/RecentBenchmarkResults.md b/extras/RecentBenchmarkResults.md index ae0ccec..71e713b 100644 --- a/extras/RecentBenchmarkResults.md +++ b/extras/RecentBenchmarkResults.md @@ -7,311 +7,311 @@ ## SV-SingleBattle-MonteCarlo-SimulateTurn-VerticalSlice1 | Inputs | Samples | Iterations / Sample | Estimated Completion Time | Mean of Samples | Standard Deviation | Mean / Input Count | Mean Lower Bound / Input Count | Mean Upper Bound / Input Count | | --- | --- | --- | --- | --- | --- | --- | --- | --- | -| 1 | 100 | 1 | 40.903200ms | 64.751060us | 13.241984us | 64.751060us | 63.049000us | 69.326680us | -| 2 | 100 | 1 | 45.237200ms | 72.316250us | 11.156965us | 36.158125us | 35.372805us | 37.843155us | -| 4 | 100 | 1 | 45.094700ms | 80.899330us | 15.447007us | 20.224833us | 19.685545us | 21.390310us | -| 8 | 100 | 1 | 47.835100ms | 97.569600us | 14.229048us | 12.196200us | 11.914257us | 12.647726us | -| 16 | 100 | 1 | 51.849600ms | 127.422290us | 13.618114us | 7.963893us | 7.834408us | 8.189355us | -| 32 | 100 | 1 | 58.071700ms | 178.688950us | 13.828511us | 5.584030us | 5.523486us | 5.714057us | -| 64 | 100 | 1 | 70.624300ms | 278.118320us | 13.761318us | 4.345599us | 4.313814us | 4.404643us | -| 128 | 100 | 1 | 91.227300ms | 464.601060us | 13.701615us | 3.629696us | 3.614032us | 3.659708us | -| 256 | 100 | 1 | 130.319400ms | 835.676500us | 13.347904us | 3.264361us | 3.257545us | 3.282041us | -| 512 | 100 | 1 | 210.583900ms | 1.574808ms | 21.690614us | 3.075797us | 3.068069us | 3.084801us | -| 1024 | 100 | 1 | 374.280300ms | 3.029757ms | 38.298986us | 2.958747us | 2.952332us | 2.967172us | -| 2048 | 100 | 1 | 680.023500ms | 5.888828ms | 55.708698us | 2.875404us | 2.870706us | 2.881498us | -| 4096 | 100 | 1 | 1262.550700ms | 11.672139ms | 83.383478us | 2.849643us | 2.845998us | 2.854012us | -| 8192 | 100 | 1 | 2574.567700ms | 23.469941ms | 263.903903us | 2.864983us | 2.859214us | 2.871812us | -| 16384 | 100 | 1 | 5120.421200ms | 47.895666ms | 1.058383ms | 2.923319us | 2.911579us | 2.937005us | -| 32768 | 100 | 1 | 10381.218800ms | 98.949863ms | 2.219354ms | 3.019710us | 3.007257us | 3.033865us | -| 65536 | 100 | 1 | 19693.915600ms | 198.909506ms | 2.398974ms | 3.035118us | 3.028720us | 3.043228us | +| 1 | 100 | 1 | 43.381900ms | 63.417550us | 12.817032us | 63.417550us | 61.717240us | 67.683650us | +| 2 | 100 | 1 | 44.497800ms | 70.374910us | 14.399336us | 35.187455us | 34.237415us | 37.614045us | +| 4 | 100 | 1 | 44.797500ms | 78.332580us | 15.879060us | 19.583145us | 19.014033us | 20.743215us | +| 8 | 100 | 1 | 47.529200ms | 90.995550us | 13.920075us | 11.374444us | 11.120759us | 11.864353us | +| 16 | 100 | 1 | 51.556000ms | 117.265460us | 16.781695us | 7.329091us | 7.179881us | 7.641741us | +| 32 | 100 | 1 | 57.162700ms | 161.205750us | 13.231306us | 5.037680us | 4.984249us | 5.179010us | +| 64 | 100 | 1 | 65.824800ms | 244.118350us | 13.013730us | 3.814349us | 3.788056us | 3.885549us | +| 128 | 100 | 1 | 83.877900ms | 406.880530us | 12.961477us | 3.178754us | 3.164539us | 3.208747us | +| 256 | 100 | 1 | 92.631100ms | 730.921030us | 15.071236us | 2.855160us | 2.846282us | 2.871166us | +| 512 | 100 | 1 | 164.067900ms | 1.362391ms | 15.303680us | 2.660920us | 2.655922us | 2.667878us | +| 1024 | 100 | 1 | 271.740400ms | 2.651165ms | 28.652598us | 2.589028us | 2.583687us | 2.594703us | +| 2048 | 100 | 1 | 528.744500ms | 5.239759ms | 42.181872us | 2.558476us | 2.554594us | 2.562661us | +| 4096 | 100 | 1 | 1043.827100ms | 10.409944ms | 96.274773us | 2.541490us | 2.537023us | 2.546249us | +| 8192 | 100 | 1 | 2093.676800ms | 20.745960ms | 185.374837us | 2.532466us | 2.528229us | 2.537086us | +| 16384 | 100 | 1 | 4191.933900ms | 41.881316ms | 361.209030us | 2.556233us | 2.552013us | 2.560656us | +| 32768 | 100 | 1 | 8551.309100ms | 84.488597ms | 723.208438us | 2.578387us | 2.574386us | 2.583017us | +| 65536 | 100 | 1 | 17072.208700ms | 171.459211ms | 1.188298ms | 2.616260us | 2.613041us | 2.620199us | ## SV-SingleBattle-Branching-SimulateTurn-VerticalSlice1 | Inputs | Samples | Iterations / Sample | Estimated Completion Time | Mean of Samples | Standard Deviation | Mean / Input Count | Mean Lower Bound / Input Count | Mean Upper Bound / Input Count | | --- | --- | --- | --- | --- | --- | --- | --- | --- | -| 1 | 100 | 1 | 54.876100ms | 178.060010us | 18.297629us | 178.060010us | 175.504470us | 183.602810us | -| 2 | 100 | 1 | 61.212300ms | 240.747730us | 18.058466us | 120.373865us | 119.218120us | 123.562200us | -| 4 | 100 | 1 | 40.969700ms | 334.056780us | 17.099022us | 83.514195us | 82.959510us | 84.990498us | -| 8 | 100 | 1 | 62.925500ms | 535.426650us | 19.497477us | 66.928331us | 66.578646us | 67.631049us | -| 16 | 100 | 1 | 99.996700ms | 871.374080us | 13.429445us | 54.460880us | 54.344639us | 54.716677us | -| 32 | 100 | 1 | 179.602000ms | 1.580655ms | 42.652504us | 49.395474us | 49.205611us | 49.785527us | -| 64 | 100 | 1 | 323.860000ms | 2.890642ms | 26.003167us | 45.166286us | 45.092701us | 45.252870us | -| 128 | 100 | 1 | 604.189700ms | 5.547036ms | 62.952408us | 43.336218us | 43.246940us | 43.442205us | -| 256 | 100 | 1 | 1156.321800ms | 10.896404ms | 179.564399us | 42.564077us | 42.438766us | 42.714605us | -| 512 | 100 | 1 | 2245.077000ms | 21.023029ms | 234.599486us | 41.060603us | 40.975254us | 41.154729us | -| 1024 | 100 | 1 | 4390.414100ms | 42.083377ms | 1.616417ms | 41.097047us | 40.822062us | 41.452568us | -| 2048 | 100 | 1 | 8363.678300ms | 83.998484ms | 2.794153ms | 41.014885us | 40.760579us | 41.296157us | -| 4096 | 100 | 1 | 16511.960600ms | 172.357422ms | 6.168278ms | 42.079449us | 41.796149us | 42.385056us | -| 8192 | 100 | 1 | 36920.882700ms | 355.223040ms | 3.635322ms | 43.362187us | 43.277478us | 43.451938us | +| 1 | 100 | 1 | 60.789300ms | 178.255930us | 18.008754us | 178.255930us | 176.058420us | 185.400650us | +| 2 | 100 | 1 | 66.433500ms | 235.892970us | 14.757494us | 117.946485us | 116.952050us | 120.348745us | +| 4 | 100 | 1 | 46.285100ms | 340.366630us | 20.309748us | 85.091657us | 84.434012us | 86.834990us | +| 8 | 100 | 1 | 62.698700ms | 532.518370us | 13.484854us | 66.564796us | 66.355913us | 67.193173us | +| 16 | 100 | 1 | 100.788800ms | 888.207060us | 15.142385us | 55.512941us | 55.383358us | 55.807822us | +| 32 | 100 | 1 | 175.353100ms | 1.598046ms | 16.252428us | 49.938928us | 49.849579us | 50.052531us | +| 64 | 100 | 1 | 323.492300ms | 2.950534ms | 28.345774us | 46.102089us | 46.017768us | 46.190412us | +| 128 | 100 | 1 | 625.015600ms | 5.640892ms | 59.804657us | 44.069472us | 43.982858us | 44.167469us | +| 256 | 100 | 1 | 1193.612600ms | 11.085049ms | 144.559831us | 43.300972us | 43.200696us | 43.424172us | +| 512 | 100 | 1 | 2312.156500ms | 21.620416ms | 310.103580us | 42.227376us | 42.116649us | 42.354801us | +| 1024 | 100 | 1 | 4402.386100ms | 42.803413ms | 905.954952us | 41.800208us | 41.632900us | 41.982244us | +| 2048 | 100 | 1 | 8644.022200ms | 86.135049ms | 1.533156ms | 42.058129us | 41.922359us | 42.215999us | +| 4096 | 100 | 1 | 17572.836400ms | 176.689001ms | 1.765788ms | 43.136963us | 43.061451us | 43.231110us | +| 8192 | 100 | 1 | 36396.212000ms | 364.126864ms | 1.951395ms | 44.449080us | 44.405619us | 44.499236us | ## SV-DoubleBattle-MonteCarlo-SimulateTurn-VerticalSlice1 | Inputs | Samples | Iterations / Sample | Estimated Completion Time | Mean of Samples | Standard Deviation | Mean / Input Count | Mean Lower Bound / Input Count | Mean Upper Bound / Input Count | | --- | --- | --- | --- | --- | --- | --- | --- | --- | -| 1 | 100 | 1 | 28.714100ms | 104.962920us | 17.976222us | 104.962920us | 102.619560us | 111.165180us | -| 2 | 100 | 1 | 28.330000ms | 124.763580us | 17.802285us | 62.381790us | 61.104500us | 64.947675us | -| 4 | 100 | 1 | 31.304500ms | 142.444740us | 19.905823us | 35.611185us | 34.924790us | 37.139990us | -| 8 | 100 | 1 | 35.143600ms | 175.177470us | 21.779799us | 21.897184us | 21.500566us | 22.678090us | -| 16 | 100 | 1 | 43.965900ms | 234.615280us | 20.592746us | 14.663455us | 14.480136us | 15.040287us | -| 32 | 100 | 1 | 43.517100ms | 335.970680us | 20.827929us | 10.499084us | 10.411548us | 10.710001us | -| 64 | 100 | 1 | 63.162400ms | 523.573160us | 19.988761us | 8.180831us | 8.136326us | 8.272197us | -| 128 | 100 | 1 | 101.953900ms | 891.204950us | 19.527180us | 6.962539us | 6.943172us | 7.016514us | -| 256 | 100 | 1 | 175.450200ms | 1.614418ms | 23.802991us | 6.306319us | 6.290794us | 6.328034us | -| 512 | 100 | 1 | 307.457500ms | 2.961867ms | 27.131545us | 5.784896us | 5.775647us | 5.796738us | -| 1024 | 100 | 1 | 593.358200ms | 5.759731ms | 40.329104us | 5.624737us | 5.618009us | 5.633844us | -| 2048 | 100 | 1 | 1149.987400ms | 11.355884ms | 108.724955us | 5.544865us | 5.537200us | 5.560191us | -| 4096 | 100 | 1 | 2281.714100ms | 22.848709ms | 324.189398us | 5.578298us | 5.564264us | 5.595358us | -| 8192 | 100 | 1 | 4593.361700ms | 45.899082ms | 524.694253us | 5.602915us | 5.592407us | 5.618191us | -| 16384 | 100 | 1 | 9304.722600ms | 93.805094ms | 1.106791ms | 5.725409us | 5.713964us | 5.740917us | -| 32768 | 100 | 1 | 19726.165200ms | 196.523386ms | 2.145987ms | 5.997418us | 5.986755us | 6.013291us | -| 65536 | 100 | 1 | 41235.629100ms | 410.906460ms | 2.312439ms | 6.269935us | 6.263185us | 6.277056us | +| 1 | 100 | 1 | 56.227500ms | 97.929180us | 16.991819us | 97.929180us | 95.568320us | 103.177750us | +| 2 | 100 | 1 | 57.634000ms | 108.533160us | 18.172834us | 54.266580us | 52.971730us | 56.929900us | +| 4 | 100 | 1 | 60.893900ms | 127.336220us | 28.322764us | 31.834055us | 30.808467us | 33.856890us | +| 8 | 100 | 1 | 62.496600ms | 148.829430us | 23.740940us | 18.603679us | 18.169814us | 19.443205us | +| 16 | 100 | 1 | 40.416300ms | 191.450380us | 13.904993us | 11.965649us | 11.861500us | 12.310057us | +| 32 | 100 | 1 | 51.338700ms | 288.499740us | 26.719532us | 9.015617us | 8.902575us | 9.277624us | +| 64 | 100 | 1 | 67.905500ms | 430.153450us | 12.426516us | 6.721148us | 6.693788us | 6.779708us | +| 128 | 100 | 1 | 83.713500ms | 746.734900us | 16.076640us | 5.833866us | 5.811229us | 5.860574us | +| 256 | 100 | 1 | 142.792800ms | 1.339796ms | 24.874331us | 5.233577us | 5.219982us | 5.262930us | +| 512 | 100 | 1 | 262.341600ms | 2.542657ms | 33.052700us | 4.966128us | 4.954136us | 4.979625us | +| 1024 | 100 | 1 | 511.444500ms | 4.955431ms | 61.473689us | 4.839288us | 4.828513us | 4.852362us | +| 2048 | 100 | 1 | 986.649900ms | 9.810576ms | 115.151561us | 4.790320us | 4.780336us | 4.802513us | +| 4096 | 100 | 1 | 1954.020400ms | 19.450265ms | 187.967994us | 4.748600us | 4.740145us | 4.758288us | +| 8192 | 100 | 1 | 3915.753400ms | 39.185225ms | 390.407078us | 4.783353us | 4.774407us | 4.793154us | +| 16384 | 100 | 1 | 7869.706900ms | 79.138612ms | 748.600593us | 4.830238us | 4.822304us | 4.840378us | +| 32768 | 100 | 1 | 16377.208600ms | 163.022287ms | 1.606141ms | 4.975045us | 4.966346us | 4.985738us | +| 65536 | 100 | 1 | 33682.688600ms | 336.932238ms | 1.525740ms | 5.141178us | 5.137039us | 5.146296us | ## SV-DoubleBattle-Branching-SimulateTurn-VerticalSlice1 | Inputs | Samples | Iterations / Sample | Estimated Completion Time | Mean of Samples | Standard Deviation | Mean / Input Count | Mean Lower Bound / Input Count | Mean Upper Bound / Input Count | | --- | --- | --- | --- | --- | --- | --- | --- | --- | -| 1 | 100 | 1 | 66.107800ms | 414.453330us | 22.076304us | 414.453330us | 411.570610us | 421.868570us | -| 2 | 100 | 1 | 72.516700ms | 596.884860us | 23.728353us | 298.442430us | 296.850895us | 302.242510us | -| 4 | 100 | 1 | 106.483600ms | 931.619440us | 23.539098us | 232.904860us | 232.170675us | 235.068085us | -| 8 | 100 | 1 | 174.365900ms | 1.560650ms | 29.308653us | 195.081228us | 194.592926us | 196.282676us | -| 16 | 100 | 1 | 296.685700ms | 2.745969ms | 23.842508us | 171.623037us | 171.370258us | 171.966436us | -| 32 | 100 | 1 | 553.397600ms | 5.127264ms | 55.466924us | 160.227011us | 159.938888us | 160.635965us | -| 64 | 100 | 1 | 1058.857500ms | 9.796736ms | 150.399620us | 153.073994us | 152.688278us | 153.636452us | -| 128 | 100 | 1 | 2054.461900ms | 19.276304ms | 434.636215us | 150.596128us | 149.995849us | 151.338990us | -| 256 | 100 | 1 | 3971.174800ms | 39.845045ms | 921.014433us | 155.644707us | 154.981378us | 156.391337us | -| 512 | 100 | 1 | 8060.438100ms | 81.597698ms | 1.784055ms | 159.370504us | 158.707895us | 160.074355us | -| 1024 | 100 | 1 | 15399.390700ms | 154.391869ms | 1.296459ms | 150.773309us | 150.539930us | 151.039045us | -| 2048 | 100 | 1 | 30595.439800ms | 309.195853ms | 2.499777ms | 150.974538us | 150.744970us | 151.225287us | -| 4096 | 100 | 1 | 61344.375600ms | 616.948103ms | 3.268078ms | 150.622096us | 150.470065us | 150.782217us | +| 1 | 100 | 1 | 69.785400ms | 421.807180us | 17.402421us | 421.807180us | 419.754730us | 428.921790us | +| 2 | 100 | 1 | 78.139000ms | 635.735740us | 21.228702us | 317.867870us | 316.462565us | 321.367850us | +| 4 | 100 | 1 | 120.824400ms | 1.000890ms | 19.017028us | 250.222582us | 249.564047us | 251.677190us | +| 8 | 100 | 1 | 188.858900ms | 1.694148ms | 21.253690us | 211.768501us | 211.293539us | 212.357116us | +| 16 | 100 | 1 | 324.176000ms | 2.998626ms | 31.062360us | 187.414148us | 187.064984us | 187.830516us | +| 32 | 100 | 1 | 611.593500ms | 5.651887ms | 72.840952us | 176.621466us | 176.214572us | 177.112176us | +| 64 | 100 | 1 | 1187.149800ms | 10.790684ms | 122.511621us | 168.604433us | 168.255948us | 169.011043us | +| 128 | 100 | 1 | 2253.315600ms | 21.205899ms | 551.510914us | 165.671089us | 165.015220us | 166.814178us | +| 256 | 100 | 1 | 4419.050200ms | 42.295507ms | 1.218220ms | 165.216823us | 164.395334us | 166.276540us | +| 512 | 100 | 1 | 8490.986700ms | 83.831534ms | 1.727556ms | 163.733465us | 163.122637us | 164.453968us | +| 1024 | 100 | 1 | 16977.077400ms | 169.280030ms | 1.637682ms | 165.312529us | 165.023158us | 165.653488us | +| 2048 | 100 | 1 | 33418.257200ms | 337.639636ms | 2.276157ms | 164.863103us | 164.661824us | 165.099274us | +| 4096 | 100 | 1 | 68280.679000ms | 680.907739ms | 2.797624ms | 166.237241us | 166.109517us | 166.378642us | ## SV-SingleBattle-CalcDamage-VerticalSlice1 | Inputs | Samples | Iterations / Sample | Estimated Completion Time | Mean of Samples | Standard Deviation | Mean / Input Count | Mean Lower Bound / Input Count | Mean Upper Bound / Input Count | | --- | --- | --- | --- | --- | --- | --- | --- | --- | -| 1 | 100 | 1 | 7.960500ms | 10.779060us | 4.071041us | 10.779060us | 10.218340us | 12.052920us | -| 2 | 100 | 1 | 8.020200ms | 11.746130us | 3.946778us | 5.873065us | 5.596080us | 6.466380us | -| 4 | 100 | 1 | 8.286400ms | 12.223240us | 5.013278us | 3.055810us | 2.879605us | 3.430340us | -| 8 | 100 | 1 | 8.434300ms | 13.710250us | 4.823369us | 1.713781us | 1.630554us | 1.904230us | -| 16 | 100 | 1 | 9.001300ms | 16.936540us | 3.448016us | 1.058534us | 1.027827us | 1.121935us | -| 32 | 100 | 1 | 9.814400ms | 23.766000us | 5.205762us | 742.687500ns | 721.337188ns | 799.110625ns | -| 64 | 100 | 1 | 11.143900ms | 35.588780us | 3.978393us | 556.074687ns | 547.390156ns | 574.955938ns | -| 128 | 100 | 1 | 13.752600ms | 58.273120us | 3.910143us | 455.258750ns | 450.826406ns | 463.963672ns | -| 256 | 100 | 1 | 19.002200ms | 103.612730us | 4.269263us | 404.737227ns | 402.123633ns | 409.010195ns | -| 512 | 100 | 1 | 29.949600ms | 191.694220us | 4.894583us | 374.402773ns | 372.979570ns | 377.017207ns | -| 1024 | 100 | 1 | 44.369800ms | 369.140440us | 4.032545us | 360.488711ns | 359.797373ns | 361.349893ns | -| 2048 | 100 | 1 | 92.663100ms | 725.695440us | 14.330368us | 354.343477ns | 353.267144ns | 356.154658ns | -| 4096 | 100 | 1 | 145.460600ms | 1.439496ms | 54.981559us | 351.439575ns | 349.570369ns | 355.652051ns | -| 8192 | 100 | 1 | 338.559000ms | 2.855515ms | 56.203752us | 348.573615ns | 347.648616ns | 350.764313ns | -| 16384 | 100 | 1 | 679.722200ms | 5.690558ms | 94.174423us | 347.324105ns | 346.494338ns | 348.944186ns | -| 32768 | 100 | 1 | 1347.478100ms | 11.409888ms | 126.489080us | 348.202150ns | 347.509778ns | 349.045829ns | -| 65536 | 100 | 1 | 2560.146600ms | 23.142747ms | 533.164743us | 353.130292ns | 351.868316ns | 355.258499ns | +| 1 | 100 | 1 | 8.074900ms | 10.613180us | 3.518546us | 10.613180us | 10.117910us | 11.677290us | +| 2 | 100 | 1 | 8.113700ms | 12.340150us | 3.655208us | 6.170075us | 5.911905us | 6.718160us | +| 4 | 100 | 1 | 8.257500ms | 12.916550us | 3.846172us | 3.229137us | 3.089212us | 3.503635us | +| 8 | 100 | 1 | 8.615200ms | 14.178410us | 4.393653us | 1.772301us | 1.693150us | 1.930828us | +| 16 | 100 | 1 | 9.173300ms | 17.633840us | 3.312056us | 1.102115us | 1.074572us | 1.170093us | +| 32 | 100 | 1 | 9.827400ms | 26.045510us | 16.045571us | 813.922187ns | 758.694062ns | 1.056528us | +| 64 | 100 | 1 | 11.292800ms | 37.242870us | 8.110317us | 581.919844ns | 566.773906ns | 632.833281ns | +| 128 | 100 | 1 | 13.967100ms | 59.258370us | 4.321090us | 462.956016ns | 457.766641ns | 471.768828ns | +| 256 | 100 | 1 | 19.061900ms | 104.279840us | 3.901526us | 407.343125ns | 404.947734ns | 411.198867ns | +| 512 | 100 | 1 | 29.563800ms | 192.226560us | 4.349039us | 375.442500ns | 373.952090ns | 377.326836ns | +| 1024 | 100 | 1 | 42.556300ms | 370.676630us | 5.595350us | 361.988896ns | 360.961650ns | 363.106113ns | +| 2048 | 100 | 1 | 93.378600ms | 724.126210us | 10.787976us | 353.577251ns | 352.649360ns | 354.746270ns | +| 4096 | 100 | 1 | 146.070400ms | 1.431497ms | 19.279921us | 349.486689ns | 348.647034ns | 350.506338ns | +| 8192 | 100 | 1 | 332.061500ms | 2.842520ms | 30.227138us | 346.987322ns | 346.315614ns | 347.771526ns | +| 16384 | 100 | 1 | 666.743800ms | 5.694379ms | 99.924798us | 347.557292ns | 346.606776ns | 349.148726ns | +| 32768 | 100 | 1 | 1317.111300ms | 11.310501ms | 137.544226us | 345.169099ns | 344.436630ns | 346.092781ns | +| 65536 | 100 | 1 | 2635.532000ms | 22.732340ms | 210.438187us | 346.867977ns | 346.271245ns | 347.542165ns | ## SV-SingleBattle-AnalyzeEffect-VerticalSlice1 | Inputs | Samples | Iterations / Sample | Estimated Completion Time | Mean of Samples | Standard Deviation | Mean / Input Count | Mean Lower Bound / Input Count | Mean Upper Bound / Input Count | | --- | --- | --- | --- | --- | --- | --- | --- | --- | -| 1 | 100 | 1 | 28.502600ms | 57.521920us | 20.695152us | 57.521920us | 54.720150us | 64.219140us | -| 2 | 100 | 1 | 29.358000ms | 63.786100us | 11.643967us | 31.893050us | 31.170900us | 34.116410us | -| 4 | 100 | 1 | 32.002800ms | 83.675240us | 12.461537us | 20.918810us | 20.518010us | 22.015625us | -| 8 | 100 | 1 | 36.426100ms | 117.564560us | 15.706368us | 14.695570us | 14.414442us | 15.264501us | -| 16 | 100 | 1 | 29.440700ms | 178.980860us | 12.189376us | 11.186304us | 11.088276us | 11.452200us | -| 32 | 100 | 1 | 39.516300ms | 296.654200us | 13.365405us | 9.270444us | 9.218435us | 9.422427us | -| 64 | 100 | 1 | 66.684000ms | 524.562410us | 9.951665us | 8.196288us | 8.175428us | 8.247296us | -| 128 | 100 | 1 | 119.528100ms | 977.683600us | 12.735385us | 7.638153us | 7.620741us | 7.660310us | -| 256 | 100 | 1 | 227.516700ms | 1.859090ms | 20.048601us | 7.262071us | 7.248634us | 7.279972us | -| 512 | 100 | 1 | 427.644100ms | 3.624145ms | 49.299807us | 7.078409us | 7.061532us | 7.099803us | -| 1024 | 100 | 1 | 836.204900ms | 7.155358ms | 149.048685us | 6.987654us | 6.963059us | 7.021949us | -| 2048 | 100 | 1 | 1538.608200ms | 14.225734ms | 429.621670us | 6.946159us | 6.910752us | 6.995293us | -| 4096 | 100 | 1 | 2907.174300ms | 27.696405ms | 477.573890us | 6.761818us | 6.740579us | 6.786545us | -| 8192 | 100 | 1 | 5815.062500ms | 57.631799ms | 1.510425ms | 7.035132us | 7.001921us | 7.074718us | -| 16384 | 100 | 1 | 12271.001900ms | 121.754162ms | 1.802541ms | 7.431284us | 7.411515us | 7.454978us | -| 32768 | 100 | 1 | 25738.756600ms | 254.501006ms | 2.224772ms | 7.766754us | 7.754215us | 7.781050us | -| 65536 | 100 | 1 | 52133.246400ms | 522.250063ms | 7.833730ms | 7.968904us | 7.949724us | 7.998618us | +| 1 | 100 | 1 | 24.731200ms | 59.413390us | 11.683582us | 59.413390us | 57.807560us | 63.041540us | +| 2 | 100 | 1 | 26.229700ms | 70.380520us | 17.668965us | 35.190260us | 34.009085us | 38.101740us | +| 4 | 100 | 1 | 28.355200ms | 91.027080us | 12.512447us | 22.756770us | 22.318225us | 23.712400us | +| 8 | 100 | 1 | 32.909400ms | 126.064000us | 10.078354us | 15.758000us | 15.581552us | 16.136524us | +| 16 | 100 | 1 | 41.381200ms | 193.052160us | 12.551299us | 12.065760us | 11.956058us | 12.303438us | +| 32 | 100 | 1 | 42.366500ms | 316.069630us | 9.403277us | 9.877176us | 9.839824us | 9.983210us | +| 64 | 100 | 1 | 71.826200ms | 562.140510us | 9.235113us | 8.783445us | 8.763020us | 8.825402us | +| 128 | 100 | 1 | 129.951200ms | 1.055924ms | 23.475509us | 8.249405us | 8.220084us | 8.295735us | +| 256 | 100 | 1 | 237.150100ms | 1.976069ms | 40.610960us | 7.719018us | 7.696854us | 7.766414us | +| 512 | 100 | 1 | 457.946100ms | 3.883428ms | 46.479848us | 7.584821us | 7.568368us | 7.603967us | +| 1024 | 100 | 1 | 886.648800ms | 7.544317ms | 87.297846us | 7.367497us | 7.352009us | 7.385582us | +| 2048 | 100 | 1 | 1628.876000ms | 15.006660ms | 247.183185us | 7.327471us | 7.306806us | 7.354658us | +| 4096 | 100 | 1 | 3120.031100ms | 29.416814ms | 414.863959us | 7.181839us | 7.163903us | 7.204059us | +| 8192 | 100 | 1 | 6236.974900ms | 60.351535ms | 889.984328us | 7.367131us | 7.347718us | 7.390622us | +| 16384 | 100 | 1 | 12933.843400ms | 128.214172ms | 2.131437ms | 7.825572us | 7.802043us | 7.853072us | +| 32768 | 100 | 1 | 27232.064700ms | 270.696784ms | 2.359379ms | 8.261010us | 8.247686us | 8.276051us | +| 65536 | 100 | 1 | 59579.857500ms | 595.449481ms | 2.831556ms | 9.085838us | 9.077998us | 9.095005us | ## SV-SingleBattle-MonteCarlo-SimulateTurn-RandomInputs-OneRandomBattle-OneRandomInput | Inputs | Samples | Iterations / Sample | Estimated Completion Time | Mean of Samples | Standard Deviation | Mean / Input Count | Mean Lower Bound / Input Count | Mean Upper Bound / Input Count | | --- | --- | --- | --- | --- | --- | --- | --- | --- | -| 1 | 100 | 1 | 39.152400ms | 71.966390us | 21.240076us | 71.966390us | 68.660040us | 77.335090us | -| 2 | 100 | 1 | 39.257100ms | 77.531170us | 16.593561us | 38.765585us | 37.455915us | 40.861190us | -| 4 | 100 | 1 | 40.162700ms | 85.303190us | 15.355736us | 21.325798us | 20.684115us | 22.219667us | -| 8 | 100 | 1 | 39.867100ms | 101.015580us | 21.384947us | 12.626947us | 12.169011us | 13.235927us | -| 16 | 100 | 1 | 40.824400ms | 128.518980us | 23.942156us | 8.032436us | 7.765429us | 8.356143us | -| 32 | 100 | 1 | 45.895500ms | 178.093580us | 32.967191us | 5.565424us | 5.378011us | 5.783992us | -| 64 | 100 | 1 | 54.154100ms | 270.322090us | 48.500040us | 4.223783us | 4.086947us | 4.384909us | -| 128 | 100 | 1 | 93.914800ms | 451.915300us | 85.846706us | 3.530588us | 3.411611us | 3.676522us | -| 256 | 100 | 1 | 139.929100ms | 791.136960us | 159.221827us | 3.090379us | 2.981330us | 3.226865us | -| 512 | 100 | 1 | 174.181700ms | 1.438921ms | 307.808154us | 2.810392us | 2.705587us | 2.944341us | -| 1024 | 100 | 1 | 542.730300ms | 2.789971ms | 609.913494us | 2.724581us | 2.620520us | 2.856163us | -| 2048 | 100 | 1 | 952.222600ms | 5.540254ms | 1.273100ms | 2.705202us | 2.595927us | 2.842830us | -| 4096 | 100 | 1 | 1817.106300ms | 11.233952ms | 2.562485ms | 2.742664us | 2.632497us | 2.880945us | -| 8192 | 100 | 1 | 2029.802900ms | 22.658225ms | 5.186344ms | 2.765897us | 2.653946us | 2.903587us | -| 16384 | 100 | 1 | 4139.569500ms | 46.289122ms | 10.750544ms | 2.825264us | 2.708987us | 2.969353us | -| 32768 | 100 | 1 | 9018.737400ms | 95.034040ms | 21.824814ms | 2.900209us | 2.781945us | 3.045680us | +| 1 | 100 | 1 | 40.238900ms | 69.398290us | 15.398271us | 69.398290us | 66.924410us | 73.159510us | +| 2 | 100 | 1 | 40.581800ms | 73.729500us | 17.159087us | 36.864750us | 35.434200us | 38.881740us | +| 4 | 100 | 1 | 41.319600ms | 81.246220us | 16.547413us | 20.311555us | 19.614020us | 21.277822us | +| 8 | 100 | 1 | 42.635400ms | 92.819900us | 18.707507us | 11.602487us | 11.196264us | 12.127259us | +| 16 | 100 | 1 | 45.799000ms | 117.145680us | 24.529121us | 7.321605us | 7.054964us | 7.663263us | +| 32 | 100 | 1 | 48.111600ms | 155.457230us | 28.965154us | 4.858038us | 4.697912us | 5.055575us | +| 64 | 100 | 1 | 54.781300ms | 239.015840us | 47.726324us | 3.734622us | 3.602921us | 3.897605us | +| 128 | 100 | 1 | 40.027300ms | 391.078740us | 78.197046us | 3.055303us | 2.948786us | 3.192210us | +| 256 | 100 | 1 | 96.002600ms | 702.702020us | 152.478620us | 2.744930us | 2.642425us | 2.880149us | +| 512 | 100 | 1 | 180.424500ms | 1.259945ms | 284.372541us | 2.460830us | 2.365173us | 2.585266us | +| 1024 | 100 | 1 | 441.141700ms | 2.443407ms | 580.269171us | 2.386139us | 2.288357us | 2.512679us | +| 2048 | 100 | 1 | 771.745900ms | 4.877686ms | 1.217654ms | 2.381683us | 2.278083us | 2.512753us | +| 4096 | 100 | 1 | 1499.712600ms | 9.867006ms | 2.418921ms | 2.408937us | 2.305551us | 2.540141us | +| 8192 | 100 | 1 | 1607.219400ms | 19.937750ms | 4.888810ms | 2.433807us | 2.329078us | 2.565982us | +| 16384 | 100 | 1 | 3367.381300ms | 40.410623ms | 9.995553ms | 2.466469us | 2.359091us | 2.601099us | +| 32768 | 100 | 1 | 7427.924700ms | 82.582544ms | 20.549416ms | 2.520219us | 2.411112us | 2.660224us | ## SV-SingleBattle-MonteCarlo-SimulateTurn-RandomInputs-OneRandomBattle-ManyRandomInputs | Inputs | Samples | Iterations / Sample | Estimated Completion Time | Mean of Samples | Standard Deviation | Mean / Input Count | Mean Lower Bound / Input Count | Mean Upper Bound / Input Count | | --- | --- | --- | --- | --- | --- | --- | --- | --- | -| 1 | 100 | 1 | 38.550000ms | 70.864780us | 18.989691us | 70.864780us | 67.960630us | 75.890940us | -| 2 | 100 | 1 | 53.160700ms | 86.408380us | 17.793001us | 43.204190us | 41.786395us | 45.440855us | -| 4 | 100 | 1 | 51.731500ms | 105.910450us | 17.448812us | 26.477612us | 25.833900us | 27.705925us | -| 8 | 100 | 1 | 59.733700ms | 130.855320us | 22.088546us | 16.356915us | 15.908949us | 17.035808us | -| 16 | 100 | 1 | 65.638100ms | 166.742900us | 22.507725us | 10.421431us | 10.180045us | 10.741831us | -| 32 | 100 | 1 | 75.492100ms | 221.428130us | 26.924488us | 6.919629us | 6.765046us | 7.096389us | -| 64 | 100 | 1 | 86.180300ms | 324.470630us | 39.751277us | 5.069854us | 4.954651us | 5.198095us | -| 128 | 100 | 1 | 113.632600ms | 527.080920us | 60.283325us | 4.117820us | 4.028319us | 4.212876us | -| 256 | 100 | 1 | 153.071100ms | 878.530410us | 100.990501us | 3.431759us | 3.357939us | 3.513460us | -| 512 | 100 | 1 | 230.689900ms | 1.755458ms | 1.106471ms | 3.428630us | 3.189907us | 4.358767us | -| 1024 | 100 | 1 | 342.842200ms | 3.061199ms | 441.504407us | 2.989452us | 2.909006us | 3.077915us | -| 2048 | 100 | 1 | 663.412300ms | 6.056251ms | 730.886248us | 2.957154us | 2.888965us | 3.028584us | -| 4096 | 100 | 1 | 1608.509100ms | 12.500449ms | 1.731351ms | 3.051867us | 2.972333us | 3.138331us | -| 8192 | 100 | 1 | 2565.074000ms | 24.901300ms | 3.674289ms | 3.039709us | 2.958392us | 3.134334us | -| 16384 | 100 | 1 | 4236.134700ms | 51.644036ms | 5.951533ms | 3.152102us | 3.082385us | 3.225059us | -| 32768 | 100 | 1 | 11962.172700ms | 108.527915ms | 14.575864ms | 3.312009us | 3.226391us | 3.399926us | +| 1 | 100 | 1 | 39.955300ms | 66.640740us | 16.236346us | 66.640740us | 64.078360us | 70.808810us | +| 2 | 100 | 1 | 47.105300ms | 83.506740us | 19.357833us | 41.753370us | 40.238695us | 44.235305us | +| 4 | 100 | 1 | 57.098300ms | 101.894950us | 23.811410us | 25.473737us | 24.570502us | 27.050840us | +| 8 | 100 | 1 | 58.619600ms | 122.821990us | 23.665505us | 15.352749us | 14.885573us | 16.092022us | +| 16 | 100 | 1 | 62.349100ms | 151.388350us | 26.749514us | 9.461772us | 9.178484us | 9.848943us | +| 32 | 100 | 1 | 47.880500ms | 195.167000us | 24.979409us | 6.098969us | 5.956233us | 6.263403us | +| 64 | 100 | 1 | 60.817200ms | 279.539190us | 35.459201us | 4.367800us | 4.265458us | 4.483715us | +| 128 | 100 | 1 | 60.134800ms | 454.811240us | 51.215898us | 3.553213us | 3.476719us | 3.633584us | +| 256 | 100 | 1 | 94.175700ms | 755.951740us | 93.212530us | 2.952936us | 2.885148us | 3.028552us | +| 512 | 100 | 1 | 212.144700ms | 1.422240ms | 185.266664us | 2.777812us | 2.709510us | 2.851989us | +| 1024 | 100 | 1 | 381.536000ms | 2.647147ms | 378.263845us | 2.585105us | 2.516907us | 2.662644us | +| 2048 | 100 | 1 | 548.123100ms | 5.280597ms | 655.890477us | 2.578416us | 2.516967us | 2.642443us | +| 4096 | 100 | 1 | 1318.855100ms | 10.852361ms | 1.561290ms | 2.649502us | 2.578271us | 2.728409us | +| 8192 | 100 | 1 | 2017.749500ms | 21.602523ms | 3.332996ms | 2.637027us | 2.564612us | 2.725674us | +| 16384 | 100 | 1 | 3496.665500ms | 45.426847ms | 5.306025ms | 2.772635us | 2.711117us | 2.838625us | +| 32768 | 100 | 1 | 9982.675500ms | 93.374885ms | 11.525760ms | 2.849575us | 2.782619us | 2.920539us | ## SV-SingleBattle-MonteCarlo-SimulateTurn-RandomInputs-ManyRandomBattles-ManyRandomInputs | Inputs | Samples | Iterations / Sample | Estimated Completion Time | Mean of Samples | Standard Deviation | Mean / Input Count | Mean Lower Bound / Input Count | Mean Upper Bound / Input Count | | --- | --- | --- | --- | --- | --- | --- | --- | --- | -| 1 | 100 | 1 | 39.453800ms | 71.778940us | 17.545691us | 71.778940us | 68.873620us | 75.937690us | -| 2 | 100 | 1 | 45.900600ms | 89.815840us | 15.466041us | 44.907920us | 43.615735us | 46.718250us | -| 4 | 100 | 1 | 58.528500ms | 115.318340us | 20.254794us | 28.829585us | 28.066492us | 30.205922us | -| 8 | 100 | 1 | 69.016000ms | 145.702750us | 18.220650us | 18.212844us | 17.839019us | 18.764143us | -| 16 | 100 | 1 | 74.575400ms | 194.834150us | 22.267389us | 12.177134us | 11.949709us | 12.514389us | -| 32 | 100 | 1 | 82.002400ms | 273.665400us | 20.679402us | 8.552044us | 8.444700us | 8.703954us | -| 64 | 100 | 1 | 100.319300ms | 403.298220us | 18.214841us | 6.301535us | 6.254787us | 6.370017us | -| 128 | 100 | 1 | 110.641500ms | 647.775320us | 17.106839us | 5.060745us | 5.035698us | 5.088302us | -| 256 | 100 | 1 | 175.298800ms | 1.092662ms | 24.838740us | 4.268212us | 4.251316us | 4.289878us | -| 512 | 100 | 1 | 275.343600ms | 1.951281ms | 33.373803us | 3.811096us | 3.798978us | 3.824486us | -| 1024 | 100 | 1 | 474.584600ms | 3.730427ms | 52.608457us | 3.642995us | 3.633823us | 3.654191us | -| 2048 | 100 | 1 | 829.782900ms | 7.350746ms | 116.662006us | 3.589231us | 3.578979us | 3.601535us | -| 4096 | 100 | 1 | 1681.412900ms | 15.643075ms | 389.007557us | 3.819110us | 3.802595us | 3.840427us | -| 8192 | 100 | 1 | 3402.742400ms | 33.447362ms | 576.189592us | 4.082930us | 4.070979us | 4.098986us | -| 16384 | 100 | 1 | 7756.883100ms | 78.233052ms | 893.335291us | 4.774967us | 4.765399us | 4.786933us | -| 32768 | 100 | 1 | 17585.275000ms | 176.447347ms | 1.316877ms | 5.384746us | 5.377393us | 5.393136us | +| 1 | 100 | 1 | 39.918700ms | 66.076350us | 15.819423us | 66.076350us | 63.596510us | 70.069630us | +| 2 | 100 | 1 | 47.267900ms | 85.146990us | 18.445526us | 42.573495us | 41.177285us | 45.023125us | +| 4 | 100 | 1 | 57.397300ms | 104.553170us | 20.625112us | 26.138292us | 25.365682us | 27.558463us | +| 8 | 100 | 1 | 65.919600ms | 133.059930us | 21.959852us | 16.632491us | 16.209124us | 17.344415us | +| 16 | 100 | 1 | 60.312100ms | 173.442720us | 19.864179us | 10.840170us | 10.639640us | 11.146895us | +| 32 | 100 | 1 | 66.121600ms | 234.835280us | 19.102403us | 7.338603us | 7.243752us | 7.488817us | +| 64 | 100 | 1 | 84.495300ms | 351.319880us | 21.456518us | 5.489373us | 5.441558us | 5.586037us | +| 128 | 100 | 1 | 114.797000ms | 561.354490us | 18.451307us | 4.385582us | 4.359771us | 4.416799us | +| 256 | 100 | 1 | 111.774600ms | 974.159080us | 28.556082us | 3.805309us | 3.785469us | 3.829838us | +| 512 | 100 | 1 | 205.151500ms | 1.721591ms | 33.148915us | 3.362483us | 3.350238us | 3.375582us | +| 1024 | 100 | 1 | 397.858100ms | 3.330081ms | 66.183073us | 3.252032us | 3.239991us | 3.265358us | +| 2048 | 100 | 1 | 777.497200ms | 6.750344ms | 252.793011us | 3.296066us | 3.274130us | 3.322827us | +| 4096 | 100 | 1 | 1597.138600ms | 14.088948ms | 595.116276us | 3.439685us | 3.414986us | 3.473059us | +| 8192 | 100 | 1 | 3293.034100ms | 32.559129ms | 1.350518ms | 3.974503us | 3.944686us | 4.010015us | +| 16384 | 100 | 1 | 7905.986000ms | 78.582591ms | 1.533448ms | 4.796301us | 4.779788us | 4.816928us | +| 32768 | 100 | 1 | 17821.011600ms | 178.055130ms | 1.985696ms | 5.433811us | 5.422947us | 5.446945us | ## SV-SingleBattle-CalcDamage-RandomInputs-OneRandomBattle-OneRandomInput | Inputs | Samples | Iterations / Sample | Estimated Completion Time | Mean of Samples | Standard Deviation | Mean / Input Count | Mean Lower Bound / Input Count | Mean Upper Bound / Input Count | | --- | --- | --- | --- | --- | --- | --- | --- | --- | -| 1 | 100 | 1 | 9.275100ms | 12.736680us | 4.891792us | 12.736680us | 12.001200us | 14.063480us | -| 2 | 100 | 1 | 9.491400ms | 14.626970us | 5.242848us | 7.313485us | 6.879315us | 7.930580us | -| 4 | 100 | 1 | 10.024900ms | 21.304610us | 39.138205us | 5.326153us | 4.248230us | 9.614770us | -| 8 | 100 | 1 | 10.734200ms | 21.419060us | 9.056046us | 2.677383us | 2.489170us | 2.944260us | -| 16 | 100 | 1 | 11.741800ms | 28.838340us | 10.518675us | 1.802396us | 1.675553us | 1.932533us | -| 32 | 100 | 1 | 10.438100ms | 44.025660us | 16.446340us | 1.375802us | 1.272505us | 1.474607us | -| 64 | 100 | 1 | 12.223600ms | 72.973950us | 30.140925us | 1.140218us | 1.046936us | 1.231696us | -| 128 | 100 | 1 | 20.515700ms | 131.104720us | 57.229418us | 1.024256us | 935.750156ns | 1.110637us | -| 256 | 100 | 1 | 31.841600ms | 244.326070us | 112.145920us | 954.398711ns | 867.966523ns | 1.039533us | -| 512 | 100 | 1 | 60.550900ms | 412.458600us | 219.899541us | 805.583203ns | 721.993750ns | 889.410410ns | -| 1024 | 100 | 1 | 108.220200ms | 813.149770us | 438.061268us | 794.091572ns | 709.578936ns | 877.507129ns | -| 2048 | 100 | 1 | 212.064800ms | 1.619361ms | 873.346719us | 790.703755ns | 707.387754ns | 874.101626ns | -| 4096 | 100 | 1 | 606.989300ms | 3.257063ms | 1.743999ms | 795.181475ns | 710.896826ns | 878.335769ns | -| 8192 | 100 | 1 | 1206.916300ms | 6.573106ms | 3.475988ms | 802.381097ns | 718.581738ns | 885.608850ns | -| 16384 | 100 | 1 | 2473.049700ms | 13.364027ms | 7.073165ms | 815.675505ns | 731.471935ns | 900.420960ns | -| 32768 | 100 | 1 | 4843.723500ms | 27.126750ms | 14.545292ms | 827.842710ns | 740.814207ns | 914.791726ns | +| 1 | 100 | 1 | 9.390300ms | 13.284440us | 5.264188us | 13.284440us | 12.476200us | 14.645800us | +| 2 | 100 | 1 | 9.799600ms | 14.829240us | 5.564010us | 7.414620us | 6.953100us | 8.072980us | +| 4 | 100 | 1 | 10.196400ms | 17.859980us | 8.737827us | 4.464995us | 4.146865us | 5.085102us | +| 8 | 100 | 1 | 10.909900ms | 22.020790us | 9.633537us | 2.752599us | 2.561251us | 3.053294us | +| 16 | 100 | 1 | 9.796000ms | 30.839390us | 11.267051us | 1.927462us | 1.794736us | 2.071538us | +| 32 | 100 | 1 | 10.752100ms | 45.188030us | 17.506885us | 1.412126us | 1.304308us | 1.519295us | +| 64 | 100 | 1 | 12.468900ms | 75.366450us | 31.597738us | 1.177601us | 1.079560us | 1.273634us | +| 128 | 100 | 1 | 20.821200ms | 133.365800us | 58.508777us | 1.041920us | 951.313984ns | 1.129857us | +| 256 | 100 | 1 | 31.870100ms | 249.822750us | 114.165416us | 975.870117ns | 887.472188ns | 1.062948us | +| 512 | 100 | 1 | 61.764500ms | 418.955180us | 224.293617us | 818.271836ns | 732.731562ns | 904.453145ns | +| 1024 | 100 | 1 | 110.609200ms | 833.592120us | 449.201906us | 814.054805ns | 728.546846ns | 899.972373ns | +| 2048 | 100 | 1 | 215.174100ms | 1.671185ms | 908.710354us | 816.008276ns | 729.012061ns | 902.767109ns | +| 4096 | 100 | 1 | 616.706600ms | 3.359757ms | 1.818650ms | 820.253118ns | 733.815676ns | 907.881929ns | +| 8192 | 100 | 1 | 1227.927600ms | 6.793170ms | 3.646900ms | 829.244437ns | 742.521782ns | 916.632931ns | +| 16384 | 100 | 1 | 2463.592000ms | 13.833313ms | 7.511234ms | 844.318394ns | 755.329111ns | 934.408203ns | +| 32768 | 100 | 1 | 1260.110300ms | 27.972810ms | 15.746289ms | 853.662411ns | 760.544120ns | 948.347020ns | ## SV-SingleBattle-CalcDamage-RandomInputs-OneRandomBattle-ManyRandomInputs | Inputs | Samples | Iterations / Sample | Estimated Completion Time | Mean of Samples | Standard Deviation | Mean / Input Count | Mean Lower Bound / Input Count | Mean Upper Bound / Input Count | | --- | --- | --- | --- | --- | --- | --- | --- | --- | -| 1 | 100 | 1 | 9.829600ms | 12.762510us | 4.397834us | 12.762510us | 12.069790us | 13.882910us | -| 2 | 100 | 1 | 9.398000ms | 15.009050us | 3.821411us | 7.504525us | 7.205605us | 7.998690us | -| 4 | 100 | 1 | 10.711400ms | 17.129200us | 3.581238us | 4.282300us | 4.148460us | 4.522815us | -| 8 | 100 | 1 | 11.250300ms | 21.644480us | 4.899614us | 2.705560us | 2.619736us | 2.886332us | -| 16 | 100 | 1 | 5.027000ms | 28.159830us | 3.763674us | 1.759989us | 1.724792us | 1.823955us | -| 32 | 100 | 1 | 5.959800ms | 43.152380us | 4.891187us | 1.348512us | 1.323363us | 1.384840us | -| 64 | 100 | 1 | 9.097600ms | 68.718450us | 5.731764us | 1.073726us | 1.057777us | 1.093095us | -| 128 | 100 | 1 | 13.136900ms | 124.857850us | 7.890522us | 975.451953ns | 964.603438ns | 989.102109ns | -| 256 | 100 | 1 | 23.073300ms | 224.279530us | 10.025856us | 876.091914ns | 869.291445ns | 884.806016ns | -| 512 | 100 | 1 | 42.399100ms | 434.395390us | 13.511759us | 848.428496ns | 843.347949ns | 853.670117ns | -| 1024 | 100 | 1 | 88.429500ms | 846.978170us | 17.707498us | 827.127119ns | 823.834844ns | 830.609883ns | -| 2048 | 100 | 1 | 171.223700ms | 1.669469ms | 36.316353us | 815.170410ns | 811.812988ns | 818.801958ns | -| 4096 | 100 | 1 | 343.664900ms | 3.334521ms | 59.124150us | 814.091948ns | 811.431895ns | 817.108096ns | -| 8192 | 100 | 1 | 696.743600ms | 6.655329ms | 121.455215us | 812.418145ns | 809.731576ns | 815.588295ns | -| 16384 | 100 | 1 | 1369.131900ms | 13.285971ms | 185.324610us | 810.911304ns | 808.837743ns | 813.284174ns | -| 32768 | 100 | 1 | 2747.984900ms | 26.914152ms | 347.622687us | 821.354740ns | 819.378907ns | 823.539500ns | +| 1 | 100 | 1 | 9.447900ms | 13.509250us | 5.589642us | 13.509250us | 12.611420us | 14.899170us | +| 2 | 100 | 1 | 9.512600ms | 16.370540us | 4.729824us | 8.185270us | 7.827700us | 8.822950us | +| 4 | 100 | 1 | 10.455800ms | 17.821540us | 4.021482us | 4.455385us | 4.304540us | 4.723912us | +| 8 | 100 | 1 | 10.904000ms | 22.125830us | 5.055394us | 2.765729us | 2.671054us | 2.936160us | +| 16 | 100 | 1 | 12.681600ms | 28.738470us | 4.464246us | 1.796154us | 1.751829us | 1.867030us | +| 32 | 100 | 1 | 13.364300ms | 44.749960us | 5.807342us | 1.398436us | 1.368211us | 1.441638us | +| 64 | 100 | 1 | 17.387500ms | 72.957500us | 18.186065us | 1.139961us | 1.106275us | 1.255777us | +| 128 | 100 | 1 | 13.001500ms | 124.778070us | 7.561057us | 974.828672ns | 964.139688ns | 987.467656ns | +| 256 | 100 | 1 | 23.399500ms | 228.996250us | 9.815459us | 894.516602ns | 887.407305ns | 902.426680ns | +| 512 | 100 | 1 | 43.279100ms | 439.417460us | 12.292203us | 858.237227ns | 853.612773ns | 862.988223ns | +| 1024 | 100 | 1 | 89.143300ms | 859.249370us | 17.436897us | 839.110713ns | 835.816035ns | 842.507031ns | +| 2048 | 100 | 1 | 174.759700ms | 1.697438ms | 35.387344us | 828.827163ns | 825.559380ns | 832.298037ns | +| 4096 | 100 | 1 | 349.981100ms | 3.464073ms | 150.285288us | 845.721030ns | 841.057666ns | 858.607083ns | +| 8192 | 100 | 1 | 715.937100ms | 6.921317ms | 114.788724us | 844.887313ns | 842.245271ns | 847.772095ns | +| 16384 | 100 | 1 | 1433.189300ms | 13.899350ms | 205.907802us | 848.348975ns | 845.927060ns | 850.845021ns | +| 32768 | 100 | 1 | 2863.808800ms | 28.325676ms | 680.936967us | 864.431024ns | 861.237004ns | 869.815971ns | ## SV-SingleBattle-CalcDamage-RandomInputs-ManyRandomBattles-ManyRandomInputs | Inputs | Samples | Iterations / Sample | Estimated Completion Time | Mean of Samples | Standard Deviation | Mean / Input Count | Mean Lower Bound / Input Count | Mean Upper Bound / Input Count | | --- | --- | --- | --- | --- | --- | --- | --- | --- | -| 1 | 100 | 1 | 9.900900ms | 12.941710us | 4.667073us | 12.941710us | 12.194250us | 14.099240us | -| 2 | 100 | 1 | 9.223300ms | 14.756860us | 4.691262us | 7.378430us | 7.032175us | 8.030605us | -| 4 | 100 | 1 | 10.278400ms | 18.110090us | 6.469688us | 4.527522us | 4.309630us | 5.045318us | -| 8 | 100 | 1 | 10.956600ms | 23.316040us | 6.383123us | 2.914505us | 2.807905us | 3.172957us | -| 16 | 100 | 1 | 5.375800ms | 31.200470us | 3.817060us | 1.950029us | 1.914774us | 2.016566us | -| 32 | 100 | 1 | 6.523200ms | 48.529540us | 4.805162us | 1.516548us | 1.493081us | 1.554834us | -| 64 | 100 | 1 | 9.810600ms | 80.136840us | 4.686769us | 1.252138us | 1.239204us | 1.268219us | -| 128 | 100 | 1 | 14.705600ms | 142.331320us | 6.661662us | 1.111963us | 1.102068us | 1.122564us | -| 256 | 100 | 1 | 26.466400ms | 265.892510us | 10.690700us | 1.038643us | 1.030819us | 1.047268us | -| 512 | 100 | 1 | 48.147700ms | 452.717020us | 13.857522us | 884.212930ns | 878.900859ns | 889.451504ns | -| 1024 | 100 | 1 | 95.077800ms | 885.777690us | 22.302736us | 865.017275ns | 860.882725ns | 869.434707ns | -| 2048 | 100 | 1 | 193.553600ms | 1.761886ms | 38.919457us | 860.296138ns | 857.089033ns | 864.680005ns | -| 4096 | 100 | 1 | 374.813000ms | 3.635773ms | 65.496612us | 887.639817ns | 884.776279ns | 891.105427ns | -| 8192 | 100 | 1 | 759.019200ms | 7.429843ms | 100.650414us | 906.963289ns | 904.757238ns | 909.604518ns | -| 16384 | 100 | 1 | 1517.567800ms | 15.200369ms | 307.549782us | 927.756917ns | 925.245366ns | 933.694448ns | -| 32768 | 100 | 1 | 3111.234400ms | 30.889677ms | 327.431583us | 942.678135ns | 940.879789ns | 944.822961ns | +| 1 | 100 | 1 | 6.631800ms | 13.136740us | 4.613613us | 13.136740us | 12.398670us | 14.273790us | +| 2 | 100 | 1 | 10.322900ms | 15.531150us | 5.311985us | 7.765575us | 7.367985us | 8.482470us | +| 4 | 100 | 1 | 11.315400ms | 18.231640us | 5.237512us | 4.557910us | 4.391360us | 5.022017us | +| 8 | 100 | 1 | 11.961200ms | 25.036520us | 10.481453us | 3.129565us | 2.960560us | 3.588153us | +| 16 | 100 | 1 | 12.999600ms | 33.106270us | 4.620079us | 2.069142us | 2.024959us | 2.145649us | +| 32 | 100 | 1 | 14.264900ms | 49.787790us | 5.073774us | 1.555868us | 1.530061us | 1.594338us | +| 64 | 100 | 1 | 18.265600ms | 81.867300us | 5.562510us | 1.279177us | 1.264301us | 1.298846us | +| 128 | 100 | 1 | 15.298900ms | 145.286350us | 6.585051us | 1.135050us | 1.125520us | 1.145637us | +| 256 | 100 | 1 | 27.589400ms | 272.763940us | 11.651773us | 1.065484us | 1.056955us | 1.074793us | +| 512 | 100 | 1 | 49.415400ms | 464.358750us | 18.906656us | 906.950684ns | 900.794707ns | 915.570859ns | +| 1024 | 100 | 1 | 99.558800ms | 917.495770us | 25.767481us | 895.991963ns | 891.184404ns | 901.049473ns | +| 2048 | 100 | 1 | 202.949900ms | 1.861090ms | 48.009471us | 908.735449ns | 904.345225ns | 913.502119ns | +| 4096 | 100 | 1 | 403.876600ms | 3.819120ms | 87.883403us | 932.402249ns | 928.377688ns | 936.770142ns | +| 8192 | 100 | 1 | 814.121600ms | 7.857365ms | 140.857255us | 959.151039ns | 956.021390ns | 962.817142ns | +| 16384 | 100 | 1 | 1646.624300ms | 16.259448ms | 387.039953us | 992.397975ns | 988.560640ns | 998.124011ns | +| 32768 | 100 | 1 | 3367.114000ms | 33.494552ms | 732.985501us | 1.022173us | 1.018344us | 1.027257us | ## SV-SingleBattle-AnalyzeEffect-RandomInputs-OneRandomBattle-OneRandomInput | Inputs | Samples | Iterations / Sample | Estimated Completion Time | Mean of Samples | Standard Deviation | Mean / Input Count | Mean Lower Bound / Input Count | Mean Upper Bound / Input Count | | --- | --- | --- | --- | --- | --- | --- | --- | --- | -| 1 | 100 | 1 | 13.658000ms | 86.937990us | 27.508978us | 86.937990us | 80.782490us | 91.719020us | -| 2 | 100 | 1 | 16.492800ms | 110.624610us | 35.300006us | 55.312305us | 51.297320us | 58.307610us | -| 4 | 100 | 1 | 23.059500ms | 157.396380us | 50.404870us | 39.349095us | 36.416268us | 41.462758us | -| 8 | 100 | 1 | 35.573100ms | 250.039480us | 82.349078us | 31.254935us | 28.858612us | 33.002032us | -| 16 | 100 | 1 | 47.470800ms | 409.888280us | 138.101655us | 25.618018us | 23.646621us | 27.093143us | -| 32 | 100 | 1 | 95.199700ms | 733.995650us | 238.606511us | 22.937364us | 21.229047us | 24.212768us | -| 64 | 100 | 1 | 224.721600ms | 1.378519ms | 454.099875us | 21.539362us | 19.930441us | 22.759269us | -| 128 | 100 | 1 | 423.130300ms | 2.633007ms | 872.295709us | 20.570363us | 19.014935us | 21.739867us | -| 256 | 100 | 1 | 560.659200ms | 5.142866ms | 1.715764ms | 20.089320us | 18.572685us | 21.242771us | -| 512 | 100 | 1 | 1080.673500ms | 9.915316ms | 3.303158ms | 19.365852us | 17.907720us | 20.470031us | -| 1024 | 100 | 1 | 2119.005700ms | 19.571918ms | 6.535966ms | 19.113201us | 17.664401us | 20.202229us | -| 2048 | 100 | 1 | 4023.828200ms | 40.353653ms | 13.537382ms | 19.703932us | 18.206082us | 20.841866us | -| 4096 | 100 | 1 | 10562.810200ms | 84.980499ms | 28.907028ms | 20.747192us | 19.186023us | 21.976599us | -| 8192 | 100 | 1 | 22519.101500ms | 179.602776ms | 61.029217ms | 21.924167us | 20.257293us | 23.208195us | -| 16384 | 100 | 1 | 46787.618900ms | 372.576724ms | 126.905073ms | 22.740279us | 21.010730us | 24.092928us | +| 1 | 100 | 1 | 13.920600ms | 89.705530us | 28.191992us | 89.705530us | 83.455810us | 94.596980us | +| 2 | 100 | 1 | 16.842300ms | 117.830580us | 37.372543us | 58.915290us | 54.649040us | 62.089105us | +| 4 | 100 | 1 | 23.257300ms | 170.349030us | 54.279771us | 42.587257us | 39.414115us | 44.876287us | +| 8 | 100 | 1 | 36.355500ms | 257.475990us | 83.478818us | 32.184499us | 29.769941us | 33.934271us | +| 16 | 100 | 1 | 50.874000ms | 442.517320us | 147.882596us | 27.657332us | 25.532766us | 29.229046us | +| 32 | 100 | 1 | 102.946500ms | 774.360640us | 249.097184us | 24.198770us | 22.411924us | 25.520413us | +| 64 | 100 | 1 | 238.431600ms | 1.448940ms | 471.620999us | 22.639684us | 20.933463us | 23.900937us | +| 128 | 100 | 1 | 319.577700ms | 2.787760ms | 913.616994us | 21.779371us | 20.148950us | 22.997866us | +| 256 | 100 | 1 | 590.141900ms | 5.431778ms | 1.794969ms | 21.217884us | 19.646800us | 22.414340us | +| 512 | 100 | 1 | 1131.820800ms | 10.456250ms | 3.459140ms | 20.422364us | 18.856063us | 21.570066us | +| 1024 | 100 | 1 | 2274.842300ms | 21.042414ms | 7.012021ms | 20.549233us | 19.000088us | 21.714754us | +| 2048 | 100 | 1 | 4270.282400ms | 43.423651ms | 14.531183ms | 21.202955us | 19.581245us | 22.424573us | +| 4096 | 100 | 1 | 11132.249000ms | 90.753333ms | 30.612931ms | 22.156575us | 20.462278us | 23.440685us | +| 8192 | 100 | 1 | 23879.340100ms | 191.141422ms | 64.717944ms | 23.332693us | 21.575681us | 24.696410us | +| 16384 | 100 | 1 | 49642.423300ms | 395.612147ms | 134.237533ms | 24.146249us | 22.307110us | 25.565315us | ## SV-SingleBattle-AnalyzeEffect-RandomInputs-OneRandomBattle-ManyRandomInputs | Inputs | Samples | Iterations / Sample | Estimated Completion Time | Mean of Samples | Standard Deviation | Mean / Input Count | Mean Lower Bound / Input Count | Mean Upper Bound / Input Count | | --- | --- | --- | --- | --- | --- | --- | --- | --- | -| 1 | 100 | 1 | 36.528700ms | 83.118280us | 27.397371us | 83.118280us | 77.206320us | 88.011230us | -| 2 | 100 | 1 | 41.273300ms | 112.780860us | 19.737317us | 56.390430us | 54.838475us | 58.898535us | -| 4 | 100 | 1 | 43.386600ms | 144.912190us | 19.983803us | 36.228048us | 35.366690us | 37.352863us | -| 8 | 100 | 1 | 30.340800ms | 207.507390us | 23.831953us | 25.938424us | 25.440774us | 26.635645us | -| 16 | 100 | 1 | 46.746500ms | 327.844190us | 31.582024us | 20.490262us | 20.131428us | 20.908098us | -| 32 | 100 | 1 | 69.455200ms | 584.719640us | 36.738569us | 18.272489us | 18.046638us | 18.496398us | -| 64 | 100 | 1 | 136.382500ms | 1.147213ms | 58.175008us | 17.925198us | 17.745045us | 18.100007us | -| 128 | 100 | 1 | 263.552000ms | 2.507317ms | 127.167442us | 19.588415us | 19.393584us | 19.784415us | -| 256 | 100 | 1 | 640.707000ms | 5.962921ms | 269.095515us | 23.292658us | 23.093727us | 23.506311us | -| 512 | 100 | 1 | 1523.674100ms | 15.541312ms | 558.643643us | 30.354126us | 30.141994us | 30.568017us | -| 1024 | 100 | 1 | 4130.121200ms | 40.256270ms | 1.135772ms | 39.312764us | 39.101776us | 39.534842us | -| 2048 | 100 | 1 | 10025.652900ms | 99.411265ms | 2.335895ms | 48.540657us | 48.315358us | 48.762062us | -| 4096 | 100 | 1 | 22916.185700ms | 226.119487ms | 4.207797ms | 55.204953us | 55.011237us | 55.413477us | -| 8192 | 100 | 1 | 48779.707400ms | 485.714879ms | 6.631716ms | 59.291367us | 59.135220us | 59.453289us | -| 16384 | 100 | 1 | 101854.708000ms | 1014.495804ms | 11.297657ms | 61.919910us | 61.790603us | 62.061419us | +| 1 | 100 | 1 | 13.864100ms | 89.593650us | 29.128853us | 89.593650us | 83.301120us | 94.770710us | +| 2 | 100 | 1 | 17.420200ms | 117.657870us | 15.575147us | 58.828935us | 57.707510us | 61.056875us | +| 4 | 100 | 1 | 19.709100ms | 151.292360us | 16.144262us | 37.823090us | 37.092402us | 38.695155us | +| 8 | 100 | 1 | 31.407700ms | 220.684360us | 23.037345us | 27.585545us | 27.062193us | 28.201155us | +| 16 | 100 | 1 | 46.786800ms | 340.016520us | 33.944700us | 21.251033us | 20.885480us | 21.736241us | +| 32 | 100 | 1 | 69.224600ms | 609.693880us | 40.389366us | 19.052934us | 18.802717us | 19.297894us | +| 64 | 100 | 1 | 138.866700ms | 1.172574ms | 57.616523us | 18.321471us | 18.145843us | 18.498341us | +| 128 | 100 | 1 | 267.372700ms | 2.570479ms | 128.132581us | 20.081863us | 19.884408us | 20.277797us | +| 256 | 100 | 1 | 657.146200ms | 6.165315ms | 270.334314us | 24.083263us | 23.881049us | 24.295747us | +| 512 | 100 | 1 | 1571.536700ms | 15.932636ms | 546.759873us | 31.118429us | 30.906204us | 31.324112us | +| 1024 | 100 | 1 | 4267.384000ms | 41.624136ms | 1.253188ms | 40.648571us | 40.412846us | 40.898211us | +| 2048 | 100 | 1 | 10289.394300ms | 102.750964ms | 2.254847ms | 50.171369us | 49.961896us | 50.392556us | +| 4096 | 100 | 1 | 23476.260200ms | 231.143774ms | 4.119021ms | 56.431585us | 56.235400us | 56.627462us | +| 8192 | 100 | 1 | 49127.580700ms | 496.202409ms | 6.618396ms | 60.571583us | 60.414002us | 60.729524us | +| 16384 | 100 | 1 | 102227.455800ms | 1036.370391ms | 12.485348ms | 63.255029us | 63.105349us | 63.404307us | ## SV-SingleBattle-AnalyzeEffect-RandomInputs-ManyRandomBattles-ManyRandomInputs | Inputs | Samples | Iterations / Sample | Estimated Completion Time | Mean of Samples | Standard Deviation | Mean / Input Count | Mean Lower Bound / Input Count | Mean Upper Bound / Input Count | | --- | --- | --- | --- | --- | --- | --- | --- | --- | -| 1 | 100 | 1 | 36.778400ms | 86.106940us | 30.305784us | 86.106940us | 79.880870us | 91.821250us | -| 2 | 100 | 1 | 41.270400ms | 126.500350us | 22.572838us | 63.250175us | 61.080260us | 65.531955us | -| 4 | 100 | 1 | 25.898900ms | 188.552010us | 20.619763us | 47.138002us | 46.080295us | 48.106977us | -| 8 | 100 | 1 | 42.271900ms | 292.080190us | 28.937168us | 36.510024us | 35.757836us | 37.183964us | -| 16 | 100 | 1 | 61.946100ms | 490.845530us | 36.222488us | 30.677846us | 30.221036us | 31.108959us | -| 32 | 100 | 1 | 116.582800ms | 879.302030us | 42.691311us | 27.478188us | 27.209715us | 27.734966us | -| 64 | 100 | 1 | 204.442300ms | 1.639195ms | 71.553253us | 25.612426us | 25.382650us | 25.821756us | -| 128 | 100 | 1 | 375.431900ms | 3.128170ms | 96.976242us | 24.438829us | 24.288528us | 24.584769us | -| 256 | 100 | 1 | 713.694600ms | 6.055232ms | 156.292524us | 23.653248us | 23.532205us | 23.770851us | -| 512 | 100 | 1 | 1440.203600ms | 12.001409ms | 570.580790us | 23.440253us | 23.250112us | 23.692393us | -| 1024 | 100 | 1 | 2738.673800ms | 23.742097ms | 591.884248us | 23.185641us | 23.086220us | 23.314371us | -| 2048 | 100 | 1 | 5365.438200ms | 50.304498ms | 1.195304ms | 24.562743us | 24.454789us | 24.685594us | -| 4096 | 100 | 1 | 10832.505200ms | 106.853324ms | 1.380815ms | 26.087237us | 26.022698us | 26.154889us | -| 8192 | 100 | 1 | 22561.991900ms | 225.428688ms | 1.815967ms | 27.518150us | 27.475845us | 27.563092us | -| 16384 | 100 | 1 | 47330.621000ms | 472.394221ms | 2.401319ms | 28.832655us | 28.804025us | 28.861759us | +| 1 | 100 | 1 | 13.889400ms | 90.897960us | 28.879026us | 90.897960us | 84.492750us | 95.904920us | +| 2 | 100 | 1 | 17.772400ms | 132.711770us | 22.534030us | 66.355885us | 64.095155us | 68.538690us | +| 4 | 100 | 1 | 25.916400ms | 200.164400us | 20.533911us | 50.041100us | 48.958225us | 50.980650us | +| 8 | 100 | 1 | 42.715900ms | 303.530160us | 29.268201us | 37.941270us | 37.180544us | 38.618383us | +| 16 | 100 | 1 | 62.626000ms | 507.333150us | 37.483370us | 31.708322us | 31.247481us | 32.164951us | +| 32 | 100 | 1 | 118.583800ms | 903.692480us | 42.825778us | 28.240390us | 27.975689us | 28.500581us | +| 64 | 100 | 1 | 213.464200ms | 1.693045ms | 72.523540us | 26.453831us | 26.222357us | 26.667489us | +| 128 | 100 | 1 | 395.608600ms | 3.248932ms | 103.550091us | 25.382284us | 25.224204us | 25.540134us | +| 256 | 100 | 1 | 748.665000ms | 6.387514ms | 298.093037us | 24.951228us | 24.763038us | 25.236883us | +| 512 | 100 | 1 | 1480.929700ms | 12.401221ms | 353.574820us | 24.221134us | 24.091207us | 24.362388us | +| 1024 | 100 | 1 | 2794.033300ms | 24.528668ms | 690.174648us | 23.953778us | 23.840239us | 24.110350us | +| 2048 | 100 | 1 | 5578.930900ms | 51.414736ms | 1.274492ms | 25.104852us | 24.989510us | 25.233969us | +| 4096 | 100 | 1 | 10885.927300ms | 108.323205ms | 1.747741ms | 26.446095us | 26.369782us | 26.537520us | +| 8192 | 100 | 1 | 22749.832800ms | 230.025219ms | 2.246294ms | 28.079250us | 28.028827us | 28.136966us | +| 16384 | 100 | 1 | 47970.155900ms | 478.856007ms | 3.892357ms | 29.227051us | 29.185941us | 29.280228us | diff --git a/src/AnalyzeEffect/AnalyzeEffect.cpp b/src/AnalyzeEffect/AnalyzeEffect.cpp index 079891e..d5ab68e 100644 --- a/src/AnalyzeEffect/AnalyzeEffect.cpp +++ b/src/AnalyzeEffect/AnalyzeEffect.cpp @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -274,16 +275,14 @@ void ignoreBattlesWithEffectActive(Simulation& simulation) { types::entity createAnalyzeEffectMove( types::registry& registry, dex::Move move, types::entity battleEntity, types::entity attackerEntity, - types::entity defenderEntity, const Pokedex& pokedex) { - types::entity moveEntity = createActionMoveForTarget( - {registry, defenderEntity}, - battleEntity, - attackerEntity, - move, - pokedex, - registry.create()); + types::entity defenderEntity) { + types::entity moveEntity = registry.create(); + + setupActionMoveBuild(registry, battleEntity, attackerEntity, defenderEntity, moveEntity, move); + registry.emplace(moveEntity, move); registry.emplace(moveEntity); + registry.emplace(moveEntity); registry.emplace_or_replace(attackerEntity); registry.emplace_or_replace(defenderEntity); @@ -291,22 +290,20 @@ types::entity createAnalyzeEffectMove( } void createOneCalculationMovePair( - types::handle inputHandle, Battle battle, EffectMove move, Attacker attacker, Defender defender, - const Pokedex& pokedex) { + types::handle inputHandle, Battle battle, EffectMove move, Attacker attacker, Defender defender) { entt::entity moveEntity = - createAnalyzeEffectMove(*inputHandle.registry(), move.val, battle.val, attacker.val, defender.val, pokedex); + createAnalyzeEffectMove(*inputHandle.registry(), move.val, battle.val, attacker.val, defender.val); inputHandle.emplace(moveEntity, moveEntity); } void createTwoCalculationsMovePair( types::handle inputHandle, Battle battle, EffectMove move, Attacker attacker, Defender defender, - const OriginalInputEntities& originals, const Pokedex& pokedex) { + const OriginalInputEntities& originals) { types::registry& registry = *inputHandle.registry(); entt::entity originalEntity = - createAnalyzeEffectMove(registry, move.val, originals.battle, originals.attacker, originals.defender, pokedex); - entt::entity copyEntity = - createAnalyzeEffectMove(registry, move.val, battle.val, attacker.val, defender.val, pokedex); + createAnalyzeEffectMove(registry, move.val, originals.battle, originals.attacker, originals.defender); + entt::entity copyEntity = createAnalyzeEffectMove(registry, move.val, battle.val, attacker.val, defender.val); // All active pokemon in should have their stats refreshed in doubles for moves like Beat Up which rely on the stats // of Pokemon outside of the attacker and defender @@ -420,9 +417,10 @@ void createAppliedEffectBattles(Simulation& simulation) { } } - simulation.view, entt::exclude_t>( - simulation.pokedex()); - simulation.view(simulation.pokedex()); + simulation.view, entt::exclude_t>(); + simulation.view(); + simulation.pokedex().buildMoves(simulation.registry); + simulation.registry.clear(); } void applyPseudoWeatherEffect(types::handle, Battle, PseudoWeatherName) {} diff --git a/src/Battle/Clone/Clone.cpp b/src/Battle/Clone/Clone.cpp index 66d9902..0a91864 100644 --- a/src/Battle/Clone/Clone.cpp +++ b/src/Battle/Clone/Clone.cpp @@ -52,8 +52,16 @@ void traverseBattle(types::registry& registry, VisitEntity visitEntity = nullptr } } - for (const auto [entity, recycledAction] : registry.view().each()) { + for (const auto [entity, recycledAction, recycledActionMove] : + registry.view().each()) { registry.emplace(recycledAction.val); + registry.emplace(recycledActionMove.val); + } + + for (const auto [entity, addedRecycledActionMove1, addedRecycledActionMove2] : + registry.view().each()) { + registry.emplace(addedRecycledActionMove1.val); + registry.emplace(addedRecycledActionMove2.val); } } @@ -83,15 +91,21 @@ void traverseAction(types::registry& registry, VisitEntity visitEntity = nullptr visitEntity(entity); } } -} -template -void traverseCurrentActionMove(types::registry& registry, VisitEntity visitEntity = nullptr) { - const static bool ForCloning = !std::is_same_v; - using Tag = std::conditional_t; + for (types::entity entity : registry.view()) { + if constexpr (ForCloning) { + visitEntity(entity); + } + } + + for (types::entity entity : registry.view()) { + if constexpr (ForCloning) { + visitEntity(entity); + } + } - if constexpr (ForCloning) { - for (types::entity entity : registry.view()) { + for (types::entity entity : registry.view()) { + if constexpr (ForCloning) { visitEntity(entity); } } @@ -145,14 +159,6 @@ void cloneAction( }); } -void cloneCurrentActionMove( - types::registry& registry, types::ClonedEntityMap& entityMap, - entt::dense_map& srcEntityStorages, types::entityIndex cloneCount) { - traverseCurrentActionMove(registry, [&](types::entity entity) { - cloneEntity(entity, registry, entityMap, srcEntityStorages, cloneCount); - }); -} - void clonePokemon( types::registry& registry, types::ClonedEntityMap& entityMap, entt::dense_map& srcEntityStorages, types::entityIndex cloneCount) { @@ -173,10 +179,6 @@ void deleteAction(types::registry& registry) { traverseAction(registry); } -void deleteCurrentActionMove(types::registry& registry) { - traverseCurrentActionMove(registry); -} - void deletePokemon(types::registry& registry) { traversePokemon(registry); } @@ -230,7 +232,6 @@ types::ClonedEntityMap clone(types::registry& registry, std::optional(registry, entityMap); + remapComponentEntities(registry, entityMap); remapComponentEntities(registry, entityMap); remapComponentEntities(registry, entityMap); remapComponentEntities(registry, entityMap); remapComponentEntities(registry, entityMap); remapComponentEntities(registry, entityMap); remapComponentEntities(registry, entityMap); - remapComponentEntities(registry, entityMap); - remapComponentEntities(registry, entityMap); remapComponentEntities(registry, entityMap); - remapComponentEntities(registry, entityMap); - remapComponentEntities(registry, entityMap); remapComponentEntities(registry, entityMap); remapComponentEntities(registry, entityMap); + remapComponentEntities(registry, entityMap); + remapComponentEntities(registry, entityMap); + remapComponentEntities(registry, entityMap); + remapComponentEntities(registry, entityMap); remapComponentEntities(registry, entityMap); remapComponentEntities(registry, entityMap); remapComponentEntities(registry, entityMap); remapComponentEntities(registry, entityMap); + remapComponentEntities(registry, entityMap); remapComponentEntities(registry, entityMap); remapComponentEntities(registry, entityMap); remapComponentEntities(registry, entityMap); @@ -302,7 +306,6 @@ void deleteClones(types::registry& registry) { deleteSide(registry); deleteAction(registry); deletePokemon(registry); - deleteCurrentActionMove(registry); auto remove = registry.view(); registry.destroy(remove.begin(), remove.end()); } diff --git a/src/Battle/Helpers/Helpers.cpp b/src/Battle/Helpers/Helpers.cpp index 9b95521..5aa15ed 100644 --- a/src/Battle/Helpers/Helpers.cpp +++ b/src/Battle/Helpers/Helpers.cpp @@ -1,5 +1,6 @@ #include "Helpers.hpp" +#include #include #include #include @@ -8,6 +9,7 @@ #include #include #include +#include #include #include #include @@ -100,30 +102,19 @@ types::moveSlotIndex moveToMoveSlot(const MoveSlots& moveSlots, dex::Move move) return 0U; } -types::entity createActionMoveForTarget( - types::handle targetHandle, types::entity battleEntity, types::entity sourceEntity, dex::Move move, - const Pokedex& pokedex, types::entity entityToUse) { - types::registry& registry = *targetHandle.registry(); - types::entity moveEntity = pokedex.buildActionMove(move, registry, entityToUse); +void setupActionMoveBuild( + types::registry& registry, types::entity battleEntity, types::entity sourceEntity, types::entity targetEntity, + types::entity actionMoveEntity, dex::Move move) { + types::handle actionMoveHandle{registry, actionMoveEntity}; - registry.emplace(moveEntity); - registry.emplace(moveEntity, battleEntity); - registry.emplace(moveEntity, sourceEntity); - registry.emplace(moveEntity, targetHandle.entity()); + move::tags::emplaceTagFromEnum(move, actionMoveHandle); + actionMoveHandle.emplace(battleEntity); + actionMoveHandle.emplace(sourceEntity); + actionMoveHandle.emplace(targetEntity); + actionMoveHandle.emplace(); + actionMoveHandle.emplace(); - targetHandle.get_or_emplace().val.push_back(moveEntity); - registry.get_or_emplace(sourceEntity).val.push_back(moveEntity); - - if (registry.all_of(battleEntity)) { - registry.emplace(moveEntity); - } - if (registry.all_of(battleEntity)) { - registry.emplace(moveEntity); - } - if (registry.all_of(battleEntity)) { - registry.emplace(moveEntity); - } - - return moveEntity; + registry.get_or_emplace(targetEntity).val.push_back(actionMoveEntity); + registry.get_or_emplace(sourceEntity).val.push_back(actionMoveEntity); } } // namespace pokesim diff --git a/src/Battle/Helpers/Helpers.hpp b/src/Battle/Helpers/Helpers.hpp index c26bac0..20a78d9 100644 --- a/src/Battle/Helpers/Helpers.hpp +++ b/src/Battle/Helpers/Helpers.hpp @@ -17,7 +17,7 @@ types::entity slotToPokemonEntity(const types::registry& registry, const Sides& types::entity slotToAllyPokemonEntity(const types::registry& registry, const Sides& sides, Slot targetSlot); types::moveSlotIndex moveToMoveSlot(const MoveSlots& moveSlots, dex::Move move); -types::entity createActionMoveForTarget( - types::handle targetHandle, types::entity battleEntity, types::entity sourceEntity, dex::Move move, - const Pokedex& pokedex, types::entity entityToUse); +void setupActionMoveBuild( + types::registry& registry, types::entity battleEntity, types::entity sourceEntity, types::entity targetEntity, + types::entity actionMoveEntity, dex::Move move); } // namespace pokesim diff --git a/src/Battle/ManageBattleState.cpp b/src/Battle/ManageBattleState.cpp index 43205fb..201670a 100644 --- a/src/Battle/ManageBattleState.cpp +++ b/src/Battle/ManageBattleState.cpp @@ -1,20 +1,37 @@ #include "ManageBattleState.hpp" #include +#include +#include +#include +#include +#include #include #include #include #include +#include +#include #include #include #include #include #include +#include +#include +#include #include #include +#include #include +#include +#include #include +#include +#include #include +#include +#include #include #include #include @@ -60,6 +77,23 @@ void updateCurrentActionTargets(types::registry& registry, CurrentActionTargets& targets.val.pop_count(deleteCount); } + +template +void clearActionMoveComponents(types::registry& registry, const View& view) { + registry.remove< + tags::SimulateTurn, + tags::CalculateDamage, + tags::AnalyzeEffect, + Battle, + TypeName, + AtkBoost, + DefBoost, + SpaBoost, + SpdBoost, + SpeBoost, + status::tags::Paralysis, + status::tags::Burn>(view.begin(), view.end()); +} } // namespace void assignRootBattle(types::handle battleHandle) { @@ -99,8 +133,6 @@ void setCurrentActionTarget( if (pickedTarget) { battleHandle.emplace(types::targets{targetEntity}); - registry.emplace(targetEntity); - registry.emplace(targetEntity, source); } else { types::entity sourceEntity = battleHandle.get().val; @@ -109,27 +141,6 @@ void setCurrentActionTarget( } } -void setCurrentActionMove( - types::handle battleHandle, CurrentActionSource source, const CurrentActionTargets& targets, CurrentAction action, - const Pokedex& pokedex) { - types::registry& registry = *battleHandle.registry(); - const MoveName& move = registry.get(action.val); - const MoveSlots& moveSlots = registry.get(source.val); - - for (types::entity target : targets.val) { - createActionMoveForTarget( - {registry, target}, - battleHandle.entity(), - source.val, - move.val, - pokedex, - registry.create()); - } - - types::moveSlotIndex moveSlotIndex = moveToMoveSlot(moveSlots, move.val); - battleHandle.emplace(moveSlotIndex); -} - void setFailedActionMove( types::handle moveHandle, Battle battle, CurrentActionSource source, CurrentActionTarget target) { types::registry& registry = *moveHandle.registry(); @@ -158,38 +169,55 @@ void setFailedActionMove( void clearCurrentAction(Simulation& simulation) { types::registry& registry = simulation.registry; - registry.clear(); - registry.clear(); - registry.clear(); - registry.clear(); - registry.clear(); - registry.clear(); - registry.clear(); - registry.clear(); - registry.clear(); - - registry.clear(); - registry.clear(); - registry.clear(); - registry.clear(); - registry.clear(); - - auto actionMoves = registry.view(); - auto failedActionMoves = registry.view(); - auto currentActions = registry.view(); - registry.destroy(actionMoves.begin(), actionMoves.end()); - registry.destroy(failedActionMoves.begin(), failedActionMoves.end()); - - registry.remove( - currentActions.begin(), - currentActions.end()); - - auto battles = simulation.battleEntities(); - registry.remove< + registry.clear< + CurrentAction, + CurrentActionTargets, + CurrentActionSource, + CurrentActionTarget, + FailedCurrentActionSource, + FailedCurrentActionTarget, + CurrentActionMovesAsSource, + CurrentActionMovesAsTarget, + CurrentActionMoveSlot, + tags::CurrentActionMoveSource, + tags::CurrentActionMoveTarget, + tags::CurrentActionMoveSlot, + tags::CurrentMoveHit, + tags::FailedCurrentMoveHit>(); + + registry.clear< + move::effect::tags::Primary, + move::effect::tags::Secondary, + move::effect::tags::MoveSource, + move::effect::tags::MoveTarget, + move::tags::FuryAttack, + move::tags::KnockOff, + move::tags::Moonblast, + move::tags::QuiverDance, + move::tags::Splash, + move::tags::Thunderbolt, + move::tags::WillOWisp, + move::tags::Physical, + move::tags::Special, + move::tags::Status, + move::tags::Contact, + move::tags::BypassSubstitute, + move::tags::Punch, + move::tags::VariableHitCount, + BaseEffectChance, + Accuracy, + BasePower, + HitCount, + move::tags::AccuracyDependentHitCount, + move::tags::Self, + move::tags::AnySingleTarget, + move::tags::AnySingleAlly>(); + + registry.clear(); + + registry.clear< action::tags::Item, - ItemName, action::tags::Move, - MoveName, action::tags::BeforeTurn, action::tags::Dynamax, action::tags::MegaEvolve, @@ -202,6 +230,18 @@ void clearCurrentAction(Simulation& simulation) { action::tags::RevivalBlessing, action::tags::Switch, action::tags::SwitchOut, - action::tags::Terastallize>(battles.begin(), battles.end()); + action::tags::Terastallize>(); + + auto actionMoves = registry.view(); + auto failedActionMoves = registry.view(); + clearActionMoveComponents(registry, actionMoves); + clearActionMoveComponents(registry, failedActionMoves); + registry.clear(); + + simulation.removeFromEntities(); + registry.clear(); + + auto battles = registry.view(); + registry.remove(battles.begin(), battles.end()); } } // namespace pokesim diff --git a/src/Battle/ManageBattleState.hpp b/src/Battle/ManageBattleState.hpp index a3afb94..d1d1f3a 100644 --- a/src/Battle/ManageBattleState.hpp +++ b/src/Battle/ManageBattleState.hpp @@ -20,9 +20,6 @@ void setCurrentActionSource(types::handle battleHandle, const Sides& sides, Curr void setCurrentActionTarget( types::handle battleHandle, const Sides& sides, CurrentAction action, CurrentActionSource source, const Simulation& simulation); -void setCurrentActionMove( - types::handle battleHandle, CurrentActionSource source, const CurrentActionTargets& targets, CurrentAction action, - const Pokedex& pokedex); void setFailedActionMove( types::handle moveHandle, Battle battle, CurrentActionSource source, CurrentActionTarget target); void clearCurrentAction(Simulation& simulation); diff --git a/src/Battle/Setup/BattleStateSetup.cpp b/src/Battle/Setup/BattleStateSetup.cpp index ea6f3b5..3a393d7 100644 --- a/src/Battle/Setup/BattleStateSetup.cpp +++ b/src/Battle/Setup/BattleStateSetup.cpp @@ -41,11 +41,25 @@ void BattleStateSetup::initBlank() { setProbability(Constants::Probability::DEFAULT); } -void BattleStateSetup::setRecycledAction(types::entity recycledAction) { +void BattleStateSetup::setRecycledAction(types::entity recycledAction, types::entity recycledActionMove) { types::registry& registry = *handle.registry(); handle.emplace(recycledAction); registry.emplace(recycledAction); + + handle.emplace(recycledActionMove); + registry.emplace(recycledActionMove); +} + +void BattleStateSetup::setAddedRecycledActionMoves( + types::entity addedRecycledActionMove1, types::entity addedRecycledActionMove2) { + types::registry& registry = *handle.registry(); + + handle.emplace(addedRecycledActionMove1); + registry.emplace(addedRecycledActionMove1); + + handle.emplace(addedRecycledActionMove2); + registry.emplace(addedRecycledActionMove2); } void BattleStateSetup::setAutoID() { diff --git a/src/Battle/Setup/BattleStateSetup.hpp b/src/Battle/Setup/BattleStateSetup.hpp index 6e41eab..f709dcc 100644 --- a/src/Battle/Setup/BattleStateSetup.hpp +++ b/src/Battle/Setup/BattleStateSetup.hpp @@ -33,7 +33,8 @@ struct BattleStateSetup : internal::StateSetupBase { */ void initBlank(); - void setRecycledAction(types::entity recycledAction); + void setRecycledAction(types::entity recycledAction, types::entity recycledActionMove); + void setAddedRecycledActionMoves(types::entity addedRecycledActionMove1, types::entity addedRecycledActionMove2); void setAutoID(); void setID(types::stateId id); void setSide(types::entity sideEntity); diff --git a/src/CalcDamage/Setup/CalcDamageInputSetup.cpp b/src/CalcDamage/Setup/CalcDamageInputSetup.cpp index aa213d6..4c63ad0 100644 --- a/src/CalcDamage/Setup/CalcDamageInputSetup.cpp +++ b/src/CalcDamage/Setup/CalcDamageInputSetup.cpp @@ -16,14 +16,14 @@ namespace pokesim::calc_damage { InputSetup::InputSetup(types::registry& registry, types::entity moveEntity) : handle(registry, moveEntity) {} void InputSetup::setup( - types::entity battleEntity, types::entity sourceEntity, types::entity targetEntity, dex::Move move, - const Pokedex& pokedex) { + types::entity battleEntity, types::entity sourceEntity, types::entity targetEntity, dex::Move move) { types::registry& registry = *handle.registry(); - createActionMoveForTarget({registry, targetEntity}, battleEntity, sourceEntity, move, pokedex, entity()); + setupActionMoveBuild(registry, battleEntity, sourceEntity, targetEntity, entity(), move); handle.emplace(move); handle.emplace(); + handle.emplace(); registry.emplace_or_replace(sourceEntity); registry.emplace_or_replace(targetEntity); } diff --git a/src/CalcDamage/Setup/CalcDamageInputSetup.hpp b/src/CalcDamage/Setup/CalcDamageInputSetup.hpp index f89e98f..a71e454 100644 --- a/src/CalcDamage/Setup/CalcDamageInputSetup.hpp +++ b/src/CalcDamage/Setup/CalcDamageInputSetup.hpp @@ -17,9 +17,7 @@ struct InputSetup { public: InputSetup(types::registry& registry, types::entity moveEntity); - void setup( - types::entity battleEntity, types::entity sourceEntity, types::entity targetEntity, dex::Move move, - const Pokedex& pokedex); + void setup(types::entity battleEntity, types::entity sourceEntity, types::entity targetEntity, dex::Move move); types::entity entity() const { return handle.entity(); } }; diff --git a/src/Components/EntityHolders/RecycledEntities.hpp b/src/Components/EntityHolders/RecycledEntities.hpp index eaede1d..b6b7c93 100644 --- a/src/Components/EntityHolders/RecycledEntities.hpp +++ b/src/Components/EntityHolders/RecycledEntities.hpp @@ -6,4 +6,16 @@ namespace pokesim { struct RecycledAction { types::entity val{}; }; + +struct RecycledActionMove { + types::entity val{}; +}; + +struct AddedRecycledActionMove1 { + types::entity val{}; +}; + +struct AddedRecycledActionMove2 { + types::entity val{}; +}; } // namespace pokesim diff --git a/src/Components/Tags/RecycledEntities.hpp b/src/Components/Tags/RecycledEntities.hpp index 2af36e9..fae9eea 100644 --- a/src/Components/Tags/RecycledEntities.hpp +++ b/src/Components/Tags/RecycledEntities.hpp @@ -2,4 +2,7 @@ namespace pokesim::tags { struct RecycledAction {}; +struct RecycledActionMove {}; +struct AddedRecycledActionMove1 {}; +struct AddedRecycledActionMove2 {}; } // namespace pokesim::tags diff --git a/src/Components/Tags/Selection.hpp b/src/Components/Tags/Selection.hpp index 15cf44d..3a9f55c 100644 --- a/src/Components/Tags/Selection.hpp +++ b/src/Components/Tags/Selection.hpp @@ -1,6 +1,8 @@ #pragma once namespace pokesim::internal::tags { +struct BuildPokedexMove {}; +struct BuildActionMove {}; struct CloneFromDamageRolls {}; struct ApplySideDamageRollOptions {}; } // namespace pokesim::internal::tags diff --git a/src/Pokedex/Pokedex.cpp b/src/Pokedex/Pokedex.cpp index ce67c61..4267049 100644 --- a/src/Pokedex/Pokedex.cpp +++ b/src/Pokedex/Pokedex.cpp @@ -1,5 +1,7 @@ #include "Pokedex.hpp" +#include +#include #include #include #include @@ -29,16 +31,24 @@ void Pokedex::loadItems(const entt::dense_set& itemSet) { load(itemsMap, itemSet, [this](dex::Item item) { return buildItem(item, dexRegistry); }); } -void Pokedex::loadMoves(const entt::dense_set& moveSet) { - load(movesMap, moveSet, [this](dex::Move move) { return buildMove(move, dexRegistry, false, dexRegistry.create()); }); -} - void Pokedex::loadAbilities(const entt::dense_set& abilitySet) { load(abilitiesMap, abilitySet, [this](dex::Ability ability) { return buildAbility(ability, dexRegistry); }); } -types::entity Pokedex::buildActionMove(dex::Move move, types::registry& registry, types::entity entityToUse) const { - return buildMove(move, registry, true, entityToUse); +void Pokedex::loadMoves(const entt::dense_set& moveSet) { + for (dex::Move move : moveSet) { + if (movesMap.contains(move)) { + continue; + } + + types::entity moveEntity = dexRegistry.create(); + movesMap[move] = moveEntity; + move::tags::emplaceTagFromEnum(move, {dexRegistry, moveEntity}); + dexRegistry.emplace(moveEntity); + } + + buildMoves(dexRegistry); + dexRegistry.clear(); } void Pokedex::loadForBattleInfo(const std::vector& battleInfoList) { diff --git a/src/Pokedex/Pokedex.hpp b/src/Pokedex/Pokedex.hpp index 6259800..166872c 100644 --- a/src/Pokedex/Pokedex.hpp +++ b/src/Pokedex/Pokedex.hpp @@ -39,8 +39,6 @@ class Pokedex { void load(entt::dense_map& map, const entt::dense_set& list, Build build); types::entity buildSpecies(dex::Species species, types::registry& registry) const; - types::entity buildMove( - dex::Move move, types::registry& registry, bool forActiveMove, types::entity entityToUse) const; types::entity buildItem(dex::Item item, types::registry& registry) const; types::entity buildAbility(dex::Ability ability, types::registry& registry) const; @@ -226,7 +224,7 @@ class Pokedex { return dexRegistry.all_of(movesMap.at(move)); } - types::entity buildActionMove(dex::Move move, types::registry& registry, types::entity entityToUse) const; + void buildMoves(types::registry& registry) const; void loadForBattleInfo(const std::vector& battleInfoList); }; } // namespace pokesim diff --git a/src/Pokedex/Setup/GetMoveBuild.cpp b/src/Pokedex/Setup/GetMoveBuild.cpp index 961865f..f07fcba 100644 --- a/src/Pokedex/Setup/GetMoveBuild.cpp +++ b/src/Pokedex/Setup/GetMoveBuild.cpp @@ -1,7 +1,20 @@ +#include +#include +#include +#include #include +#include +#include +#include +#include +#include +#include +#include +#include #include #include #include +#include #include #include #include @@ -10,17 +23,17 @@ #include #include #include +#include #include #include #include "../Moves/headers.hpp" -#include "MoveDexDataSetup.hpp" // TODO(aed3): Make this and the individual move files autogenerated namespace pokesim { namespace { -template +template struct BuildMove { private: enum class Optional : std::uint8_t { @@ -80,228 +93,282 @@ struct BuildMove { template struct has> : std::true_type {}; - template - static void setEffect( - dex::internal::MoveDexDataSetup& move, GameMechanics gameMechanic, const EffectValues&... effectValues) { - if constexpr (moveEffectKind == MoveEffectKind::primary) { - static_assert( - !has::value, - "Primary effects cannot have a chance to happen because they always happen if the move is successful."); - move.setPrimaryEffect(effectValues...); + struct EntitySetup { + using EntityList = entt::view>; + types::registry* registry; + const EntityList* list; + std::size_t size; + + EntitySetup(types::registry& registry_, const EntityList& list_) + : registry(®istry_), list(&list_), size(list->size_hint()) {} + + template + void add(const Component& component) { + registry->storage().reserve(size); + registry->insert(list->begin(), list->end(), component); } - else { - types::percentChance chance = Constants::MoveBaseEffectChance::DEFAULT; - if constexpr (has::value) { - chance = EffectData::chance(gameMechanic); - } - move.setSecondaryEffect(chance, effectValues...); + + template + void setProperties(Tags) { + (add(Types{}), ...); } - } - template - static void setEffectTags(dex::internal::MoveDexDataSetup& move, GameMechanics gameMechanic, Tags) { + template + bool any_of() { + return std::any_of(list->begin(), list->end(), [&](types::entity entity) { + return registry->template any_of(entity); + }); + } + }; + + template + static void buildEffect(EntitySetup& setup, GameMechanics gameMechanic) { if constexpr (moveEffectKind == MoveEffectKind::primary) { static_assert( !has::value, "Primary effects cannot have a chance to happen because they always happen if the move is successful."); - (move.setPrimaryEffect(), ...); + + POKESIM_REQUIRE( + !setup.template any_of(), + "Moves can only have primary or secondary effects, not both."); + + setup.add(move::effect::tags::Primary{}); } else { + POKESIM_REQUIRE( + !setup.template any_of(), + "Moves can only have secondary or primary effects, not both."); + types::percentChance chance = Constants::MoveBaseEffectChance::DEFAULT; if constexpr (has::value) { chance = EffectData::chance(gameMechanic); } - (move.setSecondaryEffect(chance), ...); + setup.add(move::effect::tags::Secondary{}); + setup.add(BaseEffectChance{chance}); } - } - template - static void buildEffect(dex::internal::MoveDexDataSetup& move, GameMechanics gameMechanic) { if constexpr (has::value) { - setEffect(move, gameMechanic, EffectData::atkBoost(gameMechanic)); + setup.add(AtkBoost{EffectData::atkBoost(gameMechanic)}); } if constexpr (has::value) { - setEffect(move, gameMechanic, EffectData::defBoost(gameMechanic)); + setup.add(DefBoost{EffectData::defBoost(gameMechanic)}); } if constexpr (has::value) { - setEffect(move, gameMechanic, EffectData::spaBoost(gameMechanic)); + setup.add(SpaBoost{EffectData::spaBoost(gameMechanic)}); } if constexpr (has::value) { - setEffect(move, gameMechanic, EffectData::spdBoost(gameMechanic)); + setup.add(SpdBoost{EffectData::spdBoost(gameMechanic)}); } if constexpr (has::value) { - setEffect(move, gameMechanic, EffectData::speBoost(gameMechanic)); + setup.add(SpeBoost{EffectData::speBoost(gameMechanic)}); } - setEffectTags(move, gameMechanic, EffectData::effectTags); + setup.setProperties(EffectData::effectTags); } public: - static types::entity build( - types::registry& registry, GameMechanics gameMechanic, bool forActiveMove, types::entity entityToUse) { - dex::internal::MoveDexDataSetup move(registry, entityToUse); - - if (forActiveMove) { - move.setNameTag(T::name(gameMechanic)); + static void build(types::registry& registry, GameMechanics gameMechanic) { + auto list = registry.view(); + if (list.begin() == list.end()) { + return; } - else { - move.setName(T::name(gameMechanic)); - move.setBasePp(T::basePp(gameMechanic)); + + EntitySetup setup{registry, list}; + + if (std::is_same_v) { + setup.add(MoveName{Move::name(gameMechanic)}); + setup.add(Pp{Move::basePp(gameMechanic)}); } - move.setType(T::type(gameMechanic)); - switch (T::category(gameMechanic)) { + setup.add(TypeName{Move::type(gameMechanic)}); + switch (Move::category(gameMechanic)) { case dex::MoveCategory::PHYSICAL: { - move.setCategoryPhysical(); + POKESIM_REQUIRE( + !(setup.template any_of()), + "A move can only have one category."); + + setup.add(move::tags::Physical{}); break; } case dex::MoveCategory::SPECIAL: { - move.setCategorySpecial(); + POKESIM_REQUIRE( + !(setup.template any_of()), + "A move can only have one category."); + + setup.add(move::tags::Special{}); break; } case dex::MoveCategory::STATUS: { - move.setCategoryStatus(); + POKESIM_REQUIRE( + !(setup.template any_of()), + "A move can only have one category."); + setup.add(move::tags::Status{}); break; } } - if constexpr (has::value) { - move.setAccuracy(T::accuracy(gameMechanic)); + if constexpr (has::value) { + setup.add(Accuracy{Move::accuracy(gameMechanic)}); } - if constexpr (has::value) { - move.setBasePower(T::basePower(gameMechanic)); + if constexpr (has::value) { + setup.add(BasePower{Move::basePower(gameMechanic)}); } - if constexpr (has::value) { - move.setHitCount(T::hitCount(gameMechanic)); + if constexpr (has::value) { + setup.add(HitCount{Move::hitCount(gameMechanic)}); } - if constexpr (has::value) { - buildEffect(move); - move.setEffectTargetsMoveSource(); + if constexpr (has::value) { + buildEffect(setup); + POKESIM_REQUIRE( + !(setup.template any_of()), + "Moves effects can only affect the target or source, not both."); + setup.add(move::effect::tags::MoveSource{}); } - if constexpr (has::value) { - buildEffect(move, gameMechanic); - move.setEffectTargetsMoveTarget(); + if constexpr (has::value) { + POKESIM_REQUIRE( + !(setup.template any_of()), + "Moves effects can only affect the target or source, not both."); + buildEffect(setup, gameMechanic); + setup.add(move::effect::tags::MoveTarget{}); } - if constexpr (has::value) { - buildEffect(move, gameMechanic); - move.setEffectTargetsMoveSource(); + if constexpr (has::value) { + POKESIM_REQUIRE( + !(setup.template any_of()), + "Moves effects can only affect the target or source, not both."); + buildEffect(setup, gameMechanic); + setup.add(move::effect::tags::MoveSource{}); } - if constexpr (has::value) { - buildEffect(move, gameMechanic); - move.setEffectTargetsMoveTarget(); + if constexpr (has::value) { + POKESIM_REQUIRE( + !(setup.template any_of()), + "Moves effects can only affect the target or source, not both."); + buildEffect(setup, gameMechanic); + setup.add(move::effect::tags::MoveTarget{}); } - move.setProperties(T::moveTags); + setup.setProperties(Move::moveTags); - switch (T::target(gameMechanic)) { + switch (Move::target(gameMechanic)) { case MoveTarget::ANY_SINGLE_TARGET: { - move.setProperty(); + setup.add(move::tags::AnySingleTarget{}); break; } case MoveTarget::ANY_SINGLE_FOE: { - move.setProperty(); + setup.add(move::tags::AnySingleFoe{}); break; } case MoveTarget::ANY_SINGLE_ALLY: { - move.setProperty(); + setup.add(move::tags::AnySingleAlly{}); break; } case MoveTarget::ALLY_OR_SELF: { - move.setProperty(); + setup.add(move::tags::AllyOrSelf{}); break; } case MoveTarget::SELF: { - move.setProperty(); + setup.add(move::tags::Self{}); break; } case MoveTarget::ALL_FOES: { - move.setProperty(); - move.addAddedTargets(AddedTargetOptions::TARGET_ALLY); + setup.add(move::tags::AllFoes{}); + setup.add(move::added_targets::tags::TargetAlly{}); break; } case MoveTarget::ALLIES_AND_FOES: { - move.setProperty(); - move.addAddedTargets(AddedTargetOptions::TARGET_ALLY); - move.addAddedTargets(AddedTargetOptions::USER_ALLY); + setup.add(move::tags::AlliesAndFoes{}); + setup.add(move::added_targets::tags::TargetAlly{}); + setup.add(move::added_targets::tags::UserAlly{}); break; } case MoveTarget::ALLIES_AND_SELF: { - move.setProperty(); + setup.add(move::tags::AlliesAndSelf{}); // Deliberately not USER_ALLY as the target of AlliesAndSelf moves is the user - move.addAddedTargets(AddedTargetOptions::TARGET_ALLY); + setup.add(move::added_targets::tags::TargetAlly{}); break; } case MoveTarget::FOE_SIDE: { - move.setProperty(); - move.addAddedTargets(AddedTargetOptions::TARGET_SIDE); + setup.add(move::tags::FoeSide{}); + setup.add(move::added_targets::tags::TargetSide{}); break; } case MoveTarget::ALLY_SIDE: { - move.setProperty(); - move.addAddedTargets(AddedTargetOptions::USER_SIDE); + setup.add(move::tags::AllySide{}); + setup.add(move::added_targets::tags::UserSide{}); break; } case MoveTarget::FIELD: { - move.setProperty(); - move.addAddedTargets(AddedTargetOptions::FIELD); + setup.add(move::tags::Field{}); + setup.add(move::added_targets::tags::Field{}); break; } case MoveTarget::ALLY_TEAM: { - move.setProperty(); - move.addAddedTargets(AddedTargetOptions::USER_SIDE); + setup.add(move::tags::AllyTeam{}); + setup.add(move::added_targets::tags::UserSide{}); break; } case MoveTarget::RETALIATION: { - move.setProperty(); + setup.add(move::tags::Retaliation{}); break; } case MoveTarget::RANDOM_FOE: { - move.setProperty(); + setup.add(move::tags::RandomFoe{}); break; } default: break; } - return move.entity(); + if (std::is_same_v) { + registry.remove(list.begin(), list.end()); + } } }; -types::entity buildByGameMechanic( - dex::Move move, types::registry& registry, bool forActiveMove, GameMechanics gameMechanic, - types::entity entityToUse) { - // Tidy check ignored because "using namespace" is in function - using namespace pokesim::dex; // NOLINT(google-build-using-namespace) - switch (move) { - case Move::FURY_ATTACK: return BuildMove::build(registry, gameMechanic, forActiveMove, entityToUse); - case Move::KNOCK_OFF: return BuildMove::build(registry, gameMechanic, forActiveMove, entityToUse); - case Move::MOONBLAST: return BuildMove::build(registry, gameMechanic, forActiveMove, entityToUse); - case Move::QUIVER_DANCE: return BuildMove::build(registry, gameMechanic, forActiveMove, entityToUse); - case Move::SPLASH: return BuildMove::build(registry, gameMechanic, forActiveMove, entityToUse); - case Move::THUNDERBOLT: return BuildMove::build(registry, gameMechanic, forActiveMove, entityToUse); - case Move::WILL_O_WISP: return BuildMove::build(registry, gameMechanic, forActiveMove, entityToUse); - - default: break; + +template +struct BuildMoves { + private: + template + static void buildActionMoveFromView(types::registry& registry, GameMechanics gameMechanics) { + BuildMove::build(registry, gameMechanics); } - POKESIM_REQUIRE_FAIL("Building a move that is not yet supported."); - return types::entity{}; -} + static void buildActionMoveByGameMechanic(types::registry& registry, GameMechanics gameMechanic) { + using namespace pokesim::dex; // NOLINT(google-build-using-namespace) + + buildActionMoveFromView(registry, gameMechanic); + buildActionMoveFromView(registry, gameMechanic); + buildActionMoveFromView(registry, gameMechanic); + buildActionMoveFromView(registry, gameMechanic); + buildActionMoveFromView(registry, gameMechanic); + buildActionMoveFromView(registry, gameMechanic); + buildActionMoveFromView(registry, gameMechanic); + } + + public: + static void build(const Pokedex& pokedex, types::registry& registry) { + if (pokedex.isGameMechanic(GameMechanics::SCARLET_VIOLET)) { + buildActionMoveByGameMechanic(registry, GameMechanics::SCARLET_VIOLET); + return; + } + + POKESIM_REQUIRE_FAIL("Building for a game that is not yet supported."); + } +}; } // namespace -types::entity Pokedex::buildMove( - dex::Move move, types::registry& registry, bool forActiveMove, types::entity entityToUse) const { - if (isGameMechanic(GameMechanics::SCARLET_VIOLET)) { - return buildByGameMechanic(move, registry, forActiveMove, GameMechanics::SCARLET_VIOLET, entityToUse); +void Pokedex::buildMoves(types::registry& registry) const { + if (!registry.view().empty()) { + BuildMoves::build(*this, registry); } - POKESIM_REQUIRE_FAIL("Building for a game that is not yet supported."); - return types::entity{}; + if (!registry.view().empty()) { + BuildMoves::build(*this, registry); + } } } // namespace pokesim diff --git a/src/Pokedex/Setup/MoveDexDataSetup.cpp b/src/Pokedex/Setup/MoveDexDataSetup.cpp deleted file mode 100644 index 30b4972..0000000 --- a/src/Pokedex/Setup/MoveDexDataSetup.cpp +++ /dev/null @@ -1,110 +0,0 @@ -#include "MoveDexDataSetup.hpp" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace pokesim::dex::internal { -void MoveDexDataSetup::setName(Move move) { - handle.emplace(move); -} - -void MoveDexDataSetup::setNameTag(Move move) { - move::tags::emplaceTagFromEnum(move, handle); -} - -void MoveDexDataSetup::setType(Type type) { - handle.emplace(type); -} - -void MoveDexDataSetup::addAddedTargets(AddedTargetOptions addedTargets) { - AddedTargets& existingTargets = handle.get_or_emplace(); - existingTargets.val = existingTargets.val | addedTargets; - - switch (addedTargets) { - case AddedTargetOptions::TARGET_ALLY: { - setProperty(); - break; - } - case AddedTargetOptions::USER_ALLY: { - setProperty(); - break; - } - case AddedTargetOptions::TARGET_SIDE: { - setProperty(); - break; - } - case AddedTargetOptions::USER_SIDE: { - setProperty(); - break; - } - case AddedTargetOptions::FIELD: { - setProperty(); - break; - } - default: break; - } -} - -void MoveDexDataSetup::setAccuracy(types::baseAccuracy accuracy) { - handle.emplace(accuracy); -} - -void MoveDexDataSetup::setBasePower(types::basePower basePower) { - handle.emplace(basePower); -} - -void MoveDexDataSetup::setCategoryPhysical() { - POKESIM_REQUIRE(!(handle.any_of()), "A move can only have one category."); - setProperty(); -} - -void MoveDexDataSetup::setCategorySpecial() { - POKESIM_REQUIRE(!(handle.any_of()), "A move can only have one category."); - setProperty(); -} - -void MoveDexDataSetup::setCategoryStatus() { - POKESIM_REQUIRE(!(handle.any_of()), "A move can only have one category."); - setProperty(); -} - -void MoveDexDataSetup::setBasePp(types::pp pp) { - handle.emplace(pp); -} - -void MoveDexDataSetup::setPriority(types::priority priority) { - handle.emplace(priority); -} - -void MoveDexDataSetup::setHitCount(types::moveHits hitCount) { - handle.emplace(hitCount); -} - -void MoveDexDataSetup::setEffectTargetsMoveSource() { - POKESIM_REQUIRE( - !handle.all_of(), - "Moves effects can only affect the target or source, not both."); - handle.emplace(); -} - -void MoveDexDataSetup::setEffectTargetsMoveTarget() { - POKESIM_REQUIRE( - !handle.all_of(), - "Moves effects can only affect the source or target, not both."); - handle.emplace(); -} -} // namespace pokesim::dex::internal diff --git a/src/Pokedex/Setup/MoveDexDataSetup.hpp b/src/Pokedex/Setup/MoveDexDataSetup.hpp deleted file mode 100644 index ec814d0..0000000 --- a/src/Pokedex/Setup/MoveDexDataSetup.hpp +++ /dev/null @@ -1,60 +0,0 @@ -#pragma once - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "DexDataSetup.hpp" - -namespace pokesim::dex::internal { -struct MoveDexDataSetup : DexDataSetup { - MoveDexDataSetup(types::registry& registry, types::entity entity) : DexDataSetup(registry, entity) {} - - void setName(Move move); - void setNameTag(Move move); - void setType(Type type); - void setAccuracy(types::baseAccuracy accuracy); - void setBasePower(types::basePower basePower); - - void setCategoryPhysical(); - void setCategorySpecial(); - void setCategoryStatus(); - - void setBasePp(types::pp pp); - void setPriority(types::priority priority); - void setHitCount(types::moveHits hitCount); - - void addAddedTargets(AddedTargetOptions addedTargets); - - void setEffectTargetsMoveSource(); - void setEffectTargetsMoveTarget(); - - template - void setPrimaryEffect(const EffectValues&... effectValues) { - POKESIM_REQUIRE( - !handle.all_of(), - "Moves can only have primary or secondary effects, not both."); - handle.emplace_or_replace(); - handle.emplace(effectValues...); - } - - template - void setSecondaryEffect(types::percentChance chance, const EffectValues&... effectValues) { - POKESIM_REQUIRE( - !handle.all_of(), - "Moves can only have secondary or primary effects, not both."); - handle.emplace_or_replace(); - handle.emplace(effectValues...); - handle.emplace(chance); - } -}; -} // namespace pokesim::dex::internal diff --git a/src/Pokedex/Setup/headers.hpp b/src/Pokedex/Setup/headers.hpp index 233c3a2..c1050cd 100644 --- a/src/Pokedex/Setup/headers.hpp +++ b/src/Pokedex/Setup/headers.hpp @@ -5,5 +5,4 @@ #include "AbilityDexDataSetup.hpp" #include "DexDataSetup.hpp" #include "ItemDexDataSetup.hpp" -#include "MoveDexDataSetup.hpp" #include "SpeciesDexDataSetup.hpp" diff --git a/src/Pokedex/headers.hpp b/src/Pokedex/headers.hpp index 23f94ec..ba40563 100644 --- a/src/Pokedex/headers.hpp +++ b/src/Pokedex/headers.hpp @@ -40,7 +40,6 @@ #include "Setup/AbilityDexDataSetup.hpp" #include "Setup/DexDataSetup.hpp" #include "Setup/ItemDexDataSetup.hpp" -#include "Setup/MoveDexDataSetup.hpp" #include "Setup/SpeciesDexDataSetup.hpp" #include "Species/Ampharos.hpp" #include "Species/Dragapult.hpp" diff --git a/src/SimulateTurn/SimulateTurn.cpp b/src/SimulateTurn/SimulateTurn.cpp index 3b352dd..6b60518 100644 --- a/src/SimulateTurn/SimulateTurn.cpp +++ b/src/SimulateTurn/SimulateTurn.cpp @@ -4,6 +4,7 @@ #include #include #include +#include #include #include #include @@ -30,7 +31,9 @@ #include #include #include +#include #include +#include #include #include #include @@ -53,64 +56,116 @@ auto getBattleFilter(Simulation& simulation) { return pokesim::internal::EntityFilter{simulation}; } -void addTargetAllyToTargets(types::registry& registry, const Battle& battle) { +void addAddedTarget(types::registry& registry, Battle battle, Slot allySlot) { const Sides& sides = registry.get(battle.val); - const TargetSlotName& targetSlotName = registry.get(registry.get(battle.val).val); - - types::entity allyEntity = slotToAllyPokemonEntity(registry, sides, targetSlotName.val); + types::entity allyEntity = slotToAllyPokemonEntity(registry, sides, allySlot); if (allyEntity == entt::null) { return; } CurrentActionTargets& targets = registry.get(battle.val); + + POKESIM_REQUIRE(!targets.val.empty(), "Added targets should not be the first in the list of targets."); + + if (targets.val.size() == 1U) { + registry.emplace(battle.val); + } + else { + registry.emplace(battle.val); + } + targets.val.push_back(allyEntity); } +void addTargetAllyToTargets(types::registry& registry, Battle battle) { + const TargetSlotName& targetSlotName = registry.get(registry.get(battle.val).val); + addAddedTarget(registry, battle, targetSlotName.val); +} + void addUserAllyToTargets(types::registry& registry, const Battle& battle) { - const Sides& sides = registry.get(battle.val); const SourceSlotName& sourceSlotName = registry.get(registry.get(battle.val).val); + addAddedTarget(registry, battle, sourceSlotName.val); +} - types::entity allyEntity = slotToAllyPokemonEntity(registry, sides, sourceSlotName.val); - if (allyEntity == entt::null) { - return; +void setTargetReferenceComponents( + types::registry& registry, const CurrentActionTargets& targets, CurrentActionSource source) { + for (types::entity target : targets.val) { + registry.emplace(target); + registry.emplace(target, source.val); } - - CurrentActionTargets& targets = registry.get(battle.val); - targets.val.push_back(allyEntity); } -void resolveMoveTargets(types::registry& registry, CurrentActionTargets& targets) { - for (types::entity target : targets.val) { - registry.emplace_or_replace(target); +template +void setActionMoveReferenceComponents( + types::handle battleHandle, CurrentActionSource source, CurrentActionTargets targets, CurrentAction action, + RecycledActionMoveType actionMove) { + types::registry& registry = *battleHandle.registry(); + types::handle actionMoveHandle{registry, actionMove.val}; + types::entity target; + + if constexpr (std::is_same_v) { + target = targets.val[0]; + } + else if constexpr (std::is_same_v) { + target = targets.val[1]; + } + else if constexpr (std::is_same_v) { + target = targets.val[2]; + } + else { + static_assert(false, "Using a RecycledActionMoveType that isn't associated with a target."); } - // More to do... + MoveName move = registry.get(action.val); + setupActionMoveBuild(registry, battleHandle.entity(), source.val, target, actionMove.val, move.val); } -void createActionMoveForTargets( - types::handle targetHandle, Battle battle, CurrentActionSource source, const Pokedex& pokedex) { - types::registry& registry = *targetHandle.registry(); +void setActionMoveData(Simulation& simulation) { + simulation.addToEntities(); + simulation.pokedex().buildMoves(simulation.registry); +} - dex::Move move = registry.get(registry.get(battle.val).val).val; - types::entity moveEntity = - createActionMoveForTarget(targetHandle, battle.val, source.val, move, pokedex, registry.create()); +void setCurrentActionMoveSlot(types::handle handle, CurrentActionSource source, CurrentAction action) { + types::registry& registry = *handle.registry(); + const MoveName& move = registry.get(action.val); + const MoveSlots& moveSlots = registry.get(source.val); - registry.emplace(moveEntity); + types::moveSlotIndex moveSlotIndex = moveToMoveSlot(moveSlots, move.val); + handle.emplace(moveSlotIndex); } -void getMoveTargets(Simulation& simulation) { +void setMoveTargets(Simulation& simulation) { + pokesim::internal::EntityFilter battleFilter{simulation}; + if (battleFilter.hasNoneSelected()) { + return; + } + + battleFilter.view(simulation); + + battleFilter.view>(); + setActionMoveData(simulation); + simulation.removeFromEntities(); + + runModifyTarget(simulation); if (simulation.isBattleFormat(BattleFormat::DOUBLES)) { simulation .view>(); simulation .view>(); + + battleFilter.view< + setActionMoveReferenceComponents, + Tags>(); + battleFilter.view< + setActionMoveReferenceComponents, + Tags>(); + setActionMoveData(simulation); + simulation.removeFromEntities(); + simulation.removeFromEntities(); + simulation.removeFromEntities(); } - simulation.view, entt::exclude_t>(); - simulation.view< - createActionMoveForTargets, - Tags, - entt::exclude_t>(simulation.pokedex()); + battleFilter.view(); } void useMove(Simulation& simulation) { @@ -118,7 +173,6 @@ void useMove(Simulation& simulation) { // ModifyType runModifyMove(simulation); - getMoveTargets(simulation); runMoveHitChecks(simulation); runAfterMoveUsedEvent(simulation); } @@ -147,8 +201,8 @@ void runMoveAction(Simulation& simulation) { return; } - battleFilter.view(simulation); - battleFilter.view(simulation.pokedex()); + setMoveTargets(simulation); + battleFilter.view(); runBeforeMove(simulation); @@ -311,7 +365,7 @@ void simulateTurn(Simulation& simulation) { battleFilter.view(); battleFilter.view, entt::exclude_t>(); - simulation.addToEntities(); + simulation.addToEntities(); battleFilter.view(); using ActionsLimit = Constants::ActionQueueLength; @@ -328,8 +382,7 @@ void simulateTurn(Simulation& simulation) { nextTurn(simulation); - simulation - .removeFromEntities(); + simulation.removeFromEntities(); battleFilter.view(); simulation.addToEntities(); diff --git a/src/Simulation/RunEvent.cpp b/src/Simulation/RunEvent.cpp index 0c05a47..f9c8406 100644 --- a/src/Simulation/RunEvent.cpp +++ b/src/Simulation/RunEvent.cpp @@ -130,6 +130,8 @@ template void runAfterEachBoostEvent(Simulation&); void runAfterBoostEvent(Simulation&) {} +void runModifyTarget(Simulation& simulation) {} + void runModifyMove(Simulation& simulation) { dex::ChoiceScarf::onSourceModifyMove(simulation); dex::ChoiceSpecs::onSourceModifyMove(simulation); diff --git a/src/Simulation/RunEvent.hpp b/src/Simulation/RunEvent.hpp index 560a0e5..5d453c3 100644 --- a/src/Simulation/RunEvent.hpp +++ b/src/Simulation/RunEvent.hpp @@ -31,6 +31,7 @@ void runTryBoostEvent(Simulation& simulation); template void runAfterEachBoostEvent(Simulation& simulation); void runAfterBoostEvent(Simulation& simulation); +void runModifyTarget(Simulation& simulation); // onModifyMove for Curse and Expanding force should go here void runModifyMove(Simulation& simulation); void runDisableMove(Simulation& simulation); diff --git a/src/Simulation/SimulationSetup.cpp b/src/Simulation/SimulationSetup.cpp index 182aebc..5153f7e 100644 --- a/src/Simulation/SimulationSetup.cpp +++ b/src/Simulation/SimulationSetup.cpp @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include @@ -64,6 +65,8 @@ struct EntityLists { EntityList sides; EntityList pokemon; EntityList recycledActions; + EntityList recycledActionMoves; + EntityList addedRecycledActionMoves; EntityList calcDamageInputs; EntityList analyzeEffectInputs; @@ -90,6 +93,9 @@ struct EntityLists { types::entityIndex sideCount = battleCount * 2; types::entityIndex recycledActionCount = battleCount; + types::entityIndex recycledActionMoveCount = battleCount; + types::entityIndex addedRecycledActionMoveCount = + simulation->isBattleFormat(BattleFormat::DOUBLES) ? battleCount * 2 : 0; POKESIM_REQUIRE( battleCount + sideCount + recycledActionCount + pokemonCount + calcDamageInputCount + analyzeEffectInputCount < @@ -101,6 +107,8 @@ struct EntityLists { sides = {registry, sideCount}; pokemon = {registry, pokemonCount}; recycledActions = {registry, recycledActionCount}; + recycledActionMoves = {registry, recycledActionMoveCount}; + addedRecycledActionMoves = {registry, addedRecycledActionMoveCount}; calcDamageInputs = {registry, calcDamageInputCount}; analyzeEffectInputs = {registry, analyzeEffectInputCount}; } @@ -275,7 +283,7 @@ void createInitialPokemon( void createCalcDamageInput( const CalcDamageInputInfo& inputInfo, BattleStateSetup& battleSetup, types::registry& registry, - const Pokedex& pokedex, EntityLists& entityLists, debug::SimulationSetupChecks& debugChecks) { + EntityLists& entityLists, debug::SimulationSetupChecks& debugChecks) { POKESIM_REQUIRE(inputInfo.attackerSlot != Slot::NONE, "A damage calculation must have a attacker."); POKESIM_REQUIRE(inputInfo.defenderSlot != Slot::NONE, "A damage calculation must have a defender."); POKESIM_REQUIRE(!inputInfo.moves.empty(), "A damage calculation must have a move."); @@ -288,7 +296,7 @@ void createCalcDamageInput( calc_damage::InputSetup inputSetup{registry, entityLists.calcDamageInputs.getNext()}; POKESIM_REQUIRE(move != dex::Move::NO_MOVE, "A damage calculation must have a move."); - inputSetup.setup(battleSetup.entity(), attackerEntity, defenderEntity, move, pokedex); + inputSetup.setup(battleSetup.entity(), attackerEntity, defenderEntity, move); debugChecks.addToCalcDamageChecklist(battleSetup, inputSetup, inputInfo); } } @@ -446,7 +454,12 @@ void createInitialState( for (types::entityIndex battleIndex = 0; battleIndex < battleSetupList.size(); battleIndex++) { BattleStateSetup& battleSetup = battleSetupList[battleIndex]; createInitialBattle(battleInfo, battleSetup, sideSetupLists[battleIndex]); - battleSetup.setRecycledAction(entityLists.recycledActions.getNext()); + battleSetup.setRecycledAction(entityLists.recycledActions.getNext(), entityLists.recycledActionMoves.getNext()); + if (simulation->isBattleFormat(BattleFormat::DOUBLES)) { + battleSetup.setAddedRecycledActionMoves( + entityLists.addedRecycledActionMoves.getNext(), + entityLists.addedRecycledActionMoves.getNext()); + } } for (types::sideIndex sideIndex = 0; sideIndex < battleInfo.sides.size(); sideIndex++) { @@ -482,7 +495,7 @@ void createInitialState( BattleStateSetup& battleSetup = battleSetupList[0]; for (const CalcDamageInputInfo& calcDamageInputInfo : battleInfo.damageCalculations) { - createCalcDamageInput(calcDamageInputInfo, battleSetup, registry, pokedex, entityLists, debugChecks); + createCalcDamageInput(calcDamageInputInfo, battleSetup, registry, entityLists, debugChecks); } for (const AnalyzeEffectInputInfo& analyzeEffectInputInfo : battleInfo.effectsToAnalyze) { @@ -500,6 +513,9 @@ void Simulation::createInitialStates(const std::vector& batt createInitialState(battleInfo, this, entityLists, debugChecks); } + pokedex().buildMoves(registry); + registry.clear(); + debugChecks.checkOutputs(); } } // namespace pokesim diff --git a/src/Utilities/ArgumentChecks.cpp b/src/Utilities/ArgumentChecks.cpp index 9f209ed..7bf5744 100644 --- a/src/Utilities/ArgumentChecks.cpp +++ b/src/Utilities/ArgumentChecks.cpp @@ -688,6 +688,15 @@ void check(const RecycledAction& recycledAction, const types::registry& registry POKESIM_REQUIRE_NM(has(recycledAction.val, registry)); } +template <> +void check(const RecycledActionMove&, const types::registry&) {} + +template <> +void check(const AddedRecycledActionMove1&, const types::registry&) {} + +template <> +void check(const AddedRecycledActionMove2&, const types::registry&) {} + template <> void check(const Side& side, const types::registry& registry) { checkSide(side.val, registry); diff --git a/src/Utilities/ArgumentChecks.hpp b/src/Utilities/ArgumentChecks.hpp index 517b32c..93e0de2 100644 --- a/src/Utilities/ArgumentChecks.hpp +++ b/src/Utilities/ArgumentChecks.hpp @@ -51,6 +51,9 @@ struct FaintQueue; struct FoeSide; struct Pokemon; struct RecycledAction; +struct RecycledActionMove; +struct AddedRecycledActionMove1; +struct AddedRecycledActionMove2; struct Side; struct Sides; struct Team; @@ -322,6 +325,15 @@ void check(const Pokemon&, const types::registry&); template <> void check(const RecycledAction&, const types::registry&); +template <> +void check(const RecycledActionMove&, const types::registry&); + +template <> +void check(const AddedRecycledActionMove1&, const types::registry&); + +template <> +void check(const AddedRecycledActionMove2&, const types::registry&); + template <> void check(const Side&, const types::registry&); From c6c12b5d887f5f8a40d8510776486f6052283230 Mon Sep 17 00:00:00 2001 From: aed3 <32887801+aed3@users.noreply.github.com> Date: Fri, 26 Jun 2026 10:36:14 -0500 Subject: [PATCH 08/10] Pre-PR review fixes Found some things while looking over the code before making the PR to fix. Removing that unused entity holder and that `removeFromEntities` shortcut resulted in small performance improvements. --- extras/PokeSim.cpp | 57 ++- extras/PokeSim.hpp | 28 +- extras/RecentBenchmarkResults.md | 472 +++++++++++----------- src/Battle/Clone/Clone.cpp | 21 +- src/Battle/Pokemon/ManagePokemonState.cpp | 4 +- src/Components/EntityHolders/Pokemon.hpp | 10 - src/Components/EntityHolders/headers.hpp | 1 - src/Components/headers.hpp | 1 - src/SimulateTurn/SimulateTurn.cpp | 1 - src/Simulation/Simulation.hpp | 12 +- src/Simulation/SimulationSetup.cpp | 12 +- src/Utilities/ArgumentChecks.cpp | 20 +- src/Utilities/ArgumentChecks.hpp | 4 - src/Utilities/DebugChecks.hpp | 1 - tools/updateBenchmarkResultsFile.js | 3 - 15 files changed, 310 insertions(+), 337 deletions(-) delete mode 100644 src/Components/EntityHolders/Pokemon.hpp diff --git a/extras/PokeSim.cpp b/extras/PokeSim.cpp index db9422b..13b6ae4 100644 --- a/extras/PokeSim.cpp +++ b/extras/PokeSim.cpp @@ -833,11 +833,6 @@ void check(const FoeSide& foeSide, const types::registry& registry) { checkSide(foeSide.val, registry); } -template <> -void check(const Pokemon& pokemon, const types::registry& registry) { - checkPokemon(pokemon.val, registry); -} - template <> void check(const RecycledAction& recycledAction, const types::registry& registry) { types::registry::checkEntity(recycledAction.val, registry); @@ -845,13 +840,22 @@ void check(const RecycledAction& recycledAction, const types::registry& registry } template <> -void check(const RecycledActionMove&, const types::registry&) {} +void check(const RecycledActionMove& recycledActionMove, const types::registry& registry) { + types::registry::checkEntity(recycledActionMove.val, registry); + POKESIM_REQUIRE_NM(has(recycledActionMove.val, registry)); +} template <> -void check(const AddedRecycledActionMove1&, const types::registry&) {} +void check(const AddedRecycledActionMove1& addedRecycledActionMove1, const types::registry& registry) { + types::registry::checkEntity(addedRecycledActionMove1.val, registry); + POKESIM_REQUIRE_NM(has(addedRecycledActionMove1.val, registry)); +} template <> -void check(const AddedRecycledActionMove2&, const types::registry&) {} +void check(const AddedRecycledActionMove2& addedRecycledActionMove2, const types::registry& registry) { + types::registry::checkEntity(addedRecycledActionMove2.val, registry); + POKESIM_REQUIRE_NM(has(addedRecycledActionMove2.val, registry)); +} template <> void check(const Side& side, const types::registry& registry) { @@ -1398,10 +1402,10 @@ struct EntityLists { EntityList analyzeEffectInputs; EntityLists(Simulation* simulation, const std::vector& battleInfoList) { - types::entityIndex battleCount = 0; - types::entityIndex pokemonCount = 0; - types::entityIndex calcDamageInputCount = 0; - types::entityIndex analyzeEffectInputCount = 0; + types::entityIndex battleCount = 0U; + types::entityIndex pokemonCount = 0U; + types::entityIndex calcDamageInputCount = 0U; + types::entityIndex analyzeEffectInputCount = 0U; for (const BattleCreationInfo& battleInfo : battleInfoList) { types::entityIndex battleCountIncrease = getBattleCreationCount(battleInfo); battleCount += battleCountIncrease; @@ -1418,11 +1422,11 @@ struct EntityLists { } } - types::entityIndex sideCount = battleCount * 2; + types::entityIndex sideCount = battleCount * 2U; types::entityIndex recycledActionCount = battleCount; types::entityIndex recycledActionMoveCount = battleCount; types::entityIndex addedRecycledActionMoveCount = - simulation->isBattleFormat(BattleFormat::DOUBLES) ? battleCount * 2 : 0; + simulation->isBattleFormat(BattleFormat::DOUBLES) ? battleCount * 2U : 0U; POKESIM_REQUIRE( battleCount + sideCount + recycledActionCount + pokemonCount + calcDamageInputCount + analyzeEffectInputCount < @@ -5700,11 +5704,11 @@ void clearVolatiles(types::handle pokemonHandle) { void deductPp(types::handle handle, MoveSlots& moveSlots, LastUsedMove lastUsedMove) { MoveSlot& moveSlot = moveSlots.val[lastUsedMove.val]; - if (moveSlot.pp >= Constants::PP_USE_DEDUCTION) { + if (moveSlot.pp >= Constants::PP_USE_DEDUCTION + Constants::MovePp::MIN) { moveSlot.pp -= Constants::PP_USE_DEDUCTION; } else { - moveSlot.pp = 0U; + moveSlot.pp = Constants::MovePp::MIN; } } @@ -6238,26 +6242,20 @@ void traverseAction(types::registry& registry, VisitEntity visitEntity = nullptr const static bool ForCloning = !std::is_same_v; using Tag = std::conditional_t; - for (types::entity entity : registry.view()) { - if constexpr (ForCloning) { + if constexpr (ForCloning) { + for (types::entity entity : registry.view()) { visitEntity(entity); } - } - for (types::entity entity : registry.view()) { - if constexpr (ForCloning) { + for (types::entity entity : registry.view()) { visitEntity(entity); } - } - for (types::entity entity : registry.view()) { - if constexpr (ForCloning) { + for (types::entity entity : registry.view()) { visitEntity(entity); } - } - for (types::entity entity : registry.view()) { - if constexpr (ForCloning) { + for (types::entity entity : registry.view()) { visitEntity(entity); } } @@ -6268,8 +6266,8 @@ void traversePokemon(types::registry& registry, VisitEntity visitEntity = nullpt const static bool ForCloning = !std::is_same_v; using Tag = std::conditional_t; - for (types::entity entity : registry.view()) { - if constexpr (ForCloning) { + if constexpr (ForCloning) { + for (types::entity entity : registry.view()) { visitEntity(entity); } } @@ -6429,7 +6427,6 @@ types::ClonedEntityMap clone(types::registry& registry, std::optional(registry, entityMap); remapComponentEntities(registry, entityMap); remapComponentEntities(registry, entityMap); - remapComponentEntities(registry, entityMap); remapComponentEntities(registry, entityMap); remapComponentEntities(registry, entityMap); remapComponentEntities(registry, entityMap); diff --git a/extras/PokeSim.hpp b/extras/PokeSim.hpp index 55a0bef..549c607 100644 --- a/extras/PokeSim.hpp +++ b/extras/PokeSim.hpp @@ -116,7 +116,6 @@ * src/Components/EVsIVs.hpp * src/Components/EntityHolders/FaintQueue.hpp * src/Components/EntityHolders/FoeSide.hpp - * src/Components/EntityHolders/Pokemon.hpp * src/Components/EntityHolders/RecycledEntities.hpp * src/Components/EntityHolders/Side.hpp * src/Components/EntityHolders/Sides.hpp @@ -18994,17 +18993,6 @@ struct FoeSide { /////////////// END OF src/Components/EntityHolders/FoeSide.hpp //////////////// -////////////// START OF src/Components/EntityHolders/Pokemon.hpp /////////////// - -namespace pokesim { -// Contains the entity pointing to a Pokemon. -struct Pokemon { - types::entity val{}; -}; -} // namespace pokesim - -/////////////// END OF src/Components/EntityHolders/Pokemon.hpp //////////////// - ////////// START OF src/Components/EntityHolders/RecycledEntities.hpp ////////// namespace pokesim { @@ -20471,7 +20459,6 @@ struct CurrentEffectsAsSource; struct CurrentEffectsAsTarget; struct FaintQueue; struct FoeSide; -struct Pokemon; struct RecycledAction; struct RecycledActionMove; struct AddedRecycledActionMove1; @@ -20741,9 +20728,6 @@ void check(const FaintQueue&, const types::registry&); template <> void check(const FoeSide&, const types::registry&); -template <> -void check(const Pokemon&, const types::registry&); - template <> void check(const RecycledAction&, const types::registry&); @@ -22653,14 +22637,22 @@ class Simulation { } template void addToEntities(const Args&... args) { + static_assert( + sizeof...(ViewComponents) != 0, + "Using this function without view components will cause Type to be added to every entity."); auto view = registry.view(); registry.insert(view.begin(), view.end(), args...); } template void removeFromEntities(entt::exclude_t exclude = entt::exclude_t{}) { - auto view = registry.view(exclude); - registry.remove(view.begin(), view.end()); + if constexpr (sizeof...(ViewComponents) == 0 && sizeof...(ExcludeComponents) == 0) { + registry.clear(); + } + else { + auto view = registry.view(exclude); + registry.remove(view.begin(), view.end()); + } } }; } // namespace pokesim diff --git a/extras/RecentBenchmarkResults.md b/extras/RecentBenchmarkResults.md index 71e713b..4adce63 100644 --- a/extras/RecentBenchmarkResults.md +++ b/extras/RecentBenchmarkResults.md @@ -7,311 +7,311 @@ ## SV-SingleBattle-MonteCarlo-SimulateTurn-VerticalSlice1 | Inputs | Samples | Iterations / Sample | Estimated Completion Time | Mean of Samples | Standard Deviation | Mean / Input Count | Mean Lower Bound / Input Count | Mean Upper Bound / Input Count | | --- | --- | --- | --- | --- | --- | --- | --- | --- | -| 1 | 100 | 1 | 43.381900ms | 63.417550us | 12.817032us | 63.417550us | 61.717240us | 67.683650us | -| 2 | 100 | 1 | 44.497800ms | 70.374910us | 14.399336us | 35.187455us | 34.237415us | 37.614045us | -| 4 | 100 | 1 | 44.797500ms | 78.332580us | 15.879060us | 19.583145us | 19.014033us | 20.743215us | -| 8 | 100 | 1 | 47.529200ms | 90.995550us | 13.920075us | 11.374444us | 11.120759us | 11.864353us | -| 16 | 100 | 1 | 51.556000ms | 117.265460us | 16.781695us | 7.329091us | 7.179881us | 7.641741us | -| 32 | 100 | 1 | 57.162700ms | 161.205750us | 13.231306us | 5.037680us | 4.984249us | 5.179010us | -| 64 | 100 | 1 | 65.824800ms | 244.118350us | 13.013730us | 3.814349us | 3.788056us | 3.885549us | -| 128 | 100 | 1 | 83.877900ms | 406.880530us | 12.961477us | 3.178754us | 3.164539us | 3.208747us | -| 256 | 100 | 1 | 92.631100ms | 730.921030us | 15.071236us | 2.855160us | 2.846282us | 2.871166us | -| 512 | 100 | 1 | 164.067900ms | 1.362391ms | 15.303680us | 2.660920us | 2.655922us | 2.667878us | -| 1024 | 100 | 1 | 271.740400ms | 2.651165ms | 28.652598us | 2.589028us | 2.583687us | 2.594703us | -| 2048 | 100 | 1 | 528.744500ms | 5.239759ms | 42.181872us | 2.558476us | 2.554594us | 2.562661us | -| 4096 | 100 | 1 | 1043.827100ms | 10.409944ms | 96.274773us | 2.541490us | 2.537023us | 2.546249us | -| 8192 | 100 | 1 | 2093.676800ms | 20.745960ms | 185.374837us | 2.532466us | 2.528229us | 2.537086us | -| 16384 | 100 | 1 | 4191.933900ms | 41.881316ms | 361.209030us | 2.556233us | 2.552013us | 2.560656us | -| 32768 | 100 | 1 | 8551.309100ms | 84.488597ms | 723.208438us | 2.578387us | 2.574386us | 2.583017us | -| 65536 | 100 | 1 | 17072.208700ms | 171.459211ms | 1.188298ms | 2.616260us | 2.613041us | 2.620199us | +| 1 | 100 | 1 | 41.812800ms | 64.410770us | 10.613091us | 64.410770us | 62.923830us | 67.598850us | +| 2 | 100 | 1 | 44.811200ms | 69.359510us | 12.225382us | 34.679755us | 33.837560us | 36.581325us | +| 4 | 100 | 1 | 45.432100ms | 79.643050us | 13.034458us | 19.910763us | 19.410393us | 20.769002us | +| 8 | 100 | 1 | 47.340000ms | 89.290100us | 12.679521us | 11.161263us | 10.922881us | 11.587753us | +| 16 | 100 | 1 | 50.377200ms | 116.391260us | 14.009545us | 7.274454us | 7.145342us | 7.516420us | +| 32 | 100 | 1 | 55.668500ms | 159.736090us | 11.495001us | 4.991753us | 4.936947us | 5.086350us | +| 64 | 100 | 1 | 65.361300ms | 242.715470us | 13.385733us | 3.792429us | 3.762530us | 3.853901us | +| 128 | 100 | 1 | 82.613400ms | 404.300350us | 11.075102us | 3.158596us | 3.145546us | 3.181765us | +| 256 | 100 | 1 | 91.589800ms | 722.717890us | 12.542475us | 2.823117us | 2.815423us | 2.835470us | +| 512 | 100 | 1 | 161.780200ms | 1.367900ms | 18.836156us | 2.671679us | 2.664916us | 2.679382us | +| 1024 | 100 | 1 | 270.591700ms | 2.627893ms | 19.273673us | 2.566302us | 2.562771us | 2.570133us | +| 2048 | 100 | 1 | 529.576500ms | 5.214860ms | 53.712859us | 2.546319us | 2.541447us | 2.551790us | +| 4096 | 100 | 1 | 1028.742500ms | 10.355275ms | 105.030953us | 2.528143us | 2.523365us | 2.533476us | +| 8192 | 100 | 1 | 2070.164400ms | 20.586104ms | 189.235971us | 2.512952us | 2.508843us | 2.517972us | +| 16384 | 100 | 1 | 4141.424700ms | 41.496992ms | 386.738538us | 2.532775us | 2.528571us | 2.537910us | +| 32768 | 100 | 1 | 8299.488800ms | 83.789194ms | 775.171153us | 2.557043us | 2.552890us | 2.562288us | +| 65536 | 100 | 1 | 16878.553400ms | 169.356254ms | 932.327033us | 2.584171us | 2.581514us | 2.587102us | ## SV-SingleBattle-Branching-SimulateTurn-VerticalSlice1 | Inputs | Samples | Iterations / Sample | Estimated Completion Time | Mean of Samples | Standard Deviation | Mean / Input Count | Mean Lower Bound / Input Count | Mean Upper Bound / Input Count | | --- | --- | --- | --- | --- | --- | --- | --- | --- | -| 1 | 100 | 1 | 60.789300ms | 178.255930us | 18.008754us | 178.255930us | 176.058420us | 185.400650us | -| 2 | 100 | 1 | 66.433500ms | 235.892970us | 14.757494us | 117.946485us | 116.952050us | 120.348745us | -| 4 | 100 | 1 | 46.285100ms | 340.366630us | 20.309748us | 85.091657us | 84.434012us | 86.834990us | -| 8 | 100 | 1 | 62.698700ms | 532.518370us | 13.484854us | 66.564796us | 66.355913us | 67.193173us | -| 16 | 100 | 1 | 100.788800ms | 888.207060us | 15.142385us | 55.512941us | 55.383358us | 55.807822us | -| 32 | 100 | 1 | 175.353100ms | 1.598046ms | 16.252428us | 49.938928us | 49.849579us | 50.052531us | -| 64 | 100 | 1 | 323.492300ms | 2.950534ms | 28.345774us | 46.102089us | 46.017768us | 46.190412us | -| 128 | 100 | 1 | 625.015600ms | 5.640892ms | 59.804657us | 44.069472us | 43.982858us | 44.167469us | -| 256 | 100 | 1 | 1193.612600ms | 11.085049ms | 144.559831us | 43.300972us | 43.200696us | 43.424172us | -| 512 | 100 | 1 | 2312.156500ms | 21.620416ms | 310.103580us | 42.227376us | 42.116649us | 42.354801us | -| 1024 | 100 | 1 | 4402.386100ms | 42.803413ms | 905.954952us | 41.800208us | 41.632900us | 41.982244us | -| 2048 | 100 | 1 | 8644.022200ms | 86.135049ms | 1.533156ms | 42.058129us | 41.922359us | 42.215999us | -| 4096 | 100 | 1 | 17572.836400ms | 176.689001ms | 1.765788ms | 43.136963us | 43.061451us | 43.231110us | -| 8192 | 100 | 1 | 36396.212000ms | 364.126864ms | 1.951395ms | 44.449080us | 44.405619us | 44.499236us | +| 1 | 100 | 1 | 58.163000ms | 176.119500us | 14.512645us | 176.119500us | 174.076850us | 180.498130us | +| 2 | 100 | 1 | 65.307900ms | 234.839760us | 15.332718us | 117.419880us | 116.348895us | 119.747675us | +| 4 | 100 | 1 | 45.145400ms | 336.142090us | 17.076938us | 84.035523us | 83.452685us | 85.377718us | +| 8 | 100 | 1 | 62.287900ms | 522.963890us | 11.457068us | 65.370486us | 65.161474us | 65.773331us | +| 16 | 100 | 1 | 101.154700ms | 888.516450us | 20.869015us | 55.532278us | 55.317294us | 55.840456us | +| 32 | 100 | 1 | 176.625400ms | 1.556070ms | 19.464035us | 48.627184us | 48.535648us | 48.793738us | +| 64 | 100 | 1 | 319.875400ms | 2.896670ms | 33.479973us | 45.260475us | 45.163830us | 45.369003us | +| 128 | 100 | 1 | 618.644100ms | 5.546284ms | 59.750287us | 43.330343us | 43.252121us | 43.438863us | +| 256 | 100 | 1 | 1151.506400ms | 10.722321ms | 84.227375us | 41.884064us | 41.822439us | 41.951441us | +| 512 | 100 | 1 | 2196.152500ms | 20.810947ms | 219.889225us | 40.646381us | 40.571680us | 40.741695us | +| 1024 | 100 | 1 | 4219.736700ms | 40.871901ms | 538.619921us | 39.913965us | 39.822107us | 40.031604us | +| 2048 | 100 | 1 | 8269.893600ms | 81.293653ms | 816.960237us | 39.694166us | 39.622747us | 39.781102us | +| 4096 | 100 | 1 | 16490.486400ms | 166.452831ms | 1.743960ms | 40.637898us | 40.570346us | 40.744618us | +| 8192 | 100 | 1 | 34419.343400ms | 346.039368ms | 1.470653ms | 42.241134us | 42.206612us | 42.277211us | ## SV-DoubleBattle-MonteCarlo-SimulateTurn-VerticalSlice1 | Inputs | Samples | Iterations / Sample | Estimated Completion Time | Mean of Samples | Standard Deviation | Mean / Input Count | Mean Lower Bound / Input Count | Mean Upper Bound / Input Count | | --- | --- | --- | --- | --- | --- | --- | --- | --- | -| 1 | 100 | 1 | 56.227500ms | 97.929180us | 16.991819us | 97.929180us | 95.568320us | 103.177750us | -| 2 | 100 | 1 | 57.634000ms | 108.533160us | 18.172834us | 54.266580us | 52.971730us | 56.929900us | -| 4 | 100 | 1 | 60.893900ms | 127.336220us | 28.322764us | 31.834055us | 30.808467us | 33.856890us | -| 8 | 100 | 1 | 62.496600ms | 148.829430us | 23.740940us | 18.603679us | 18.169814us | 19.443205us | -| 16 | 100 | 1 | 40.416300ms | 191.450380us | 13.904993us | 11.965649us | 11.861500us | 12.310057us | -| 32 | 100 | 1 | 51.338700ms | 288.499740us | 26.719532us | 9.015617us | 8.902575us | 9.277624us | -| 64 | 100 | 1 | 67.905500ms | 430.153450us | 12.426516us | 6.721148us | 6.693788us | 6.779708us | -| 128 | 100 | 1 | 83.713500ms | 746.734900us | 16.076640us | 5.833866us | 5.811229us | 5.860574us | -| 256 | 100 | 1 | 142.792800ms | 1.339796ms | 24.874331us | 5.233577us | 5.219982us | 5.262930us | -| 512 | 100 | 1 | 262.341600ms | 2.542657ms | 33.052700us | 4.966128us | 4.954136us | 4.979625us | -| 1024 | 100 | 1 | 511.444500ms | 4.955431ms | 61.473689us | 4.839288us | 4.828513us | 4.852362us | -| 2048 | 100 | 1 | 986.649900ms | 9.810576ms | 115.151561us | 4.790320us | 4.780336us | 4.802513us | -| 4096 | 100 | 1 | 1954.020400ms | 19.450265ms | 187.967994us | 4.748600us | 4.740145us | 4.758288us | -| 8192 | 100 | 1 | 3915.753400ms | 39.185225ms | 390.407078us | 4.783353us | 4.774407us | 4.793154us | -| 16384 | 100 | 1 | 7869.706900ms | 79.138612ms | 748.600593us | 4.830238us | 4.822304us | 4.840378us | -| 32768 | 100 | 1 | 16377.208600ms | 163.022287ms | 1.606141ms | 4.975045us | 4.966346us | 4.985738us | -| 65536 | 100 | 1 | 33682.688600ms | 336.932238ms | 1.525740ms | 5.141178us | 5.137039us | 5.146296us | +| 1 | 100 | 1 | 54.424500ms | 96.700350us | 16.468150us | 96.700350us | 94.469360us | 101.891580us | +| 2 | 100 | 1 | 55.863600ms | 109.740020us | 17.444388us | 54.870010us | 53.589350us | 57.350430us | +| 4 | 100 | 1 | 59.855000ms | 123.350980us | 19.947269us | 30.837745us | 30.195015us | 32.628638us | +| 8 | 100 | 1 | 61.344800ms | 145.996070us | 16.544502us | 18.249509us | 17.970055us | 18.936669us | +| 16 | 100 | 1 | 40.349500ms | 192.570550us | 16.320874us | 12.035659us | 11.893081us | 12.346166us | +| 32 | 100 | 1 | 50.671400ms | 275.636480us | 14.517291us | 8.613640us | 8.547742us | 8.742956us | +| 64 | 100 | 1 | 68.248000ms | 429.723110us | 12.393512us | 6.714424us | 6.683335us | 6.762779us | +| 128 | 100 | 1 | 82.665400ms | 730.178540us | 12.349704us | 5.704520us | 5.689514us | 5.729443us | +| 256 | 100 | 1 | 141.352400ms | 1.327241ms | 13.103564us | 5.184534us | 5.174971us | 5.195082us | +| 512 | 100 | 1 | 260.796700ms | 2.517451ms | 29.220961us | 4.916897us | 4.906757us | 4.929288us | +| 1024 | 100 | 1 | 506.724300ms | 4.887645ms | 42.071362us | 4.773091us | 4.766053us | 4.782430us | +| 2048 | 100 | 1 | 976.053700ms | 9.673801ms | 94.835464us | 4.723536us | 4.715200us | 4.733430us | +| 4096 | 100 | 1 | 1939.586300ms | 19.169027ms | 179.625633us | 4.679938us | 4.672027us | 4.689362us | +| 8192 | 100 | 1 | 3880.831800ms | 38.621122ms | 364.510444us | 4.714492us | 4.706193us | 4.723713us | +| 16384 | 100 | 1 | 7760.602200ms | 77.884083ms | 722.467931us | 4.753667us | 4.745750us | 4.763304us | +| 32768 | 100 | 1 | 15970.031900ms | 160.705123ms | 1.162949ms | 4.904331us | 4.897900us | 4.911857us | +| 65536 | 100 | 1 | 33302.099700ms | 333.177880ms | 1.406518ms | 5.083891us | 5.079829us | 5.088285us | ## SV-DoubleBattle-Branching-SimulateTurn-VerticalSlice1 | Inputs | Samples | Iterations / Sample | Estimated Completion Time | Mean of Samples | Standard Deviation | Mean / Input Count | Mean Lower Bound / Input Count | Mean Upper Bound / Input Count | | --- | --- | --- | --- | --- | --- | --- | --- | --- | -| 1 | 100 | 1 | 69.785400ms | 421.807180us | 17.402421us | 421.807180us | 419.754730us | 428.921790us | -| 2 | 100 | 1 | 78.139000ms | 635.735740us | 21.228702us | 317.867870us | 316.462565us | 321.367850us | -| 4 | 100 | 1 | 120.824400ms | 1.000890ms | 19.017028us | 250.222582us | 249.564047us | 251.677190us | -| 8 | 100 | 1 | 188.858900ms | 1.694148ms | 21.253690us | 211.768501us | 211.293539us | 212.357116us | -| 16 | 100 | 1 | 324.176000ms | 2.998626ms | 31.062360us | 187.414148us | 187.064984us | 187.830516us | -| 32 | 100 | 1 | 611.593500ms | 5.651887ms | 72.840952us | 176.621466us | 176.214572us | 177.112176us | -| 64 | 100 | 1 | 1187.149800ms | 10.790684ms | 122.511621us | 168.604433us | 168.255948us | 169.011043us | -| 128 | 100 | 1 | 2253.315600ms | 21.205899ms | 551.510914us | 165.671089us | 165.015220us | 166.814178us | -| 256 | 100 | 1 | 4419.050200ms | 42.295507ms | 1.218220ms | 165.216823us | 164.395334us | 166.276540us | -| 512 | 100 | 1 | 8490.986700ms | 83.831534ms | 1.727556ms | 163.733465us | 163.122637us | 164.453968us | -| 1024 | 100 | 1 | 16977.077400ms | 169.280030ms | 1.637682ms | 165.312529us | 165.023158us | 165.653488us | -| 2048 | 100 | 1 | 33418.257200ms | 337.639636ms | 2.276157ms | 164.863103us | 164.661824us | 165.099274us | -| 4096 | 100 | 1 | 68280.679000ms | 680.907739ms | 2.797624ms | 166.237241us | 166.109517us | 166.378642us | +| 1 | 100 | 1 | 68.781600ms | 418.995070us | 18.291826us | 418.995070us | 416.385850us | 424.331330us | +| 2 | 100 | 1 | 74.290300ms | 613.443300us | 18.385417us | 306.721650us | 305.413160us | 309.418715us | +| 4 | 100 | 1 | 111.756300ms | 975.307620us | 18.308259us | 243.826905us | 243.171562us | 245.149225us | +| 8 | 100 | 1 | 184.274200ms | 1.660305ms | 26.456051us | 207.538166us | 206.925606us | 208.224419us | +| 16 | 100 | 1 | 324.812500ms | 2.951015ms | 35.147060us | 184.438419us | 184.070315us | 184.954260us | +| 32 | 100 | 1 | 593.472100ms | 5.529738ms | 52.863369us | 172.804314us | 172.505745us | 173.154561us | +| 64 | 100 | 1 | 1143.484900ms | 10.519655ms | 98.933867us | 164.369613us | 164.087314us | 164.693767us | +| 128 | 100 | 1 | 2204.598000ms | 20.468510ms | 238.941670us | 159.910237us | 159.589040us | 160.329441us | +| 256 | 100 | 1 | 4261.828000ms | 41.830724ms | 1.723036ms | 163.401267us | 162.234796us | 164.907955us | +| 512 | 100 | 1 | 8289.530600ms | 80.515633ms | 1.292235ms | 157.257096us | 156.811789us | 157.806180us | +| 1024 | 100 | 1 | 16396.756800ms | 161.586219ms | 1.370532ms | 157.799042us | 157.547054us | 158.070821us | +| 2048 | 100 | 1 | 31942.599700ms | 323.483822ms | 4.232925ms | 157.951085us | 157.605704us | 158.435030us | +| 4096 | 100 | 1 | 65320.875900ms | 650.907380ms | 2.389461ms | 158.912935us | 158.807548us | 159.037943us | ## SV-SingleBattle-CalcDamage-VerticalSlice1 | Inputs | Samples | Iterations / Sample | Estimated Completion Time | Mean of Samples | Standard Deviation | Mean / Input Count | Mean Lower Bound / Input Count | Mean Upper Bound / Input Count | | --- | --- | --- | --- | --- | --- | --- | --- | --- | -| 1 | 100 | 1 | 8.074900ms | 10.613180us | 3.518546us | 10.613180us | 10.117910us | 11.677290us | -| 2 | 100 | 1 | 8.113700ms | 12.340150us | 3.655208us | 6.170075us | 5.911905us | 6.718160us | -| 4 | 100 | 1 | 8.257500ms | 12.916550us | 3.846172us | 3.229137us | 3.089212us | 3.503635us | -| 8 | 100 | 1 | 8.615200ms | 14.178410us | 4.393653us | 1.772301us | 1.693150us | 1.930828us | -| 16 | 100 | 1 | 9.173300ms | 17.633840us | 3.312056us | 1.102115us | 1.074572us | 1.170093us | -| 32 | 100 | 1 | 9.827400ms | 26.045510us | 16.045571us | 813.922187ns | 758.694062ns | 1.056528us | -| 64 | 100 | 1 | 11.292800ms | 37.242870us | 8.110317us | 581.919844ns | 566.773906ns | 632.833281ns | -| 128 | 100 | 1 | 13.967100ms | 59.258370us | 4.321090us | 462.956016ns | 457.766641ns | 471.768828ns | -| 256 | 100 | 1 | 19.061900ms | 104.279840us | 3.901526us | 407.343125ns | 404.947734ns | 411.198867ns | -| 512 | 100 | 1 | 29.563800ms | 192.226560us | 4.349039us | 375.442500ns | 373.952090ns | 377.326836ns | -| 1024 | 100 | 1 | 42.556300ms | 370.676630us | 5.595350us | 361.988896ns | 360.961650ns | 363.106113ns | -| 2048 | 100 | 1 | 93.378600ms | 724.126210us | 10.787976us | 353.577251ns | 352.649360ns | 354.746270ns | -| 4096 | 100 | 1 | 146.070400ms | 1.431497ms | 19.279921us | 349.486689ns | 348.647034ns | 350.506338ns | -| 8192 | 100 | 1 | 332.061500ms | 2.842520ms | 30.227138us | 346.987322ns | 346.315614ns | 347.771526ns | -| 16384 | 100 | 1 | 666.743800ms | 5.694379ms | 99.924798us | 347.557292ns | 346.606776ns | 349.148726ns | -| 32768 | 100 | 1 | 1317.111300ms | 11.310501ms | 137.544226us | 345.169099ns | 344.436630ns | 346.092781ns | -| 65536 | 100 | 1 | 2635.532000ms | 22.732340ms | 210.438187us | 346.867977ns | 346.271245ns | 347.542165ns | +| 1 | 100 | 1 | 7.744100ms | 10.695850us | 3.416505us | 10.695850us | 10.225820us | 11.760020us | +| 2 | 100 | 1 | 7.999900ms | 12.316620us | 4.003514us | 6.158310us | 5.873765us | 6.742695us | +| 4 | 100 | 1 | 7.990500ms | 12.923390us | 3.909913us | 3.230847us | 3.092548us | 3.525740us | +| 8 | 100 | 1 | 8.248800ms | 14.491220us | 3.936035us | 1.811403us | 1.738154us | 1.946499us | +| 16 | 100 | 1 | 8.703000ms | 18.785980us | 5.926089us | 1.174124us | 1.126027us | 1.301746us | +| 32 | 100 | 1 | 9.490200ms | 24.697390us | 6.589186us | 771.793437ns | 746.378750ns | 848.976562ns | +| 64 | 100 | 1 | 11.030100ms | 36.141160us | 3.659896us | 564.705625ns | 556.369375ns | 580.727188ns | +| 128 | 100 | 1 | 13.696300ms | 58.077550us | 3.697501us | 453.730859ns | 449.304531ns | 461.260000ns | +| 256 | 100 | 1 | 18.714700ms | 103.424030us | 7.166658us | 404.000117ns | 400.001484ns | 412.038906ns | +| 512 | 100 | 1 | 29.134400ms | 188.731770us | 3.412212us | 368.616738ns | 367.495566ns | 370.155566ns | +| 1024 | 100 | 1 | 41.800400ms | 362.664140us | 4.132482us | 354.164199ns | 353.408486ns | 354.997178ns | +| 2048 | 100 | 1 | 91.092400ms | 710.905980us | 7.654724us | 347.122061ns | 346.427822ns | 347.898501ns | +| 4096 | 100 | 1 | 144.453400ms | 1.410041ms | 16.486543us | 344.248381ns | 343.515916ns | 345.099919ns | +| 8192 | 100 | 1 | 328.181500ms | 2.808827ms | 32.681289us | 342.874351ns | 342.181533ns | 343.766742ns | +| 16384 | 100 | 1 | 650.308000ms | 5.584978ms | 59.026460us | 340.879984ns | 340.235309ns | 341.657454ns | +| 32768 | 100 | 1 | 1302.452000ms | 11.229741ms | 108.848624us | 342.704485ns | 342.119248ns | 343.432393ns | +| 65536 | 100 | 1 | 2652.809300ms | 22.544264ms | 179.816747us | 343.998169ns | 343.522599ns | 344.615771ns | ## SV-SingleBattle-AnalyzeEffect-VerticalSlice1 | Inputs | Samples | Iterations / Sample | Estimated Completion Time | Mean of Samples | Standard Deviation | Mean / Input Count | Mean Lower Bound / Input Count | Mean Upper Bound / Input Count | | --- | --- | --- | --- | --- | --- | --- | --- | --- | -| 1 | 100 | 1 | 24.731200ms | 59.413390us | 11.683582us | 59.413390us | 57.807560us | 63.041540us | -| 2 | 100 | 1 | 26.229700ms | 70.380520us | 17.668965us | 35.190260us | 34.009085us | 38.101740us | -| 4 | 100 | 1 | 28.355200ms | 91.027080us | 12.512447us | 22.756770us | 22.318225us | 23.712400us | -| 8 | 100 | 1 | 32.909400ms | 126.064000us | 10.078354us | 15.758000us | 15.581552us | 16.136524us | -| 16 | 100 | 1 | 41.381200ms | 193.052160us | 12.551299us | 12.065760us | 11.956058us | 12.303438us | -| 32 | 100 | 1 | 42.366500ms | 316.069630us | 9.403277us | 9.877176us | 9.839824us | 9.983210us | -| 64 | 100 | 1 | 71.826200ms | 562.140510us | 9.235113us | 8.783445us | 8.763020us | 8.825402us | -| 128 | 100 | 1 | 129.951200ms | 1.055924ms | 23.475509us | 8.249405us | 8.220084us | 8.295735us | -| 256 | 100 | 1 | 237.150100ms | 1.976069ms | 40.610960us | 7.719018us | 7.696854us | 7.766414us | -| 512 | 100 | 1 | 457.946100ms | 3.883428ms | 46.479848us | 7.584821us | 7.568368us | 7.603967us | -| 1024 | 100 | 1 | 886.648800ms | 7.544317ms | 87.297846us | 7.367497us | 7.352009us | 7.385582us | -| 2048 | 100 | 1 | 1628.876000ms | 15.006660ms | 247.183185us | 7.327471us | 7.306806us | 7.354658us | -| 4096 | 100 | 1 | 3120.031100ms | 29.416814ms | 414.863959us | 7.181839us | 7.163903us | 7.204059us | -| 8192 | 100 | 1 | 6236.974900ms | 60.351535ms | 889.984328us | 7.367131us | 7.347718us | 7.390622us | -| 16384 | 100 | 1 | 12933.843400ms | 128.214172ms | 2.131437ms | 7.825572us | 7.802043us | 7.853072us | -| 32768 | 100 | 1 | 27232.064700ms | 270.696784ms | 2.359379ms | 8.261010us | 8.247686us | 8.276051us | -| 65536 | 100 | 1 | 59579.857500ms | 595.449481ms | 2.831556ms | 9.085838us | 9.077998us | 9.095005us | +| 1 | 100 | 1 | 28.694800ms | 57.617330us | 9.198119us | 57.617330us | 56.350270us | 60.472490us | +| 2 | 100 | 1 | 30.301300ms | 69.118740us | 11.595012us | 34.559370us | 33.699535us | 36.144545us | +| 4 | 100 | 1 | 32.548200ms | 88.074370us | 12.473999us | 22.018593us | 21.579225us | 22.947085us | +| 8 | 100 | 1 | 37.372200ms | 127.977970us | 9.835300us | 15.997246us | 15.804711us | 16.307325us | +| 16 | 100 | 1 | 46.329700ms | 187.443720us | 10.319932us | 11.715233us | 11.619277us | 11.891499us | +| 32 | 100 | 1 | 42.392400ms | 313.347180us | 10.416110us | 9.792099us | 9.743124us | 9.881070us | +| 64 | 100 | 1 | 72.380800ms | 548.792260us | 10.908489us | 8.574879us | 8.550356us | 8.623546us | +| 128 | 100 | 1 | 129.958800ms | 1.034135ms | 14.708402us | 8.079183us | 8.058559us | 8.103757us | +| 256 | 100 | 1 | 241.450000ms | 1.947662ms | 22.481428us | 7.608053us | 7.591882us | 7.626514us | +| 512 | 100 | 1 | 454.467400ms | 3.809853ms | 51.576459us | 7.441118us | 7.424772us | 7.465450us | +| 1024 | 100 | 1 | 862.451000ms | 7.419605ms | 63.198825us | 7.245708us | 7.234562us | 7.258873us | +| 2048 | 100 | 1 | 1613.272500ms | 14.545996ms | 116.832606us | 7.102537us | 7.092377us | 7.114790us | +| 4096 | 100 | 1 | 3056.781800ms | 28.652978ms | 275.603694us | 6.995356us | 6.983105us | 7.009625us | +| 8192 | 100 | 1 | 6062.615100ms | 59.389962ms | 773.001591us | 7.249751us | 7.232492us | 7.269536us | +| 16384 | 100 | 1 | 12404.663600ms | 124.122005ms | 1.207120ms | 7.575806us | 7.561884us | 7.590622us | +| 32768 | 100 | 1 | 26375.589700ms | 263.007432ms | 1.736749ms | 8.026350us | 8.016360us | 8.037224us | +| 65536 | 100 | 1 | 58744.488500ms | 583.838130ms | 1.947928ms | 8.908663us | 8.903017us | 8.914710us | ## SV-SingleBattle-MonteCarlo-SimulateTurn-RandomInputs-OneRandomBattle-OneRandomInput | Inputs | Samples | Iterations / Sample | Estimated Completion Time | Mean of Samples | Standard Deviation | Mean / Input Count | Mean Lower Bound / Input Count | Mean Upper Bound / Input Count | | --- | --- | --- | --- | --- | --- | --- | --- | --- | -| 1 | 100 | 1 | 40.238900ms | 69.398290us | 15.398271us | 69.398290us | 66.924410us | 73.159510us | -| 2 | 100 | 1 | 40.581800ms | 73.729500us | 17.159087us | 36.864750us | 35.434200us | 38.881740us | -| 4 | 100 | 1 | 41.319600ms | 81.246220us | 16.547413us | 20.311555us | 19.614020us | 21.277822us | -| 8 | 100 | 1 | 42.635400ms | 92.819900us | 18.707507us | 11.602487us | 11.196264us | 12.127259us | -| 16 | 100 | 1 | 45.799000ms | 117.145680us | 24.529121us | 7.321605us | 7.054964us | 7.663263us | -| 32 | 100 | 1 | 48.111600ms | 155.457230us | 28.965154us | 4.858038us | 4.697912us | 5.055575us | -| 64 | 100 | 1 | 54.781300ms | 239.015840us | 47.726324us | 3.734622us | 3.602921us | 3.897605us | -| 128 | 100 | 1 | 40.027300ms | 391.078740us | 78.197046us | 3.055303us | 2.948786us | 3.192210us | -| 256 | 100 | 1 | 96.002600ms | 702.702020us | 152.478620us | 2.744930us | 2.642425us | 2.880149us | -| 512 | 100 | 1 | 180.424500ms | 1.259945ms | 284.372541us | 2.460830us | 2.365173us | 2.585266us | -| 1024 | 100 | 1 | 441.141700ms | 2.443407ms | 580.269171us | 2.386139us | 2.288357us | 2.512679us | -| 2048 | 100 | 1 | 771.745900ms | 4.877686ms | 1.217654ms | 2.381683us | 2.278083us | 2.512753us | -| 4096 | 100 | 1 | 1499.712600ms | 9.867006ms | 2.418921ms | 2.408937us | 2.305551us | 2.540141us | -| 8192 | 100 | 1 | 1607.219400ms | 19.937750ms | 4.888810ms | 2.433807us | 2.329078us | 2.565982us | -| 16384 | 100 | 1 | 3367.381300ms | 40.410623ms | 9.995553ms | 2.466469us | 2.359091us | 2.601099us | -| 32768 | 100 | 1 | 7427.924700ms | 82.582544ms | 20.549416ms | 2.520219us | 2.411112us | 2.660224us | +| 1 | 100 | 1 | 39.296800ms | 65.967040us | 15.651345us | 65.967040us | 63.477230us | 69.905500us | +| 2 | 100 | 1 | 39.786700ms | 74.364430us | 18.692057us | 37.182215us | 35.645205us | 39.405250us | +| 4 | 100 | 1 | 40.330800ms | 81.503910us | 16.633579us | 20.375978us | 19.680528us | 21.341272us | +| 8 | 100 | 1 | 42.143900ms | 90.237610us | 16.599146us | 11.279701us | 10.919396us | 11.740909us | +| 16 | 100 | 1 | 43.412100ms | 119.949260us | 37.148564us | 7.496829us | 7.170080us | 8.195664us | +| 32 | 100 | 1 | 47.338500ms | 157.963110us | 31.916415us | 4.936347us | 4.758865us | 5.155409us | +| 64 | 100 | 1 | 53.622700ms | 233.826040us | 46.734239us | 3.653532us | 3.523565us | 3.813181us | +| 128 | 100 | 1 | 57.840400ms | 385.494130us | 79.282268us | 3.011673us | 2.904076us | 3.150131us | +| 256 | 100 | 1 | 93.011100ms | 689.251710us | 147.508840us | 2.692389us | 2.593992us | 2.822483us | +| 512 | 100 | 1 | 215.428900ms | 1.230267ms | 287.296993us | 2.402865us | 2.306641us | 2.531161us | +| 1024 | 100 | 1 | 436.221200ms | 2.396178ms | 573.736951us | 2.340018us | 2.243888us | 2.466864us | +| 2048 | 100 | 1 | 747.289200ms | 4.742278ms | 1.186398ms | 2.315565us | 2.215083us | 2.444445us | +| 4096 | 100 | 1 | 1486.914900ms | 9.670002ms | 2.398906ms | 2.360840us | 2.259849us | 2.491898us | +| 8192 | 100 | 1 | 1567.550800ms | 19.481458ms | 4.897783ms | 2.378108us | 2.274543us | 2.512788us | +| 16384 | 100 | 1 | 3294.990700ms | 39.614178ms | 9.978755ms | 2.417858us | 2.310997us | 2.551948us | +| 32768 | 100 | 1 | 7206.425300ms | 80.945634ms | 20.213887ms | 2.470265us | 2.362542us | 2.607539us | ## SV-SingleBattle-MonteCarlo-SimulateTurn-RandomInputs-OneRandomBattle-ManyRandomInputs | Inputs | Samples | Iterations / Sample | Estimated Completion Time | Mean of Samples | Standard Deviation | Mean / Input Count | Mean Lower Bound / Input Count | Mean Upper Bound / Input Count | | --- | --- | --- | --- | --- | --- | --- | --- | --- | -| 1 | 100 | 1 | 39.955300ms | 66.640740us | 16.236346us | 66.640740us | 64.078360us | 70.808810us | -| 2 | 100 | 1 | 47.105300ms | 83.506740us | 19.357833us | 41.753370us | 40.238695us | 44.235305us | -| 4 | 100 | 1 | 57.098300ms | 101.894950us | 23.811410us | 25.473737us | 24.570502us | 27.050840us | -| 8 | 100 | 1 | 58.619600ms | 122.821990us | 23.665505us | 15.352749us | 14.885573us | 16.092022us | -| 16 | 100 | 1 | 62.349100ms | 151.388350us | 26.749514us | 9.461772us | 9.178484us | 9.848943us | -| 32 | 100 | 1 | 47.880500ms | 195.167000us | 24.979409us | 6.098969us | 5.956233us | 6.263403us | -| 64 | 100 | 1 | 60.817200ms | 279.539190us | 35.459201us | 4.367800us | 4.265458us | 4.483715us | -| 128 | 100 | 1 | 60.134800ms | 454.811240us | 51.215898us | 3.553213us | 3.476719us | 3.633584us | -| 256 | 100 | 1 | 94.175700ms | 755.951740us | 93.212530us | 2.952936us | 2.885148us | 3.028552us | -| 512 | 100 | 1 | 212.144700ms | 1.422240ms | 185.266664us | 2.777812us | 2.709510us | 2.851989us | -| 1024 | 100 | 1 | 381.536000ms | 2.647147ms | 378.263845us | 2.585105us | 2.516907us | 2.662644us | -| 2048 | 100 | 1 | 548.123100ms | 5.280597ms | 655.890477us | 2.578416us | 2.516967us | 2.642443us | -| 4096 | 100 | 1 | 1318.855100ms | 10.852361ms | 1.561290ms | 2.649502us | 2.578271us | 2.728409us | -| 8192 | 100 | 1 | 2017.749500ms | 21.602523ms | 3.332996ms | 2.637027us | 2.564612us | 2.725674us | -| 16384 | 100 | 1 | 3496.665500ms | 45.426847ms | 5.306025ms | 2.772635us | 2.711117us | 2.838625us | -| 32768 | 100 | 1 | 9982.675500ms | 93.374885ms | 11.525760ms | 2.849575us | 2.782619us | 2.920539us | +| 1 | 100 | 1 | 38.895300ms | 65.179230us | 15.947083us | 65.179230us | 62.647510us | 69.191710us | +| 2 | 100 | 1 | 39.771500ms | 86.643040us | 17.384812us | 43.321520us | 41.808725us | 45.253165us | +| 4 | 100 | 1 | 57.081500ms | 98.455710us | 17.096963us | 24.613928us | 23.912005us | 25.637207us | +| 8 | 100 | 1 | 46.726100ms | 119.458700us | 18.736255us | 14.932337us | 14.532960us | 15.471093us | +| 16 | 100 | 1 | 50.652000ms | 149.415710us | 21.057817us | 9.338482us | 9.099269us | 9.619647us | +| 32 | 100 | 1 | 60.559000ms | 193.016630us | 25.203515us | 6.031770us | 5.887825us | 6.198360us | +| 64 | 100 | 1 | 68.742900ms | 275.413990us | 35.996543us | 4.303344us | 4.198623us | 4.421129us | +| 128 | 100 | 1 | 61.222500ms | 447.448670us | 50.539713us | 3.495693us | 3.422321us | 3.577479us | +| 256 | 100 | 1 | 94.411800ms | 751.251990us | 94.376256us | 2.934578us | 2.867349us | 3.012100us | +| 512 | 100 | 1 | 226.852600ms | 1.397829ms | 181.452892us | 2.730134us | 2.664364us | 2.803475us | +| 1024 | 100 | 1 | 377.991800ms | 2.585393ms | 370.758004us | 2.524798us | 2.458083us | 2.600545us | +| 2048 | 100 | 1 | 530.871900ms | 5.135049ms | 645.747600us | 2.507348us | 2.447650us | 2.570923us | +| 4096 | 100 | 1 | 1297.011500ms | 10.580533ms | 1.554946ms | 2.583138us | 2.512838us | 2.662451us | +| 8192 | 100 | 1 | 1953.164000ms | 21.136448ms | 3.252297ms | 2.580133us | 2.509519us | 2.666563us | +| 16384 | 100 | 1 | 3390.706500ms | 44.123448ms | 5.172564ms | 2.693082us | 2.633290us | 2.757579us | +| 32768 | 100 | 1 | 9742.000200ms | 90.811982ms | 11.504846ms | 2.771362us | 2.704248us | 2.842261us | ## SV-SingleBattle-MonteCarlo-SimulateTurn-RandomInputs-ManyRandomBattles-ManyRandomInputs | Inputs | Samples | Iterations / Sample | Estimated Completion Time | Mean of Samples | Standard Deviation | Mean / Input Count | Mean Lower Bound / Input Count | Mean Upper Bound / Input Count | | --- | --- | --- | --- | --- | --- | --- | --- | --- | -| 1 | 100 | 1 | 39.918700ms | 66.076350us | 15.819423us | 66.076350us | 63.596510us | 70.069630us | -| 2 | 100 | 1 | 47.267900ms | 85.146990us | 18.445526us | 42.573495us | 41.177285us | 45.023125us | -| 4 | 100 | 1 | 57.397300ms | 104.553170us | 20.625112us | 26.138292us | 25.365682us | 27.558463us | -| 8 | 100 | 1 | 65.919600ms | 133.059930us | 21.959852us | 16.632491us | 16.209124us | 17.344415us | -| 16 | 100 | 1 | 60.312100ms | 173.442720us | 19.864179us | 10.840170us | 10.639640us | 11.146895us | -| 32 | 100 | 1 | 66.121600ms | 234.835280us | 19.102403us | 7.338603us | 7.243752us | 7.488817us | -| 64 | 100 | 1 | 84.495300ms | 351.319880us | 21.456518us | 5.489373us | 5.441558us | 5.586037us | -| 128 | 100 | 1 | 114.797000ms | 561.354490us | 18.451307us | 4.385582us | 4.359771us | 4.416799us | -| 256 | 100 | 1 | 111.774600ms | 974.159080us | 28.556082us | 3.805309us | 3.785469us | 3.829838us | -| 512 | 100 | 1 | 205.151500ms | 1.721591ms | 33.148915us | 3.362483us | 3.350238us | 3.375582us | -| 1024 | 100 | 1 | 397.858100ms | 3.330081ms | 66.183073us | 3.252032us | 3.239991us | 3.265358us | -| 2048 | 100 | 1 | 777.497200ms | 6.750344ms | 252.793011us | 3.296066us | 3.274130us | 3.322827us | -| 4096 | 100 | 1 | 1597.138600ms | 14.088948ms | 595.116276us | 3.439685us | 3.414986us | 3.473059us | -| 8192 | 100 | 1 | 3293.034100ms | 32.559129ms | 1.350518ms | 3.974503us | 3.944686us | 4.010015us | -| 16384 | 100 | 1 | 7905.986000ms | 78.582591ms | 1.533448ms | 4.796301us | 4.779788us | 4.816928us | -| 32768 | 100 | 1 | 17821.011600ms | 178.055130ms | 1.985696ms | 5.433811us | 5.422947us | 5.446945us | +| 1 | 100 | 1 | 39.136400ms | 66.576990us | 17.309905us | 66.576990us | 63.875020us | 71.031900us | +| 2 | 100 | 1 | 46.481400ms | 84.827920us | 18.982256us | 42.413960us | 40.998280us | 45.014000us | +| 4 | 100 | 1 | 48.575900ms | 104.577050us | 18.194988us | 26.144262us | 25.464862us | 27.395430us | +| 8 | 100 | 1 | 59.066000ms | 129.160640us | 18.754053us | 16.145080us | 15.799235us | 16.784999us | +| 16 | 100 | 1 | 67.905100ms | 169.310210us | 20.041990us | 10.581888us | 10.382197us | 10.893959us | +| 32 | 100 | 1 | 73.221600ms | 234.828800us | 22.610659us | 7.338400us | 7.226386us | 7.515850us | +| 64 | 100 | 1 | 93.302100ms | 348.880560us | 23.250427us | 5.451259us | 5.392658us | 5.539776us | +| 128 | 100 | 1 | 114.429100ms | 556.978350us | 20.545081us | 4.351393us | 4.324243us | 4.388245us | +| 256 | 100 | 1 | 128.150700ms | 952.892230us | 21.429536us | 3.722235us | 3.706526us | 3.739384us | +| 512 | 100 | 1 | 204.682400ms | 1.702825ms | 30.587237us | 3.325830us | 3.314766us | 3.338207us | +| 1024 | 100 | 1 | 387.349500ms | 3.282676ms | 68.190076us | 3.205738us | 3.195898us | 3.224204us | +| 2048 | 100 | 1 | 764.120800ms | 6.563048ms | 140.324327us | 3.204613us | 3.192260us | 3.219359us | +| 4096 | 100 | 1 | 1568.697200ms | 14.457058ms | 420.090960us | 3.529555us | 3.510256us | 3.550583us | +| 8192 | 100 | 1 | 3282.954800ms | 31.616605ms | 752.427811us | 3.859449us | 3.843104us | 3.879339us | +| 16384 | 100 | 1 | 7811.748100ms | 77.396062ms | 901.243971us | 4.723881us | 4.714107us | 4.735845us | +| 32768 | 100 | 1 | 17717.420700ms | 175.728594ms | 1.438841ms | 5.362811us | 5.354887us | 5.372185us | ## SV-SingleBattle-CalcDamage-RandomInputs-OneRandomBattle-OneRandomInput | Inputs | Samples | Iterations / Sample | Estimated Completion Time | Mean of Samples | Standard Deviation | Mean / Input Count | Mean Lower Bound / Input Count | Mean Upper Bound / Input Count | | --- | --- | --- | --- | --- | --- | --- | --- | --- | -| 1 | 100 | 1 | 9.390300ms | 13.284440us | 5.264188us | 13.284440us | 12.476200us | 14.645800us | -| 2 | 100 | 1 | 9.799600ms | 14.829240us | 5.564010us | 7.414620us | 6.953100us | 8.072980us | -| 4 | 100 | 1 | 10.196400ms | 17.859980us | 8.737827us | 4.464995us | 4.146865us | 5.085102us | -| 8 | 100 | 1 | 10.909900ms | 22.020790us | 9.633537us | 2.752599us | 2.561251us | 3.053294us | -| 16 | 100 | 1 | 9.796000ms | 30.839390us | 11.267051us | 1.927462us | 1.794736us | 2.071538us | -| 32 | 100 | 1 | 10.752100ms | 45.188030us | 17.506885us | 1.412126us | 1.304308us | 1.519295us | -| 64 | 100 | 1 | 12.468900ms | 75.366450us | 31.597738us | 1.177601us | 1.079560us | 1.273634us | -| 128 | 100 | 1 | 20.821200ms | 133.365800us | 58.508777us | 1.041920us | 951.313984ns | 1.129857us | -| 256 | 100 | 1 | 31.870100ms | 249.822750us | 114.165416us | 975.870117ns | 887.472188ns | 1.062948us | -| 512 | 100 | 1 | 61.764500ms | 418.955180us | 224.293617us | 818.271836ns | 732.731562ns | 904.453145ns | -| 1024 | 100 | 1 | 110.609200ms | 833.592120us | 449.201906us | 814.054805ns | 728.546846ns | 899.972373ns | -| 2048 | 100 | 1 | 215.174100ms | 1.671185ms | 908.710354us | 816.008276ns | 729.012061ns | 902.767109ns | -| 4096 | 100 | 1 | 616.706600ms | 3.359757ms | 1.818650ms | 820.253118ns | 733.815676ns | 907.881929ns | -| 8192 | 100 | 1 | 1227.927600ms | 6.793170ms | 3.646900ms | 829.244437ns | 742.521782ns | 916.632931ns | -| 16384 | 100 | 1 | 2463.592000ms | 13.833313ms | 7.511234ms | 844.318394ns | 755.329111ns | 934.408203ns | -| 32768 | 100 | 1 | 1260.110300ms | 27.972810ms | 15.746289ms | 853.662411ns | 760.544120ns | 948.347020ns | +| 1 | 100 | 1 | 9.281300ms | 12.882730us | 4.503493us | 12.882730us | 12.181030us | 14.034820us | +| 2 | 100 | 1 | 9.493800ms | 14.967660us | 5.621356us | 7.483830us | 7.018605us | 8.155395us | +| 4 | 100 | 1 | 9.830400ms | 18.185240us | 7.597458us | 4.546310us | 4.252262us | 5.037750us | +| 8 | 100 | 1 | 10.493300ms | 21.487820us | 7.231599us | 2.685977us | 2.516505us | 2.869960us | +| 16 | 100 | 1 | 11.714100ms | 29.953710us | 11.058561us | 1.872107us | 1.737398us | 2.006979us | +| 32 | 100 | 1 | 10.349800ms | 45.853260us | 21.100808us | 1.432914us | 1.321325us | 1.585775us | +| 64 | 100 | 1 | 12.246200ms | 75.088690us | 31.266282us | 1.173261us | 1.075051us | 1.267450us | +| 128 | 100 | 1 | 20.548400ms | 132.740740us | 58.557500us | 1.037037us | 947.394609ns | 1.125965us | +| 256 | 100 | 1 | 31.726600ms | 248.382120us | 114.311158us | 970.242656ns | 882.405234ns | 1.057647us | +| 512 | 100 | 1 | 61.065800ms | 419.251070us | 224.621054us | 818.849746ns | 732.365781ns | 904.899023ns | +| 1024 | 100 | 1 | 108.493200ms | 828.829220us | 449.072441us | 809.403535ns | 723.406074ns | 896.395889ns | +| 2048 | 100 | 1 | 214.125200ms | 1.668830ms | 912.108377us | 814.858462ns | 727.528975ns | 901.593911ns | +| 4096 | 100 | 1 | 608.766300ms | 3.339028ms | 1.809850ms | 815.192283ns | 728.678948ns | 902.426763ns | +| 8192 | 100 | 1 | 1212.611100ms | 6.753387ms | 3.620123ms | 824.388018ns | 736.994628ns | 910.304702ns | +| 16384 | 100 | 1 | 2436.718600ms | 13.787446ms | 7.485719ms | 841.518928ns | 752.065709ns | 931.515229ns | +| 32768 | 100 | 1 | 1263.239900ms | 27.800361ms | 15.609926ms | 848.399691ns | 755.240095ns | 942.076887ns | ## SV-SingleBattle-CalcDamage-RandomInputs-OneRandomBattle-ManyRandomInputs | Inputs | Samples | Iterations / Sample | Estimated Completion Time | Mean of Samples | Standard Deviation | Mean / Input Count | Mean Lower Bound / Input Count | Mean Upper Bound / Input Count | | --- | --- | --- | --- | --- | --- | --- | --- | --- | -| 1 | 100 | 1 | 9.447900ms | 13.509250us | 5.589642us | 13.509250us | 12.611420us | 14.899170us | -| 2 | 100 | 1 | 9.512600ms | 16.370540us | 4.729824us | 8.185270us | 7.827700us | 8.822950us | -| 4 | 100 | 1 | 10.455800ms | 17.821540us | 4.021482us | 4.455385us | 4.304540us | 4.723912us | -| 8 | 100 | 1 | 10.904000ms | 22.125830us | 5.055394us | 2.765729us | 2.671054us | 2.936160us | -| 16 | 100 | 1 | 12.681600ms | 28.738470us | 4.464246us | 1.796154us | 1.751829us | 1.867030us | -| 32 | 100 | 1 | 13.364300ms | 44.749960us | 5.807342us | 1.398436us | 1.368211us | 1.441638us | -| 64 | 100 | 1 | 17.387500ms | 72.957500us | 18.186065us | 1.139961us | 1.106275us | 1.255777us | -| 128 | 100 | 1 | 13.001500ms | 124.778070us | 7.561057us | 974.828672ns | 964.139688ns | 987.467656ns | -| 256 | 100 | 1 | 23.399500ms | 228.996250us | 9.815459us | 894.516602ns | 887.407305ns | 902.426680ns | -| 512 | 100 | 1 | 43.279100ms | 439.417460us | 12.292203us | 858.237227ns | 853.612773ns | 862.988223ns | -| 1024 | 100 | 1 | 89.143300ms | 859.249370us | 17.436897us | 839.110713ns | 835.816035ns | 842.507031ns | -| 2048 | 100 | 1 | 174.759700ms | 1.697438ms | 35.387344us | 828.827163ns | 825.559380ns | 832.298037ns | -| 4096 | 100 | 1 | 349.981100ms | 3.464073ms | 150.285288us | 845.721030ns | 841.057666ns | 858.607083ns | -| 8192 | 100 | 1 | 715.937100ms | 6.921317ms | 114.788724us | 844.887313ns | 842.245271ns | 847.772095ns | -| 16384 | 100 | 1 | 1433.189300ms | 13.899350ms | 205.907802us | 848.348975ns | 845.927060ns | 850.845021ns | -| 32768 | 100 | 1 | 2863.808800ms | 28.325676ms | 680.936967us | 864.431024ns | 861.237004ns | 869.815971ns | +| 1 | 100 | 1 | 9.242000ms | 13.146540us | 4.147769us | 13.146540us | 12.422940us | 14.070120us | +| 2 | 100 | 1 | 9.254200ms | 15.793350us | 3.749088us | 7.896675us | 7.603480us | 8.373470us | +| 4 | 100 | 1 | 10.247200ms | 17.389930us | 3.509557us | 4.347482us | 4.219698us | 4.594655us | +| 8 | 100 | 1 | 10.610800ms | 22.772540us | 5.863189us | 2.846567us | 2.735711us | 3.044040us | +| 16 | 100 | 1 | 12.307000ms | 30.029510us | 9.243447us | 1.876844us | 1.798936us | 2.063049us | +| 32 | 100 | 1 | 13.232300ms | 43.718160us | 9.099352us | 1.366193us | 1.328665us | 1.461762us | +| 64 | 100 | 1 | 17.139300ms | 70.400470us | 6.037977us | 1.100007us | 1.083706us | 1.121252us | +| 128 | 100 | 1 | 13.113100ms | 123.717720us | 7.394618us | 966.544688ns | 956.258281ns | 979.130937ns | +| 256 | 100 | 1 | 23.374300ms | 226.781330us | 9.301527us | 885.864570ns | 879.212500ns | 893.545469ns | +| 512 | 100 | 1 | 42.946300ms | 437.958200us | 12.213190us | 855.387109ns | 850.744961ns | 860.124453ns | +| 1024 | 100 | 1 | 89.047600ms | 857.226530us | 16.951742us | 837.135283ns | 833.826396ns | 840.334795ns | +| 2048 | 100 | 1 | 174.729600ms | 1.702241ms | 36.595307us | 831.172412ns | 827.694912ns | 834.690112ns | +| 4096 | 100 | 1 | 348.893700ms | 3.429840ms | 53.283505us | 837.363330ns | 834.858679ns | 839.959651ns | +| 8192 | 100 | 1 | 712.074200ms | 6.871512ms | 95.368851us | 838.807644ns | 836.629833ns | 841.219465ns | +| 16384 | 100 | 1 | 1406.063900ms | 13.859635ms | 214.366783us | 845.924990ns | 843.457043ns | 848.561189ns | +| 32768 | 100 | 1 | 2826.122700ms | 28.015054ms | 318.756751us | 854.951609ns | 853.149748ns | 856.972537ns | ## SV-SingleBattle-CalcDamage-RandomInputs-ManyRandomBattles-ManyRandomInputs | Inputs | Samples | Iterations / Sample | Estimated Completion Time | Mean of Samples | Standard Deviation | Mean / Input Count | Mean Lower Bound / Input Count | Mean Upper Bound / Input Count | | --- | --- | --- | --- | --- | --- | --- | --- | --- | -| 1 | 100 | 1 | 6.631800ms | 13.136740us | 4.613613us | 13.136740us | 12.398670us | 14.273790us | -| 2 | 100 | 1 | 10.322900ms | 15.531150us | 5.311985us | 7.765575us | 7.367985us | 8.482470us | -| 4 | 100 | 1 | 11.315400ms | 18.231640us | 5.237512us | 4.557910us | 4.391360us | 5.022017us | -| 8 | 100 | 1 | 11.961200ms | 25.036520us | 10.481453us | 3.129565us | 2.960560us | 3.588153us | -| 16 | 100 | 1 | 12.999600ms | 33.106270us | 4.620079us | 2.069142us | 2.024959us | 2.145649us | -| 32 | 100 | 1 | 14.264900ms | 49.787790us | 5.073774us | 1.555868us | 1.530061us | 1.594338us | -| 64 | 100 | 1 | 18.265600ms | 81.867300us | 5.562510us | 1.279177us | 1.264301us | 1.298846us | -| 128 | 100 | 1 | 15.298900ms | 145.286350us | 6.585051us | 1.135050us | 1.125520us | 1.145637us | -| 256 | 100 | 1 | 27.589400ms | 272.763940us | 11.651773us | 1.065484us | 1.056955us | 1.074793us | -| 512 | 100 | 1 | 49.415400ms | 464.358750us | 18.906656us | 906.950684ns | 900.794707ns | 915.570859ns | -| 1024 | 100 | 1 | 99.558800ms | 917.495770us | 25.767481us | 895.991963ns | 891.184404ns | 901.049473ns | -| 2048 | 100 | 1 | 202.949900ms | 1.861090ms | 48.009471us | 908.735449ns | 904.345225ns | 913.502119ns | -| 4096 | 100 | 1 | 403.876600ms | 3.819120ms | 87.883403us | 932.402249ns | 928.377688ns | 936.770142ns | -| 8192 | 100 | 1 | 814.121600ms | 7.857365ms | 140.857255us | 959.151039ns | 956.021390ns | 962.817142ns | -| 16384 | 100 | 1 | 1646.624300ms | 16.259448ms | 387.039953us | 992.397975ns | 988.560640ns | 998.124011ns | -| 32768 | 100 | 1 | 3367.114000ms | 33.494552ms | 732.985501us | 1.022173us | 1.018344us | 1.027257us | +| 1 | 100 | 1 | 6.272300ms | 13.112660us | 4.499970us | 13.112660us | 12.386770us | 14.215710us | +| 2 | 100 | 1 | 9.939900ms | 14.920500us | 3.902991us | 7.460250us | 7.144165us | 7.937335us | +| 4 | 100 | 1 | 11.007700ms | 18.320580us | 4.447133us | 4.580145us | 4.414435us | 4.882195us | +| 8 | 100 | 1 | 11.669500ms | 23.451450us | 4.845250us | 2.931431us | 2.837827us | 3.089150us | +| 16 | 100 | 1 | 12.712800ms | 32.194210us | 4.411407us | 2.012138us | 1.968504us | 2.082025us | +| 32 | 100 | 1 | 14.026700ms | 49.918150us | 6.977955us | 1.559942us | 1.528417us | 1.621345us | +| 64 | 100 | 1 | 17.886900ms | 81.493460us | 4.993903us | 1.273335us | 1.259162us | 1.290016us | +| 128 | 100 | 1 | 15.010600ms | 145.415530us | 7.119982us | 1.136059us | 1.125540us | 1.147279us | +| 256 | 100 | 1 | 27.180300ms | 271.272000us | 10.441639us | 1.059656us | 1.051775us | 1.067861us | +| 512 | 100 | 1 | 48.908700ms | 459.334060us | 14.951726us | 897.136836ns | 891.545957ns | 902.946211ns | +| 1024 | 100 | 1 | 100.008500ms | 907.734450us | 20.632221us | 886.459424ns | 882.509971ns | 890.433340ns | +| 2048 | 100 | 1 | 203.609400ms | 1.837764ms | 43.725756us | 897.345801ns | 893.424351ns | 901.847134ns | +| 4096 | 100 | 1 | 391.410300ms | 3.870556ms | 83.233563us | 944.959976ns | 941.130142ns | 949.114746ns | +| 8192 | 100 | 1 | 795.626000ms | 7.780079ms | 97.857467us | 949.716643ns | 947.494556ns | 952.193033ns | +| 16384 | 100 | 1 | 1623.647000ms | 16.095192ms | 176.318422us | 982.372531ns | 980.370444ns | 984.608819ns | +| 32768 | 100 | 1 | 3301.038600ms | 33.148607ms | 384.229519us | 1.011615us | 1.009492us | 1.014106us | ## SV-SingleBattle-AnalyzeEffect-RandomInputs-OneRandomBattle-OneRandomInput | Inputs | Samples | Iterations / Sample | Estimated Completion Time | Mean of Samples | Standard Deviation | Mean / Input Count | Mean Lower Bound / Input Count | Mean Upper Bound / Input Count | | --- | --- | --- | --- | --- | --- | --- | --- | --- | -| 1 | 100 | 1 | 13.920600ms | 89.705530us | 28.191992us | 89.705530us | 83.455810us | 94.596980us | -| 2 | 100 | 1 | 16.842300ms | 117.830580us | 37.372543us | 58.915290us | 54.649040us | 62.089105us | -| 4 | 100 | 1 | 23.257300ms | 170.349030us | 54.279771us | 42.587257us | 39.414115us | 44.876287us | -| 8 | 100 | 1 | 36.355500ms | 257.475990us | 83.478818us | 32.184499us | 29.769941us | 33.934271us | -| 16 | 100 | 1 | 50.874000ms | 442.517320us | 147.882596us | 27.657332us | 25.532766us | 29.229046us | -| 32 | 100 | 1 | 102.946500ms | 774.360640us | 249.097184us | 24.198770us | 22.411924us | 25.520413us | -| 64 | 100 | 1 | 238.431600ms | 1.448940ms | 471.620999us | 22.639684us | 20.933463us | 23.900937us | -| 128 | 100 | 1 | 319.577700ms | 2.787760ms | 913.616994us | 21.779371us | 20.148950us | 22.997866us | -| 256 | 100 | 1 | 590.141900ms | 5.431778ms | 1.794969ms | 21.217884us | 19.646800us | 22.414340us | -| 512 | 100 | 1 | 1131.820800ms | 10.456250ms | 3.459140ms | 20.422364us | 18.856063us | 21.570066us | -| 1024 | 100 | 1 | 2274.842300ms | 21.042414ms | 7.012021ms | 20.549233us | 19.000088us | 21.714754us | -| 2048 | 100 | 1 | 4270.282400ms | 43.423651ms | 14.531183ms | 21.202955us | 19.581245us | 22.424573us | -| 4096 | 100 | 1 | 11132.249000ms | 90.753333ms | 30.612931ms | 22.156575us | 20.462278us | 23.440685us | -| 8192 | 100 | 1 | 23879.340100ms | 191.141422ms | 64.717944ms | 23.332693us | 21.575681us | 24.696410us | -| 16384 | 100 | 1 | 49642.423300ms | 395.612147ms | 134.237533ms | 24.146249us | 22.307110us | 25.565315us | +| 1 | 100 | 1 | 14.015100ms | 89.379360us | 29.402899us | 89.379360us | 82.966480us | 94.617710us | +| 2 | 100 | 1 | 17.163900ms | 118.764530us | 38.436526us | 59.382265us | 55.090790us | 62.691225us | +| 4 | 100 | 1 | 23.072100ms | 167.545470us | 54.105146us | 41.886367us | 38.774960us | 44.182360us | +| 8 | 100 | 1 | 35.796000ms | 258.874210us | 84.213013us | 32.359276us | 29.924467us | 34.130726us | +| 16 | 100 | 1 | 51.182100ms | 437.330450us | 146.665676us | 27.333153us | 25.249321us | 28.901304us | +| 32 | 100 | 1 | 102.245700ms | 773.093330us | 248.564255us | 24.159167us | 22.377807us | 25.474037us | +| 64 | 100 | 1 | 232.327400ms | 1.423977ms | 464.632705us | 22.249636us | 20.587487us | 23.477125us | +| 128 | 100 | 1 | 443.885000ms | 2.747839ms | 897.953542us | 21.467495us | 19.848680us | 22.648245us | +| 256 | 100 | 1 | 576.809700ms | 5.317923ms | 1.760734ms | 20.773135us | 19.221506us | 21.949039us | +| 512 | 100 | 1 | 1114.246400ms | 10.240397ms | 3.373785ms | 20.000776us | 18.484790us | 21.124387us | +| 1024 | 100 | 1 | 2247.263900ms | 20.564683ms | 6.860419ms | 20.082698us | 18.557170us | 21.228746us | +| 2048 | 100 | 1 | 4227.531700ms | 42.715353ms | 14.364216ms | 20.857106us | 19.272759us | 22.057492us | +| 4096 | 100 | 1 | 10849.898800ms | 88.098303ms | 29.610923ms | 21.508375us | 19.874705us | 22.754319us | +| 8192 | 100 | 1 | 23739.510900ms | 187.444712ms | 63.531659ms | 22.881435us | 21.149769us | 24.230355us | +| 16384 | 100 | 1 | 48676.663900ms | 385.924891ms | 131.034838ms | 23.554986us | 21.747504us | 24.930574us | ## SV-SingleBattle-AnalyzeEffect-RandomInputs-OneRandomBattle-ManyRandomInputs | Inputs | Samples | Iterations / Sample | Estimated Completion Time | Mean of Samples | Standard Deviation | Mean / Input Count | Mean Lower Bound / Input Count | Mean Upper Bound / Input Count | | --- | --- | --- | --- | --- | --- | --- | --- | --- | -| 1 | 100 | 1 | 13.864100ms | 89.593650us | 29.128853us | 89.593650us | 83.301120us | 94.770710us | -| 2 | 100 | 1 | 17.420200ms | 117.657870us | 15.575147us | 58.828935us | 57.707510us | 61.056875us | -| 4 | 100 | 1 | 19.709100ms | 151.292360us | 16.144262us | 37.823090us | 37.092402us | 38.695155us | -| 8 | 100 | 1 | 31.407700ms | 220.684360us | 23.037345us | 27.585545us | 27.062193us | 28.201155us | -| 16 | 100 | 1 | 46.786800ms | 340.016520us | 33.944700us | 21.251033us | 20.885480us | 21.736241us | -| 32 | 100 | 1 | 69.224600ms | 609.693880us | 40.389366us | 19.052934us | 18.802717us | 19.297894us | -| 64 | 100 | 1 | 138.866700ms | 1.172574ms | 57.616523us | 18.321471us | 18.145843us | 18.498341us | -| 128 | 100 | 1 | 267.372700ms | 2.570479ms | 128.132581us | 20.081863us | 19.884408us | 20.277797us | -| 256 | 100 | 1 | 657.146200ms | 6.165315ms | 270.334314us | 24.083263us | 23.881049us | 24.295747us | -| 512 | 100 | 1 | 1571.536700ms | 15.932636ms | 546.759873us | 31.118429us | 30.906204us | 31.324112us | -| 1024 | 100 | 1 | 4267.384000ms | 41.624136ms | 1.253188ms | 40.648571us | 40.412846us | 40.898211us | -| 2048 | 100 | 1 | 10289.394300ms | 102.750964ms | 2.254847ms | 50.171369us | 49.961896us | 50.392556us | -| 4096 | 100 | 1 | 23476.260200ms | 231.143774ms | 4.119021ms | 56.431585us | 56.235400us | 56.627462us | -| 8192 | 100 | 1 | 49127.580700ms | 496.202409ms | 6.618396ms | 60.571583us | 60.414002us | 60.729524us | -| 16384 | 100 | 1 | 102227.455800ms | 1036.370391ms | 12.485348ms | 63.255029us | 63.105349us | 63.404307us | +| 1 | 100 | 1 | 14.264500ms | 90.206140us | 29.048567us | 90.206140us | 83.858240us | 95.359690us | +| 2 | 100 | 1 | 17.314200ms | 115.941590us | 13.545431us | 57.970795us | 56.934520us | 59.760240us | +| 4 | 100 | 1 | 19.335100ms | 148.389520us | 17.085416us | 37.097380us | 36.340885us | 38.030793us | +| 8 | 100 | 1 | 31.087200ms | 219.757700us | 25.138538us | 27.469712us | 26.917089us | 28.165299us | +| 16 | 100 | 1 | 46.248800ms | 336.541010us | 31.904953us | 21.033813us | 20.674353us | 21.461407us | +| 32 | 100 | 1 | 69.011700ms | 607.908410us | 37.441701us | 18.997138us | 18.761706us | 19.221494us | +| 64 | 100 | 1 | 136.789700ms | 1.168939ms | 58.701380us | 18.264676us | 18.088168us | 18.446317us | +| 128 | 100 | 1 | 265.082200ms | 2.545773ms | 135.818576us | 19.888855us | 19.683653us | 20.099171us | +| 256 | 100 | 1 | 658.302600ms | 6.079851ms | 271.970482us | 23.749418us | 23.551003us | 23.967573us | +| 512 | 100 | 1 | 1551.688000ms | 15.637741ms | 536.187438us | 30.542462us | 30.336983us | 30.748214us | +| 1024 | 100 | 1 | 4158.878100ms | 40.751015ms | 1.285745ms | 39.795913us | 39.560420us | 40.052851us | +| 2048 | 100 | 1 | 10009.695000ms | 100.369033ms | 2.604113ms | 49.008317us | 48.760195us | 49.258035us | +| 4096 | 100 | 1 | 22328.018000ms | 228.021804ms | 4.051899ms | 55.669386us | 55.477999us | 55.866209us | +| 8192 | 100 | 1 | 48203.900400ms | 489.236563ms | 7.836421ms | 59.721260us | 59.539786us | 59.915870us | +| 16384 | 100 | 1 | 100309.384500ms | 1021.017615ms | 12.709936ms | 62.317970us | 62.167280us | 62.472558us | ## SV-SingleBattle-AnalyzeEffect-RandomInputs-ManyRandomBattles-ManyRandomInputs | Inputs | Samples | Iterations / Sample | Estimated Completion Time | Mean of Samples | Standard Deviation | Mean / Input Count | Mean Lower Bound / Input Count | Mean Upper Bound / Input Count | | --- | --- | --- | --- | --- | --- | --- | --- | --- | -| 1 | 100 | 1 | 13.889400ms | 90.897960us | 28.879026us | 90.897960us | 84.492750us | 95.904920us | -| 2 | 100 | 1 | 17.772400ms | 132.711770us | 22.534030us | 66.355885us | 64.095155us | 68.538690us | -| 4 | 100 | 1 | 25.916400ms | 200.164400us | 20.533911us | 50.041100us | 48.958225us | 50.980650us | -| 8 | 100 | 1 | 42.715900ms | 303.530160us | 29.268201us | 37.941270us | 37.180544us | 38.618383us | -| 16 | 100 | 1 | 62.626000ms | 507.333150us | 37.483370us | 31.708322us | 31.247481us | 32.164951us | -| 32 | 100 | 1 | 118.583800ms | 903.692480us | 42.825778us | 28.240390us | 27.975689us | 28.500581us | -| 64 | 100 | 1 | 213.464200ms | 1.693045ms | 72.523540us | 26.453831us | 26.222357us | 26.667489us | -| 128 | 100 | 1 | 395.608600ms | 3.248932ms | 103.550091us | 25.382284us | 25.224204us | 25.540134us | -| 256 | 100 | 1 | 748.665000ms | 6.387514ms | 298.093037us | 24.951228us | 24.763038us | 25.236883us | -| 512 | 100 | 1 | 1480.929700ms | 12.401221ms | 353.574820us | 24.221134us | 24.091207us | 24.362388us | -| 1024 | 100 | 1 | 2794.033300ms | 24.528668ms | 690.174648us | 23.953778us | 23.840239us | 24.110350us | -| 2048 | 100 | 1 | 5578.930900ms | 51.414736ms | 1.274492ms | 25.104852us | 24.989510us | 25.233969us | -| 4096 | 100 | 1 | 10885.927300ms | 108.323205ms | 1.747741ms | 26.446095us | 26.369782us | 26.537520us | -| 8192 | 100 | 1 | 22749.832800ms | 230.025219ms | 2.246294ms | 28.079250us | 28.028827us | 28.136966us | -| 16384 | 100 | 1 | 47970.155900ms | 478.856007ms | 3.892357ms | 29.227051us | 29.185941us | 29.280228us | +| 1 | 100 | 1 | 14.443300ms | 89.508500us | 29.350274us | 89.508500us | 83.127520us | 94.730250us | +| 2 | 100 | 1 | 18.431500ms | 129.523140us | 22.955727us | 64.761570us | 62.520840us | 67.035790us | +| 4 | 100 | 1 | 26.085700ms | 192.032470us | 18.546889us | 48.008117us | 47.043235us | 48.863107us | +| 8 | 100 | 1 | 43.938800ms | 312.720100us | 32.801661us | 39.090013us | 38.259749us | 39.866901us | +| 16 | 100 | 1 | 63.950000ms | 513.112620us | 37.897235us | 32.069539us | 31.596078us | 32.528343us | +| 32 | 100 | 1 | 121.276600ms | 906.939940us | 45.832578us | 28.341873us | 28.061428us | 28.621278us | +| 64 | 100 | 1 | 214.976400ms | 1.688651ms | 78.004462us | 26.385173us | 26.139625us | 26.617205us | +| 128 | 100 | 1 | 394.588500ms | 3.219096ms | 101.783063us | 25.149186us | 24.993880us | 25.305009us | +| 256 | 100 | 1 | 736.303900ms | 6.227213ms | 159.458198us | 24.325049us | 24.202862us | 24.448462us | +| 512 | 100 | 1 | 1454.820300ms | 12.157858ms | 251.844087us | 23.745817us | 23.651304us | 23.844751us | +| 1024 | 100 | 1 | 2765.638200ms | 24.305804ms | 677.094068us | 23.736137us | 23.617806us | 23.879778us | +| 2048 | 100 | 1 | 5408.036800ms | 51.303629ms | 1.184174ms | 25.050600us | 24.945373us | 25.173154us | +| 4096 | 100 | 1 | 10411.095500ms | 105.463330ms | 1.254550ms | 25.747883us | 25.690347us | 25.810688us | +| 8192 | 100 | 1 | 22601.287600ms | 224.739582ms | 1.663130ms | 27.434031us | 27.396160us | 27.475692us | +| 16384 | 100 | 1 | 46901.729800ms | 468.131335ms | 2.517891ms | 28.572469us | 28.543054us | 28.603217us | diff --git a/src/Battle/Clone/Clone.cpp b/src/Battle/Clone/Clone.cpp index 0a91864..12831dd 100644 --- a/src/Battle/Clone/Clone.cpp +++ b/src/Battle/Clone/Clone.cpp @@ -86,26 +86,20 @@ void traverseAction(types::registry& registry, VisitEntity visitEntity = nullptr const static bool ForCloning = !std::is_same_v; using Tag = std::conditional_t; - for (types::entity entity : registry.view()) { - if constexpr (ForCloning) { + if constexpr (ForCloning) { + for (types::entity entity : registry.view()) { visitEntity(entity); } - } - for (types::entity entity : registry.view()) { - if constexpr (ForCloning) { + for (types::entity entity : registry.view()) { visitEntity(entity); } - } - for (types::entity entity : registry.view()) { - if constexpr (ForCloning) { + for (types::entity entity : registry.view()) { visitEntity(entity); } - } - for (types::entity entity : registry.view()) { - if constexpr (ForCloning) { + for (types::entity entity : registry.view()) { visitEntity(entity); } } @@ -116,8 +110,8 @@ void traversePokemon(types::registry& registry, VisitEntity visitEntity = nullpt const static bool ForCloning = !std::is_same_v; using Tag = std::conditional_t; - for (types::entity entity : registry.view()) { - if constexpr (ForCloning) { + if constexpr (ForCloning) { + for (types::entity entity : registry.view()) { visitEntity(entity); } } @@ -277,7 +271,6 @@ types::ClonedEntityMap clone(types::registry& registry, std::optional(registry, entityMap); remapComponentEntities(registry, entityMap); remapComponentEntities(registry, entityMap); - remapComponentEntities(registry, entityMap); remapComponentEntities(registry, entityMap); remapComponentEntities(registry, entityMap); remapComponentEntities(registry, entityMap); diff --git a/src/Battle/Pokemon/ManagePokemonState.cpp b/src/Battle/Pokemon/ManagePokemonState.cpp index d58e5a9..28d9d1c 100644 --- a/src/Battle/Pokemon/ManagePokemonState.cpp +++ b/src/Battle/Pokemon/ManagePokemonState.cpp @@ -231,11 +231,11 @@ void clearVolatiles(types::handle pokemonHandle) { void deductPp(types::handle handle, MoveSlots& moveSlots, LastUsedMove lastUsedMove) { MoveSlot& moveSlot = moveSlots.val[lastUsedMove.val]; - if (moveSlot.pp >= Constants::PP_USE_DEDUCTION) { + if (moveSlot.pp >= Constants::PP_USE_DEDUCTION + Constants::MovePp::MIN) { moveSlot.pp -= Constants::PP_USE_DEDUCTION; } else { - moveSlot.pp = 0U; + moveSlot.pp = Constants::MovePp::MIN; } } diff --git a/src/Components/EntityHolders/Pokemon.hpp b/src/Components/EntityHolders/Pokemon.hpp deleted file mode 100644 index 1678082..0000000 --- a/src/Components/EntityHolders/Pokemon.hpp +++ /dev/null @@ -1,10 +0,0 @@ -#pragma once - -#include - -namespace pokesim { -// Contains the entity pointing to a Pokemon. -struct Pokemon { - types::entity val{}; -}; -} // namespace pokesim diff --git a/src/Components/EntityHolders/headers.hpp b/src/Components/EntityHolders/headers.hpp index 885d862..a99a2bd 100644 --- a/src/Components/EntityHolders/headers.hpp +++ b/src/Components/EntityHolders/headers.hpp @@ -7,7 +7,6 @@ #include "Current.hpp" #include "FaintQueue.hpp" #include "FoeSide.hpp" -#include "Pokemon.hpp" #include "RecycledEntities.hpp" #include "Side.hpp" #include "Sides.hpp" diff --git a/src/Components/headers.hpp b/src/Components/headers.hpp index 953095b..833e9c7 100644 --- a/src/Components/headers.hpp +++ b/src/Components/headers.hpp @@ -28,7 +28,6 @@ #include "EntityHolders/Current.hpp" #include "EntityHolders/FaintQueue.hpp" #include "EntityHolders/FoeSide.hpp" -#include "EntityHolders/Pokemon.hpp" #include "EntityHolders/RecycledEntities.hpp" #include "EntityHolders/Side.hpp" #include "EntityHolders/Sides.hpp" diff --git a/src/SimulateTurn/SimulateTurn.cpp b/src/SimulateTurn/SimulateTurn.cpp index 6b60518..c30715c 100644 --- a/src/SimulateTurn/SimulateTurn.cpp +++ b/src/SimulateTurn/SimulateTurn.cpp @@ -4,7 +4,6 @@ #include #include #include -#include #include #include #include diff --git a/src/Simulation/Simulation.hpp b/src/Simulation/Simulation.hpp index 8975418..5f632ff 100644 --- a/src/Simulation/Simulation.hpp +++ b/src/Simulation/Simulation.hpp @@ -119,14 +119,22 @@ class Simulation { } template void addToEntities(const Args&... args) { + static_assert( + sizeof...(ViewComponents) != 0, + "Using this function without view components will cause Type to be added to every entity."); auto view = registry.view(); registry.insert(view.begin(), view.end(), args...); } template void removeFromEntities(entt::exclude_t exclude = entt::exclude_t{}) { - auto view = registry.view(exclude); - registry.remove(view.begin(), view.end()); + if constexpr (sizeof...(ViewComponents) == 0 && sizeof...(ExcludeComponents) == 0) { + registry.clear(); + } + else { + auto view = registry.view(exclude); + registry.remove(view.begin(), view.end()); + } } }; } // namespace pokesim diff --git a/src/Simulation/SimulationSetup.cpp b/src/Simulation/SimulationSetup.cpp index 5153f7e..c667ea0 100644 --- a/src/Simulation/SimulationSetup.cpp +++ b/src/Simulation/SimulationSetup.cpp @@ -71,10 +71,10 @@ struct EntityLists { EntityList analyzeEffectInputs; EntityLists(Simulation* simulation, const std::vector& battleInfoList) { - types::entityIndex battleCount = 0; - types::entityIndex pokemonCount = 0; - types::entityIndex calcDamageInputCount = 0; - types::entityIndex analyzeEffectInputCount = 0; + types::entityIndex battleCount = 0U; + types::entityIndex pokemonCount = 0U; + types::entityIndex calcDamageInputCount = 0U; + types::entityIndex analyzeEffectInputCount = 0U; for (const BattleCreationInfo& battleInfo : battleInfoList) { types::entityIndex battleCountIncrease = getBattleCreationCount(battleInfo); battleCount += battleCountIncrease; @@ -91,11 +91,11 @@ struct EntityLists { } } - types::entityIndex sideCount = battleCount * 2; + types::entityIndex sideCount = battleCount * 2U; types::entityIndex recycledActionCount = battleCount; types::entityIndex recycledActionMoveCount = battleCount; types::entityIndex addedRecycledActionMoveCount = - simulation->isBattleFormat(BattleFormat::DOUBLES) ? battleCount * 2 : 0; + simulation->isBattleFormat(BattleFormat::DOUBLES) ? battleCount * 2U : 0U; POKESIM_REQUIRE( battleCount + sideCount + recycledActionCount + pokemonCount + calcDamageInputCount + analyzeEffectInputCount < diff --git a/src/Utilities/ArgumentChecks.cpp b/src/Utilities/ArgumentChecks.cpp index 7bf5744..b9f720f 100644 --- a/src/Utilities/ArgumentChecks.cpp +++ b/src/Utilities/ArgumentChecks.cpp @@ -677,11 +677,6 @@ void check(const FoeSide& foeSide, const types::registry& registry) { checkSide(foeSide.val, registry); } -template <> -void check(const Pokemon& pokemon, const types::registry& registry) { - checkPokemon(pokemon.val, registry); -} - template <> void check(const RecycledAction& recycledAction, const types::registry& registry) { types::registry::checkEntity(recycledAction.val, registry); @@ -689,13 +684,22 @@ void check(const RecycledAction& recycledAction, const types::registry& registry } template <> -void check(const RecycledActionMove&, const types::registry&) {} +void check(const RecycledActionMove& recycledActionMove, const types::registry& registry) { + types::registry::checkEntity(recycledActionMove.val, registry); + POKESIM_REQUIRE_NM(has(recycledActionMove.val, registry)); +} template <> -void check(const AddedRecycledActionMove1&, const types::registry&) {} +void check(const AddedRecycledActionMove1& addedRecycledActionMove1, const types::registry& registry) { + types::registry::checkEntity(addedRecycledActionMove1.val, registry); + POKESIM_REQUIRE_NM(has(addedRecycledActionMove1.val, registry)); +} template <> -void check(const AddedRecycledActionMove2&, const types::registry&) {} +void check(const AddedRecycledActionMove2& addedRecycledActionMove2, const types::registry& registry) { + types::registry::checkEntity(addedRecycledActionMove2.val, registry); + POKESIM_REQUIRE_NM(has(addedRecycledActionMove2.val, registry)); +} template <> void check(const Side& side, const types::registry& registry) { diff --git a/src/Utilities/ArgumentChecks.hpp b/src/Utilities/ArgumentChecks.hpp index 93e0de2..5b24784 100644 --- a/src/Utilities/ArgumentChecks.hpp +++ b/src/Utilities/ArgumentChecks.hpp @@ -49,7 +49,6 @@ struct CurrentEffectsAsSource; struct CurrentEffectsAsTarget; struct FaintQueue; struct FoeSide; -struct Pokemon; struct RecycledAction; struct RecycledActionMove; struct AddedRecycledActionMove1; @@ -319,9 +318,6 @@ void check(const FaintQueue&, const types::registry&); template <> void check(const FoeSide&, const types::registry&); -template <> -void check(const Pokemon&, const types::registry&); - template <> void check(const RecycledAction&, const types::registry&); diff --git a/src/Utilities/DebugChecks.hpp b/src/Utilities/DebugChecks.hpp index 85d1b66..30e5db5 100644 --- a/src/Utilities/DebugChecks.hpp +++ b/src/Utilities/DebugChecks.hpp @@ -8,7 +8,6 @@ #include #include #include -#include #include #include #include diff --git a/tools/updateBenchmarkResultsFile.js b/tools/updateBenchmarkResultsFile.js index 56d4413..8440ceb 100644 --- a/tools/updateBenchmarkResultsFile.js +++ b/tools/updateBenchmarkResultsFile.js @@ -151,17 +151,14 @@ benchmarkProcess.stdout.on('data', (chunk) => { } valueDiff = valueDiff.toFixed(3); - let timesDiff = ''; let color = ''; let suffix = ''; if (valueDiff > 0) { valueDiff = '+' + valueDiff; - timesDiff = (1 / percentDiff).toFixed(3); suffix = '% slower'; color = 'red'; } else { - timesDiff = (1 / (1 - percentDiff)).toFixed(3); suffix = '% faster'; color = 'green'; } From 45aaacc60a25086c1b5fbb5407a3266cb48d7395 Mon Sep 17 00:00:00 2001 From: aed3 <32887801+aed3@users.noreply.github.com> Date: Fri, 26 Jun 2026 15:22:25 -0500 Subject: [PATCH 09/10] Fixing PR build issues --- extras/PokeSim.cpp | 18 ++++++++---------- extras/PokeSim.hpp | 11 +++++++---- src/CalcDamage/CalcDamage.cpp | 2 +- src/SimulateTurn/ManageActionQueue.cpp | 4 +--- src/SimulateTurn/SimulateTurn.cpp | 2 +- src/Simulation/RunEvent.cpp | 2 +- src/Simulation/SimulationSetup.cpp | 8 ++++---- src/Simulation/SimulationSetupDebugChecks.hpp | 2 ++ src/Types/Decisions.hpp | 9 +++++---- 9 files changed, 30 insertions(+), 28 deletions(-) diff --git a/extras/PokeSim.cpp b/extras/PokeSim.cpp index 13b6ae4..376af6a 100644 --- a/extras/PokeSim.cpp +++ b/extras/PokeSim.cpp @@ -1369,7 +1369,7 @@ void check(const DamageRollOptions& damageRollOptions) { namespace pokesim { namespace { types::entityIndex getBattleCreationCount(const BattleCreationInfo& battleInfo) { - return std::max(1UL, battleInfo.decisionsToSimulate.size()); + return std::max((std::size_t)1UL, battleInfo.decisionsToSimulate.size()); } struct EntityLists { @@ -1411,14 +1411,14 @@ struct EntityLists { battleCount += battleCountIncrease; for (const SideCreationInfo& side : battleInfo.sides) { - pokemonCount += side.team.size() * battleCountIncrease; + pokemonCount += (types::teamPositionIndex)side.team.size() * battleCountIncrease; } for (const CalcDamageInputInfo& calcDamageInputInfo : battleInfo.damageCalculations) { - calcDamageInputCount += calcDamageInputInfo.moves.size(); + calcDamageInputCount += (types::entityIndex)calcDamageInputInfo.moves.size(); } for (const AnalyzeEffectInputInfo& analyzeEffectInputInfo : battleInfo.effectsToAnalyze) { - analyzeEffectInputCount += analyzeEffectInputInfo.moves.size(); + analyzeEffectInputCount += (types::entityIndex)analyzeEffectInputInfo.moves.size(); } } @@ -2132,7 +2132,7 @@ template void runAfterEachBoostEvent(Simulation&); void runAfterBoostEvent(Simulation&) {} -void runModifyTarget(Simulation& simulation) {} +void runModifyTarget(Simulation&) {} void runModifyMove(Simulation& simulation) { dex::ChoiceScarf::onSourceModifyMove(simulation); @@ -2476,7 +2476,7 @@ void setActionMoveReferenceComponents( target = targets.val[2]; } else { - static_assert(false, "Using a RecycledActionMoveType that isn't associated with a target."); + POKESIM_REQUIRE_FAIL("Using a RecycledActionMoveType that isn't associated with a target."); } MoveName move = registry.get(action.val); @@ -3383,9 +3383,7 @@ void resolveSlotDecisions(types::handle sideHandle, const types::slotDecisions& } } -void resolveTeamDecision(types::registry& registry, const types::teamOrder& teamOrder, ActionQueue& battleActionQueue) { - -} +void resolveTeamDecision(types::registry&, const types::teamOrder&, ActionQueue&) {} } // namespace void resolveDecision(types::handle sideHandle, const SideDecision& sideDecision) { @@ -5113,7 +5111,7 @@ void setUnboostedStat(Simulation& simulation) { updateSpd(simulation, true); } else { - static_assert("No other stat is used as the attacking or defending stat."); + POKESIM_REQUIRE_FAIL("No other stat is used as the attacking or defending stat."); } if constexpr (forAttacker) { diff --git a/extras/PokeSim.hpp b/extras/PokeSim.hpp index 549c607..70c50d8 100644 --- a/extras/PokeSim.hpp +++ b/extras/PokeSim.hpp @@ -18412,16 +18412,17 @@ namespace types { struct slotDecision : pokesim::internal::variant< MoveDecision, MegaEvolveAndMoveDecision, TerastallizeAndMoveDecision, DynamaxAndMoveDecision, ZMoveDecision, SwitchDecision, ItemDecision> { - using pokesim::internal::variant< + using base = pokesim::internal::variant< MoveDecision, MegaEvolveAndMoveDecision, TerastallizeAndMoveDecision, DynamaxAndMoveDecision, ZMoveDecision, - SwitchDecision, ItemDecision>::variant; + SwitchDecision, ItemDecision>; + using base::variant; constexpr Slot sourceSlot() const { - return std::visit([](auto&& decision) { return decision.sourceSlot; }, *this); + return std::visit([](auto&& decision) { return decision.sourceSlot; }, (base) * this); } constexpr Slot targetSlot() const { - return std::visit([](auto&& decision) { return decision.targetSlot; }, *this); + return std::visit([](auto&& decision) { return decision.targetSlot; }, (base) * this); } }; @@ -23297,6 +23298,8 @@ struct SimulationSetupChecks { #else namespace pokesim { +struct BattleStateSetup; + namespace calc_damage { struct InputSetup; } diff --git a/src/CalcDamage/CalcDamage.cpp b/src/CalcDamage/CalcDamage.cpp index 6ff2cf1..b9ab6be 100644 --- a/src/CalcDamage/CalcDamage.cpp +++ b/src/CalcDamage/CalcDamage.cpp @@ -457,7 +457,7 @@ void setUnboostedStat(Simulation& simulation) { updateSpd(simulation, true); } else { - static_assert("No other stat is used as the attacking or defending stat."); + POKESIM_REQUIRE_FAIL("No other stat is used as the attacking or defending stat."); } if constexpr (forAttacker) { diff --git a/src/SimulateTurn/ManageActionQueue.cpp b/src/SimulateTurn/ManageActionQueue.cpp index 5058924..34e2e5f 100644 --- a/src/SimulateTurn/ManageActionQueue.cpp +++ b/src/SimulateTurn/ManageActionQueue.cpp @@ -84,9 +84,7 @@ void resolveSlotDecisions(types::handle sideHandle, const types::slotDecisions& } } -void resolveTeamDecision(types::registry& registry, const types::teamOrder& teamOrder, ActionQueue& battleActionQueue) { - -} +void resolveTeamDecision(types::registry&, const types::teamOrder&, ActionQueue&) {} } // namespace void resolveDecision(types::handle sideHandle, const SideDecision& sideDecision) { diff --git a/src/SimulateTurn/SimulateTurn.cpp b/src/SimulateTurn/SimulateTurn.cpp index c30715c..2448b82 100644 --- a/src/SimulateTurn/SimulateTurn.cpp +++ b/src/SimulateTurn/SimulateTurn.cpp @@ -112,7 +112,7 @@ void setActionMoveReferenceComponents( target = targets.val[2]; } else { - static_assert(false, "Using a RecycledActionMoveType that isn't associated with a target."); + POKESIM_REQUIRE_FAIL("Using a RecycledActionMoveType that isn't associated with a target."); } MoveName move = registry.get(action.val); diff --git a/src/Simulation/RunEvent.cpp b/src/Simulation/RunEvent.cpp index f9c8406..9286ddd 100644 --- a/src/Simulation/RunEvent.cpp +++ b/src/Simulation/RunEvent.cpp @@ -130,7 +130,7 @@ template void runAfterEachBoostEvent(Simulation&); void runAfterBoostEvent(Simulation&) {} -void runModifyTarget(Simulation& simulation) {} +void runModifyTarget(Simulation&) {} void runModifyMove(Simulation& simulation) { dex::ChoiceScarf::onSourceModifyMove(simulation); diff --git a/src/Simulation/SimulationSetup.cpp b/src/Simulation/SimulationSetup.cpp index c667ea0..6387729 100644 --- a/src/Simulation/SimulationSetup.cpp +++ b/src/Simulation/SimulationSetup.cpp @@ -38,7 +38,7 @@ namespace pokesim { namespace { types::entityIndex getBattleCreationCount(const BattleCreationInfo& battleInfo) { - return std::max(1UL, battleInfo.decisionsToSimulate.size()); + return std::max((std::size_t)1UL, battleInfo.decisionsToSimulate.size()); } struct EntityLists { @@ -80,14 +80,14 @@ struct EntityLists { battleCount += battleCountIncrease; for (const SideCreationInfo& side : battleInfo.sides) { - pokemonCount += side.team.size() * battleCountIncrease; + pokemonCount += (types::teamPositionIndex)side.team.size() * battleCountIncrease; } for (const CalcDamageInputInfo& calcDamageInputInfo : battleInfo.damageCalculations) { - calcDamageInputCount += calcDamageInputInfo.moves.size(); + calcDamageInputCount += (types::entityIndex)calcDamageInputInfo.moves.size(); } for (const AnalyzeEffectInputInfo& analyzeEffectInputInfo : battleInfo.effectsToAnalyze) { - analyzeEffectInputCount += analyzeEffectInputInfo.moves.size(); + analyzeEffectInputCount += (types::entityIndex)analyzeEffectInputInfo.moves.size(); } } diff --git a/src/Simulation/SimulationSetupDebugChecks.hpp b/src/Simulation/SimulationSetupDebugChecks.hpp index bc92ea7..71ba976 100644 --- a/src/Simulation/SimulationSetupDebugChecks.hpp +++ b/src/Simulation/SimulationSetupDebugChecks.hpp @@ -606,6 +606,8 @@ struct SimulationSetupChecks { #include "Simulation.hpp" namespace pokesim { +struct BattleStateSetup; + namespace calc_damage { struct InputSetup; } diff --git a/src/Types/Decisions.hpp b/src/Types/Decisions.hpp index 7122eba..4c727ea 100644 --- a/src/Types/Decisions.hpp +++ b/src/Types/Decisions.hpp @@ -47,16 +47,17 @@ namespace types { struct slotDecision : pokesim::internal::variant< MoveDecision, MegaEvolveAndMoveDecision, TerastallizeAndMoveDecision, DynamaxAndMoveDecision, ZMoveDecision, SwitchDecision, ItemDecision> { - using pokesim::internal::variant< + using base = pokesim::internal::variant< MoveDecision, MegaEvolveAndMoveDecision, TerastallizeAndMoveDecision, DynamaxAndMoveDecision, ZMoveDecision, - SwitchDecision, ItemDecision>::variant; + SwitchDecision, ItemDecision>; + using base::variant; constexpr Slot sourceSlot() const { - return std::visit([](auto&& decision) { return decision.sourceSlot; }, *this); + return std::visit([](auto&& decision) { return decision.sourceSlot; }, (base) * this); } constexpr Slot targetSlot() const { - return std::visit([](auto&& decision) { return decision.targetSlot; }, *this); + return std::visit([](auto&& decision) { return decision.targetSlot; }, (base) * this); } }; From e14fee871ce9d3084a51842467e0db52add9fa1a Mon Sep 17 00:00:00 2001 From: aed3 <32887801+aed3@users.noreply.github.com> Date: Fri, 26 Jun 2026 15:35:00 -0500 Subject: [PATCH 10/10] More/Better PR build fixes --- extras/PokeSim.cpp | 9 ++++----- extras/PokeSim.hpp | 18 ++++++++++-------- src/Battle/ManageBattleState.cpp | 3 +-- src/Battle/ManageBattleState.hpp | 3 +-- src/Battle/Pokemon/ManagePokemonState.cpp | 2 +- src/Battle/Pokemon/ManagePokemonState.hpp | 2 +- src/Simulation/SimulationSetup.cpp | 4 ++-- src/Types/Decisions.hpp | 8 ++++---- src/Utilities/Variant.hpp | 5 ++++- 9 files changed, 28 insertions(+), 26 deletions(-) diff --git a/extras/PokeSim.cpp b/extras/PokeSim.cpp index 376af6a..36e15da 100644 --- a/extras/PokeSim.cpp +++ b/extras/PokeSim.cpp @@ -1368,7 +1368,7 @@ void check(const DamageRollOptions& damageRollOptions) { namespace pokesim { namespace { -types::entityIndex getBattleCreationCount(const BattleCreationInfo& battleInfo) { +std::size_t getBattleCreationCount(const BattleCreationInfo& battleInfo) { return std::max((std::size_t)1UL, battleInfo.decisionsToSimulate.size()); } @@ -1407,7 +1407,7 @@ struct EntityLists { types::entityIndex calcDamageInputCount = 0U; types::entityIndex analyzeEffectInputCount = 0U; for (const BattleCreationInfo& battleInfo : battleInfoList) { - types::entityIndex battleCountIncrease = getBattleCreationCount(battleInfo); + types::entityIndex battleCountIncrease = (types::entityIndex)getBattleCreationCount(battleInfo); battleCount += battleCountIncrease; for (const SideCreationInfo& side : battleInfo.sides) { @@ -5700,7 +5700,7 @@ void clearVolatiles(types::handle pokemonHandle) { pokemonHandle.remove(); } -void deductPp(types::handle handle, MoveSlots& moveSlots, LastUsedMove lastUsedMove) { +void deductPp(MoveSlots& moveSlots, LastUsedMove lastUsedMove) { MoveSlot& moveSlot = moveSlots.val[lastUsedMove.val]; if (moveSlot.pp >= Constants::PP_USE_DEDUCTION + Constants::MovePp::MIN) { moveSlot.pp -= Constants::PP_USE_DEDUCTION; @@ -5938,8 +5938,7 @@ void setCurrentActionSource(types::handle battleHandle, const Sides& sides, Curr } void setCurrentActionTarget( - types::handle battleHandle, const Sides& sides, CurrentAction action, CurrentActionSource source, - const Simulation& simulation) { + types::handle battleHandle, const Sides& sides, CurrentAction action, const Simulation& simulation) { types::registry& registry = *battleHandle.registry(); const TargetSlotName& targetSlotName = registry.get(action.val); types::entity targetEntity = slotToPokemonEntity(registry, sides, targetSlotName.val); diff --git a/extras/PokeSim.hpp b/extras/PokeSim.hpp index 70c50d8..a453ca7 100644 --- a/extras/PokeSim.hpp +++ b/extras/PokeSim.hpp @@ -18329,8 +18329,11 @@ static constexpr std::uint8_t TOTAL_SLOT_COUNT = (std::uint8_t)Slot::TOTAL_SLOT namespace pokesim::internal { template class variant : public std::variant { + protected: + using base = std::variant; + public: - using std::variant::variant; + using base::variant; template variant& operator=(const T& rhs) { @@ -18412,17 +18415,17 @@ namespace types { struct slotDecision : pokesim::internal::variant< MoveDecision, MegaEvolveAndMoveDecision, TerastallizeAndMoveDecision, DynamaxAndMoveDecision, ZMoveDecision, SwitchDecision, ItemDecision> { - using base = pokesim::internal::variant< + using variant = pokesim::internal::variant< MoveDecision, MegaEvolveAndMoveDecision, TerastallizeAndMoveDecision, DynamaxAndMoveDecision, ZMoveDecision, SwitchDecision, ItemDecision>; - using base::variant; + using variant::variant; constexpr Slot sourceSlot() const { - return std::visit([](auto&& decision) { return decision.sourceSlot; }, (base) * this); + return std::visit([](auto&& decision) { return decision.sourceSlot; }, (variant::base) * this); } constexpr Slot targetSlot() const { - return std::visit([](auto&& decision) { return decision.targetSlot; }, (base) * this); + return std::visit([](auto&& decision) { return decision.targetSlot; }, (variant::base) * this); } }; @@ -23430,7 +23433,7 @@ void clearStatus(types::handle pokemonHandle); void clearVolatiles(types::handle pokemonHandle); -void deductPp(types::handle handle, MoveSlots& moveSlots, LastUsedMove lastUsedMove); +void deductPp(MoveSlots& moveSlots, LastUsedMove lastUsedMove); void setLastMoveUsed(types::registry& registry, CurrentActionSource source, const CurrentActionMoveSlot& move); void resetEffectiveAtk(types::handle handle, stat::Atk atk); void resetEffectiveDef(types::handle handle, stat::Def def); @@ -24262,8 +24265,7 @@ void collectTurnOutcomeBattles(types::handle leafBattleHandle, const RootBattle& void setCurrentActionSource(types::handle battleHandle, const Sides& sides, CurrentAction action); void setCurrentActionTarget( - types::handle battleHandle, const Sides& sides, CurrentAction action, CurrentActionSource source, - const Simulation& simulation); + types::handle battleHandle, const Sides& sides, CurrentAction action, const Simulation& simulation); void setFailedActionMove( types::handle moveHandle, Battle battle, CurrentActionSource source, CurrentActionTarget target); void clearCurrentAction(Simulation& simulation); diff --git a/src/Battle/ManageBattleState.cpp b/src/Battle/ManageBattleState.cpp index 201670a..35c0e4b 100644 --- a/src/Battle/ManageBattleState.cpp +++ b/src/Battle/ManageBattleState.cpp @@ -117,8 +117,7 @@ void setCurrentActionSource(types::handle battleHandle, const Sides& sides, Curr } void setCurrentActionTarget( - types::handle battleHandle, const Sides& sides, CurrentAction action, CurrentActionSource source, - const Simulation& simulation) { + types::handle battleHandle, const Sides& sides, CurrentAction action, const Simulation& simulation) { types::registry& registry = *battleHandle.registry(); const TargetSlotName& targetSlotName = registry.get(action.val); types::entity targetEntity = slotToPokemonEntity(registry, sides, targetSlotName.val); diff --git a/src/Battle/ManageBattleState.hpp b/src/Battle/ManageBattleState.hpp index d1d1f3a..3998324 100644 --- a/src/Battle/ManageBattleState.hpp +++ b/src/Battle/ManageBattleState.hpp @@ -18,8 +18,7 @@ void collectTurnOutcomeBattles(types::handle leafBattleHandle, const RootBattle& void setCurrentActionSource(types::handle battleHandle, const Sides& sides, CurrentAction action); void setCurrentActionTarget( - types::handle battleHandle, const Sides& sides, CurrentAction action, CurrentActionSource source, - const Simulation& simulation); + types::handle battleHandle, const Sides& sides, CurrentAction action, const Simulation& simulation); void setFailedActionMove( types::handle moveHandle, Battle battle, CurrentActionSource source, CurrentActionTarget target); void clearCurrentAction(Simulation& simulation); diff --git a/src/Battle/Pokemon/ManagePokemonState.cpp b/src/Battle/Pokemon/ManagePokemonState.cpp index 28d9d1c..073ef40 100644 --- a/src/Battle/Pokemon/ManagePokemonState.cpp +++ b/src/Battle/Pokemon/ManagePokemonState.cpp @@ -229,7 +229,7 @@ void clearVolatiles(types::handle pokemonHandle) { pokemonHandle.remove(); } -void deductPp(types::handle handle, MoveSlots& moveSlots, LastUsedMove lastUsedMove) { +void deductPp(MoveSlots& moveSlots, LastUsedMove lastUsedMove) { MoveSlot& moveSlot = moveSlots.val[lastUsedMove.val]; if (moveSlot.pp >= Constants::PP_USE_DEDUCTION + Constants::MovePp::MIN) { moveSlot.pp -= Constants::PP_USE_DEDUCTION; diff --git a/src/Battle/Pokemon/ManagePokemonState.hpp b/src/Battle/Pokemon/ManagePokemonState.hpp index 12d0e8d..68a3e19 100644 --- a/src/Battle/Pokemon/ManagePokemonState.hpp +++ b/src/Battle/Pokemon/ManagePokemonState.hpp @@ -38,7 +38,7 @@ void clearStatus(types::handle pokemonHandle); void clearVolatiles(types::handle pokemonHandle); -void deductPp(types::handle handle, MoveSlots& moveSlots, LastUsedMove lastUsedMove); +void deductPp(MoveSlots& moveSlots, LastUsedMove lastUsedMove); void setLastMoveUsed(types::registry& registry, CurrentActionSource source, const CurrentActionMoveSlot& move); void resetEffectiveAtk(types::handle handle, stat::Atk atk); void resetEffectiveDef(types::handle handle, stat::Def def); diff --git a/src/Simulation/SimulationSetup.cpp b/src/Simulation/SimulationSetup.cpp index 6387729..f7a455f 100644 --- a/src/Simulation/SimulationSetup.cpp +++ b/src/Simulation/SimulationSetup.cpp @@ -37,7 +37,7 @@ namespace pokesim { namespace { -types::entityIndex getBattleCreationCount(const BattleCreationInfo& battleInfo) { +std::size_t getBattleCreationCount(const BattleCreationInfo& battleInfo) { return std::max((std::size_t)1UL, battleInfo.decisionsToSimulate.size()); } @@ -76,7 +76,7 @@ struct EntityLists { types::entityIndex calcDamageInputCount = 0U; types::entityIndex analyzeEffectInputCount = 0U; for (const BattleCreationInfo& battleInfo : battleInfoList) { - types::entityIndex battleCountIncrease = getBattleCreationCount(battleInfo); + types::entityIndex battleCountIncrease = (types::entityIndex)getBattleCreationCount(battleInfo); battleCount += battleCountIncrease; for (const SideCreationInfo& side : battleInfo.sides) { diff --git a/src/Types/Decisions.hpp b/src/Types/Decisions.hpp index 4c727ea..e7fe3c1 100644 --- a/src/Types/Decisions.hpp +++ b/src/Types/Decisions.hpp @@ -47,17 +47,17 @@ namespace types { struct slotDecision : pokesim::internal::variant< MoveDecision, MegaEvolveAndMoveDecision, TerastallizeAndMoveDecision, DynamaxAndMoveDecision, ZMoveDecision, SwitchDecision, ItemDecision> { - using base = pokesim::internal::variant< + using variant = pokesim::internal::variant< MoveDecision, MegaEvolveAndMoveDecision, TerastallizeAndMoveDecision, DynamaxAndMoveDecision, ZMoveDecision, SwitchDecision, ItemDecision>; - using base::variant; + using variant::variant; constexpr Slot sourceSlot() const { - return std::visit([](auto&& decision) { return decision.sourceSlot; }, (base) * this); + return std::visit([](auto&& decision) { return decision.sourceSlot; }, (variant::base) * this); } constexpr Slot targetSlot() const { - return std::visit([](auto&& decision) { return decision.targetSlot; }, (base) * this); + return std::visit([](auto&& decision) { return decision.targetSlot; }, (variant::base) * this); } }; diff --git a/src/Utilities/Variant.hpp b/src/Utilities/Variant.hpp index 97ab3f9..e2adc93 100644 --- a/src/Utilities/Variant.hpp +++ b/src/Utilities/Variant.hpp @@ -6,8 +6,11 @@ namespace pokesim::internal { template class variant : public std::variant { + protected: + using base = std::variant; + public: - using std::variant::variant; + using base::variant; template variant& operator=(const T& rhs) {