HOME WORLD FORUMS WIKI VIDEOS RECORDS
5936 members and stacking!
     Welcome guest, please login or sign up

Live Stream Calendar
2 Pages V < 1 2  
Reply to this topicStart new topic
> Automatic Fumen Export from Nullpomino
belzebub
post Apr 26 2012, 02:05 PM
Post #11


Tetris Apprentice
Group Icon
Posts: 178
Joined: 29-June 11



QUOTE(farter @ Apr 26 2012, 01:44 PM) *

ok here..

yes i see that your generated report contains 2 generated versions: "one frame per piece" in popup window, and "one frame per frame in game" version.

the data of the first is about 60 lines (counting number of "?"), which can be displayed properly.
and the full one .. URL too long and i don't want to count that....

and this one was copied piece by piece using my hands...%^$*^&*&#$........


only 6 "?"s...
Sticking Out Tongue.png


You are certainly right and the length is longer. First I want to say that this is no problem in offline mode, only at my server there is a query limit and that's why it doesn't show.

Then, there is a lot of functionality in the fumen tool, but the code is really complex and it's hard to reverse engineer the japanese code. I figured out a way to display the fumens, so that's enough for me. If i have time i might look into it further and try to find a more concise way, but i don't feel like it's really necessary at the moment, it's more a nice to have for me.
User is offlinePM
Go to the top of the page
+Quote Post
farter
post Apr 26 2012, 03:50 PM
Post #12


Tetris Apprentice
Group Icon
Posts: 106
Joined: 19-April 11



QUOTE(belzebub @ Apr 26 2012, 10:05 PM) *

You are certainly right and the length is longer. First I want to say that this is no problem in offline mode, only at my server there is a query limit and that's why it doesn't show.

Then, there is a lot of functionality in the fumen tool, but the code is really complex and it's hard to reverse engineer the japanese code. I figured out a way to display the fumens, so that's enough for me. If i have time i might look into it further and try to find a more concise way, but i don't feel like it's really necessary at the moment, it's more a nice to have for me.

ok.. i see..
i'm just guessing the encoding should be easy...
well never mind... Wink.png


--------------------
User is offlinePM
Go to the top of the page
+Quote Post
belzebub
post Apr 26 2012, 04:11 PM
Post #13


Tetris Apprentice
Group Icon
Posts: 178
Joined: 29-June 11



QUOTE(farter @ Apr 26 2012, 03:50 PM) *

ok.. i see..
i'm just guessing the encoding should be easy...
well never mind... Wink.png


ah okay, yeah it was some heavy stuff to go through :/ was so happy when the first fumens rolled out lol xD
User is offlinePM
Go to the top of the page
+Quote Post
benmullen
post Apr 26 2012, 06:46 PM
Post #14


Tetris Apprentice
Group Icon
Posts: 101
Joined: 11-June 10



Please make this for NES Tetris hahaha!
User is offlinePM
Go to the top of the page
+Quote Post
farter
post Apr 27 2012, 12:21 PM
Post #15


Tetris Apprentice
Group Icon
Posts: 106
Joined: 19-April 11



QUOTE(belzebub @ Apr 27 2012, 12:11 AM) *

ah okay, yeah it was some heavy stuff to go through :/ was so happy when the first fumens rolled out lol xD

i tried to read the code of fumen encoding...
seems not so hard? or problem about reading comments in Japanese?

CODE

