Tuesday, 11 July 2017

Functions on ordered set

A simple thing that I encountered during my tutorial sessions so I decided to share it here.


Let $(A, \geq)$ be a partially ordered set.

If $(A,+, \times$) is a ring we may add an order $\geq$ that cooperates with the binary operations if

- $a\geq b \Rightarrow ac \geq bc$, if $c \geq 1$.
- $a\geq b \Rightarrow a+c \geq b+c$.

That in fact decide much of the order, and denies the existence of order for any rings with finite characteristic or invertible elements. (That is why complete totally ordered field is so rare, too.) Clearly a finite ring has finite characteristic - and it will be hard to put an partial order on it. If a space has sub-structure that looks like a finite ring it might be bad to have an order as well.

Example 1. We all know that $\mathbb{C}$ has no total order. It is possible to assign a partial order to it that is consistent with the order on the reals? The answer is no, too.

Problem. Consider a poset $(\mathbb{C}, +, \times, \geq)$ that cooperates with the real order. Let $\omega = e^{q\pi i}\neq \pm 1$ where $q\in \mathbb{Q}$. Show that  $\omega$ is not related to 1. Hence or otherwise, show that such an order does not exist.


To further demonstrate why orders cannot cooperate with binary operations we look at the following example.

Definition 2. Let $f:(A, \geq) \to (B, \geq ')$ be a function. $f$ is said to be increasing if $a\geq b$ implies $f(a) \geq ' f(b)$.

Since the strength of different orders varies, it is very hard to compare maximality in different spaces.

Proposition 3. Let $f:(A, \geq) \to (B, \geq ')$ be an increasing bijection. Maximality of $a\in A$ does not imply maximality of $f(a)\in B$.

Proof. Take the identity map of $f: (A, =)\to (A, \geq)$ where $A = \left\{ 1,2\right\}$ and consider 1. 1 is maximal under the equality order but not maximal under the $\geq$ order.

But then crafting an example with respective to the same order is much harder.

Proposition 4. Let $f:(A, \geq) \to (A, \geq)$ be an increasing bijection. Maximality of $a\in A$ does not imply maximality of $f(a)\in B$.

Proof. Consider $A = \mathbb{Z}$ with the order $s \geq t$ iff $(s,t) = (2n+1,2n)$ where $n\in \mathbb{N}$ plus the reflexive relations. The function $f(n) = n+2$ is an increasing bijection, but the maximality of $0$ does not imply the maximality of $f(0) = 2$.

The reason behind is that finite poset failed to work here.

Theorem 5. Let $f:(A, \geq)\to (A, \geq)$ be an increasing bijection, where $|A| < \infty$. Then maximality of $a\in A$ implies maximality of $f(a)\in A$.

Proof. For $a\in A$ define $\langle a \rangle = \left\{ f^k(a) \mid k \in \mathbb{Z}\right\}$. If $A$ is finite then so as $\langle a \rangle$, so there exists $p,q\in \mathbb{Z}$ so that $f^p(a) = f^q(a)$. Taking inverses we have $f^k(a) = a$ for some $k \in \mathbb{N}$. [This is a standard algebra argument.]

Suppose there exists partial order $\geq$ so that $a$ is maximal and $f(a)$ is not, then we have $c \in A$ so that $c > f(a)$. But that implies $f^{k-1}(c) > f^k(a) = a$ which is a contradiction.

Problem. The function $f$ is decreasing if $a\geq b$ implies $f(a) \leq f(b)$. Does the above results [3,4,5] holds for decreasing bijection?

Monday, 10 July 2017

Ramen, ramen, ramen

An essential part in any trip to Japan. Such a unique class of cuisine that is spread universally, with various form developed in different places, yet delivered by the same type of people -- the professionals who carries the spirit over generations.

My love to noodles does not restrict to ramen. Italian (pasta), Chinese (egg noodles, `river' noodles, vermicelli,... and a lot more), Japanese (udon and soba) -- are all my favourites. You expect different textures and hence different combination of ingredients to go with different kinds of noodles. For example the best way to enjoy Cantonese wonton noodle has to be fine egg noodles with wonton in a clear shrimp based soup, and when it comes to ramen I prefer a rather thick soup acting as a bridge to mix everything together.

During my trip I tried lots of different ramen, but here are six that impressed me, emphasizing two uncommon classes of ramen outside of Japan, chicken soup based ramen and dipping ramen.

[My out of 10 rating system - 6 = adequate 7 = good 8 = excellent]


道玄家 蒲田東店 (Dougenya)
東京都 大田区 蒲田 5-28-4
Tabelog: 3.03/5
My rating: 6.5/10

Close to the Keikyu station, Kamata is not a bad place to find some quick food especially in the night time. They are more well known for their chicken ramen which is less common in the foreign world, so I gave it a try.

Chicken soup for ramen does not taste like western broth - instead it is more like the pure taste of chicken - and when it becomes very thick it works well with other strong companions like chopped spring onion and raw onion. The protein - chicken thigh, chicken breast and meatball delivered properly. I like their use of fine noodles as they trap more soup when you take them out; eventually you finished and didn't find much soup left, then you know that must be heck of a thick soup. My only complaint is the quality of the noodle itself - the texture is slightly too soft to match other ingredients [onions and chicken pieces].

(As a said note...their shio-tonkotsu ramen is quite bad...I would rather recommend their strength only.)


麺屋 武一 秋葉原店 (Menyatakeichi)
東京都 千代田区 外神田 3-13-5
Tabelog: 3.56/5
My rating: 7.5/10

It's very hard for me to describe how good this is...an evolved version of Dougenya's one. Softer treatment on chicken breast, nice bamboo shoot and soft boiled egg with flavors well penetrated, better noodles...there is a reason for this restaurant to become popular among all the others in the center of Akihabara.


天下一品 蒲田店 (Tenkaippin)
東京都 大田区 西蒲田 7-5-13
Tabelog rating: 3.08/5
My rating: 6/10

One of the leading chain stores when it comes to thick soup as well as Kansai ramen. I was strongly encouraged to try this, so why not?

What makes things even more interesting is that the soup is chicken based instead of pork of cow...but you can quite clearly differentiate Tenkaippin's soup from the previous two due to the bulk use of vegetables. The soup looks thick as sludge, and taste thick as sludge...but everything just work, even the sandiness in the soup adds another layer to the overall texture.

You may occasionally find rice as an extra option to go with dipping noodles - that you can dump the rice into the thick soup and enjoy every bit of the meal. You can do the same here, and in fact this is a popular option here. Unlike dipping soup that could be too salty even with rice, the chicken based soup here is very close to our usual leftover juice that you liked to pour over rice...just a much delicious one.

Undoubtedly they have some very solid ramen...but the rest are less satisfying. The barbecued pork is rather dry, the gyoza is kind of bland and the fried chicken...somehow reminded me "America's worst fried chicken of the night" from Masterchef, if you know what I mean.


頑者ネクスト レベル アクアシティお台場店 (頑者 NEXTLEVEL)
東京都 港区 台場 1-7-1 アクアシティお台場(Aqua City) 5F
Tabelog rating: 3.06/5
My rating: 6.5/10

Ramen themed food court in shopping mall, Daiba. Well I do have expectations when it comes to dipping noodles but once again I shouldn't have too much expectation over restaurants in malls from a tourist spot.

The motivation for separating soup and noodles is to preserve noodle's texture. But by doing such it will be very hard to keep the soup warm because cold noodles will draw the heat away quickly. This is sometimes compensated by allowing customers to re-heat the soup or adding new boiling soup into the bowl, but they do not seem to be popular solutions in Japan.

At first I thought the noodles here are relatively expensive (about 200 yen higher) because it's inside a mall, but it turns out to be a feast - you will find 3 pieces of pork in this 1100 yen set (2 of them in the soup), each giving a different flavor. The prawn and pork based soup is rather salty, but matches with the well-known thick noodle.

Everything is so good -- you even got the exclusive view of Tokyo Bay from here, but the cold soup could ruin the day. I just do not like the design of the bowl because it gets cold even faster. Or maybe it's only my fault as I failed to communicate with the waiter properly...


東京駅 斑鳩 (Ikaruga)
東京都 千代田区 丸の内 1-9-1 東京駅一番街 B1F (Ramen street, "First Avenue" Tokyo Station)
Tabelog rating: 3.58/10
My rating: 7/10

You know that has to be a great one when the tabelog rating is 0.5 higher than the rest...and it is indeed a good one. When I am standing in front of the vending machine a waiter came and unchecked the "sold out" signal for dipping ramen - so I knew I had to go for it.

It was my first time having spicy ramen soup. Never a big fan of any kind of spiciness, but I have to say that it worked well with the fish and pork based soup. Very tender and flavorful pork, good noodles and egg...but again the soup got cold before I could finish all noodles at my greatest pace.

As a rather classy restaurant they did a great deco job and I enjoyed eating there a lot. My only complain was the cloth covering spoons...that failed to match with the rest of the restaurant.


はやし (Hayashi)
東京都 渋谷区 道玄坂 1-14-9 ソシアル道玄坂
Tabelog rating: 3.61/10
My rating: 8.5/10

If you have never tried ramen before, take this as your origin.
Then you will fall in love with ramen.

Menu with ultimate simplicity: ramen, ramen with egg and ramen with roasted pork, but they executed every part to perfection: noodles with right thickness and chewiness, fish and clam based soup not boiling but at the right temperature for you to enjoy immediately once served, nicely layered pork slice... The instant reaction from both my friend and me as a first time visitor -- "now I know why people are queuing for this". It's very hard to describe in words but it has to be one of the best ramen restaurant in Shibuya.


I really should have written this before the taste fled from my memory...or instead I should have learned to describe good food and not just criticizing.

Wednesday, 21 June 2017

夢.十夜 (2) The xenologue







Tuesday, 20 June 2017

FE Heroes: my blitzkrieg team

(Akashic Records of Bastard Magic Instructor ep.11)

We've been saying that FE Heroes is the simplification of the traditional FE series on game consoles onto the portable platform. In order to set up a minimal battle system we may either allow a team of 3 or a team of 4.

A team of 3 comes naturally from both real ancient battles and novels: one attacking unit, one defending unit and supportive unit. In FE there is a another special correspondence: a team of 3 allows the elemental cycle to be completed. But of course battling with teams of 3 is too boring, and we have the colourless typed unit as well. The fourth unit allows the possibility on the use of tactical units, as well as enforcing one of the above roles.

So here I want to introduce my balanced team that I have been using.

The killer queen: Ursula

"My master has been complaining that I did not receive proper illustration...but that's not a problem because my target will stand no chance to have a single glimpse on me."
A: Death Blow 3 [Fury]
B: Desperation 3 [Quick Ripsote/Vantage]
C: Threaten Res 3
S: Attack 1
D: Reciprocal Aid
SP: Moonbow

Her superior attacking ability allows her to two-hit-KO almost all red, blue melee, cavalry, armored, flying and green melee units. As a cavalry unit her mobility allows convenient use of the reciprocal aid - she can even switch HP among other units! Desperation allows double hits without receiving further damage, although I hesitate to put Fury on her because that affects the use of reciprocal aid. Moonbow is kind of a standard fast-charging SP nowdays, and is very effective given her double hit ability.

The magical tank: Julia

"Oh...someone produced 0 damage on me...yet again."
A: Fury 3 [Resistance 3]
B: G Tomebreaker 3
C: Hone Spd 3 [Breath of Life 3]
S: Fortify Def 1
D: - (To be added. Draw back?)
SP: Iceburg
[] - Skills to use in the trials

Another unit with solid magical stats. She can attract and tank most magical firepower (especially those cavalry magical units), and when unit approaches they will be swiftly killed by Ursula. With Ursula's elemental cover she only needs to face green and blue units, so the G breaker works very well against even the toughest green magicians like Nino.

When she stays at the back she supports the team well with her supportive skills. She can stay directly behind the melee units so that she can at the same time support the unit at the front, and attack.

The specific/tactical solution: Takumi

"I break archers...but not only those."
A: Close Counter
B: Bow Breaker 3
C: Threaten Spd 3
S: HP 3
D: - (To be added)
SP: Vengeance

Problem arises: there are units with high resistances and attacks physically - the fliers. So Takumi is a perfect solution here. Takumi is the ultimate solution to fliers as well as all units with low attack high resistance (typically staff users) that Ursula and Julia cannot quickly eliminate. Bow breaker allows him to finish all archers (in particular Takumi, who is considered the greatest threat usually). When he cannot find specific target he serves as a steady physical damage output as well.

The core/physical tank/red unit: Olivia

"Oh please give no chance to the enemy to have a peek of my dance!"
A: Death Blow 3
B: Sword Breaker 3
C: Hone Atk 3
S: Speed 1
D: Dance
SP: Escutcheon

Ursula, Julia and Takumi are all distant attackers. Once the enemy tanks all the damage and come close the formation can be very restrictive. At the beginning of the battle distant attackers may be exposed if they go beyond the front line too much - so we need Olivia to pull them back. This is the unique unit [besides Azura] that makes the improved hit-and-run tactics possible. Being a red unit she is also capable of dealing with green units that Ursula and Julia cannot properly deal with -- especially the king -- Hector(s). I gave her sword breakers to deal with red units just in case. Hone attack is the perfect skill for her because units always surrounds her as the origin of the blitzkrieg, too.

Two evident weaknesses:
- Hector with Vantage. Olivia is the only unit that can defend his attack. Hector alone is usually fine (Julia hone def + Ursula recovering), but if Hector drags her away the other units will be exposed .
- Dagger users: they have moderate def and resistance yet attacking physically, so all three distant attackers will experience difficulty dealing with them. Again Olivia is the solution, but if that does not work out the team is in great trouble. Precise positioning is often required to wipe them off.

Takumi is a specific solution against bowers, and Kaguro is the specific solution against dagger users so I often switch between them. However Takumi enjoys full skill inheritance and a higher physical stats so he will still be my short term choice. It's not a long term solution because they are only specific solution but not as useful as Ursula and Julia in general. When I look at their skill points (effectively the kill count), the SP of Takumi is less than half of Ursula's -- so he does not really kill a lot.

One last negative on this team: I get used with Olivia too much that I do not know how to play when I have a team without her. That is precisely the case when I was going through the tempest trials where you will need multiple teams (usually), but I only have one Olivia. Eventually I came up with another strong team (Nino, Tharja[+40%], Ryoma and Kaguro) but it's only for the boss stage specifically. I don't think it will stand any chance against any matured 680+ arena team.

Results so far:
- Arena: @690+, tier 18~19
- Clears all 7 stages in the trials event sometimes, 6 stages at least

Wednesday, 17 May 2017

FE Heroes: Arena Tiers

Recently FE Heroes adopted a new reward system which is kind of an extension of the classic promotion/demotion system. Players start from the tiers they have been in in the last season. At the end of each season a portion of players are promoted/demoted from their current tier (promotion to tiers more than a rank higher is possible).  Such system is quite popular among games that use tier rewards instead of fixed ranking (that saves the work of calculating the suitable amount of prize you want to give), and it enhances consistent participation. Another game that uses similar structure is the Venus Eleven.

In terms of mathematics, we may transform population into proportion, and instead of a distribution at a certain moment we look at probability distribution of a single node in the system. There are something from conventional mathematics that we can use immediately - the queuing theory.

The whole thing is basically just a birth and death process. You equate the in-flow rate and out-flow rate, set up the equations then it can be solved easily. Results say that the transition matrix has eigenvalues at most 1, so it is going to converge. You can always find the stable state vector by doing some tedious linear algebra work...but well we only care about the numerical result here, so it won't be a shame to solve the stable state vector using numerical method.

We do expect something like a geometric distribution. The reasoning from queuing theory is simple as well: let $p_n$ be the probability (proportion) of object at state 0, and let $\rho = \lambda / \mu$ be the traffic density. By checking the first equation with $\mu p_1 = \lambda p_0$ so that by induction you have $p_n = \rho ^n p_0$. If you have a queue of infinite capacity then $p_n = (1-\rho ) \rho ^n$. Here $\rho _i $ is not fixed but it's still approximately throughout and double promotion is possible, but if we focus at the top (recall the memoryless nature of this process) the process is pretty close to a classic M/M/1.

Below is the plotted graph for the long time distribution:

That could be a pleasant surprise to the players (in terms of its generosity) and to the mathematicians.

Why is it not geometric? Well it is quite geometric if you break it into two parts: tier 7-16 and tier 17-20. On the lower section we have $\rho >1$ so that most players tend to advances from their current tier, and on the upper section we have $\rho < 1$ so players struggles to go up.

What is surprising is that they did not make the top tier unreachable -- tier 20 contains top 7% of the players instead of like, 0.5~1% as (Asian) gaming veterans would have been expecting. This is quite generous --- or overly generous. Consider that there are around 100k active players in the pool currently, 7000 of them could be in the top tier that corresponds to the top 5.5 categories in the old system.

Putting that generosity aside, the idea of loosening award tiers in FEH does fit the philosophy of Nintendo / IS running the game. As mentioned, the game can be treated as part of the their experiment of adopting Japanese styled mobile online into western consumption patterns. They want to attract more consistent light spenders (mid-top players) rather than letting the game being dominated by a small group of heavy spenders.

Note the dynamics in the system: when we say 7% in the system that is for the population at the moment, but the proportion of players that wanders between 19-20 could be a lot more than that. In terms of feather rewards it's linear with tiers except for the top tier with a huge jump (2000 -> 3000), so if we want to draw a spectrum the reward for those high-end players are majored by their time spending in tier 20, and for the rest their average tier would be a good enough approximation.

The actual spectrum relies on the strength of the players that cannot be determined, so here is my approximated spectrum. Square bracketed number indicates the tier where player usually sits in (otherwise we assume they spend about equal amount of time among those tiers):

- Tier 20 Avg. 3000 (2%)
- Tier 19~20 Avg. 2500 (4%)
--------------------------------Top 7% // Tier 20
- Tier 18~[19]~20 Avg. 2200 (4%)
- Tier [18]~19~20 Avg. 2000 (5%)
- Tier 17~[18]~19 Avg. 1800 (5%)
--------------------------------Top 21% // Tier 19+
- Tier [17]~18 Avg. 1720 (5%)
--------------------------------Top 44% // Tier 18+

Even without drawing the spectrum explicitly you would expect the spike to occur among players who topped 19 but not quite enough to stabilize in 20. That includes 8~12% of all players and they are exactly the mid-top players that the developing team is aiming for -- if they spend some money (and effort) onto the game they might be able to push a bit further and receive a significantly increased award.

And, for me...I am sitting around the upper quartile line, I would expect myself to wander between 17~18 steadily. Of course, 18 gives an orb more so I should push a bit harder, too...

Tuesday, 2 May 2017

Two game mechanics (2)

Here are two more observations that was made long time ago but recently came into my mind in some other form again.

Question from a Monopoly-like board game

If you have played Monopoly before you must have met situations where you really want to land on a certain grid for whatever reason (to grab a set of lands, to build houses etc) right? In that case the only thing you can do it to ride you luck and hope that you diced the right number.

Of course, however, in online games these can be easily negotiated. Item comes into play and give certainty on what number you can get from the dice, with some cost as well. You want to use those item wisely, so here is our model:

- A circular board of 22 grids.
- A fair square dice is used each round by default. Items maybe used to specify the dicing outcome.
- 4 bonus grids spreads uniformly over the 21 grids (except the starting grid). One must land on that grid exactly to receive bonus.
- 6 rounds in total. Note that it is theoretically possible to get all 4 bonuses regardless of the bonus distribution.
Goal: we want to land on all 4 bonus grids every time, while minimizing the usage of items.


You would expect that 3~5 items are used each time: if the distance from treasure is less than 6 you have no choice but to use an item to make sure that you reach the treasure. Sometimes you have to stretch faraway enough to reach those grids.

But what about the average usage of each of those numbers 1/2/3/4/5/6? Are they the same?

Well, simple simulation shows that the distribution is approximately geometric. But it turns out that my average usage on all 6 items are almost the same, which is an interesting fact to investigate at. Below is my thoughts:

First of all, it's natural to use a lot of 1/2 according to our distribution. At the same time if we uses lots of 1/2 then we might need to use more 5/6 as the rest of the grids are more sparsely spread.  What about 3/4? This is in fact the most mysterious part in my point of view but a possible reason is that the most probable distance that requires multiple rounds is of course the 7-9 range, and there is a high chance that you will need to use 3/4 to correct your position.

(For instance if the distance is 8 then there is a 4/9 chance that you will be using 3/4 once. This can be done by simply listing all possible outcomes. (x) is the correction step:

6 - (2)
5 - (3)
4 - (4)
3 - (5)
2 - 6
2 - 5 - (1)
2 - 4 - (2)
2 - 3 - (3)
2 - 2 - (4)
2 - 1 - (5)
1 - 6 - (1)
1 - 5 - (2)
1 - 4 - (3)
1 - 3 - (4)
1 - 2 - (5)
1 - 1 - (6)

Therefore the chance is 2/6 + 4/36 = 4/9.)

But given the geometric/exponential nature 7-9 won't happen that often after all. It is still very hard to explain my uniform usage of those items.

Of course, this is not even a problem for the developers -- this is something that only the players should worry about. Imagine that the board game comes from an extremely popular online game where 24/7 grinding + unlimited potion is required to get a rank up high, and the actual usage is uneven ("the alternative hypothesis"), knowing the correct distribution would save you several minutes from going back to the shop, hence giving you an edge over other players ---

Luckily the game I mentioned, is not competitive at all.

Exponential effort resulting in linear growth

Systems requiring exponential effort for linear growth is a canonical choice. It appears in most RPG (as well as idle games), based on the fact that exponential growth overwhelms any polynomial growth from whatever percentage bonus. The implementation is usually simple too. EXP bar that grows exponentially, item prices that grow exponentially, time requirements that grow exponentially...

But are there more implicit implementation of this trick? Some may suggest an item forging system so that when you forge A into B, A gains a fraction of the power of B -- you can still see the exponential nature behind: you need $2^N$ items to boost the item $N$ times (proportionally, and if we ignore the higher terms).

But recently there is a game that allows unlimited forging on the same item: on the Nth forge, 1/(N+r)k fraction of the power is merged into the item, where r and k are constants.

The developer is using harmonic series smartly here, with the fact that harmonic series is asymptotic to the log function. Let us do the mathematics here:

Suppose we have $2^N-r$ identical items of power 1. By forging everything into the same item, the new power is given by:

$1 + \sum _{i=r}^{2^N}\frac{1}{ik} \approx 1 + k^{-1}(N\ln 2 - \ln r)$

And if we have $2^N$ items and we forge it in the usual `exponential way' we get

$(1+\frac{1}{rk})^N  \leq 1 + \frac{5}{4}\frac{N}{rk}$

we use the constant 5/4 as for a generous upper bound.

Exponential effort is clearly necessary for linear growth. It prevents players from forging items using the usual `exponential way' as well. This is clear by checking the following equation

$N \ln 2 - \ln r - \frac{5}{4}\frac{N}{r} \geq 0$

to be feasible for most reasonable $r, N$, like $(N,r) = (5,3)$.

Thursday, 27 April 2017

夢.十夜 (1) The beginning




其實穿過這條橋也就數秒的事。在兩層防火門之間我好好檢查一下這次的的裝備;水手服、有!過膝襪、有!水和毛巾、有!這可是去練舞的必要裝備,無論缺那一樣都會讓我渾身不舒服從而令表現變差。今天就先打兩道DEA(Dance Evolution Arcade)然後練十刀DDR(Dance Dance Revolution),以1100大卡為底限吧。我這樣想著推開了防火門,眼前的景象從破舊的唐樓變成了荒廢的商場:兩尺見方的白方瓷磚大概是唯一比較淨的東西;乾透的醬汁一點點地散落在牆邊的桌子上,幾張膠椅在旁邊東倒西歪;垃圾筒早已超過它所能承載的容量,本來可以旅轉良蓋子現在反面朝天,露出裡面的快餐紙袋,還有顯然是我前天來時留下的空壽司盒。完全空置的三樓從扶手電梯那邊傳來野戰的聲音;有人或許會問到底是軍事宅對這個免租的樓層加以利用,還是一對對小情侶在享受價比千金的happy moment--管它呢,那種地方我死也不會去。

一陣違和感從商場的另一邊傳了過來,明明是死寂的地方卻傳來了不該有的電子聲音。我把貼滿遊戲海報的玻璃門推開,模糊聲音立刻變得清晰可辨:前排是四個一組的街霸、拳王和鐵拳三代格鬥遊戲;中間放了傳統俄羅斯方塊(Classic tetris)、Pang、魂斗羅等中古經典小遊戲;後面貼牆的部分則是秋名山司機三五成群飆車的指定地點。裡面的違和感與其說是各種在發聲的機台倒不如說是機廳人滿為患,拳王等熱門遊戲不消說已經聚集了一群好武之人整裝待發,小眾遊戲如泡泡龍都有兩三人圍著討論機台和GBA版幀數算法不同引致爆彈用法上的分別--這不可能啊!這種平時只有我一個認真玩遊戲其他人都過來做偷偷摸摸的事的地方就算貼出即將結業的公告也沒人來吧!況且在一旁煙癮還沒發作的老闆在一邊老神在在地和小孩玩耍,兌銀機也還活得好好的,根本不像是快要結業的樣子。


Tuesday, 11 April 2017


The 10-point rating system

According to the announcement, Pixiv removed the 10 point rating system and instead put a "Like" button up there. The reason is that "95% of the evaluation function are currently evaluated at 10 points. Also, some problems rose due to the negative usage of the evaluation function".

Well the reason is not very surprising especially to those Osu! players. The average rating rises with time due to multiple reasons (the actual improvement in quality, fan-based community, points became popularity contests etc) and it's occasionally abused like spammed by 1-pointers (this is less common in pixiv because we don't have a in-built critic circle there, but for Osu! this is really obvious).

Two questions arose: should we modify the 10-point rating system to avoid those problems? Is the "Like" button serves as a better indicator than the rating system?

One important observation is that there's almost zero qualification required for someone to vote in both system. You just need to be a member (and played once, for Osu!) then you can rate the map/picture. That makes the source of voters very suspicious and very vulnerable against manipulation. Whether those manipulated accounts are alts or "followers" from the same community are not important -- it's out of the control of the system itself. The system can do nothing but to serve as what the sources wanted. In Pixiv, people spam 10-points for drawings they like/appreciate and that becomes a popularity contest, so why not? A "Like" system is better as for a popularity contest.

As for Osu! the in-build communication platform allows us to manually adhere some metric on the rating system - one may provide a guideline on giving rating and perhaps some suggested examples. Assuming that players (or at least the officials) reached an agreement on the ratings and players are willing to rate according to the guidelines, it is possible to introduce weighting on how valuable a vote is from a player. Players are still free to rate by their free will but votes that are overwhemingly random will receive a relatively lower weight. Ratings may also be scaled by approximating players' voting curve and make it close to the supposed guideline.

It is not possible to eliminate popularity contest because (1) first of all popularity-ish rating would still be the dominating voters after all (2) the minimal weight can't really be too low because at the end of the still this is "players' rating" not "players' rating on quality" - popularity remains as a non-negligible factor, but what we did is to reduce the power of pure haters/lovers and that gives a more representative overall rating.

A last note: although "my favourite" function exists in both Pixiv and Osu!, I would still prefer the "Like" button for Pixiv and the rating system to Osu! because Osu! system provide possibility of improving the rating system and we really have so many metric that has high correlation to pure popularity - instantaneous and long term play count etc that we don't really need another useless button to show that explicitly.

3D Touhou

Blender these days are powerful to simulate these nasty bullet hell screens and this is one of my favourite. But my question comes from the perspective of the characters themselves.

It's extremely interesting to see how the authors blend a 2-dimensional spell card into a 3-dimensional space so that the bullets (at least apparently) fill the space. But what if we really want to fill the space and wipe those characters off the screen? What kind of spellcards should we use?

- For spherical bombs you would like to pack the space so that no escape route exists. That's essentially the sphere packing problem...that clearly gets harder at higher dimensions.

- If you want to shoot radial danmaku that floods the character without allowing it to move towards you, the thing you will need is to increase the bullet density on the manifold as the tangent plane of the character per Hausdorff measure in the space (?!?) -- in simple terms, it grows in the volume of (n-1)-sphere for Euclidean spaces, which is not looking good either.

- Laser type weapons. Using spherical coordinates it is also clear that aiming with the correct angles in all those angle-based coordinates has exponential difficulty as well.

The best weapon might be Sakuya's ability of freezing time because time as an extra dimension is independent of the space dimension so it works equally well despite the change in space...but well I am not a resident of Gensokyo so I'd better leave the problem to them...

Tuesday, 4 April 2017

Two game mechanics

Great game follows from small details and smart mechanics.

As always, game mechanics are great source of giving interesting mathematical questions. Here are another two short examples on games that I've been following.

Fire Emblem Heroes

As a hardcore Nintendo fans this is probably a must, especially when the game is now full of GBA-era characters replenished. Without much money and effort I managed to score 4200~4400 per week in the arena, but this is not what I want to talk today. It is the summoning mechanism that caught my eye --- to be honest the summoning mechanism is quite special as a Japanese game because that can be treated as an attempt to adopt western consumption behavior on gaming, rather than the eastern elitism style, but such qualitative topic does not fit this entry as well.

Let's talk about simple probability. This is the (simplified version of) FEH's summoning mechanism:

- You spend 20 orbs to summon 5 heroes/cards (a complete summoning).
- By default, there will be a 6% chance of getting a 5-star (5*) hero.
- If you get no 5* heroes after a complete summoning, the chance for 5* is raised by 0.5%.
- The chance restores to 6% if a 5* hero is summoned.
- The chance only change after a complete summoning.
- Assume everything else to be independent.

Now the interesting special rule: if you get no 5* in 24 complete summonings, you will automatically get 5 5* heroes in the 25th summoning (i.e. the chance become 100% rather than 18%). The question is, why 24? A simple calculation reveals the truth:

Chance of getting 5 5*s under default chance = 0.06^5 = 0.0000007776 = 7.77*10^-7
Chance of getting 5 5*s via the special way = product (i=0..23) (1-(6+i/2)/100)^5 = 2.79*10^-7

That says, both ways getting 5 5*s in a single summoning process are of equal magnitude in terms of probability! It is quite clear that the chance varies exponentially if we change 24 to something else, so that is quite a slick design that gives mathematician a smile on his face.

A round robin league

I am recently sticking to another Japanese baseball android game, in which has an event where each team is assigned into a group of 5 every day. At the end of the day the rank is calculated and points are given to the team accordingly. At the end of the event (10 days, i.e. 10 rounds) the overall team rank is decided by the total points.

That reminds me of the guild battles from Fantasica -- the old good days where a team of 9 players around the world commit in 35 real time battles, each lasting 1 hr in 7 days that takes numerous hours of preparation work and probably thousands of cash -- that has a very similar system. Each round you fight with another guild and the total victory count determines your rank. The common feature between the two is that, your next opponent depends on your current standing and will not be someone that you have fought before.

Depending on your goals, it has been practically shown that in Fantasica there is a range of standing (typically the mid-high range) that can be achieved by lying dead in the first few battles despite random-ish weak opponents, because you can meet fewer top teams (hence less guaranteed defeat) by doing so.

The core principle in guild battle events -- rise fast, sink slow. You quick edge towards the top by defeating consecutive weak opponents then get crushed by top opponents, but your rank drop slowly because everyone of the same tier is taking defeats at the same time as well.

The question here is, does it work for such system where you are assigned into groups of 5 instead of 2? It is foreseeable that if you always group all top teams together you will be running out of top teams very quickly. Another question is if we alter the matching algorithm will it be cheat-free? At the end of the day, we want to distinguish those heavy spenders (top 5-10), light spenders (top tier) and heavy free players (mid-top) while minimal players are not too important to game revenue. With 35 turns, Fanta somehow (but not quite) managed to put mid-top players to where they should have been, but the sinking phase is still a bit too short.

Here the dev solved this problem by matching 5 teams, each with some distance on the rank but not too far away, ranging from top teams to mid table teams. Each round can be deemed as battling with 4 other teams at the same time: finishing second in the day implies you won against the 3 lower teams and lost against the top team. By such the converging can be done even quicker than the Fanta system. It's also cheat-free in the sense that you are battling with teams of the same tier every round that you don't have much space to lose.

But that's only my prediction -- no one knows how the system exactly works and I doubt if this is systematically studied in this game given its competitiveness, but I look forward very much to those post-event statistics.


3 April, 2017

Thursday, 9 March 2017



6/3/2007 - 6/3/2017








新絕代雙嬌Online (2005-2009)
Ogame (2008-2009)
Osu! (2008-)
Fantasica (2012-2015)
Quiz.「黑貓」.RPG (2013-2017)
地城戰棋 (2015-)


(EDIT: 無生還啊無生還,讓我們一勝也不行?)


我真的沒想過這裡可以堅持十年(另一邊廂xanga倒下了又以另一形式復活過來……透過我朋友之手),但是希望接下來十年我都可以透過這裡和大家再會 :)

Forretrio / Chris
9th Mar, 2017

Tuesday, 21 February 2017

DDR, the 3rd year

3 years since I start played Dance Dance Revolution (DDR). A short summary on my progress over the last year. Well to be honest I only played 3 months out of 12 last year, since they replaced the ITG machine by the stupid PIU machine.

ITG: Here I started to train those 'crazy foots' - I got 86% with 2 misses on MAX300 ("the gate towards the inner DDR world") that has not been replicated in DDR. Below is my best record:

But those custom maps opened a whole new world to me. There aren't lots of BPM 120~140 1/4 equivalent streams in DDR (BPM 240~280 is too fast and 120~140 is quite slow in general) except for some old maps (you don't expect highly electric songs with pace falling in that range) like Paranoia Survivor, but you can find loads of them in ITG. One of my favourite is Hatsura Yuki's ~Confession~, but sadly I failed to find the corresponding difficulty (SP challenge) in Stepmania :( These songs provide excellent training and eventually allow me to play MAX300 fluently. ITG also include diffs with high number of notes while retaining a relatively low density, and that is a nice training for stamina. (Maps like kokoro contains up to 750 notes which is around 17~18 while the real difficulty is around 14+ or 15-).

In 2 months I managed to go through consecutive Lv. 11 (old extended scale) maps - difficulty of these maps varies greatly but they gave me a good foundation on getting through those real DDR songs.

DDR: I spent 1.5 weeks out of 4 weeks to familiarize DDR again, wasting time on easier maps like 12-13-14 or 11-13-15 on a single credit. These are not my limit so I does not gain a lot except limited accuracy due to repeated gaming. But then I decided to start training myself to adapt higher speed - both real speed and apparent speed ("SV"). Plan 8, NEPHILIM DELTA and 放課後ストライド are three excellent songs (14)  for BPM 220+ range -- with consecutive long streams and huge number of notes you eventually pick up the stamina you need for higher difficulty. Another focus before you can confidently step into Lv.15 is the ability to switch between footing 1/2 and 1/4. Here ちくわパフェだよ☆CKP and POSSESSION are two great trainers in 14.

(Well, I had a lucky 1 miss play last year, but that couldn't be consistent...)

Last year I was able to play a few 15 but I will get exhausted after any single attempt, but now I can step into 15 and confidently play most of the songs - except for weird SV changes that requires extra reciting. Pluto series is always hard to do in that sense -- Pluto relinquish (14) and Pluto the First (14) are still hard for me (my record is still B).

14 to 15 is hard because 15 marks the beginning of the inner DDR world, but 15 to 16 is not as hard as that. Before I started to attempt some easier 16s, one of first two 16 passes was from one that I thought to be quite hard among the 16 songs - VANESSA:

The 1/3 stream is extremely nasty, but once you get used with long stream at that speed it becomes more like a routine. Though I haven't tried it for the second time I am quite confident that I can easily get better result.

I got some other high 15s and mid 16s as well...but passing those technical maps are more satisfying --- Spanish Snow Dance (15) that is supposed to be mid 16, and 灼熱Beach Side Bunny (15) with lots of exhausting jumps.

Talking about jumps that is still my weakest link and hardest bit to improve. I passed 隅田川夏恋歌 (16) (another one out of two first 16s that I passed) but I got the "kiai" part by hammering double arrow every note instead the supposedly every other note. The fact that I can't switch between single and double foot fluently hinder my performance on maps heavily seasoned with such features: 轟け!恋のビーンボール!! (a B+ pass) and 嘆きの樹:

Improving accuracy on double jumps takes a damn lot of practices, so I turned into those harder maps that I can achieve relatively easier -- 恋する☆宇宙戦争っ!! (17) and ドーパミン (17) -- in Taiwan I have fresh machine that allows an almost 10% accuracy boost on songs in the 12-14 range, so I made use of the chance to try those hardcore maps, and turned out with some successes:

In order to get through this diff I played two BPM200 songs before trying this in the final stage...and the plan worked out properly. I passed on the first time without the 4 miss extra stage limitation. Same goes for Dopamine :3

So that's my third year on DDR. Perhaps I can get a light taste of 18 next year?

Statistics, 2016:
18 days in DDR, 129 credits
Ability to pass maps: 14 ~ 15- → 15+ ~ 17-
Ability to AA maps: 11 ~ 13- → 14 ~ 15- (under the new grading scale)
Lv. 15: 23Pass / 2AA
LV. 16: 11Pass
Lv. 17: 2 Pass

Tuesday, 31 January 2017

After Dark 4.0 in Windows 7/10


Rodger Dodger and Rock Paper Scissor are two main reasons that I keep bringing this antique back to the modern world. Every single time when I adopt a new OS the first mission would be fitting my Chinese input method into the system, and the second mission is to introduce AD4.0 into the machine.

Obviously this is hard because of a few reasons:

1) This is super old. Probably one of the oldest software that people still liked to use in 2017.
2) This is partially for 16-bit system and has limited support for 32-bit system, but machine these days are mainly 64-bit (my Chinese input software failed because of the same reason).
3) The developer decided to integrate the setting page in some very weird position which is then removed in the subsequent Windows version, particularly during the introduction of the Metro UI in 8/10 (and that applies to my Chinese input software...)
4) The installation is flawed - some registry change are missed.
5) This is not the usual kind of screensaver (and again, super old), so you can hardly find support on the Internet except for some people asking the same question every single version of the Windows OS: does AD4.0 fit into Windows xxx?

Anyway I made this entry as to share my way of getting it worked in Windows 7 and 10. Somehow I gave up on doing this on Windows 8 (I only used that computer for a very short time), but the 10-method should work for 8 as well.

Windows 7:

This forum post gave a complete guide on fixing this. It worked for me and should work for every one.

In Windows 7 you have no access to the AD setting page (which was in the monitor page) and you will see "unable to select module..." as the screensaver name. These are minor things (settings can be change directly in the registry and no one cares about the name) but you can fix it following the instructions here.

Windows 10:

(Updated 2/2/17)

EDIT: Somehow I need to perform a recovery on the system hence giving me a second chance to install AD4. Here is a simple solution to get it solved:

- Install AD4 as usual.
- Bring "After Dark.scr" into C:\Windows\System32
- Settings can be done via the registry package from this YouTube video.

Now everything should work the same as what you get in Windows7. The same problem remains -- the 'unable to select module' name and limited access to the settings. Since more registry entries are missed you really have to rely on the package from that video.

But for those AD lovers, I hope the above manual helps you to retrieve what your beloved screensaver that you first met 20 years ago :D

Tuesday, 3 January 2017

書評 // 時光當舖 01:思念物的歸處


時光當舖 01:思念物的歸處
著/ 千川
繪/ Ooi Choon Liang









要我來評分的話這本小說絕對可以得到合格以上的分數,也大概足夠讓我拿起續作繼續看下去。很多有趣的巧妙設定,但是我一開始所期待的東西一樣也沒有中:時光當舖以另一種出乎意料的方式被解讀;圍繞當舖的舖陳也幾乎沒有(某靈出場時我還以為我在看科幻小說而不是輕微靈異的小說)。在缺少一堆核心設定的情況下第一本可以過關,但是這終究是續作中繞不開的難題。雖然這是一個不折不扣的缺點,在我的期待下反而變成了我看下一部的誘因……所以希望各位讀者看過這篇書評後能對這本小說產生一個比較合理的期待,然後找個下午茶的時間沖一壼Mariage Frères的Marco Polo或者Harvey & Sons的Paris(恕我品茶知識實在有限,找不出層次和小說相配的茶品……但是用這兩種茶來描述我閱讀時的情緒的話已經足夠貼切了),好好享受作者把故事妮妮道來吧!