WIP TGM/TAP clone for GBA

Thread in 'Discussion' started by Kitaru, 17 Jan 2008.

  1. I have been working on this off and on since I picked TGM back up in May, but I haven't really mentioned it to many people before now. Right now it is at a stage of development where I think it is probably worth making public.


    http://kitaru.ath.cx/progs/tgm.gba

    [​IMG]

    TODO:

    Optimize and re-enable sound engine

    Optimize other bits of sloppy code

    Split this monster into separate files so it isn't frightening to look at

    Spiffy graphics and sound?

    Secret grade?


    Right now it feels like a sloppy mash-up between TGM and TAP. It has the original GRS and frame timings with TAP firm drop and randomizer re-rolls. Since the TAP grade point system is now well documented on the wiki, I plan to mimic TAP systems rather than TGM ones.


    Feel free to make suggestions. I'm going to be busy with school and such, but I'll try to make time to work on this as well.


    Enjoy!
     
  2. jujube

    jujube Unregistered

    great work Kitaru [​IMG]

    one thing i noticed: firm drop input during ARE isn't doing anything. other than that it feels good.
     
  3. I never knew about that, haha. I had it set up so input from up or down were skipped during ARE. They are now free, no longer oppressed by the evil "if(!in_are)..." Right now, the firm drop behavior is a key hit to trigger when the piece is in play and a key hold to trigger it during ARE. If anyone believes it should always be a "key is down" trigger, let me know. I think it should probably be a key hit when in play in order to mimic a 4-way joystick's behavior.


    EDIT: Did a little more tweaking. Up and down are ignored if left or right are held. Otherwise, both are triggered whenever the key is down.


    EDIT2: Master gravity table in place. Now we have accurate TGM1 with firm drop! :p I pruned all of the constant gravity modes except for 0G and 20G. Perhaps they can make a return in a practice mode of some sort?


    EDIT3: Master mode now uses all of the correct frame timings.


    EDIT4: Moved manual locking to a place where it wouldn't be affected by the conditionals disallowing diagonal movement. Manual locking works a great deal better now.


    EDIT5: Death mode complete after some multidimensional array hassling. The game got stuck in the line clear phase when I hit section 100, so line clear time for 100-299 is 1 frame for now. I'll fix it when I get the chance.
     
  4. tepples

    tepples Lockjaw developer

    Do you plan on making source code for this available, so that somebody can port it for the benefit of people who have a Nintendo DS and a SLOT-1 card?
     
  5. It is a real mess, but you can look at it if you'd like.


    http://kitaru.ath.cx/progs/tgm.c


    EDIT: I lied, Death mode needs some tweaking.

    EDIT2: It appears I fixed all the things I had forgotten to consider. All you Death Masters should be good to go.
     
  6. Muf

    Muf

    But why do I get "GAME OVER" when I manual lock a tetromino? (tap up, down)
     
  7. That is an excellent question, but I'm afraid it will have to wait until I return from school today. I don't know what I broke, stay tuned.
     
  8. tepples

    tepples Lockjaw developer

    Thank you. Once the program stabilizes, I'll see what I can do about the port.


    Programming tip: The GBA and DS do not have an FPU. If you use a variable of type 'float' or 'double', you bring in an FPU emulator that costs your program size and speed. Your gravity code used to use it; right now, only the dimming code uses it.
     
  9. I still have work to do, but I managed to VNC into my computer and do a quick work around on it. I think it was locking on entry. Keep me posted.
     
  10. Zednom

    Zednom Unregistered

    Nice job - I was looking for something like this to have with me on my psp (I have lockjaw on it, but I always forget the TGM settings).


    Looking forward to any improvements you make to it, keep up the good work. [​IMG]
     
  11. Yep. I've been trying to weed out floats and division when possible. I'm particularly displeased with how my dimming code is set up right now, so that will definitely be one of the sloppy things I clean up later on.


    EDIT: I forgot to mention what ended up being broken in the code. Somehow the "if(P.lock > ...){LockTetrimino();}" conditional had ended up on the wrong side of some braces when I added the variable timings. You won't get phantom locks at piece entry any longer.


    EDIT2: I found out the L, J, and T wall kicks are still wrong in that they ignore the center column rule. I'll try to see where I went wrong.


    EDIT3: Fixed. Now investigating some strangely short line clear periods. Remind me never to program until 5AM ever again.


    EDIT4: Hahaha, it was using Death timings for every mode. "if(MD_DEATH)" is not the same thing as "if(P.mode == MD_DEATH)." Let me know if there are any other bugs found. As far as I know, everything is fixed now. *knocks on wood*


    EDIT5: I forgot to mention my clone's equivalent of button C. The button R repeats the rotation key previously used. Flicking either of the face buttons and R will result in a net 180 degree rotation, just as flicking A and C would.


    EDIT6: The TAP Grade Point system is in place. If something about that doesn't feel right, let me know. Also, I've been wrestling with soft drop and manual lock. I don't think they are as tight as they should be, but it might just be me. Please let me know what you think of the grading and piece handling.
     
  12. kesiev

    kesiev Unregistered

    Casually I've bought a flashable GBA/NDS cart in these days and I'm discovering the depth of Tetris browsing the tetrisconcept wiki (and, since I'm a programmer, I'm writing too my own tetris - but not for GBA [​IMG] ).

    Probably I cannot help you to check how millisecond-perfect is your tetris to the TGM original and so on - since I'm quite a newbie - but... keep on working on it! I think that playing a TGM clone for 24/7 on my micro can be surely helpful [​IMG]

    PS: should be nice a bit of arcade-esque (cough--- cough--- Heboris) graphics/backdrops [​IMG]

    EDIT: A tiny blog or something RSSable for easily following the progresses?
     
  13. The trick is to not be millisecond perfect, but frame perfect. When everything is defined as a whole amount of frames, it'a kinda hard to screw up the timing, unless the code can't actually do everything it needs to in one frame...
     
  14. I copied the frame tables from the wiki, so everything should be perfect. I suspected that it was possible that they could all be off by one, but I double checked the way I had written the game loop to ensure this wasn't the case. 0 frame line clears are now perfect as well. (That's right! Not an infinite frame animation, not a one frame animation, a true zero frames thanks to recursion! :p)


    As for getting everything done in one frame, there is no problem there. When I had the sound code in, it used to drop frames here and there. It was sitting in the loop following the wait for vsync, as it was causing bizarre behavior when being called as an interrupt. Any time it needed to mix several sounds, the game would drop 15 or so frames in that second. I plan on investigating sound-related oddness once I'm happy with all the base features of the game.


    EDIT: Fixed the behavior of 20G locking safeness check. The variable of this also replaced the frame timing section indicator in the top right corner of the screen, if anyone cares. :p


    EDIT2: The beginnings of the credit roll are in place. Everything will stay visible and your grade will not be affected, but play continues for a specified time after you reach 999.
     
  15. Edo

    Edo a.k.a. FSY

    Now might be an opportune time to point out that the values on the wiki currently aren't correct.
    Firstly, the Death mode values were measured by observation, whereas the Master mode values were extracted from the game code; this means that these two sets of data are inconsistent with each other. Secondly, the values are incomplete, and make no mention of the time available to charge DAS during ARE. I was investigating the timings a while back, and collected a bit of information on my wiki talk page.

    After reading my talk page, you can see that the reason for a 0 frame delay is because the total ARE is the same regardless of whether or not lines are cleared, and not because the animation is actually 0 frames long. If you glance over the Shirase mode timings, you'll see that at one point, the line clear delay is actually negative, this is because the ARE is shorter when you clear lines. Hopefully this info will be of use.


    There's more detail needed on DAS charging, colour_thief's probably the man to talk to about that. I remember him saying something about it being possible to maintain DAS charge in between placing tetrominoes.
     

  16. I've really got to get on that. The behaviour is entirely understood, at least for TA/TAP. Would you believe the major holdup is that I can't be bothered to make pretty pictures? [​IMG]

    I'll see if I can get the information up, even with rough pictures. It can always be polished later.
     
  17. Muf

    Muf

    Okay... I just found out I can only play this game properly if I cross my hands and use my right hand for the D-pad and my left hand for rotation. Otherwise I can't figure out which button rotates which way [​IMG]. Oh, the intense tetlag... Aren't there any special Nintendo DS models for left-handed folks? That would be great, even though I'm right handed.
     
  18. mat

    mat

    you could use the face buttons as a dpad and the dpad for rotation... if that were your thing. yet another reason i preach left handed movement on a keyboard...
     
  19. tepples

    tepples Lockjaw developer

    When Nintendo DS homebrew was young, people used Game Boy Advance flash cards to run DS programs. A DS flash card that took SD cards wasn't out yet. (Only later did people figure out how to use CF and later SD memory.) Around this time, I used GIMP to shop a photo of what I called "Nintendo SD":





    What is wrong with this picture?
     
  20. Muf

    Muf

    Well, it's rather vicious.. This is double tetlag: I play Tetris DS WFC quite a bit, which uses left-directions right-rotations.. BUT: TDS uses SRS rotations, which are opposite to ARS rotations. Now to make matters worse, I only rotate one way in SRS games (there's no real need for bidirectional rotation because of infinity), but rotate bidirectional in ARS games, which I've only played on keyboard. [​IMG]

    EDIT:

    Btw, reversing the D-pad and the ABXY buttons wouldn't be such a bad idea for tetris. You never need to press any of the rotation buttons simultaneously, but for directions there is definitely something to say for having separate buttons for each direction. Double tapping (up then down to sonic drop then lock) is considerably less efficient with a D-pad than with cursor keys, so if you simply used the ABXY buttons as cursor keys, that would solve two problems at once. The problem here though is that Kitaru's game is written for GBA, so it isn't aware of the X and Y buttons.


    EDIT2:

    Heh, nice pic tepples [​IMG] That's definitely the leftie DS I was thinking about, though I'd never want to own a Phat.
     

Share This Page