• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 04:40
CEST 10:40
KST 17:40
  • Home
  • Forum
  • Calendar
  • Streams
  • Liquipedia
  • Features
  • Store
  • EPT
  • TL+
  • StarCraft 2
  • Brood War
  • Smash
  • Heroes
  • Counter-Strike
  • Overwatch
  • Liquibet
  • Fantasy StarCraft
  • TLPD
  • StarCraft 2
  • Brood War
  • Blogs
Forum Sidebar
Events/Features
News
Featured News
uThermal's 2v2 Tour: $15,000 Main Event5Serral wins EWC 202543Tournament Spotlight: FEL Cracow 202510Power Rank - Esports World Cup 202580RSL Season 1 - Final Week9
Community News
SC2's Safe House 2 - October 18 & 193Weekly Cups (Jul 28-Aug 3): herO doubles up6LiuLi Cup - August 2025 Tournaments5[BSL 2025] H2 - Team Wars, Weeklies & SB Ladder10EWC 2025 - Replay Pack4
StarCraft 2
General
Rogue Talks: "Koreans could dominate again" uThermal's 2v2 Tour: $15,000 Main Event The GOAT ranking of GOAT rankings RSL Revival patreon money discussion thread Official Ladder Map Pool Update (April 28, 2025)
Tourneys
SC2's Safe House 2 - October 18 & 19 LiuLi Cup - August 2025 Tournaments $5,100+ SEL Season 2 Championship (SC: Evo) WardiTV Mondays RSL Season 2 Qualifier Links and Dates
Strategy
Custom Maps
External Content
Mutation # 485 Death from Below Mutation # 484 Magnetic Pull Mutation #239 Bad Weather Mutation # 483 Kill Bot Wars
Brood War
General
ASL Season 20 Ro24 Groups Player “Jedi” cheat on CSL BGH Auto Balance -> http://bghmmr.eu/ StarCraft player reflex TE scores BW General Discussion
Tourneys
KCM 2025 Season 3 Small VOD Thread 2.0 [Megathread] Daily Proleagues [ASL20] Online Qualifiers Day 2
Strategy
Fighting Spirit mining rates [G] Mineral Boosting Simple Questions, Simple Answers Muta micro map competition
Other Games
General Games
Stormgate/Frost Giant Megathread Nintendo Switch Thread Total Annihilation Server - TAForever Beyond All Reason [MMORPG] Tree of Savior (Successor of Ragnarok)
Dota 2
Official 'what is Dota anymore' discussion
League of Legends
Heroes of the Storm
Simple Questions, Simple Answers Heroes of the Storm 2.0
Hearthstone
Heroes of StarCraft mini-set
TL Mafia
TL Mafia Community Thread Vanilla Mini Mafia
Community
General
US Politics Mega-thread Russo-Ukrainian War Thread Things Aren’t Peaceful in Palestine The Games Industry And ATVI European Politico-economics QA Mega-thread
Fan Clubs
INnoVation Fan Club SKT1 Classic Fan Club!
Media & Entertainment
Anime Discussion Thread [\m/] Heavy Metal Thread [Manga] One Piece Movie Discussion! Korean Music Discussion
Sports
2024 - 2025 Football Thread Formula 1 Discussion TeamLiquid Health and Fitness Initiative For 2023
World Cup 2022
Tech Support
Gtx660 graphics card replacement Installation of Windows 10 suck at "just a moment" Computer Build, Upgrade & Buying Resource Thread
TL Community
TeamLiquid Team Shirt On Sale The Automated Ban List
Blogs
Gaming After Dark: Poor Slee…
TrAiDoS
[Girl blog} My fema…
artosisisthebest
Sharpening the Filtration…
frozenclaw
ASL S20 English Commentary…
namkraft
momentary artworks from des…
tankgirl
from making sc maps to makin…
Husyelt
Customize Sidebar...

Website Feedback

Closed Threads



Active: 563 users

[Mahjong]Tenhou Thread - Page 15

Forum Index > General Games
Post a Reply
Prev 1 13 14 15 16 17 49 Next All
spinesheath
Profile Blog Joined June 2009
Germany8679 Posts
Last Edited: 2012-08-23 07:34:22
August 20 2012 06:40 GMT
#281
I'm not gonna double post just to show off some random hand.

Anyways, I appreciate the comments. I've pretty much just started playing, and I'm already through all the English strategy resources I can find via google. If I don't have to figure everything out by myself that'll be quite helpful.

I didn't really call the Kan to increase my points, the idea was to provide me with that extra tile. I suppose that one tile is indeed not worth the risk though.


By the way, I've been wondering what happens (on Tenhou) if someone declares Riichi and 2 people win at once a bit later (the Riichi goes through). Do they split the 1000 points from Riichi? Or does the stick remain on the table? Surely the player who called Riichi wouldn't have to pay another 1000...


