Tuesday, 20 January 2026

20/1/2026: 一戰封神/觀音樓/速通

2026年的一月上旬如果要說發生過甚麼大事的話答案就只有一個,那就是在大統領的英明指揮下美軍活捉了委內瑞拉總統馬杜羅,把委國從獨裁中解救出來(大概吧)。

中國外交部用上了「極為震驚」的措詞,但更震驚的應該是速通失敗打了四年仗的俄羅斯吧。他們震驚的不是為何堂堂大國可以如此無視國際法跨國抓人,而是震驚於一戰封神的竟不是他們的土木國防部長。你以為這是段子,但打開各種親俄tg軍事群組的話就不難發現他們真是這樣想的。他們之所以會這樣反應,其中一個原因就是如果四年前他們真的能夠速通(speedrun)烏克蘭,一小時二十二分拿下勝利的話,他們又怎會受這四年的痛苦呢。

法律和國際關係的部分先拋開不談。網上最大的討論應該是Grok的自動改圖?本來網民都用這功能來生成色色,結果看到那張馬杜羅被兩位DEA夾著的照片立馬忍不住出手改圖。改成委內瑞拉士兵反抓大統領,又或是各種動漫人物被生擒。只能說網民除了色色以外還有著別的公約數的。

題外話抱怨一下BBC。他們家的文字直播(live text)總是神神祕祕的,用的是hash網址,而且每次直播完畢以後進入該文字直播的連結就會被拔掉。也就是說如果直播時你沒進去的話,以後想進去就只能靠google替你挖出來。這不是很麻煩嗎?有必要如此低調嗎?你說政治類直播藏起來免得日後打臉就算了,怎麼你連體育直播也藏呢?

然後大統領放話還有下一個。格陵蘭、哥倫比亞、古巴……

嗯?古巴?

*

我對古巴的印象並不多,能舉出來的只有四項。古巴飛彈危機當然是其一,我家附近那成群的雪茄店是第二。還有兩個都是網上影片:第三是古巴人自己搭內聯網打CS,還有第四就是紐約某家古巴中菜。那個西班牙文名字我不太會讀,但它的中文名字挺好認的,那就是觀音樓。

作為一個與拉美沒甚麼緣分的人來說,要理解這個地方的文化屬實不易。萬幸的是食物是無分國界的語言,只要看一眼嚐一口就能懂了。你或許吃不慣那些混進一堆豆類和大蕉的菜式,但他們家的炒麵--應該叫雜碎--卻是全世界的中式快餐都能找到的東西。不是現在那些到處擴張的預制中式連鎖垃圾,而是那些移民家庭在外地開的,給「鬼佬」做的中菜。

有時候工作跑到陌生的鄉下城市,獨自一人實在沒心情吃甚麼好的西餐,外賣壽司也吃膩了,我就會跑來這種地方點個炒麵加個檸檬雞。在後廚炒菜的是老爸和兒子,收銀的是老媽,還有小孩從廚房連接的主宅跑出來。你接過外賣,炒麵不出意外是炒得很油像是上海粗炒的麵條,夾著幾片叉燒,還有紅蘿蔔和西蘭花。檸檬雞是最不中菜的中菜,上了厚粉炸的雞腿肉加上檸檬醬--當然不是大陸西南用的傳統檸檬醬,而是廉價的、用檸檬汁開的糖漿,說是弱化版咕嚕肉都是一種抬舉。這些作為中菜水準實屬一般,你在意的卻是食物以外的滿足。

嘛,如果有機會我還能多寫我對外國中餐館的回憶感覺。其實觀音樓更靠近餐廳而非專做takeaway的中式快餐,但我莫名奇妙就對這我從未光顧過的小菜館有著好感。

為甚麼我會突然記起它呢?其實它在經營三四十年後頂不住疫情倒了,每次回去看那影片都能看到下面的留言在懷緬。可這次不同了--觀音樓在原址四街之隔重開,看起來也是原班人馬,看起來還有本事把古巴中菜這歷史偶然產生的神奇菜系延續下去一段時間。如果有讀者有幸去吃一次的話,歡迎留言讓我知道吃起來怎麼樣!

*

俄佬沒法速通烏克蘭不要緊,至少我們還有遊戲速通可以看。每年的AGDQ又來了,第一集網絡隨心巡記本來就是因為AGDQ而寫的。結果這次有興趣看的意外的少呢:

- dlroW oiraM repuS是倒序打通SMW的mod。按理說正常打不會太難,但這個遊戲是典型打起來不難、速通起來超難的遊戲。如果有SMW的經驗的話蠻值得一看的。
- Bloons Tower Defense 6。原祖級塔防系列,但總覺得但凡加太多複雜機制的話就會被找出一種很好通關的作業,這正是我看完這段示範後的感想。還是簡單的比較好玩,專注於輸出穩定性和怪物血量之間的平衡就夠了。