function encode(focusset){ // ★ データ出力 // output data
  var tx=document.getElementById("tx");
  var out=document.getElementById("out");
  var url=document.getElementById("url");
  var submit=document.getElementById("submit");
  var view=document.getElementById("view");
  pushframe(frame);
  encc=0;
  fldrepaddr=-1;
  for(i=0;i<220;i++)encf[i]=0;
  for(e=0;encc<enclim&&e<=framemax;e++){
    // フィールド出力 // output field blocks
    for(j=0;j<220;j++)encf[j]=af[e*220+j]+8-encf[j];
    fc=0;
    for(j=0;j<219;j++){
      fc++;
      if(encf[j]!=encf[j+1]){
        tmp=encf[j]*220+(fc-1);
        enc[encc++]=tmp%64;tmp=Math.floor(tmp/64);
        enc[encc++]=tmp%64;tmp=Math.floor(tmp/64);
        fc=0;
      }
    }
    fc++;
    tmp=encf[j]*220+(fc-1);
    enc[encc++]=tmp%64;tmp=Math.floor(tmp/64);
    enc[encc++]=tmp%64;tmp=Math.floor(tmp/64);
    fc=0;
    if(enc[encc-2]+enc[encc-1]*64==1979){
      if(fldrepaddr<0){
        fldrepaddr=encc++;enc[fldrepaddr]=0;
      }else{
        if(enc[fldrepaddr]<63){enc[fldrepaddr]++;encc-=2;}else{fldrepaddr=encc++;enc[fldrepaddr]=0;}
      }
    }else{
      if(fldrepaddr>=0)fldrepaddr=-1;
    }
    // タイプ,角度,座標出力 // output piece type, rotation, position
    cmstrrep=(e>0)?ac[e-1]:'';
    refreshquiz(e,1,0);
    cmstrrep=escape(cmstrrep).substring(0,4095);
    tmpstr=escape(ac[e]).substring(0,4095);
    tmplen=tmpstr.length;
    if(tmplen>4095)tmplen=4095;
    tmp=ap[e*3+0]+ap[e*3+1]*8+ap[e*3+2]*32+au[e]*7040+am[e]*14080+(e==0)*ct*28160+(tmpstr!=cmstrrep)*56320+ad[e]*112640;
    enc[encc++]=tmp%64;tmp=Math.floor(tmp/64);
    enc[encc++]=tmp%64;tmp=Math.floor(tmp/64);
    enc[encc++]=tmp%64;tmp=Math.floor(tmp/64);
    // コメント出力 // output comments
    if(tmpstr!=cmstrrep){
      tmp=tmplen;
      enc[encc++]=tmp%64;tmp=Math.floor(tmp/64);
      enc[encc++]=tmp%64;tmp=Math.floor(tmp/64);
      for(i=0;i<tmplen;i+=4){
        tmp=(((ins=asctbl.indexOf(tmpstr.charAt(i+0)))>=0?ins:0)%96);
        tmp+=(((ins=asctbl.indexOf(tmpstr.charAt(i+1)))>=0?ins:0)%96)*96;
        tmp+=(((ins=asctbl.indexOf(tmpstr.charAt(i+2)))>=0?ins:0)%96)*9216;
        tmp+=(((ins=asctbl.indexOf(tmpstr.charAt(i+3)))>=0?ins:0)%96)*884736;
        enc[encc++]=tmp%64;tmp=Math.floor(tmp/64);
        enc[encc++]=tmp%64;tmp=Math.floor(tmp/64);
        enc[encc++]=tmp%64;tmp=Math.floor(tmp/64);
        enc[encc++]=tmp%64;tmp=Math.floor(tmp/64);
        enc[encc++]=tmp%64;tmp=Math.floor(tmp/64);
      }
    }
    // フィールド記憶 // field memory? seems this is how it reduces length with normal game progress
    for(j=0;j<220;j++)encf[j]=af[e*220+j];
    if(!ad[e]){ // ミノ接着 // mino locking
      // ブロック配置 // set up the blocks
      if(ap[e*3+0]>0){
        for(j=0;j<4;j++)encf[ap[e*3+2]+b[ap[e*3+0]*32+ap[e*3+1]*8+j*2+1]*10+b[ap[e*3+0]*32+ap[e*3+1]*8+j*2]-11]=ap[e*3+0];
      }
      // フィールドずらし消去 // line clear
      for(i=20,k=20;k>=0;k--){
        chk=0;for(j=0;j<10;j++)chk+=(encf[k*10+j]>0);
        if(chk<10){
          for(j=0;j<10;j++)encf[i*10+j]=encf[k*10+j];
          i--;
        }
      }
      for(;i>=0;i--)for(j=0;j<10;j++)encf[i*10+j]=0;
      // せり上がり //garbage
      if(au[e]){for(i=0;i<210;i++)encf[i]=encf[i+10];for(i=210;i<220;i++)encf[i]=0;}
      // ミラー発動 //mirror
      if(am[e])for(i=0;i<21;i++)for(j=0;j<5;j++){tmp=encf[i*10+j];encf[i*10+j]=encf[i*10+9-j];encf[i*10+9-j]=tmp;}
    }
  }
  encstr='v110@';
  for(i=0;i<encc;i++){
    encstr=encstr+enctbl.charAt(enc[i]);
  if(i%47==41)encstr=encstr+"?";
  }
  tx.value=encstr;
  tmp=location.href.indexOf('?');if(tmp<0)tmp=location.href.length;
  tmp2=location.href.indexOf('#');if(tmp2<0)tmp2=location.href.length;
  if(tmp2<tmp)tmp=tmp2;
  url.value=location.href.substring(0,tmp)+'?'+encstr;
  if(submit!=null){submit.disabled=false;}
  view.value=location.href.substring(0,tmp)+'?m'+encstr.substring(1);
  out.style.color='black';
  out.style.backgroundColor="white";
  refreshquiz(frame,0,1);
  keybuttonenable(p[0]>0);
  if(focusset){
    url.focus();
  }
}
//declaration
f=new Array(220);encf=new Array(220);af=new Array(220*(framelim+1)); // 仮想フィールド // frames
p=new Array(3);ap=new Array(3*(framelim+1)); // ピース種類,角度,座標 // piece type, rotation, position
pcustom=new Array(-1,-1,-1,-1); // カスタムピース座標 // custom piece
pce=0; // カスタムピース作成色 // color of custom piece
au=new Array(framelim); // せり上がり // raise garbage or not
am=new Array(framelim); // 反転スイッチ // mirror or not
ac=new Array(framelim); // コメント // comments
ad=new Array(framelim); // 接着 // lock or not =w=
//and that's all?


--------------------
User is offlinePM
Go to the top of the page
+Quote Post
Shuey
post May 26 2012, 12:18 AM
Post #16


Tetris Specialist
Group Icon
Posts: 267
Joined: 12-November 10



Good stuff! Do you have an idea when this will be out of beta? I'd love to test this out some time.


--------------------
Start your journey to becoming a Tetris Ninja! Get your Tetris Belts

Subscribe to me on YouTube
User is offlinePM
Go to the top of the page
+Quote Post

2 Pages V < 1 2
Reply to this topicStart new topic
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members:

 

©2009-2013 Hard Drop Community & Forum
harddrop.com is not sponsored or endorsed by The Tetris Company or its subsidiaries.