I'm pretty mad at this guy... Not only did he have safe tiles against south and going betaori should be obvious, he also drew one of my winning tiles that very same turn...
+ Show Spoiler +
[image loading]
There goes my double Yakuman...
If you have a good reason to disagree with the above, please tell me. Thank you.
Rhaegar99
Profile Blog Joined September 2008
Australia1190 Posts
August 22 2012 07:09 GMT
#282
Ah im not too sure how to word this properly. IIRC the person who is first in line of the winds at the beginning of the game gets the 1000 points. Priority goes East -> South -> West -> North. For example, if we are in east wind seat 3, and south and west wins off east, then west takes the 1000 points because back in east wind seat 1, he was east, whereas south was north. This is the same method they use to calculate the final position if there are tied points at the end of the game.
spinesheath
Profile Blog Joined June 2009
Germany8679 Posts
Last Edited: 2012-09-12 20:13:55
September 07 2012 08:21 GMT
#283
Question first:
When some opponent discards a tile, I can see it coming from somewhere in his hand. I am assuming that it comes from the right position in case of a Tsumokiri, and from a random other position in all other cases. So you can tell whether the tile was thrown from the hand or if it was discarded immediately. Is that correct?
After all there's quite the difference between a 9 discarded in round 7 being a Tsumokiri and the same tile thrown from inside the hand...

+ Show Spoiler [stuff about replays] +
Next, about replay files:
I'm cosidering writing a small program that automatically goes through a list of replay links and collects the replay data into a file. Does anyone know how I would go about this? My programming skills in general should easily be sufficient, but I've never done stuff like that so I don't know how to start. Does anyone have information about Tenhou bots (the ones that play as if they were humans)?

So apparently you get sent replay files and not just single actions when you watch a replay. For example:
http://ff.mjv.jp/0/log/?2012090918gm-0089-0000-484a55b6
This should be one of my replays. It has a seed for tile shuffling and then some stuff that seems to be player actions. I have yet to analyze the file in detail; whether it is just 1 hand or a full hanchan and so on. E: Actually it's quite certainly the full hanchan in one file.
And then I have to figure out how to access these files effectively. I found it through packet capture using wireshark, but obviously I would want to automate the process based on the list of replay links I can access from the tenhou client (which is supposed to be stored on my computer anyways).


Call for help. The above replay file belongs to this replay:
http://tenhou.net/0/?log=2012090918gm-0089-0000-x8a20abea0f04&tw=0
Most of the replay file is straightforward, but for now I'm stuck at the Pon/Chi/Kan descriptions. Maybe someone can figure it out (I'll keep looking into it of course).

Some info about the file format:
The file is split into XML-like parts, it always looks like this:
<STUFF/>

The first element is the game version, the second (huge) element a seed for the tile shuffling, but that isn't needed unless you want to show the unused parts of the wall.
Next is some introductory stuff, player names and rankings etc.
The names are in the form %UNICODE, dan="10" means first dan, less means kyu ranks.
+ Show Spoiler [example] +
<GO type="137" lobby="0"/>

<UN
n0="%73%70%69%6E%65%73"
n1="%6D%69%78%61%33%33%33"
n2="%3B%47%75%65%73%74%3B"
n3="%E5%85%AD%E6%AD%8C%E4%BB%99"
dan="11,10,12,12"
rate="1681.37,1554.69,1705.88,1817.24"
sx="M,M,M,F"
/>

<TAIKYOKU oya="0"/>

The INIT element lines out the starting hands for all players. Each number stands for a tile, according to this table:
+ Show Spoiler [tile numbers] +
0,1,2,3: 1m tiles
...
16: red 5m
17, 18, 19: other 5m
...
32,33,34,35: 9m tiles

36 - 71: pinzu
72 - 107 souzu

108, 109, 110, 111: Ton
...
120, 121, 122, 123: Pei

124 - 135: Haku, Hatsu, Chun

+ Show Spoiler [example] +
<INIT
seed="0,0,0,3,3,93"
ten="250,250,250,250"
oya="0"
hai0="50,2,109,73,41,96,95,88,92,112,46,3,11"
hai1="58,72,115,86,108,4,90,124,65,5,47,101,83"
hai2="121,125,44,39,20,110,32,63,135,130,111,7,84"
hai3="15,132,1,13,81,85,16,28,66,120,33,122,23"
/>

Next is a block of elements each describing an action a player makes.
T## means player 0 draws tile ##, D## means player 0 discards tile ##
U and E for player 1, V and F for player 2, W and G for player 3.
+ Show Spoiler [example] +
<T54/><D112/>
<U17/><E101/>
<V82/><F32/>
<W71/><G132/>

N stands for Naki (I think), which means "Call" I guess. The "who" attribute is the index of the player who called the last discard. Then comes a mysterious "m" attribute, which is (as far as I can tell) a 5 digit number. That number has to be responsible for multiple things: Specify the type of call (Chi, Pon, Closed Kan, Open Kan, Added Kan) and specify the tiles used for the call. For Chi it certainly needs some info, and when you add in Aka Dora, it also gets messy for Pon.
+ Show Spoiler [example] +
<N who="2" m="41482"/>

Riichi is split into two elements, one preceding the discard and one with the new score after the discard went through.
+ Show Spoiler [example] +
<REACH who="0" step="1"/><D95/>
<REACH who="0" ten="240,250,250,250" step="2"/>

The AGARI element wraps up the game. Not sure what the "ba" attribute is for, and the "yaku" attribute might take some work too.
+ Show Spoiler [example] +

<AGARI
ba="0,1"
hai="2,3,38,41,46,50,54,56,88,92,94,96,99,100"
machi="56"
ten="20,18000,2"
yaku="1,1,0,1,7,1,52,2,54,1,53,0"
doraHai="93"
doraHaiUra="76"
who="0"
fromWho="0"
sc="240,190,250,-60,250,-60,250,-60"
/>

After that, another INIT element starts the next hand.


