|
http://tenhou.net/ranking.html
Second white box from the top it says
2011/12/06 | 牌譜 | 4535戦 独歩 2011/02/18 | 牌譜 | 2770戦 (≧▽≦) 2011/02/04 | 牌譜 | 4898戦 ASAPIN There you can download their replays (probably all the games from creating the account to the time when they reached Tenhou rank). Actually I don't know what format these files have yet, but the filenames can be used to get the replay links which you can then use to download the actual replays.
|
On December 21 2013 02:07 spinesheath wrote: Computing the fastest way to reach tenpai still is rough. You have to keep in mind that the effort for each extra turn you look ahead increases by about a factor of 30. That's massive.
My idea is that we can reduce the fanout and the depth by only considering draws that improve the hand. The goal hands that are too far away do not need to be considered. It's not a trivial extension of shanten computing but at least it is within the realm of possibility.
On December 21 2013 03:01 spinesheath wrote: There you can download their replays (probably all the games from creating the account to the time when they reached Tenhou rank). Actually I don't know what format these files have yet, but the filenames can be used to get the replay links which you can then use to download the actual replays. They are gzip files. The content is the replay in the usual format.
|
Russian Federation13 Posts
Second white box from the top it says Thanks, I seen this files before, but forget where. It's need to watch some of them...
Actually I don't know what format these files have yet, It's a usual gzip. C# decode is simply: + Show Spoiler +FileStream File = new FileStream(Filename, FileMode.Open, FileAccess.Read); GZipStream Stream = new GZipStream(File, CompressionMode.Decompress); XmlReader Reader = XmlReader.Create(Stream);
|
On December 21 2013 05:25 Benawii wrote:Show nested quote +On December 21 2013 02:07 spinesheath wrote: Computing the fastest way to reach tenpai still is rough. You have to keep in mind that the effort for each extra turn you look ahead increases by about a factor of 30. That's massive.
My idea is that we can reduce the fanout and the depth by only considering draws that improve the hand. The goal hands that are too far away do not need to be considered. It's not a trivial extension of shanten computing but at least it is within the realm of possibility. Show nested quote +On December 21 2013 03:01 spinesheath wrote: There you can download their replays (probably all the games from creating the account to the time when they reached Tenhou rank). Actually I don't know what format these files have yet, but the filenames can be used to get the replay links which you can then use to download the actual replays. They are gzip files. The content is the replay in the usual format. You should at least look 1-2 turns ahead each turn and take the most promising lines, then calculate everything again from that point (ideally caching some results). I don't think you should be so greedy to ignore all discards that don't improve the hand right now. I would guess that there is some decent information available online on basic strategies like that in the chess area.
Good to know about the gzip.
On December 20 2013 13:40 Rhaegar99 wrote:![[image loading]](http://i.imgur.com/WddPSxr.png) He was 3shanten at start of the round and made it to 1shanten in 3 tiles. Noone saw it coming. Luckily south took the bullet and dealt into it  I'm jealous. He even had 2 dora!
|
Russian Federation13 Posts
spinesheath You are right, in Osamuko facebook group people found rule: "A player is not considered tenpai if he is waiting only for a tile of which he already has 4" In Chapter 3.4.2 Exhaustive draw in Rules for japanese mahjong.
|
Good, so I didn't go through all this work of creating a recursive algorithm that respects this rule (and because of it's slow speed the DFA based algorithm) for nothing. Thanks for finding it!
Now, you might be able to fix your algorithm with a single exception, but I would carefully check that it really covers all cases.
To elaborate why I'm worried about this quickfix: It probably works when a hand seems to be tenpai but actually is 1 shanten. But what if your algorithm says it's 1 shanten? If you draw and discard your next tile, will the hand be tenpai or will it turn out to be one of these exceptional cases? Your algorithm doesn't keep track of how many tiles of a certain type a hand will need to draw before it can reach tenpai. What if it's more than 1 shanten?
Here's an example:
1245m 119p called: 333m 6666m
Your algorithm probably says it's 1 shanten: draw a 3m to complete 123m and wait on the 36m to complete 45m. Your quickfix won't apply because you don't know yet that you need to draw two 3m. Sure, you might be able to work this special case in too, but unless you can prove that it covers all the corner cases you're just gambling on the correctness of your algorithm.
And it's not like these hands are particularly unlikely to appear: Calling for monocolored hands isn't all that rare.
That's why my recursive algorithm keeps track of the tiles that would be necessary to complete the shape it is looking at. It also considers things like (45 waiting on 3) a different shape as (45 waiting on 6). This is certain to give the correct result, but really slow.
On December 21 2013 02:51 teplofizik wrote:I know about logs from this page: http://tenhou.net/sc/raw/ (radiobutton "鳳凰卓"), archives contain actual links to phoenix lobby (unreal upper dan lobby) replays for everyday, as example scc2013121200.html.gz (I cannot use direct links, they are dies fast). Page has js interface in json format for automatic downloading (see on page's bottom "ログの自動ダウンロードについて"). Maybe, somewhere (arcturus.su) exists full archives for all time. You can use it for statistics =) Would you be able to write a small program that checks every 10 minutes or so if there are new replays available and then downloads them to some folder? That would be a nice way to stock up on replays from all kinds of high ranked players. Replaypacks by single players like ASAPIN are a bit sketchy for statistics...
|
Russian Federation13 Posts
Your algorithm probably says it's 1 shanten: draw a 3m to complete 123m and wait on the 36m to complete 45m. Your quickfix won't apply because you don't know yet that you need to draw two 3m. Sure, you might be able to work this special case in too, but unless you can prove that it covers all the corner cases you're just gambling on the correctness of your algorithm. It's true, I'd think about i. Fix for tempai is more significant, about other shantens... I can wait and think. Maybe exists a not complicated way to handle this. Are you want to write article about shanten counting algorithms? This problem poorly described in internet.
Would you be able to write a small program that checks every 10 minutes or so if there are new replays available and then downloads them to some folder? That would be a nice way to stock up on replays from all kinds of high ranked players. Replaypacks by single players like ASAPIN are a bit sketchy for statistics... Hm, maybe. But new archives appears not frequently than a one per hour =) I think, such program is not difficult. If there are not much work, I'd try to do it.
|
On December 23 2013 02:48 teplofizik wrote:Show nested quote +Your algorithm probably says it's 1 shanten: draw a 3m to complete 123m and wait on the 36m to complete 45m. Your quickfix won't apply because you don't know yet that you need to draw two 3m. Sure, you might be able to work this special case in too, but unless you can prove that it covers all the corner cases you're just gambling on the correctness of your algorithm. It's true, I'd think about i. Fix for tempai is more significant, about other shantens... I can wait and think. Maybe exists a not complicated way to handle this. Are you want to write article about shanten counting algorithms? This problem poorly described in internet. Show nested quote +Would you be able to write a small program that checks every 10 minutes or so if there are new replays available and then downloads them to some folder? That would be a nice way to stock up on replays from all kinds of high ranked players. Replaypacks by single players like ASAPIN are a bit sketchy for statistics... Hm, maybe. But new archives appears not frequently than a one per hour =) I think, such program is not difficult. If there are not much work, I'd try to do it. If you know how to download the files (or maybe even have the code for it already), it shouldn't take much more than a loop and Thread.Sleep(). I just don't really know a thing about the download interface on tenhou.net, while you seem to know it well enough.
I've been thinking about writing about shanten counting before, I put a lot of effort into developing my algorithms after all. I'm just lazy... Knowing that someone is interested is a big help though. Maybe I'll find enough motivation this or next week, I should have enough time at least.
By the way, any specific topics you would be interested in? If I just write down what comes to my mind I will probably forget half the interesting topics.
|
Russian Federation13 Posts
while you seem to know it well enough. Yeap, it's easy and can be detected by browser's cache =) It's only one difficult: converting replay hash from encoded form to decoded (encoded was in browser flash client, decoded in windows) to build replay url.
And another little difficulty to parse replay pack - 7z archiver. There is need to study 7zip SDK or use tenhou unpacker...
By the way, any specific topics you would be interested in? Mahjong algorithms =) Shanten, yaku calculating, cost calculating (there are need to test all variants of fu/han counting), AI algorithms and such.
It seems there are new lobby in tenhou: (archives which starts with "sce"), replay sample http://tenhou.net/0/?log=2013121600gm-0841-0000-076460cd I don't know what it mean (unknown ranks, gold?), but replay file format get some new additions.
|
On December 24 2013 20:29 teplofizik wrote:Yeap, it's easy and can be detected by browser's cache =) It's only one difficult: converting replay hash from encoded form to decoded (encoded was in browser flash client, decoded in windows) to build replay url. Mahjong algorithms =) Shanten, yaku calculating, cost calculating (there are need to test all variants of fu/han counting), AI algorithms and such. It seems there are new lobby in tenhou: (archives which starts with "sce"), replay sample http://tenhou.net/0/?log=2013121600gm-0841-0000-076460cdI don't know what it mean (unknown ranks, gold?), but replay file format get some new additions. Check out this class: http://sourceforge.net/p/tenview/code/HEAD/tree/tenview-code/trunk/Model/Modify/ReplayInfoGenerator.cs Specifically I think you're looking for the method GenerateDownloadUrl in there. For usage, see the method FromWatchUrl in the same file. Got the algorithm by decompiling the tenhou online client (actionscript). Feel free to use it.
I will only cover Shanten related stuff for now, yaku and such I would rather do in a seperate article. It's relatively straightforward anyways. As you said, you have to check all possible variations. But if you already verified that the hand is -1 shanten/a winning hand, the number of variations isn't all that huge.
It's probably Jansou Mode. Afaik it's basically a different way of playing for money in mahjong parlors. "Gold" is the currency.
|
Russian Federation13 Posts
ot the algorithm by decompiling the tenhou online client (actionscript). I already use this decompiled algorithm =) I decompile it in summer from tenhou client too. There no another way to download replay from any correct link to replay... But thanks anyway) Also, wall can be decoded too.
It's relatively straightforward anyways I know =) But maybe there are number of tricks or interesting ways to detect some yaku.
It's probably Jansou Mode Yep, but early I had seen no replays with it in archives... Maybe there was a results, but without links.
|
On December 24 2013 22:02 teplofizik wrote: Also, wall can be decoded too. Do you have the wall shuffling algorithm? If yes, please share. Obviously the seed says what type of encryption it is, but so far I didn't bother with trying to find out how it is implemented in detail. It would not be necessary for the online client anyways, so I didn't go lookin for it in the decompiled client.
|
Anyone want to get together for a game? I'm in #tltenhou
|
Russian Federation13 Posts
Do you have the wall shuffling algorithm? Yep, this algorithm I found somewhere in tenhou blog (without detail): 1. Decode base64 and get a seed array; 2. Use it as seed value for mt19937 random generator; 3. Generate 288 uint32 random values (mt); 4. Hash it with sha512; 5. Generate wall tiles (136 values) and fill they by indexes. 6. Swap all tiles with another, which has calculated from sha512 hash index. 7. Use it.
Tiles 0-13 is a dead hand(5,7,9,11 are dora pointers, 4,6,8,10 are ura pointers), 134-135 - dice, dealer get 130-133 tiles, shimocha get 126-130 as IRL and etc - hands can be checked by INIT tag;
Random generator initialized one time per game. For another wall generate next 288 values. I think, online client has no information about wall, only replay file =) Else it's cheating><
Files: Mersenne twister random generator; WallGenerator.cs.
Also, old algorithm (2009 year and so) descripted on arcturus.su site.
|
On December 25 2013 16:10 teplofizik wrote:Yep, this algorithm I found somewhere in tenhou blog (without detail): 1. Decode base64 and get a seed array; 2. Use it as seed value for mt19937 random generator; 3. Generate 288 uint32 random values (mt); 4. Hash it with sha512; 5. Generate wall tiles (136 values) and fill they by indexes. 6. Swap all tiles with another, which has calculated from sha512 hash index. 7. Use it. Tiles 0-13 is a dead hand(5,7,9,11 are dora pointers, 4,6,8,10 are ura pointers), 134-135 - dice, dealer get 130-133 tiles, shimocha get 126-130 as IRL and etc - hands can be checked by INIT tag; Random generator initialized one time per game. For another wall generate next 288 values. I think, online client has no information about wall, only replay file =) Else it's cheating>< Files: Mersenne twister random generator; WallGenerator.cs. Also, old algorithm (2009 year and so) descripted on arcturus.su site. Thanks. May I use that in my code (provided I also respect the license for the mersenne twister)?
Obviously you won't have wall information while playing a match. But the online replay viewer has the seed (since it has the same replay files as we have) so it could theoretically construct the wall. But since you can't display the tiles in the wall in the online replay viewer, I expect that there is no code for that in the online client.
|
Russian Federation13 Posts
May I use that in my code Of course=)
I expect that there is no code for that in the online client Oh, I misunderstand about online client and online replay viewer><
Maybe, - paid windows client should have advantages =D
|
![[image loading]](http://i.imgur.com/caxyYVC.png)
I think its the fourth time breaking the 1900 point barrier and this time I finally made it to 6dan! It took only a year and a half playing 1100 or so games. During this time I've never dropped to 4dan, though I do remember hitting ~100 points at multiple occasions.
![[image loading]](http://i.imgur.com/63PDVwO.png)
|
Congratulations!
Now share your wisdom, please
|
Congratulations!
|
There's a few changes that I've made in my play that seems to help me a lot. I'll list some that I think are important with some examples maybe.
Hold on to single rounds winds, own winds, and dragons during the early game
Not exactly too sure what they are called, but the ones that give you yakus if you have three of them. A lot of the times you want to hold on to them until someone else has played them. This lets you hold onto the opportunity to make a yakuhai hand if you draw a pair, giving you value for any hand you have no matter how crap they are. It also helps prevent other players to make their yakuhai hands and deter them from making open sets with end tiles. Another benefit is that it helps you defend easier against early riichis.
The times were you would discard the winds and dragons early are when you have a good starting hand, if you already have a pair in your hand, or you have too many of them. An exception to this is if one of them is a dora; never throw these out unless someone else has, or you are at least 1shanten.
+ Show Spoiler +
This hand is a good example where you would hold onto your wind a dragons. You want to hold onto your dora 1s pair so you wont play tanyao and your hand is not very connected. In this hand you would discard the 9m first and may even think about discarding the non red 5s next.
+ Show Spoiler +
This hand we can start discarding east and the white dragon. Although we have 3 pairs here, we have the opportunity of tanyao if you draw or south discards a 4m. The hand can also easily transition into a pinfu hand. You can also see that the other three players also favours this style of play, especially south. He realises that it is very hard from him to win this game unless he draws another south wind or red dragon. If I was playing his hand however, I would instead start discarding the 1p and 9p so that I can work my way towards a pinfu or tanyao in case I do not pick up any of those tiles.
I'll write up more when I have the time
|
|
|
|