GameCopier loses service-effect triggers and alternate states, and duplicates Radiation
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 42/100
Hướng nghiên cứu
Read GameCopier.createCardCopy() and inspect how the fallback copies abilities and CardState objects for player-managed EFFECT cards. Then trace player initialization through Player.setCounters() and Command-zone copying to understand the Radiation duplication. Use the attached ServiceEffectBehaviorTest.java runner to compare original and copied games; done means all structural and gameplay checks pass without duplicate Radiation effects.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Describe the bug
The fallback path in GameCopier.createCardCopy() does not preserve triggered abilities or alternate CardState objects for certain player-managed EFFECT cards.
The fallback creates a new card and copies static and spell abilities, but does not copy its triggers or full set of card states.
As a result, a game copy can be created successfully while producing different gameplay outcomes from the original.
Observed structural differences
| Effect | Original game | GameCopier copy |
|---|---|---|
| Initiative | 3 triggers | 0 triggers |
| Monarch | 2 triggers | 0 triggers |
| Speed | 1 trigger | 0 triggers |
| Speed card states | Original and Backside | Original only |
| Radiation | 1 trigger on the source effect | 0 triggers on the mapped effect |
| Radiation card count | 1 | 2 |
Observed gameplay differences
The following behaviors work in the original game but fail in its copy:
- Initiative transfer after combat damage.
- Monarch transfer after combat damage.
- Monarch card draw at the end step.
- Speed increase when an opponent loses life during the speed holder's turn.
Radiation has an additional issue. During player initialization, Player.setCounters() creates a Radiation effect when RAD counters are present. Subsequent Command-zone traversal also copies the original Radiation card, resulting in two Radiation effect cards.
In the single-RAD-counter test, the automatically created effect still performs the milling trigger. Therefore, this test does not establish that Radiation always stops working or mills twice. It demonstrates incorrect effect duplication and trigger loss on the mapped source card.
Expected behavior
A simulation copy should preserve the intrinsic abilities, alternate card states and relevant runtime state of active service effects.
Copying a game should not introduce duplicate service-effect cards or change the outcomes of subsequent gameplay events.
Steps to reproduce
Run the attached ServiceEffectBehaviorTest.java using the included runner and instructions.
The fixture contains six independent structural checks and five gameplay checks. Each check is executed against both the original game and its GameCopier copy.
The gameplay checks use Forge's actual combat-damage, event, trigger and stack-resolution mechanisms.
Verification
The defects were reproduced on an unchanged upstream master checkout.
| Test group | Passed | Failed |
|---|---|---|
| Original-game controls | 11 | 0 |
| Copied-game structural checks | 0 | 6 |
| Copied-game behavioral checks | 1 | 4 |
| Total | 12 | 10 |
No tests were skipped.
The only passing copied-game check was the Radiation milling case described above.
Root cause
The fallback construction in GameCopier.createCardCopy() does not perform a complete structural copy of player-managed EFFECT cards.
Radiation duplication additionally involves the order of player-counter initialization and Command-zone copying.
A generic deep-copy solution may be unsafe because different EFFECT families have specialized copying and lifecycle requirements.
Impact on AI simulations
Flat Monte Carlo simulations can evaluate incorrect gameplay consequences even when GameCopier.makeCopy() succeeds without throwing an exception.
A successful copy therefore does not necessarily imply simulation fidelity.
Environment
- Repository: Card-Forge/forge
- Branch: master
- Commit:
3460eccd2629a05032e489bc3d70c082a57a1eee - Forge version: 2.0.17-SNAPSHOT
- OS: Windows
- Java: Temurin OpenJDK 17.0.17
Additional context
Related: #11203 (effect-card mapping) and #12398 (FlatMC fidelity audit).
The attached ZIP contains structural and behavioral regression tests, execution instructions, upstream test results and detailed technical findings.
- Ngôn ngữ chính
- Java
- Star
- 2.7k
- Fork
- 1.1k
- Merge trung bình
- 20 giờ 38 phút
- Pull request đã merge (30 ngày)
- 323
Chuẩn bị môi trường
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của Card-Forge/forge
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
Card-Forge/forge#13128 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Card-Forge/forge#13092 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
Card-Forge/forge#12877 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Card-Forge/forge#12710 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Shandalar "The Drunken Plea" quest completes prematurelyCó thể làm lại được @Simisays đã nhận 35 ngày trước và không có pull request nào đang mở. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Card-Forge/forge#12306 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của Card-Forge/forge
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
yegor256/takes#1868 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
-
area: context help wanted type: decision
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
JoaccoG/spoticraft#6 ·
-
CI: LFC/ANTLR caches still use the old lfc/ paths, so the ANTLR jar is downloaded on every runCó thể đã có người làm @NicoBiernat đã nhận hôm nay. Đang mởbug CI
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
lf-lang/reactor-uc#443 ·
Maintainer thường phản hồi trong vòng 4 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
ChiselsAndBits/Chisels-and-Bits#1397 ·