Man this is becoming one hell of a long post...
Here is a table of some calls and the according "m" attributes. It already is clear that 2 melds will only have the same m (possibly m for meld) value if they use exactly the same tile IDs. Don't know yet if the discarded tile has any influence though, technically it shouldn't be necessary to store information about that tile in m. All Chi end in 111 binary so far, all Pon end in 0XY. Apart from that, I'm still clueless... As far as I can tell, the available bits aren't sufficient to store the IDs of 2 tiles even if packed tightly (ID1 + ID2*136), that is assuming that at least 3 bits are used for deciding the type of call.
Of course you don't really need the actual IDs of these tiles, if you have the type of the call and the ID of the discarded tile, you can already narrow the number of possible combinations down by a lot.
+ Show Spoiler [calls] +
Call 	Meld	TileIDs		m	m (binary)
Chi 3;1,2m 11; 3, 4 2463 0000 1001 1001 1111
Pon 1;1,1p 37; 38, 39 13834 0011 0110 0100 1001
Pon 1;1,1p 36; 37, 39 13897 0011 0110 0100 1001
Chi 8;7,9m 28; 27, 33 19615 0100 1100 1001 1111
Chi 9;7,8m 32; 25, 31 20583 0101 0000 0110 0111
Chi 4;5,6p 51; 55, 58 31103 0111 1001 0111 1111
Pon 9;9,9s 104;105,106 40042 1001 1100 0110 1010
Pon E;E,E 109;110,111 41482 1010 0010 0000 1010
Pon E;E,E 110;109,111 41993 1010 0100 0000 1001
Pon S;S,S 114;112,115 43563 1010 1010 0010 1011
Pon W;W,W 119;117,118 45578 1011 0010 0000 1010
Pon N;N,N 121;120,122 46699 1011 0110 0110 1011
Pon P;P,P 124;125,126 47722 1011 1010 0110 1010
Pon P;P,P 127;124,125 48713 1011 1110 0100 1001
Pon F;F,F 129;130,131 49163 1100 0000 0000 1011


I especially have no idea why the format isn't just a comma seperated list of tile IDs that make up the meld...



So I got my hands on the tenhou flash application and decompiled it. In there are functions that handle both the generation of the replay link and the deciphering of the m attribute. It's not pretty, and I have no idea why it is so complex. It's also completely uncommented of course. But it's something to work with and I think I can translate it into useable code. Looking good.
If you have a good reason to disagree with the above, please tell me. Thank you.
spinesheath
Profile Blog Joined June 2009
Germany8679 Posts
Last Edited: 2012-09-21 14:52:30
September 13 2012 12:22 GMT
#284
Time for a real update.

I hacked up a small, crude and mostly untested program that takes a text file as an input and then downloads all the replay files (actually called "logs" on Tenhou) that are mentioned in that file.

Use at your own risk. Though I can't see how it would do any harm unless someone on Tenhou detects you downloading many replays at once and decides to ban you or something.

EDIT: Made some important changes, will upload a new version when I have more to offer.
+ Show Spoiler [old version] +
http://www.mediafire.com/?jhjper8znzz8jrs


The program is in written in C#. It's the first C# program I wrote that other people might use, so who knows if everything works right away. You probably can break it in many ways, I haven't put a lot of effort into working around unexpected user input. Just tell me when something goes wrong or could be better.