怎麼說呢。也不是覺得速通沒意思了才不看,而是真的剛好全部都沒興趣。Switch 2首發沒關注,老任舊作像是賽車和Metroid也是我剛好不玩的東西(以前還會因為kill the animals環節而看,現在已經沒人在乎這個梗了),一些定番像是2D索尼克和super monkey ball也沒出場,小眾遊戲新作也沒幾個吸引人。壓軸的綠寶石自選一隻速通是讓(有投錢的)觀眾很有參與感沒錯,但通關方式其實大同小異,只要是熟知遊戲的人大概都能打出差不多的成績。更氣人的遊戲打到一半被火警鐘打斷了!以一個反高潮的環節來給這個無甚記憶點的活動來收尾,還真是蠻匹配的,嗯。

Speedrunning歷史達人兼Punch Out!最快打敗泰臣紀錄保持者summoningsalt最近發了部影片講他對「speedrunning已死」的感想。他先看了google搜尋speedrunning、AGDQ、加上他自己影片的熱度,那是人們的主要根據;他自己則提出了其他測量法,認為整體熱度還在上升,只不過沒像疫情時那爆發式增長,而流量分散到新興活動、遊戲和創作者也會造成整體熱度停滯不前的樣子。他為速通已經「成熟」了,有穩定的社群和流量,當然其中也有他的一份大蛋糕。

道理大家都知道,但我想說說成熟這一點。

「成熟」這個概念在這博客被反覆提起。比如說,社群對一個遊戲的理解怎樣才算是成熟了?對我來說最重要的是不用再盲目摸索,而是建立系統化、數值化的解構。能找出一個可以應對遊戲現有機制、甚至迅速看懂更新改版的理論,那對遊戲的理解也就成熟了。我印象最深刻的當然是我桐遊戲理論的探索過程

說起來,最近頁遊好像又復興了一些。西方那邊接連冒出幾個放置系RPG,中文圈則有江湖系、修仙系、還有OGame系的……至少這次不會被半夜被屠了。

把同一套理論搬到速通的理解上,所謂成熟就是能迅速理解速通一隻新遊戲的脈絡的能力。最表面的當然是「正攻」遊戲所需要的技巧和手速。凡是RPG就離不開數值規劃,有選擇就是流程規劃;有劇情就看能不能跳過,有時間就有RNG控制,內存溢出就能刷ACE;動作遊戲裡物理模型怎樣判定和計算有沒有漏洞等等。哪些技巧比較簡單、哪些不夠穩定;哪些會在早期被用上,哪些會留到最後才嘗試。

只要有了脈絡,速通的進展會變得有序和線性,就像朝著一個目標挖礦一樣。至於能不能挖下去,能挖到多深,那只取決於有沒有人來挖,挖的人技術有多好。現在一個新遊戲只要多通關幾遍,該怎樣把時間砍下去甚麼了已經了然於胸,剩下的就只是執行而已。

比如說,瑪莉歐賽車64的weathertanko技巧,一般來說成功率只有5%。如果想要三圈都成功使出來的話就要賭那八千分之一的運氣。可是這不也是被weathertanko本人試了一萬多次硬生生撞破了嗎?Bismuth三個月前發佈新影片剖析了完美速通SMB1(也就是打和TAS)的難度。他把非常有可能破紀錄、長期霸榜的Niftski在每一個難關、每一步的成功率拿出來算,算出機率大約在六萬五分一左右,如果他技術繼續進步則可能到兩萬五分一左右。雖然比weathertanko連三拉三難上一個檔次而且遊戲也更長,可是這不也是機率問題嗎?問就是多打幾次、多打幾個月、多打幾年。

你說不對啊。Bismuth他四年前還發過影片說4:54(指4:55以下的時間)為何是完美speedrun,七年前發影片說某幾個關卡的TAS framerule分別是"1/1000"、"maybe someday"和"not happening"。對比現在一直到8-4都能跟TAS平手、最終成績4:54.4的時間不是好多了,這不是理論進步的表現嗎?

還真不是。一方面是來了個高超的挖礦者把成長曲線提前了,另一方面這也是局外人對特定技巧難度的誤判。當初被說成"not happening"的8-2 TAS framerule,Niftski本人的成功率是36%。現在可以4:54完成遊戲的人已經一隻手數不完了,幾乎每個人都能大致穩定地打過8-2。所謂的難關在人才的堆疊下還是


這更像是來了個高超的挖礦者,把成長曲線提前了而已。人手操作下的SMB1攻略已經放這裡很多年了,只是沒人練到可以執行的地步而已。Niftski本人在8-2的成功率是36%,可不是甚麼not happening。你以為是他一個人太厲害嗎?其實現在能4:54通關的人已經一隻手數不完了,這些人打8-2的成功率也不可能太低。在天賦和努力的堆疊下許多打法並沒有外人想象中那麼不可能。

