From bfcb6047653d0766a070616dd02ba822aebc9a84 Mon Sep 17 00:00:00 2001 From: Garrett Cox Date: Thu, 29 Jan 2026 07:19:01 -0600 Subject: More metrics tweaks (#1514) --- mm/2s2h/Rando/Logic/GeneratePools.cpp | 24 ++++++------------------ mm/2s2h/Rando/Menu.cpp | 6 ++++-- 2 files changed, 10 insertions(+), 20 deletions(-) diff --git a/mm/2s2h/Rando/Logic/GeneratePools.cpp b/mm/2s2h/Rando/Logic/GeneratePools.cpp index fa8ce7b55..2900a1a61 100644 --- a/mm/2s2h/Rando/Logic/GeneratePools.cpp +++ b/mm/2s2h/Rando/Logic/GeneratePools.cpp @@ -278,9 +278,7 @@ void GeneratePools(RandoSaveInfo& saveInfo, std::vector& checkPool // Plentiful if (saveInfo.randoSaveOptions[RO_PLENTIFUL_ITEMS] == RO_GENERIC_YES) { - int replaceableItems = 0; std::vector plentifulItems; - std::vector potentialPlentifulItems; for (size_t i = 0; i < itemPool.size(); i++) { // The user can specify exactly how many pieces they want to shuffle, so skip those if (itemPool[i] == RI_TRIFORCE_PIECE) { @@ -295,31 +293,21 @@ void GeneratePools(RandoSaveInfo& saveInfo, std::vector& checkPool plentifulItems.push_back(itemPool[i]); break; case RITYPE_LESSER: - case RITYPE_SKULLTULA_TOKEN: - case RITYPE_STRAY_FAIRY: - if (Ship_Random(0, 2) == 1) { - potentialPlentifulItems.push_back(itemPool[i]); + if (Rando::StaticData::Items[itemPool[i]].itemId != ITEM_TINGLE_MAP && + Rando::StaticData::Items[itemPool[i]].itemId != ITEM_DUNGEON_MAP && + Rando::StaticData::Items[itemPool[i]].itemId != ITEM_COMPASS) { + plentifulItems.push_back(itemPool[i]); } break; case RITYPE_HEALTH: case RITYPE_JUNK: default: - replaceableItems++; break; } } - if (replaceableItems > plentifulItems.size()) { - for (RandoItemId plentifulItem : plentifulItems) { - itemPool.push_back(plentifulItem); - } - } - - // Only add potentialPlentifulItems if we think we have enough room (this might not be perfect) - if ((replaceableItems - plentifulItems.size() - 10) > potentialPlentifulItems.size()) { - for (RandoItemId plentifulItem : potentialPlentifulItems) { - itemPool.push_back(plentifulItem); - } + for (RandoItemId plentifulItem : plentifulItems) { + itemPool.push_back(plentifulItem); } } diff --git a/mm/2s2h/Rando/Menu.cpp b/mm/2s2h/Rando/Menu.cpp index ac250d2a9..fdbac9b62 100644 --- a/mm/2s2h/Rando/Menu.cpp +++ b/mm/2s2h/Rando/Menu.cpp @@ -209,10 +209,10 @@ void RefreshMetrics() { setOfItemsInPool.insert(RI_TIME_NIGHT_3); } // If there are less checks than non-junk items, we can't balance - if (checksInPool < (itemsInPool - junkInPool)) { + if (checksInPool * 0.9f < itemsInPool - junkInPool) { balanceStatus = 2; // If there are only slightly more checks than non-junk items, balancing is unlikely - } else if (checksInPool < (itemsInPool - junkInPool) + 10) { + } else if (checksInPool * 0.85f < itemsInPool - junkInPool) { balanceStatus = 1; } else { balanceStatus = 0; @@ -319,6 +319,8 @@ static void DrawGeneralTab() { float junkProgress = static_cast(junkInPool) / static_cast(itemsInPool); ImGui::SeparatorText("Current Settings Metrics"); + ImGui::TextWrapped("To ensure proper balancing, aim for the item pool to be at least 10%% smaller than the check " + "pool. (Not including junk items)"); ImGui::Text("Status:"); ImGui::SameLine(); if (balanceStatus == 0) { -- cgit v1.2.3