For the input file, copy the replay link list from your Tenhou account, it looks like this:
+ Show Spoiler +
[2012/08/20/上南喰赤] A:もとちゃん(+78.0) B:ふひひ(-6.0) C:上海一九四三(-45.0) D:spines(-27.0)
http.//tenhou.net/0/?log=2012082017gm-0089-0000-xe707fc80e65e&tw=3
[2012/08/20/上南喰赤] A:(´へωへ`*)(+10.0) B:spines(+56.0) C:いかさましです(-49.0) D:ムンバイ(-17.0)
http.//tenhou.net/0/?log=2012082018gm-0089-0000-xe51ca673079c&tw=1

(for some reason TL seems to mess up the code tag if there is an url inside... so I replaced : with . after the http lol)

Then choose an output directory and hit "Grab logs".
The program will name the files according to the link where they were downloaded from, and when trying to grab logs it will check if any of the logs you have in your input file already exist in your output folder. So keep the files there and don't rename them if you want to avoid downloading files unnecessarily.


Now about the replay file format: as I said before it's mostly obvious, but the Call part is weird. Here's the Action Script Tenhou probably uses to resolve that. I couldn't verify it yet, but I'm positive it's the right thing.
+ Show Spoiler [this is long!] +
var __reg1 = (_global.com.cegg.game.mahjong.Mentsu136 = function(m)
{
this.kui = m & 3;
if(m & 1 << 2)
{
var __reg3 = (m & 64512) >> 10;
var __reg4 = __reg3 % 3;
__reg3 = int(__reg3 / 3);
__reg3 = int(__reg3 / 7) * 9 + __reg3 % 7;
__reg3 = __reg3 * 4;
var __reg5 = [__reg3 + 4 * 0 + ((m & 24) >> 3), __reg3 + 4 * 1 + ((m & 96) >> 5),
__reg3 + 4 * 2 + ((m & 384) >> 7)];
if((__reg0 = __reg4) === 1)
{
__reg5.unshift(int(__reg5.splice(1, 1)[0]));
}
else if(__reg0 === 2)
{
__reg5.unshift(int(__reg5.splice(2, 1)[0]));
}
this.type = 3;
this.hai0 = __reg5[0];
this.hai1 = __reg5[1];
this.hai2 = __reg5[2];
return;
}
if(m & 1 << 3)
{
var __reg6 = (m & 96) >> 5;
var __reg7 = (m & 65042) >> 9;
var __reg8 = __reg7 % 3;
__reg7 = int(__reg7 / 3);
__reg7 = __reg7 * 4;
var __reg9 = [__reg7, __reg7, __reg7];
if((__reg0 = __reg6) === 0)
{
__reg9[0] = __reg9[0] + 1;
__reg9[0] = __reg9[0] + 2;
__reg9[0] = __reg9[0] + 3;
}
else if(__reg0 === 1)
{
__reg9[0] = __reg9[0] + 0;
__reg9[0] = __reg9[0] + 2;
__reg9[0] = __reg9[0] + 3;
}
else if(__reg0 === 2)
{
__reg9[0] = __reg9[0] + 0;
__reg9[0] = __reg9[0] + 1;
__reg9[0] = __reg9[0] + 3;
}
else if(__reg0 === 3)
{
__reg9[0] = __reg9[0] + 0;
__reg9[0] = __reg9[0] + 1;
__reg9[0] = __reg9[0] + 2;
}
if((__reg0 = __reg8) === 1)
{
__reg9.unshift(int(__reg9.splice(1,1)[0]));
}
else if(__reg0 === 2)
{
__reg9.unshift(int(__reg9.splice(2,1)[0]));
}
if(this.kui < 3)
{
__reg9.unshift(int(__reg9.splice(2,1)[0]));
}
if(this.kui < 2)
{
__reg9.unshift(int(__reg9.splice(2,1)[0]));
}
this.type = 1;
this.hai0 = __reg9[0];
this.hai1 = __reg9[1];
this.hai2 = __reg9[2];
}
if(m & 1 << 4)
{
var __reg10 = (m & 96) >> 5;
var __reg11 = (m & 65024) >> 9;
var __reg12 = __reg11 % 3;
__reg11 = int(__reg11 / 3);
__reg11 = __reg11 * 4;
var __reg13 = [__reg11, __reg11, __reg11];
if((__reg0 = __reg10) === 0)
{
__reg13[0] = __reg13[0] + 1;
__reg13[1] = __reg13[1] + 2;
__reg13[2] = __reg13[2] + 3;
}
else if(__reg0 === 1)
{
__reg13[0] = __reg13[0] + 0;
__reg13[1] = __reg13[1] + 2;
__reg13[2] = __reg13[2] + 3;
}
else if(__reg0 === 2)
{
__reg13[0] = __reg13[0] + 0;
__reg13[1] = __reg13[1] + 1;
__reg13[2] = __reg13[2] + 3;
}
else if(__reg0 === 3)
{
__reg13[0] = __reg13[0] + 0;
__reg13[1] = __reg13[1] + 1;
__reg13[2] = __reg13[2] + 2;
}
if((__reg0 = __reg12) === 1)
{
__reg13.unshift(int(__reg13.splice(1,1)[0]));
}
else if(__reg0 === 2)
{
__reg13.unshift(int(__reg13.splice(2,1)[0]));
}
this.type = 5;
this.hai0 = __reg11 + reg10;
this.hai1 = __reg13[0];
this.hai2 = __reg13[1];
this.hai3 = __reg13[2];
return;
}
if(m & 1 << 5)
{
this.type = 10;
this.hai0 = (m & 65280) >> 8;
return;
}
this.hai0 = (m & 65280) >> 8;
var __reg14 = int(this.hai0 / 4) * 4;
var __reg15 = [__reg14, __reg14, __reg14];
if((__reg0 = this.hai0 % 4) === 0)
{
__reg15[0] = __reg15[0] + 1;
__reg15[1] = __reg15[1] + 2;
__reg15[2] = __reg15[2] + 3;
}
else if(__reg0 === 1)
{
__reg15[0] = __reg15[0] + 0;
__reg15[1] = __reg15[1] + 2;
__reg15[2] = __reg15[2] + 3;
}
else if(__reg0 === 2)
{
__reg15[0] = __reg15[0] + 0;
__reg15[1] = __reg15[1] + 1;
__reg15[2] = __reg15[2] + 3;
}
else if(__reg0 === 3)
{
__reg15[0] = __reg15[0] + 0;
__reg15[1] = __reg15[1] + 1;
__reg15[2] = __reg15[2] + 2;
}
this.type = this.kui ? 2 : 4;
this.hai1 = __reg15[0];
this.hai2 = __reg15[1];
this.hai3 = __reg15[2];
}
).prototype;


__reg0.getNakiType = function(m)
{
if(m & 1 << 2)
{
return 3;
}
else if(m & 1 << 3)
{
return 1;
}
else if(m & 1 << 4)
{
return 5;
}
else if(m & 1 << 5)
{
return 10;
}
else if(m & 3)
{
return 2;
}
return 4;
}
;


__reg0.isKan = function(m)
{
if((__reg0 = com.cegg.game.mahjong.getNakiType(m)) === 2)
{
return true;
}
else if(__reg0 === 4)
{
return true;
}
else if(__reg0 === 5)
{
return true;
}
return false;
}
;



Next is to write a program that parses these replays and extracts some statistics from them... Suggestions? :p



Also, lately I've been having this bug of sorts on Tenhou where I 100% click on a another tile, and it also highlights green properly before I click it, but it still discards the tile I just drew. Any ideas what could cause that? Causes a ton of problems.
If you have a good reason to disagree with the above, please tell me. Thank you.
Nann1654
Profile Joined September 2012
United States3 Posts
September 15 2012 01:09 GMT
#285
I thought I understood when I could pick up a discarded tile and when I could not. When I am playing Janryumon - the only discarded tile that I can seem to pick up is the player to the left. There are other times that I can pick up the discarded tile from the player across from me and to the left only. I have re-read the instructions and searched hi and low.... Can someone please tell me what I am missing? I think it has to do with East, North, West and South positions... I feel that I might be able to win with more intelligence. Sincerely
Shymon
Profile Blog Joined February 2005
United States620 Posts
September 15 2012 03:24 GMT
#286
On September 15 2012 10:09 Nann1654 wrote:
I thought I understood when I could pick up a discarded tile and when I could not. When I am playing Janryumon - the only discarded tile that I can seem to pick up is the player to the left. There are other times that I can pick up the discarded tile from the player across from me and to the left only. I have re-read the instructions and searched hi and low.... Can someone please tell me what I am missing? I think it has to do with East, North, West and South positions... I feel that I might be able to win with more intelligence. Sincerely



you can call a chi from only the player on your left (a chi being a run in a suit 5-6-7 man for example). you can call a pon or a kan off any discard though (3 or 4 of a kind). You may also call ron off any discard provide you have the required winning conditions (at least 1 yaku, not in furiten, etc). hope that explains it for you :D.
Nann1654
Profile Joined September 2012
United States3 Posts
September 15 2012 03:39 GMT
#287
Thank you - you've help a lot !
spinesheath
Profile Blog Joined June 2009
Germany8679 Posts
Last Edited: 2012-09-19 19:54:42
September 19 2012 14:01 GMT
#288
Oorasu, shimocha leads with ~47000 points. He deals into a double Ron for 12000 and 8000. We enter west round.
+ Show Spoiler [first hand] +
[image loading]

+ Show Spoiler [conclusion] +
Next hand ends with Kamicha dealing into Shimocha's hand for 5200 or so...


Anyways, what's up with all the insane hands my enemies seem to get lately? They throw around Hanemans like crazy, while I often couldn't even reach Tenpai more than once a Hanchan even if I knew my draws before the game... Well at least that's what it feels like. I'm still playing in the same room, lower Dan, but these last few days have simply been ridiculous.


Oh yeah, when I look at my list of recent replays in the client, I only get 40 replays. Is threre a list of links with all the replays or are older links always deleted? Where is the list on my PC anyways?
If you have a good reason to disagree with the above, please tell me. Thank you.
Rhaegar99
Profile Blog Joined September 2008
Australia1190 Posts
Last Edited: 2012-09-21 13:46:33
September 21 2012 13:42 GMT
#289
Sup guys. I took a long break from mahjong again lol. I hit 1900 points on 5dan and lost about 1000 points over 40 games or so. Not too sure if I played bad or hit a bad run but that crushed my soul.

On September 07 2012 17:21 spinesheath wrote:
When some opponent discards a tile, I can see it coming from somewhere in his hand. I am assuming that it comes from the right position in case of a Tsumokiri, and from a random other position in all other cases. So you can tell whether the tile was thrown from the hand or if it was discarded immediately. Is that correct?


Thats correct, though I really don't suggest paying too much attention to this for now (even I have a lot of trouble with this). The only time that I do is when someone riichis and another player is also going for the win (when he discards a tile from his hand, then all the tiles thrown after the riichi stage is no longer 100% safe, though still very quite safe).


Also if your looking do pull some stats of games http://arcturus.su/tenhou/ranking/http://arcturus.su/tenhou/ranking/ maybe a bit useful. Its only got your placement and Rpoints you gain so theres really not much you can do with it.

The best method you can really do is probably to save all the replay urls after each game. This way you can still access it after the 40 replay limit.
spinesheath
Profile Blog Joined June 2009
Germany8679 Posts
September 21 2012 14:50 GMT
#290
On September 21 2012 22:42 Rhaegar99 wrote:
Sup guys. I took a long break from mahjong again lol. I hit 1900 points on 5dan and lost about 1000 points over 40 games or so. Not too sure if I played bad or hit a bad run but that crushed my soul.

Same here, ever since I hit 3dan, I've felt completely out of control in almost every single game. I'm down 300-400 points already. When I'm done with debugging my replay parser I'm going to implement a Shanten and uke-ire calculation algorithm (anyone can help me out here? Doesn't seem all that trivial at first glance, though I probably could just bruteforce it...). And then I'm gonna see if my hands actually ARE that awful or if I'm just suddenly way worse than two weeks ago...
If you have a good reason to disagree with the above, please tell me. Thank you.
Hesmyrr
Profile Blog Joined May 2010
Canada5776 Posts
September 22 2012 01:04 GMT
#291
Me three. Was 3dan but begin to make disastrous streak that brought me down to 1 dan, and ragequit by erasing the document where I wrote down the ID. So if I feel like playing again I'll once again have to start from the scratch.
"If watching the MSL finals makes you a progamer, then anyone in Korea can do it." - Ha Tae Ki
Rhaegar99
Profile Blog Joined September 2008
Australia1190 Posts
September 24 2012 16:19 GMT
#292
On September 13 2012 21:22 spinesheath wrote:
Also, lately I've been having this bug of sorts on Tenhou where I 100% click on a another tile, and it also highlights green properly before I click it, but it still discards the tile I just drew. Any ideas what could cause that? Causes a ton of problems.


Just played a few games and I got this shit happening randomly. Fuck its so annoying. Makes me so mad.
spinesheath
Profile Blog Joined June 2009
Germany8679 Posts
September 24 2012 16:38 GMT
#293
On September 25 2012 01:19 Rhaegar99 wrote:
Show nested quote +
On September 13 2012 21:22 spinesheath wrote:
Also, lately I've been having this bug of sorts on Tenhou where I 100% click on a another tile, and it also highlights green properly before I click it, but it still discards the tile I just drew. Any ideas what could cause that? Causes a ton of problems.


Just played a few games and I got this shit happening randomly. Fuck its so annoying. Makes me so mad.

And it always happens at the worst times too.
Well, you only notice it when you draw a good tile (or the Ippatsu tile of one of your enemies lol), which is the worst time... Discard a red 5 that connects to your other tiles? Hell yeah I always do that shit.

I think I also had it happen once when I tried to make a call. It's been happening a bit less frequently lately, but still not gone (at its peak I had it happen about once per hand). And I already made sure my Flash is up to date. I am entirely clueless what this is about.


In other news: Making decent progress with an offline replay viewer. Mostly for practicing WPF programming, but it also helps me with verifying that my replay parser is correct.

Does anyone here play 3s? I could use a couple of replays so that I can ensure compatability of the parser with 3s. If you do and want to provide me with some of your replays, just PM me your replay links copypasted from the Tenhou client.
+ Show Spoiler [what the links should look like] +
[2012/08/20/上南喰赤] A:もとちゃん(+78.0) B:ふひひ(-6.0) C:上海一九四三(-45.0) D:spines(-27.0)
http.//tenhou.net/0/?log=2012082017gm-0089-0000-xe707fc80e65e&tw=3
[2012/08/20/上南喰赤] A:(´へωへ`*)(+10.0) B:spines(+56.0) C:いかさましです(-49.0) D:ムンバイ(-17.0)
http.//tenhou.net/0/?log=2012082018gm-0089-0000-xe51ca673079c&tw=1
If you have a good reason to disagree with the above, please tell me. Thank you.
Wineandbread
Profile Joined September 2009
United States2065 Posts
September 24 2012 16:41 GMT
#294
For anyone with issues with the glitch discards, I am mostly sure the problem is your browser if you're running FF15

I had the same issue on mine, but no problems using Chrome. My friend also had a similar issue and fixed it by switchong browsers as well. I will try tenhou on the ff16 beta later and see if that fixes anything

Does your rank/level decay over time on tenhou? i haven't played in a while and I misplaced my ID somewhere derp
spinesheath
Profile Blog Joined June 2009
Germany8679 Posts
Last Edited: 2012-10-07 15:36:44
September 24 2012 21:57 GMT
#295
I did it! Two days of work. Grinding through horrible documentation, trying all kinds of stuff, and luckily learning a bunch of stuff as well.

I managed to display a Chakan in my replay viewer:
+ Show Spoiler +
[image loading]

Notice the 1111m Chakan in the bottom right. Beautiful, isn't it? Btw tile images taken from http://www.martinpersson.org (and slightly modified), really nice ones.

So why am I making such a fuss about this? Because that's the XAML code I had to write for it:
+ Show Spoiler +
<UserControl x:Class="TenhouReplayAnalyzer.TileRowDisplay"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:my="clr-namespace:TenhouReplayAnalyzer"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300">
<UserControl.Resources>
<my:InverseConverter x:Key="inverseConverter"/>
</UserControl.Resources>
<Grid>
<ItemsControl
ItemsSource="{Binding}"
BorderThickness="0">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Horizontal"
IsItemsHost="True"
ClipToBounds="False">
</StackPanel>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<Canvas>
<Canvas.Style>
<Style TargetType="{x:Type Canvas}">
<Style.Triggers>
<DataTrigger Binding="{Binding Path=ChakanTile}" Value="true">
<Setter Property="Width" Value="0"/>
</DataTrigger>
<DataTrigger Binding="{Binding Path=ChakanTile}" Value="false">
<Setter Property="Width" Value="{Binding ActualWidth, ElementName=imageGrid}"/>
</DataTrigger>
</Style.Triggers>
</Style>
</Canvas.Style>
<Grid
Name="imageGrid"
Canvas.Bottom="0"
Canvas.Left="0">
<Image
VerticalAlignment="Bottom"
RenderOptions.BitmapScalingMode="HighQuality"
Source="{Binding Path=Image}"
Height="{Binding ActualHeight, RelativeSource={RelativeSource AncestorType=ItemsControl}}">
<Image.Style>
<Style TargetType="{x:Type Image}">
<Style.Triggers>
<DataTrigger Binding="{Binding Path=Flipped}" Value="true">
<Setter Property="LayoutTransform">
<Setter.Value>
<RotateTransform Angle="270.0"/>
</Setter.Value>
</Setter>
</DataTrigger>
<DataTrigger
Binding="{Binding Path=ChakanTile}"
Value="true">
<Setter Property="RenderTransform">
<Setter.Value>
<TranslateTransform
X="0.0"
Y="{Binding ActualWidth,
RelativeSource={RelativeSource AncestorType=Image},
Converter={StaticResource inverseConverter}}"/>
</Setter.Value>
</Setter>
</DataTrigger>
</Style.Triggers>
</Style>
</Image.Style>
</Image>
</Grid>
</Canvas>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</Grid>
</UserControl>

Almost all of that is purely there to add that single tile on top of the previously flipped one...

The rest should be easy. No more crazy layout brainfucks. Just a couple simple buttons and some good old normal code.
If you have a good reason to disagree with the above, please tell me. Thank you.
JSH
Profile Blog Joined July 2009
United States4109 Posts
September 24 2012 23:18 GMT
#296
On September 25 2012 01:41 Wineandbread wrote:
For anyone with issues with the glitch discards, I am mostly sure the problem is your browser if you're running FF15

I had the same issue on mine, but no problems using Chrome. My friend also had a similar issue and fixed it by switchong browsers as well. I will try tenhou on the ff16 beta later and see if that fixes anything

Does your rank/level decay over time on tenhou? i haven't played in a while and I misplaced my ID somewhere derp

It shouldn't decay
I know like after 6 months of inactivity it resets the data so anyone can take the ID

Just got double dama ronned, after 5 discards ;_;
so sad...
"It's called a miracle because it doesn't happen" - Just like my chances of reaching C- on ICCUP
spinesheath
Profile Blog Joined June 2009
Germany8679 Posts
Last Edited: 2012-10-07 15:36:59
September 28 2012 15:23 GMT
#297
Time for an alpha release imo.

+ Show Spoiler +
[image loading]


Zip with LogGrabber and ReplayAnalyzer (updated version):
http://www.mediafire.com/?7a3zcdpq3qp1inx
(again, use at your own risk)

The input format for LogGrabber remains the same:
+ Show Spoiler [format] +
[2012/08/20/上南喰赤] A:もとちゃん(+78.0) B:ふひひ(-6.0) C:上海一九四三(-45.0) D:spines(-27.0)
http.//tenhou.net/0/?log=2012082017gm-0089-0000-xe707fc80e65e&tw=3
[2012/08/20/上南喰赤] A:(´へωへ`*)(+10.0) B:spines(+56.0) C:いかさましです(-49.0) D:ムンバイ(-17.0)
http.//tenhou.net/0/?log=2012082018gm-0089-0000-xe51ca673079c&tw=1

The date is actually required as it is read too. Also don't remove any linebreaks or add in extra ones, that's likely to cause issues.

Apart from that, it should be straightforward: Specify input file and output folder, and wait for the replays to be downloaded.


The Replay Analyzer doesn't do any analyzing yet, but it comes with a replay viewer. Load a bunch of replay files aquired with TenhouLogGrabber, select one from the list, and hit Watch Replay. The display is messed up before you resize the window, but if you just maximize it all should be fine.

A replay file is called a Match (Hanchan, Tonpuusen).
A Match consists of multiple Games (8 + Renchan for Hanchan).
Each Game is seperated into Frames. If a player draws a tile, it's a new frame, when he discards one it's a new frame and so on.

With this the controls should be self-explanatory.
If you hit alt, you can see the hotkeys that you can use for the buttons:
+ Show Spoiler [hotkeys] +
G next game
A prev game
F next frame (also right and bottom arrow keys)
R prev frame (also top and left arrow keys)
S selected frame

The checkboxes allow you to display the fancy information, see the spoiler below for details.

+ Show Spoiler [fancy] +

[image loading]
Red tint means the tile was tsumokiri'd.
Green in pond means that the tile has actually been called away from the pond.
Red/Green in pond is obviously the combination of the above two.
Green in the wall means that the tile normally wouldn't be visible.

Only the tiles that will become visible normally until the end of the game are shown as the rest is simply not known. The replay file specifies a seed for the randomizer used for building the wall, but I don't have the algorithm that goes with the seed.


+ Show Spoiler [BUGS off the top of my head] +
  • Will break on 3 man games.
  • Likely to have bugs related to double Ron.
  • This list is far from exhaustive.



Bug reports, ideas, suggestions and so on: Very much appreciated!

Tile icons are slightly modified versions of the ones found at:
http://www.martinpersson.org/wordpress/2010/10/free-mahjong-icons/

EDIT: I cleaned up a good amount of bugs and fixed the slowdown issue. New version link is up:
http://www.mediafire.com/?7a3zcdpq3qp1inx
No big changes, but damn, fixing the memory leak there helped a lot (memory leak in a managed language that wasn't really my fault... nobody told me about having to freeze image sources before displaying them). Fixed a lot of things connected to riichi, rinshan draws and win/draw frames.
If you have a good reason to disagree with the above, please tell me. Thank you.
spinesheath
Profile Blog Joined June 2009
Germany8679 Posts
Last Edited: 2012-10-08 21:36:05
October 07 2012 16:11 GMT
#298
New release. Now with:
  • Shanten counting
  • Uke-Ire
  • Yaku, Han, Fu calculation
  • Properly rendered replay window
  • Yaku etc. displayed in Romaji or Japanese
  • More keybindings


LogGrabber (same version as above):
http://www.mediafire.com/?iar0rtxogm63dmw

ReplayAnalyzer:
http://www.mediafire.com/?qxb76nc7c2roez7

+ Show Spoiler +
[image loading]


Uke-Ire is only displayed when you are not about to discard a tile. When you are about to discard, I want to calculate the uke-ire for each of the (reasonable) discards. I'll work on that next, and conceptually it's not hard, but it's going to be heavy on performance before I optimize the shanten calculation algorithm.
The uke-ire number is the total of single tiles that are still available, all visible tiles subtracted. The list of tile types (all 4 5pin are of the same type, for example) can contain tiles where none are left for you to draw.

Score calculation shows the Han, Fu before rounding as well as a list where the Fu comes from, and the base points for that Han and Fu (Just the Fu*2^(2+Han) formula, 2000 for Mangan and so on). Dealer gets a rounded 2 times that from all, other One/Two times that.

The Langage menu lets you select from any "language" specified in the xml file in the folder data. It's only a couple of terms like Yaku names and such. Currently I have rough drafts of Romaji and Japanese languages. If you find any spelling mistakes or know a better version for some term, let me know. That stuff isn't all that consistent on the internet after all.

For keybindings, hit alt and you'll see them.


Now where I need your help: I can't prove that my shanten counting algorithm is correct and it's pretty darn complex. If you spot any wrong results, let me know. Replay File, Game, Frame and Player is the information I would need to fix it.
Same goes for Yaku, Han and Fu calculation, of course. Here it should be enough if you just give me a list of the tiles in the hand, unless it involves special things like Ippatsu, Double Riichi, Rinshan Kaihou, Haitei Raoyue and so on.

Also: Does Tenhou allow the 8-wins in a row Yakuman?
If you have a good reason to disagree with the above, please tell me. Thank you.
JSH
Profile Blog Joined July 2009
United States4109 Posts
Last Edited: 2012-10-08 12:58:48
October 08 2012 12:58 GMT
#299
I don't think Tenhou has the 8 win Yakuman thing

anyways, thanks for working on these things

question:
[image loading]
Bail or push?

If I win I get 1st place
If I don't deal in, I get 2nd
If west wins, (and I don't deal in) I get 1st
If I deal in, I get 3rd or possibly, but unlikely 4th

I ended up bailing, and West dealt into East and I ended up 2nd

And Premium is pretty cool
"It's called a miracle because it doesn't happen" - Just like my chances of reaching C- on ICCUP
spinesheath
Profile Blog Joined June 2009
Germany8679 Posts
October 08 2012 14:45 GMT
#300
I wouldn't decide that before I see the next discard and your draw, you're Iishanten with a chance to go Damaten with a nice wait after all. You also only have one suji 7 and no other safe tiles if I see that correctly. Suji 7 isn't even all that safe to begin with.
If you have a good reason to disagree with the above, please tell me. Thank you.
Prev 1 13 14 15 16 17 49 Next All
Please log in or register to reply.
Live Events Refresh
Next event in 1h 20m
[ Submit Event ]
Live Streams
Refresh
StarCraft: Brood War
Barracks 843
firebathero 763
Larva 574
Killer 282
ggaemo 212
Leta 188
Dewaltoss 113
JulyZerg 74
BeSt 55
EffOrt 28
[ Show more ]
yabsab 16
IntoTheRainbow 13
Noble 5
Dota 2
XcaliburYe1024
XaKoH 521
Fuzer 160
League of Legends
JimRising 527
Counter-Strike
Stewie2K933
allub363
Super Smash Bros
Westballz40
Heroes of the Storm
Khaldor156
Other Games
summit1g10760
SortOf136
ArmadaUGS12
Organizations
Other Games
gamesdonequick861
BasetradeTV27
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 12 non-featured ]
StarCraft 2
• davetesta26
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
League of Legends
• HappyZerGling134
Upcoming Events
RSL Revival
1h 20m
SC Evo League
3h 20m
uThermal 2v2 Circuit
6h 20m
CSO Cup
7h 20m
Sparkling Tuna Cup
1d 1h
uThermal 2v2 Circuit
1d 6h
Wardi Open
2 days
RotterdaM Event
2 days
Replay Cast
2 days
WardiTV Summer Champion…
3 days
[ Show More ]
RSL Revival
3 days
PiGosaur Monday
3 days
WardiTV Summer Champion…
4 days
The PondCast
5 days
WardiTV Summer Champion…
5 days
Replay Cast
5 days
LiuLi Cup
6 days
Liquipedia Results

Completed

ASL Season 20: Qualifier #2
FEL Cracow 2025
CC Div. A S7

Ongoing

Copa Latinoamericana 4
Jiahua Invitational
BSL 20 Team Wars
KCM Race Survival 2025 Season 3
BSL 21 Qualifiers
uThermal 2v2 Main Event
HCC Europe
BLAST Bounty Fall Qual
IEM Cologne 2025
FISSURE Playground #1
BLAST.tv Austin Major 2025

Upcoming

ASL Season 20
CSLPRO Chat StarLAN 3
BSL Season 21
BSL 21 Team A
RSL Revival: Season 2
Maestros of the Game
SEL Season 2 Championship
WardiTV Summer 2025
Thunderpick World Champ.
MESA Nomadic Masters Fall
CS Asia Championships 2025
Roobet Cup 2025
ESL Pro League S22
StarSeries Fall 2025
FISSURE Playground #2
BLAST Open Fall 2025
BLAST Open Fall Qual
Esports World Cup 2025
BLAST Bounty Fall 2025
TLPD

1. ByuN
2. TY
3. Dark
4. Solar
5. Stats
6. Nerchio
7. sOs
8. soO
9. INnoVation
10. Elazer
1. Rain
2. Flash
3. EffOrt
4. Last
5. Bisu
6. Soulkey
7. Mini
8. Sharp
Sidebar Settings...

Advertising | Privacy Policy | Terms Of Use | Contact Us

Original banner artwork: Jim Warren
The contents of this webpage are copyright © 2025 TLnet. All Rights Reserved.