課程:IBDP Mathematics: Applications and Interpretation (SL) Subject: IBDP Mathematics: Applications and Interpretation (SL)
我是透過我的哥哥接觸到 Tetris 的。我們一起玩的版本是 TETR.IO,這是一款具有獨特遊戲模式的版本。它包含兩種主要模式:一種是專為訓練設計的單人模式,另一種是專注於競技對戰的線上多人模式。在單人模式中,你可以通過消除 40 行來訓練速度 (40 Lines),測試兩分鐘內能得多少分 (Blitz),或探索其他挑戰。而在線上多人模式中,則設有一套競技攻擊系統,允許玩家通過執行特定的消除來發送垃圾行 (Garbage Lines) 擾亂對手。
I was introduced to Tetris by my brother. The version we played together was TETR.IO, which features a distinct gameplay mode. One is a single-player mode designed for training, and the other is an online multiplayer mode focused on competitive play. In single-player mode, you can train your speed by clearing 40 lines, test how many points you can score within two minutes, or explore other solo challenges. The online multiplayer mode, on the other hand, features a competitive attack system that allows players to send lines to disrupt their opponents by executing specific types of clears.
起初,我只是單純享受堆疊方塊和消除行的過程。然而,隨著我對遊戲的深入,我開始對隱藏在機制背後的邏輯和策略感到著迷。在與哥哥和其他玩家的對戰中,我注意到並非所有的行消除都有相同的影響力。例如,消除單行 (Single) 似乎沒有攻擊效果,而執行 Tetris(一次消除四行)或使用 T-Spin(一種將 T 型方塊旋轉進狹窄空間的特殊技巧)通常會產生更強的攻擊。
At first, I simply enjoyed the calming pattern of stacking and clearing lines. However, as I delved deeper into the game, I became increasingly fascinated by the logic and strategy hidden within its mechanics. During matches with my brother and other players, I noticed that not all line clears had the same impact. For example, clearing a single line appeared to have no offensive effect, while performing a Tetris (clearing four lines at once) or using T-Spin (a special technique that rotates the T-shaped piece into a tight space) often produced stronger attacks.
這引發了我對遊戲背後的計分和攻擊系統的好奇。我發現像 T-Spins 這樣的高階策略在競技比賽中備受推崇,這挑戰了我最初的假設,即「消除越多行總是導致更強的攻擊」。
This sparked my curiosity about the scoring and attack systems behind the game. I discovered that advanced strategies such as T-Spins are highly valued in competitive play, challenging my original assumption that "clearing more lines always leads to stronger attacks."
研究問題 (Research Question): Research Question:
"T-Spin 的使用如何影響 Tetris 中的攻擊效率(計分)?" "How does T-Spin usage affect attack efficiency (scoring) in Tetris?"
Tetris 是由蘇聯軟體工程師 Alexey Pajitnov 於 1984 年開發的經典益智遊戲。其核心玩法包括旋轉和堆疊七種不同的四格骨牌 (Tetrominoes)。當填滿一條水平線時,該線消失,玩家得分。雖然規則簡單,但該遊戲擁有驚人的深度和複雜性。
Tetris is a classic puzzle video game developed in 1984 by Soviet software engineer Alexey Pajitnov. Its core gameplay involves rotating and stacking seven different tetrominoes, each consisting of four square blocks. When a horizontal line is filled, it disappears, and the player earns points. While the rules of Tetris are simple, the game possesses surprising depth and complexity.
| Action | Classic Tetris (NES-style) | TETR.IO (Guideline-based) |
|---|---|---|
| Single | $40 \times Level$ | 100 pts |
| Double | $100 \times Level$ | 300 pts |
| Triple | $300 \times Level$ | 500 pts |
| Tetris (4 Lines) | $1200 \times Level$ | 800 pts |
| T-Spin Double | Not available | 1200 pts |
表 1: 計分權重比較。注意 TETR.IO 中 T-Spin Double (1200) 高於 Tetris (800)。 Table 1: Scoring Comparison. Note that T-Spin Double (1200) outscores Tetris (800) in TETR.IO.
T-Spin 是一個反直覺的動作,在歐幾里得幾何中,T 形方塊的對角線長度大於單格寬度,理論上無法在狹窄空間旋轉。TETR.IO 使用 SRS (Super Rotation System) 來允許這種操作。以下我們將 T-Spin 的過程分解為四個關鍵步驟。
T-Spin is a counter-intuitive maneuver. In Euclidean geometry, the diagonal length of a T-piece exceeds the single-cell width, making rotation in tight spaces theoretically impossible. TETR.IO uses the SRS (Super Rotation System) to allow this. Below, we decompose the T-Spin process into four key steps.
物理悖論: Physical Paradox:
方塊此時停在屋簷上方。在傳統物理中,它無法進入下方的凹槽,因為旋轉路徑被阻擋。 The piece rests on the overhang. In classic physics, it cannot enter the notch below because the rotation path is blocked.
當玩家按下旋轉鍵時,系統檢測到碰撞,並觸發 Wall Kick,將 T 方塊「瞬移」至凹槽內部。 When the player rotates, the system detects a collision and triggers a Wall Kick, teleporting the T-piece into the notch.
法則:若 4 個角落中至少有 3 個被佔據 (紅點),則判定為 T-Spin。 Rule: If at least 3 of the 4 corners are occupied (Red), it is a valid T-Spin.
為了準確回答研究問題,我需要收集不同策略下的「得分效率 (PPP)」數據。在研究初期,我經歷了幾種不同的數據收集嘗試,並從中發現了許多問題:
To accurately answer the research question, I needed data on "Points Per Piece (PPP)" for different strategies. I went through several data collection attempts and encountered various issues:
我最初嘗試自己進行 50 場遊戲:25 場只做 Quad,25 場只做 TSD。
發現的問題: 我的 T-Spin 技術不夠熟練,經常因為手誤 (Misdrop)
或恐慌而導致死局。這導致數據反映的不是「策略本身的效率」,而是「我的技術熟練度」。這是一個巨大的干擾變數 (Confounding Variable)。
I initially tried playing 50 games myself.
Problem Identified: My T-Spin skills were inconsistent. I often misdropped due to
panic. The data reflected my "skill level" rather than the "strategy's efficiency," introducing a major
confounding variable.
為了消除技術誤差,我轉而分析 Youtube 上頂尖選手(如 Diao 或 FireStorm)的比賽錄影。
發現的問題: 頂尖選手採用的是「混合策略 (Hybrid Strategy)」。他們會根據當前形勢靈活切換,我無法將「純 Quad」或「純
TSD」的數據單獨剝離出來。樣本缺乏純度。
To remove skill error, I analyzed replays of top players.
Problem Identified: Pros use "Hybrid Strategies." They switch flexibly based on the
situation. I could not isolate "Pure Quad" or "Pure TSD" data. The samples lacked purity.
為了克服上述限制,我決定編寫一個 Python/JavaScript 模擬器。
優勢:
1. 完美執行 (Perfect Execution): 虛擬玩家不會手誤,能反映策略的理論極限。
2. 控制變數 (Controlled Variables): 我可以控制每場遊戲的方塊數 ($N=1000$) 完全一致。
3. 隨機性一致: 使用相同的 7-Bag Randomizer 算法。
To overcome these limitations, I decided to code a simulator.
Advantages:
1. Perfect Execution: Virtual agents don't panic, reflecting theoretical limits.
2. Controlled Variables: Fixed number of pieces ($N=1000$).
3. Consistent Randomness: Uses the same 7-Bag Randomizer.
為什麼選擇 t-test 而不是 z-test?
雖然我們的樣本數 $n=50$ 大於 30,根據中央極限定理似乎可以使用 z-test。然而,z-test 的前提是必須已知「母體標準差 ($\sigma$)」。在這個研究中,所有可能的 Tetris
遊戲局面的標準差是未知的 (Unknown Population Variance)。我們只能從模擬樣本中計算出「樣本標準差 ($s$)」。因此,使用 t-test
是更嚴謹且符合統計學規範的選擇。
Why t-test instead of z-test?
Although $n=50 > 30$, suggesting a z-test might be possible, a z-test requires a known "Population Standard
Deviation ($\sigma$)." The standard deviation of all possible Tetris games is unknown. We only have the
"Sample Standard Deviation ($s$)." Therefore, the t-test is the more rigorous and
appropriate choice.
Null Hypothesis ($H_0$): $\mu_{TSD} \le \mu_{Quad}$
Alternative Hypothesis ($H_1$): $\mu_{TSD} > \mu_{Quad}$
Significance Level ($\alpha$): $0.05$
Sample n: 50 | Variance: Unequal (Welch's)
t-Statistic Formula:
Substitution:
Conclusion: --
計算結果顯示 t 值極大,對應的 p 值遠小於顯著性水準 $\alpha = 0.05$。 這意味著在統計學上,我們有足夠的證據拒絕零假設 ($H_0$)。 TSD 策略的得分效率並非隨機高於 Quad,而是具有系統性的顯著優勢。
The calculated t-statistic is very large, corresponding to a p-value far less than $\alpha = 0.05$. Statistically, we have sufficient evidence to reject the Null Hypothesis ($H_0$). The efficiency advantage of TSD is systematic and significant, not due to chance.
回顧背景章節,我們發現 TETR.IO 對於 T-Spin Double 的得分 (1200分) 是 Quad (800分) 的 1.5倍。然而,若以「行消除效率」來看,TSD 消 2 行得 1200 (600/行),Quad 消 4 行得 800 (200/行),其實際單行效率是 3.0倍。
Reviewing the background section, TETR.IO rewards a T-Spin Double (1200 pts) at 1.5x the score of a Quad (800 pts). However, regarding "line efficiency," TSD clears 2 lines for 1200 (600/line), while Quad clears 4 lines for 800 (200/line), making the actual per-line efficiency 3.0x.
官方之所以設定 1.5 倍的總分倍率,是基於「風險回報 (Risk-Reward)」的考量。TSD 需要更複雜的堆疊結構 (Setup) 和廢塊管理 (Waste Management),如果沒有額外的獎勵,玩家將傾向於使用更安全的 Quad。但問題在於:1.5 倍這個數字是過高還是過低?
The 1.5x total score multiplier is based on "Risk-Reward." TSD requires complex Setup and Waste Management. Without extra reward, players would default to the safer Quad. The question remains: Is 1.5x too high or too low?
什麼是「公平分數」?
在賽局理論與遊戲平衡設計中,數學上的「公平 (Fairness)」通常被定義為「相同的投入應獲得相同的產出」。在本研究中,投入是「方塊資源 (Pieces)」,產出是「分數
(Score)」。如果系統是公平的,那麼不同策略的 PPP (每方塊得分) 應該大致相等。目前的 $F > 1$ 顯示 TSD 的產出過高。所謂「公平分數」,就是指在保持 TSD
的構造難度與消耗方塊數不變的情況下,能夠讓其 PPP 與 Quad 策略持平的理論分數。
What is a "Fair Score"?
In game theory and balance design, mathematical "fairness" is often defined as "equal output for equal
input." In this study, the input is "Pieces," and the output is "Score." If the system were fair, the
PPP (Points Per Piece) of different strategies should be roughly equal. The current $F > 1$
indicates TSD output is too high. The "Fair Score" is the theoretical score value that would equate the PPP
of the TSD strategy with the Quad strategy, assuming construction difficulty and piece consumption remain
unchanged.
逆向工程公式的由來 (Background of the Formula)
我們的目標是尋找一個新的分數 $S_{fair}$,使得新的公平係數 $F_{new} = 1$。
已知目前的係數 $F_{current} = \frac{PPP_{TSD}}{PPP_{Quad}}$。
由於 $PPP$ 與單次得分成正比,我們可以建立等式:
$$ \frac{S_{fair}}{1200} = \frac{PPP_{Quad}}{PPP_{TSD}} = \frac{1}{F_{current}} $$
移項後即可得到逆向工程公式:
$$ S_{fair} = \frac{1200}{F_{current}} $$
這條公式幫助我們量化了「溢價」的程度。
Background of the Reverse Engineering Formula
Our goal is to find a new score $S_{fair}$ such that the new fairness coefficient $F_{new} = 1$.
We know the current coefficient $F_{current} = \frac{PPP_{TSD}}{PPP_{Quad}}$.
Since $PPP$ is directly proportional to the score of a single move, we can set up the proportion:
$$ \frac{S_{fair}}{1200} = \frac{PPP_{Quad}}{PPP_{TSD}} = \frac{1}{F_{current}} $$
Rearranging gives the reverse engineering formula:
$$ S_{fair} = \frac{1200}{F_{current}} $$
This formula helps us quantify the extent of the "premium" awarded to T-Spins.
逆向工程公式 (Reverse Engineering Formula):
$$ \text{Fair Score}_{TSD} = \frac{\text{Current Score}_{TSD}}{F} = \frac{1200}{\frac{PPP_{TSD}}{PPP_{Quad}}} $$
根據模擬數據計算: Calculated based on simulation data:
如果計算出的「公平分數」遠低於 1200 分(例如 900 分),這證明了目前的系統為了鼓勵 T-Spin 而給予了過多的「技術加成 (Skill Bonus)」。
If the calculated "Fair Score" is significantly lower than 1200 (e.g., 900), it proves the current system gives excessive "Skill Bonus" to encourage T-Spins.
本研究透過詳細的數據收集規劃與蒙地卡羅模擬,證實了 TETR.IO 中 T-Spin Double 機制的數學優越性。t-test 結果 ($p < 0.05$) 量化了這種「不公平」,確認了 T-Spin 確為遊戲中的優勢策略。
Through rigorous data collection planning and Monte Carlo simulation, this study confirmed the mathematical superiority of T-Spin Double in TETR.IO. The t-test result ($p < 0.05$) quantified this "unfairness," confirming T-Spin as the Dominant Strategy.
這引出了一個遊戲設計的深層問題:技術分 (Skill Points) 該如何衡量?
如果我們完全依照數學公平性將 TSD 分數下調至模擬出的「公平分數」,雖然實現了數學平等,但可能會毀掉遊戲的競技深度。因為 T-Spin
的風險(如失誤導致死局)無法完全被數學模型捕捉。
This leads to a deep game design question: How to measure Skill Points?
If we lower the TSD score to the "Fair Score" for mathematical equality, we might ruin
the competitive depth. The risks of T-Spin (like misdrops leading to game over) cannot be
fully captured by mathematical models.
因此,目前的 1200 分(1.5倍加成)可以被視為:
$$ \text{Total Score} = \text{Base Value} + \text{Risk Premium} + \text{Spectator Bonus}
$$
官方給予的過量分數,本質上是在支付玩家「承擔風險」與「增加觀賞性」的費用。這是一個數學上「不公平」但設計上「成功」的平衡。
Therefore, the current 1200 pts (1.5x bonus) can be viewed as:
$$ \text{Total Score} = \text{Base Value} + \text{Risk Premium} + \text{Spectator Bonus}
$$
The excessive points are essentially paying players for "Risk Taking" and "Spectatorship."
It is a mathematically "unfair" but design-wise "successful" balance.