所以說,當軌跡已經定下的時候,速通能帶來的驚喜好像就減少了很多。

這是我的一面之詞就是。

我到現在都偶而會看Werster直播綠寶石戰鬥工廠的挑戰。比起其他講求手速和精密度的速通挑戰,這更像是理論和運氣的結合。理論是很重要,但如果不給你好用的精靈,又或者把剋你的隊伍擺在你面前,甚至只在關鍵時候給你來個關鍵一擊,你還不要重頭來過?每一場、每一輪都像是在丟骰子。從這個角度看,Werster的挑戰不過是另一種形式的丟骰子而已。不過我想觀眾想看的是到他被坑死時暴怒模仿精靈尖叫的樣子,又或者僥幸通關時那種野性的喜悅吧?就像他一口氣打完七金的時候那樣。

*

我打從開始就在猶豫這篇應該屬於網絡隨心巡記還是雜談。這是三個有明確順序、兩兩緊密關連的題目。另一方面作為隨心的記錄這又有點冗長,三個題目也有點太少,何況部份題目談的不是發生在當下而是橫跨一段時間的事情,這似乎有違隨心巡記的格式。

看看那四千字的長度,還是當成雜談好了。反正不論是網絡隨心巡記還是雜談,標籤都都屬於「隨筆」不是嗎?

Saturday, 27 December 2025

Utility evaluation of gacha models in games

Think about a simple gacha model. Each pull costs 100g (gold) and there is an uniform chance of 1% to win a prize. Assume free trade of gold and items in an efficient market. What is the fair price to that prize?

This is very simple: 10000g, this is the expected cost for you to pull one from the gacha. If the market price is below 10000, every producer (gacha puller) would stop pulling so supply would halt, market makers would sweep items below 10000g, forcing trades to be conducted at 10000g. If the price is above 10000g, there will be extra producers pulling the gacha producing that item at the cost of 10000g per piece.

In reality however, situations can be well different. There are cases where the prize is being traded at prices widely off from the expected value, and similar phenomenons are consistent across all games in all platforms.

Why?

Well, note that we have already made too many assumptions, many of them are almost impossible in applications:

"Efficient market" is often the biggest lie among all. Are there actually enough buyers, sellers and market makers to keep the price competitive? Are all stakeholders smart (efficient) enough? Is it an environment with symmetric information? None of the above hold in our case.

In MMORPG, the free trade condition is also most likely obscured. The imposed tax, associated items being locked from trading, cost of marketing and trading, opportunity cost of trading slot occupation, they are all hidden cost. Ah...and time. Time cost is often the most expensive. When I say gacha in the first place the same question may well be asked in scenarios of game events or dungeons, which is equivalently gachas but with time cost involved. It is not easy to quantity such into (in-game) monetary cost, but a premium is certainly necessary as well as a widened ask-bid gap. 

The most complicated but also most important reason though, is that you won't often find a gacha with a single return. There are multiple prizes in a pool, and accounting each and every single of them would be a nightmare. It is not only those items but all associated items with supply or demand disrupted by the existence of items in our gacha pool. 

Still though, it is possible for us to take another step on gacha evaluation and to explain why the equilibrium could shift away from the expected value. This is our main focus today. 

To derive such theory we would like to differentiate between wealth and utility.

Let us take the gacha games as an example again. There is a point where no matter how strong your units are, your in-game performance probably won't improve much -- all PVE contents cleared effortlessly, similar PVP ranking and so on. That is, the utility you gain when you are extremely wealthy would be exponentially small with a cap. This is called risk-aversion. On the other side, some seek for thrills and takes values extra risk positively, these are called risk-seeking. Between risk seekers and haters there are also risk-neutral players.

In common sense we should expect the fair price to be higher than the expected value for the risk-aversion case because you want others to take the risk for you, and you are paying a premium for it. For risk-seekers, they are taking extra risk for unproportional return, so the fair value would be lower than the expected value.

With the above intuition in mind, we can set up models and prove our claims mathematically. 

There are many models to utility, but here is a simple one. Introducing the exponential utility $u(w) = -e^{-\alpha w}$ where $\alpha$ is the degree of risk preference, positive for risk-aversion and vice versa. This is derived from the constant relative risk aversion (CARA) assumption and the differential equation $-u''/u' = \alpha$, although the reason behind such differential equation would be out of scope here.

Let us call the cost of a single pull to be $x$ and the underlying value of the prize to be $V$. Call the original wealth of a player $W$. Ignoring the risk of going bankrupt while pulling the gacha (we will come back to this later), we know that the new wealth by obtaining the item precisely on the $k^{th}$ pull to be $W+V - kx$.

Assume the chance of winning the prize to be $p$, then the expected utility of pulling till you win the prize to be $EU(W,V,x,p) = \sum _{k=1}^{\infty} p(1-p)^{k-1} u(W+V-kx)$. Now we can convert that into a price $P$ that you are willing to pay instead of pulling the gacha by yourself. That gives the equation
$u(W-P) = EU(W,V,x,p)$.

First we can simplify $EU(W,V,x,p)$:
$EU(W,V,x,p) = \sum _{k=1}^{\infty} p(1-p)^{k-1} u(W+V-kx)$
$= \sum _{k=1}^{\infty} p(1-p)^{k-1} (-e^{-\alpha(W+V-kx)})$
$= -p e^{-\alpha (W+V)} e^{\alpha x} \sum _{k=1}^{\infty} ((1-p)e^{\alpha x})^{k-1}$.

Assuming the geometric factor $|(1-p)e^{\alpha x}|<1$ we obtain the form below:
$EU(W,V,x,p) = -p\frac{e^{-\alpha (W+V-x)}}{1-(1-p)e^{\alpha x}}$.
Such assumption is true for sufficiently small (aka valid) $\alpha$. It can be interpreted as that $\alpha$ must be small relative to the cost of a single pull $x$ such that each failed attempt does not inflict a large enough penalty to the point where pulling gacha itself becomes nonsense.

Plugging in $u(W-P) = -e^{-\alpha (W-P)}$ into the main equation, we obtain
$e^{-\alpha (V+P)} = p^{-1} e^{-\alpha x}(1-(1-p)e^{\alpha x})$

Taking log and some rearrangement gives
$V+P = x + \frac{1}{\alpha}(\ln p - \ln (1-(1-p)e^{\alpha x})) = f_{x,p}(\alpha)$.

The rest is slightly nasty calculus but I will leave as exercise here:

Proposition. Given $p\in (0,1)$ and $x > 0$, there exists $\alpha _0>0$ such that $f_{x,p}: (-\alpha _0,0)\cup (0,\alpha _0) \to \mathbb{R}$ is a valid function that satisfies the following:

1) $f_{x,p}$ can be continuously extended at $\alpha = 0$, denoted as $f^*_{x,p}: (-\alpha _0,\alpha _0) \to \mathbb{R}$.
2) $f^*_{x,p}$ is strictly increasing.
3) $f^*_{x,p}(0) = \frac{x}{p}$.

What does it say?

First we need to understand the term $V+P$.
$V$ is the underlying value of the item.
$P$ is the value you are willing to pay to buy the item instead of pulling.
Summing together, $V+P$ represents the value you are willing to buy the item -- or the market value of the item.

The above Proposition says that $V+P\to \frac{x}{p}$ as $\alpha \to 0$. That is, the market value of the item is equal to the value based on probability in the risk-neutral scenario, which is precisely what we claimed!!!

Since $f^*_{x,p}$ is strictly increasing, we know that $V+P > \frac{x}{p}$ when $\alpha > 0$ and vice versa. Hence there is a premium in a risk-aversion market and vice versa in a risk-seeking market.

*

It has long been something I would like to investigate since I came back to a RPG that allow trades. Some may have already noticed I wrote something about in-game economies under tax a year ago, and one may treat the above kind of a sequel to that.

But it helps more than just on the pricing side. It is also about game design.

Gacha mobile games have been around long enough and is surely a mature industry. Many designs are pretty much fixed, and the gacha system is one of them. 90% of the games provide two options, a single pull or a package of $N$ pulls with some discount/promises. When such model can be analyzed under the above utility framework, one may as well ask if such gacha system is optimized to players or to developers. Is there an alternative that is at least as attractive (in terms of utility or mere illusion) but draws more profit for the developers?

I talked with my maths and finance friends. Their general response is also what I agree: it is (much) more effective to insert attractive content than to create a better gacha logic. Better illustrations, better characters, better gaming system...improve the game itself, not means of profitization.

Yet, I found the above a fine little problem that is laid clear by the means of mathematics. This is only the first step and the rest is still largely unexplored. For those interested you can consider the following variations:

- The isoelastic utility can be used instead of the power utility. This is defined by $u(x) = \frac{x^{1-\eta} - 1}{1-\eta}$ for $\eta \geq 0$ and $\eta \neq 1$ (for $\eta = 1$ the utility if $u(x) = \ln x$ by continuous extension). Repeat the above recover the formula $V+P = g_{x,p}(\eta)$. With the help of Taylor series, try to recover a similar statement like the Proposition above.

- In reality gacha provides multiple prizes. To deal with this we can think about the case of two prizes -- you will find that the derivation is quite similar, without the need to use matrix algebra like multi-asset portfolios.