feat(coop_mining): fix multi-agent gold mining registration and elimi…#319
Open
sriramsowmithri9807 wants to merge 2 commits intogoogle-deepmind:mainfrom
Open
feat(coop_mining): fix multi-agent gold mining registration and elimi…#319sriramsowmithri9807 wants to merge 2 commits intogoogle-deepmind:mainfrom
sriramsowmithri9807 wants to merge 2 commits intogoogle-deepmind:mainfrom
Conversation
…nate duplicate rewards - Ensure each miner is counted only once per ore attempt. - Preserve immediate extraction for iron (minNumMiners == 1) and gold (minNumMiners == 2) on sufficient distinct miners. - Prevent over-reward by clearing miners and countdown and transitioning ore to wait state immediately after successful extraction. - Guard against “too many miners” by failing the attempt when the number of distinct miners already meets/exceeds the required threshold prior to the new hit. - Avoid conflicting state transitions by not mixing reset() and setState() in the same `onHit` success path. Files changed: - meltingpot/lua/levels/coop_mining/components.lua Key changes: - Ore:addMiner: only reset the mining window if it is already idle; prevents premature timer resets. - Ore:onHit: de-duplicate per-miner mining events; trigger extraction when required distinct miners are reached; ensure immediate transition to wait state after success; fail fast if miners exceed required count.
Member
|
Thanks Edgar, I'll assign for Joel. @jzleibo should probably release a new minor version once this goes in. |
…vations in verbose mode
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…nate duplicate rewards
onHitsuccess path.Files changed:
Key changes: