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.

Tuesday, 9 December 2025

9/12/2025: 八番出口

少年在某商場的深處走著,心情還不錯。

一方面是等下跟少女有約,另一方面也是他少有穿上了喜愛品牌的全套戰衣。當初他在某高檔百貨的popup store看到就一見鐘情,後來知道這個品牌在涉谷西武百貨那邊有分店立馬就跑過去了。每次說到涉谷和潮流品牌少年就想起美好世界[TWEWY]裡的換裝系統。以前他對品牌的感覺頂多讓他每次到涉谷都要巡一巡的地步,能讓他一見鍾情的品牌這卻是第一次。也許這就是遊戲中講的、品牌的魔力吧?

黑色像絲綢般柔滑的襯衫,暗銀色塗鴉風的點綴讓上衣在眼花繚亂中帶點隨性,幼皮帶束縛著同樣黑色材質的闊腳長褲,長度剛好不會蓋過厚底皮鞋。如果說少年覺得自己還沒潮到可以像卡米頭[Kamito]或者新.美好世界裡的Monocrow那樣頂著黑白中分的配色上街的話,那這全身的銀黑色的配搭應該是他能接受的極限了。這裡不是日本,踏入十二月天氣也還沒降到可被稱為舒適的天氣。雖然走在街上不到十分鐘就會汗流浹背,這依然無阻少年的好心情。

不過這也是少年走進這破商場的原因。雖然因為人流疏落要減省成本而降低冷氣強度,但因為用的是中央冷氣,在人流稀疏的位置冷氣依然足夠,甚至還有點過於涼快。不過少年走進來也是為了避暑,這樣的冷氣正好。先在商場無人注意的角落裡待個二十分鐘,還能等的話就去咖啡店吧。少年是這樣想的。

*

少年今天逛的是一個典型八九十年代建成的小型商場。格子型假天花、辦公室般正方形加菱形樣式的雲石地板,那宛如迷宮一般、時不要要直角轉彎的窄長人行道,都揭示了這個商場對應的正是經濟繁榮、市民對各式小商品需求高漲的時期。

來到三十年後的今天,這商場的榮景早已不再。商場從主打年輕人新潮玩意漸漸改成服務街坊為主,像是乾洗店、補習店、琴行這些。再往入一點則是更小眾、更私人一點的服務型小店,甚麼按摩美甲、占卜佛牌……

當然更深處是租不出去的死場。

這種半死不活的商場有人氣的範圍只限每層的電梯附近,只要走遠一點基本上就是沒人要的空舖。有些裡面空蕩蕩只在門上簡潔地貼了一個「租」字,有些還留著上手懶得清理的外殼,有些直接被當成貨倉擺放雜物--偶而還能看到一些比較詭異、不應放在這的東西。

比如一家空置店面,前身是被時代淘汰的攝影店面。裡面一片狼藉之中卻有個櫃子屹立在牆上:櫃子下半印有柯達的標誌,上半則是透明的玻璃櫃。櫃子裡面是滿滿的底片膠卷,舊式相機用的那種,櫃子大半密封,只在頂部留了一小條縫,剛好可以把膠卷投進去。膠卷從櫃子底部一直堆到接近可以伸手透過縫隙摸到膠卷的程度。

再往裡面走一點,可以看到一家已經倒閉的中古遊戲店。在懷舊遊戲機大行其道的當下這店當然不會有甚麼值錢的二手機台留下,眼看裡面就只有空蕩蕩的收銀櫃台加上各種櫃子。比較特別的是靠玻璃牆的這邊還剩下一些實在的貨物。一些舊的GB、GBA卡帶,部分看上去就是盜版卡帶。

我還記得小時候買下的英傑傳卡帶,結果發現儲存功能是假的,只要重開存檔就會不見。現在想想這不一定是盜錄者的惡意,大概是遊戲開發商的防盜機制吧?近十年大家對舊遊戲的理解越來越多,逐漸了解遊戲開發者這方面的口味真的是一言難盡。現在想玩這些遊戲上網找就好,甚至很多都能在新平台上以極低價買回來,也就不用買這種劣質卡帶了吧?被丟在這裡也是理所當然的。

最奇怪的是另一個櫃子裡殘存的竟是switch卡帶。而且不是普通的卡帶,而是被折斷了的卡帶。細小的switch卡帶幾乎不可能因為意外折斷,而且斷口整齊,很明顯是有人故意折斷的,但那又會是誰呢?我仔細再看,終於在一堆卡帶裡發現一張被蓋住一半、正面向上的卡帶屍骸--那是一張瑪莉奧賽車8的卡帶。

瑪8、折斷的卡帶。一陣寒意閃過,我瞬間好像明白了甚麼。

該不會是我亂入了傳說中的……黑暗賽車大賽……?

傳說中各大城市的裡世界都會定期舉辦黑暗賽車大賽,玩的不再是真人賽車--這個被警察取締的搞不成了--而是瑪8的比拼。獎金獎品固然豐富,但進去玩也不是沒有代價,而代價是用多少片瑪8卡帶來衡量的。一個低注碼的比賽入現費是一片卡帶,高注碼的十片、一百片卡帶也不是沒有。輸家要當著所有人面前把自己作為入場費卡帶折斷,據說折多了自己的賽車技術還會莫名奇妙地退步。

正正是因為一直有人折卡帶,這才造就了對遊戲源源不絕的需求,遊戲也得以站在銷售鎊上歷久不衰。在這個年代實體卡帶已經不太好找,但是瑪8是個例外。某些電玩店總是備著一箱箱的瑪8卡帶,等的就是黑暗賽車大賽的選手來進貨。

可是我又不玩瑪8啊。

每次有人問是誰還沒買我都能自豪地說「哈哈,是我啦」。就連瑪莉奧賽車世界出了以後瑪8開始掉下神壇,實體卡開始掉價是我還也是沒買。說了不會買就不會買,我又不玩賽車遊戲,還不如單人玩瑪莉奧派對呢。

可是這又帶來另一個問題。如果我不玩瑪8,亂入了黑暗賽車大賽會發生甚麼事?該不會因為我不玩而沒法進場,卻又因為已經踏入異度空間而沒法離去?我腦洞大開,全然沒留意到自己正往完全脫離常理的方向思考。

首先要確認自己是不是卡在異度空間裡面。

商場的深巷在目光所及範圍就只剩我一人。往前三個舖位可以向右轉,往後經過攝影店可以向左轉。這是商場最深處的小巷,再沒有別的分支。如果有甚麼異變的話,我應該就會卡在這個巷裡繞不出去吧。

我深吸一口氣邁著步子向前。

轉右,轉右,轉右,轉右。我又回到中古遊戲店的原位。

不論是這種又短又窄的小巷還是那種一直線能看到遠處的大街都是空無一人,也沒有在營業的商店。我試著沿S型路線走過每一條小巷,走了四五條還是得出一樣的結論。

我抱膝背靠中古遊戲店蹲下,抬頭看那中央空調。

如果我卡了在異度空間的話,這部空調還能輸出冷空氣嗎?如果冷空氣被無形的牆壁擋住那就能證實我被卡住,不然的話是中央空調後面還連接著其他空間嗎?很可惜我的手夠不到空調的高度,附近也沒有梯子之類的東西。

手錶顯示時間還在前進而且流逝速度與正常無異。從我進到商場深處到現在已經十五分鐘,差不多要跟少女聯絡了。這時我才發現手機的訊號不知甚麼時候也被截斷了,雖然訊號不好也是舊商場的通病就是,不過我要盡快脫困倒是真的。

我可不會甚麼魔法,自然也不知道甚麼打破結界的方法。我知道的方法就只有一個,那就是商場深處繞圈圈--看見異變就掉頭,沒事就在巷裡面繞圈圈。八次應該就能脫困吧?

…………

……


嗯,八次都沒有異變呢。

我直直地走出商場深處,重新呼吸著市井小店的氣息。少女給我發了訊息就在附近,我趕緊趕了過去,臉上還掛著不知道是驚慌還是運動而出的汗水。

少女目無表情地聽了我的故事,只有簡單兩個字的評論:「白癡。」

***

一段時間前的一個夢,是我最喜歡寫的東西。

原版本其實是有異變的,但不是以八番出口那樣的形式。每一個循環我都能在電玩店的告示上看到四個數字,有些數字組合是安全的,有些則是一種異變。異變的形式五花八門,到最後我都沒完全搞懂所有異變,能逃出來都全靠僥倖。不過這種東西寫出來過於抽象,還是算了吧。