"Tetris Worlds" for PC: Anomalies and Hacks

Thread in 'Research & Development' started by Rich Nagel, 12 Jan 2008.

  1. Dunno if anyone else here has the PC version of "Tetris Worlds" (Caffeine and Lardarse have mentioned in other threads that they have that version). Anyhow, some things I've discovered, screwed with, and/or generally made a mess of <G>.


    First of all (as described by Lardarse), all of the game's mechanics are stored within "TWS" script files. These files can be found in the "Tetris Worlds\Assets\Any_Plat\Any_Lang\Scripts" subdirectory, and are as follows:

    -=-=-=-=-=-=-=-=-=-
    • CASCADE.TWS - Cascade Tetris, "Aludra" world
    • CONNECT.TWS - Fusion Tetris, "Unukalhai" world
    • ENDURE.TWS - Endurance Tetris (see "ENDURANCE=TRUE" in the "[GAME]" heading section below), strange cascading mode that can't top out
    • HOTLINE.TWS - Hot-Line Tetris, "Talitha" world
    • LEARNING.TWS - Ultra Learning Tetris
    • MCASCADE.TWS - Ultra Cascade Tetris
    • MCONNECT.TWS - Ultra Fusion Tetris
    • MHOTLINE.TWS - Ultra Hot-Line Tetris
    • MSQUARE.TWS - Ultra Square Tetris
    • MTET2001.TWS - Ultra Tetris
    • MTNT.TWS - Ultra Sticky Tetris
    • ORIGINAL.TWS - Original Tetris, "Hadar" world (see "ORIGINALTETRIS=TRUE" in the "[GAME]" heading section below)
    • RIBBON.TWS - Ribbon Tetris (see "RIBBON=TRUE" in the "[GAME]" heading section below), same color block line clears only, starts with colored garbage already in the pit
    • SAMPLE.TWS - Sample Tetris Worlds script file (crashes game)
    • SQUARE.TWS - Square Tetris, "Mira" world
    • TEST.TWS - Test game (see "SUPEREASY=TRUE" in the "[GAME]" heading section below), I-Cheat and single line clear level advances
    • TET2001.TWS - Tetris, "Deneb" world
    • TNT.TWS - Sticky Tetris, "Antares" world

    (Note: "Ultra" = "Arcade" mode, others are "Story" mode)
    -=-=-=-=-=-=-=-=-=-


    Lots of fun stuff can be edited in these files (back up your files first!). This can probably be used in all of the scripts, but as an example, TET2001.TWS ("Tetris" mode, "Deneb" world in "Story" mode):


    Search for the following:

    -=-=-=-=-=-=-=-=-=-
    Code:
    PlayfieldColumns 10
    PlayfieldRows 22
    SearchCount 10
    
    -=-=-=-=-=-=-=-=-=-

    and change to:

    -=-=-=-=-=-=-=-=-=-
    Code:
    PlayfieldColumns 7
    PlayfieldRows 16
    SearchCount 7
    
    -=-=-=-=-=-=-=-=-=-

    Hehe, big block Tetris <G> [​IMG]


    Next, search for the following:

    -=-=-=-=-=-=-=-=-=-
    Code:
    SearchType Horizontal
    
    -=-=-=-=-=-=-=-=-=-

    and change to:

    -=-=-=-=-=-=-=-=-=-
    Code:
    SearchType Vertical
    
    -=-=-=-=-=-=-=-=-=-

    Hehe, weird <LOL>!


    The "GameType" setting in the script files sets the type of game. "GameType Marathon" is for "Story" mode and "GameType Levels" is for "Arcade" mode.


    The "MaxMovementsPerSecond" and "MaxRotationsPerSecond" in the script files sets the DAS repeat rate (see "FIRSTREPEATDELAY=(DeciSeconds)" in the "[GAME]" heading section below).

    All of the script files use the setting "MaxRotationsPerSecond 5". Also, all of the script files use the setting "MaxMovementsPerSecond 15", with the exceptions of "ENDURE.TWS", "ORIGINAL.TWS", "RIBBON.TWS", "SAMPLE.TWS", and "TEST.TWS" (which all use a setting of "MaxMovementsPerSecond 10").


    Next of all, the Tetris Worlds configuration file "TWConfig.ini", which can be found in the "Tetris Worlds\Assets\PC\Any_Lang\Misc" subdirectory.

    Under the "[SYSTEM]" heading:

    -=-=-=-=-=-=-=-=-=-
    • DEBUGKEYS=TRUE
    • SOFTRENDER=FALSE
    -=-=-=-=-=-=-=-=-=-

    "SOFTRENDER" doesn't appear to be changed by the Tetris Worlds configuration utility "TWConfig.exe", "SOFTRENDER=TRUE" to enable software graphics mode (verses hardware accelerated).

    Add the line "DEBUGKEYS=TRUE" to enable various debug keys (as well as displaying the version number at the bottom of the main menu, "Version 10.31.2001.0001"). Debug keys are as follows:

    • F6 - Dunno what this one does, seems to pause the game for a few seconds (?)
    • F7 Toggles between "Fly Cam", "Clip Debug", and "Block Light Position", press the six INSERT/DELETE/HOME/END/PAGEUP/PAGEDOWN keys on your keyboard to play around with these
    • F8 Toggles FPS counter, cool looking audio VU meters, and adds various text to lower left of the screen (looks to me like maybe the loaded program modules?)
    • F9 - Dunno what this one does, like F6, it seems to pause the game for a few seconds (?)
    • F10 Removes digits and text from the scoreboards
    • F11 Toggles between "Alpha Testing", "Alpha Blending", and "Full Alpha", (maybe) press the six INSERT/DELETE/HOME/END/PAGEUP/PAGEDOWN keys on your keyboard to play around with these (they don't do anything on my PC)


    Back to the Tetris Worlds configuration file "TWConfig.ini":

    Under the "[WORLDS]" heading:

    -=-=-=-=-=-=-=-=-=-
    • FLATBLOCKS=FALSE
    • HUDSCOREBOARD=FALSE
    -=-=-=-=-=-=-=-=-=-

    "HUDSCOREBOARD=TRUE" crashes the game in "Story" mode, but removes the HUD display shown above the playfield (current level, next pieces, time, etc...) in "Arcade" mode (sort of bass-ackwards, if you ask me). Like "SOFTRENDER" mentioned above, the Tetris Worlds configuration utility "TWConfig.exe" doesn't seem to change it.

    "FLATBLOCKS=TRUE" forces the game to use the BMP format images in the "Tetris Worlds\Assets\PC\Any_Lang\Misc" subdirectory as flat block textures.


    Under the "[GAME]" heading:

    -=-=-=-=-=-=-=-=-=-
    • ENDURANCE=TRUE
    • FIRSTREPEATDELAY=(DeciSeconds)
    • NEXTSTYLE=(unknown)
    • ORIGINALTETRIS=TRUE
    • RIBBON=TRUE
    • SUPEREASY=TRUE
    • WIREFRAME=TRUE
    -=-=-=-=-=-=-=-=-=-

    The only time that the "[GAME]" heading is added to the "TWConfig.ini" file is when you reach rank "15" for all (?) of the "Story" mode games. At that time the game also adds "ORIGINALTETRIS=TRUE" to the "TWConfig.ini" file (see "ORIGINAL.TWS" in the "Scripts" section above). This unlocks the "Original" Tetris game, ("Hadar" world in "Story" mode).

    The rest of the entires are *NOT* added to the "TWConfig.ini" file automatically by the game, and must be added manually to it if you wish to enable them.


    "FIRSTREPEATDELAY=(DeciSeconds)" (see the "MaxMovementsPerSecond" and "MaxRotationsPerSecond" section above). This sets the delay of the DAS in tenths of a second. For example, edit the line to read "FIRSTREPEATDELAY=4" to change the DAS delay to .4 seconds before the game begins to autoshift the tetrominoes.

    "ENDURANCE=TRUE" (see "ENDURE.TWS" in the "Scripts" section above). Seems like a real strange mode of gameplay, and also it's strange that there isn't any way to normally unlock this mode.

    "SUPEREASY=TRUE" (see "TEST.TWS" in the "Scripts" section above). Hehe, advance your rank to "15" for all of the "Story" mode worlds in a matter of minutes <G>. Dunno why this wasn't added as some sort of unlockable or option (sort of a "Kid Tetris" type of thing).

    "WIREFRAME=TRUE" makes the shadow tetrominoes display as wireframe.

    The function of the "NEXTSTYLE=" entry is currently unknown (I have no idea as to what the value should be for this setting, but it's listed in the game's executable "TetrisWorlds.exe").


    Lastly, under the "[GAME]" heading, "RIBBON=TRUE" (see "RIBBON.TWS" in the "Scripts" section above). This does *NOT* seem to unlock "Ribbon" mode like the other entries do for their respective gameplay modes. Dunno why that it doesn't (?), as it's listed along with the others in the game's executable "TetrisWorlds.exe".

    Does anyone know of way to enable this? The only way that I could was by copying the "RIBBON.TWS" file to one of the existing script filenames, and then selecting the respecive script's gameplay mode from within the game. Seems strange that it's listed in the "TetrisWorlds.exe" file, but (unlike the other modes) doesn't seem to function (short of renaming script files).


    Next, the "BlkColor.ini" file, which can be found in the "Tetris Worlds\Assets\Any_Plat\Any_Lang\Mino" subdirectry. This file contains all of the RGB-value colors for the various tetrominoes (minus gamma, alpha blending, and lighting effects... in other words, the RGB values are much darker in the "BlkColor.ini" file than they appear in the game).

    Also, note that the stock "BlkColor.ini" file contains an error with one of the RGB values. Under the "[OCEANWORLD]" section, search for the following:

    locked1=83,57,1157

    and change to:

    locked1=83,57,115

    Heh, no such thing as an RGB value of "83 57 1157" <G>.


    Lastly, things that make ya go "hmmmm..." <G>:

    The file "Net.ini" located in the "Tetris Worlds\Assets\Any_Plat\Any_Lang\Net". Contains network/communications type stuff, but <AFAIK> the game does NOT support network or Internet play (?) <G>.

    Listed in the game's executable "TetrisWorlds.exe" you'll find the following mysterious text:

    BASLUS-20247TW

    Heh, appears to be a leftover from the PS2 version of Tetris Worlds when they ported the game to PC <G>.


    BTW, here's a little something to play around with; "NIFSkope v1.0.21 for Windows" -> http://sourceforge.net/projects/nif....21/nifskope-1.0.21.4886-windows.exe/download .

    This utility allows you to view (and I suppose edit as well) all of the "NIF" files in Tetris Worlds. The "NIF" files are "NetImmerse" file format, and make up all of the hardware accelerated graphics for the game. All of the "NIF" files are located within the various subdirectories of the "Tetris Worlds\Assets" directory of the game.)

    P.S. The "BMP" format images within the same subdirectories are the graphics for the software renderer (although you have to manually edit the "TWConfig.ini" to enable software graphics mode, and there are a few visual issues/glitches when the game is ran in that mode).)


    (Above content updated on 3/1/2010, updates in BOLD RED)
     
    Last edited: 4 Mar 2010
  2. that's cool. it's been so long since i've played that.
     
  3. On this topic, does anyone know the input limitations of the Tetris Worlds game engine? With, say, a script or something, could you move a piece left or right two spaces in one frame? I know that the maximum gravity is 2.36G. If I knew the precise input restrictions, it would allow me to possibly create a machine that can play forever.
     

  4. Do you mean if you can (automatically) move pieces via a TWS script, or simply change the rules of how far the user can move a piece can move? Either way, I'm not really sure, although for the former, I don't believe it's possible for a script to automaitically move pieces.


    P.S. Snag this file here -> http://tang.cmoo.com/~snor/weeds/Tetris ... cripts.zip , maybe that will help ya [​IMG] All of the scripts have quite a few comments embedded in them, but the included "Sample.tws" file is *heavily* commented.
     
  5. some of these comments are pretty insightful. nice find.


    the guy typed "tetramino" in one of the comments. yay.
     
  6. Meaning, if one knew what they were doing (which usually excludes ME from most everything <LOL>!) they could *completely* change the physics of the game with the script files to simulate many different incarnations of Tetris... prolly close to the editability of LockJaw (although the TW piece o' crap will NEVER come close to LJ <IMHO>).



    [​IMG]
     
  7. Hmm, perhaps script was the wrong word. I mean that if you press right or left twice in one frame, which is possible to do automatically with macros I believe, then would the piece move left or right twice?
     

  8. Correct.
     
  9. That's very interesting. It means the playing forever strategy is viable without modification at the highest gameplay speeds Tetris Worlds has to offer. If this input handling holds true for the Gamecube version, it will be easier than expected to construct a robot that destroys the game.
     
  10. Lemme ensure that I understand correctly. Basically you're refering to if you press the left or right keys multiple times in rapid succession, that the piece would move that quickly (i.e. a rapid left-tap/tap/tap would quickly move the piece to the left 3 times, without ignoring any of the keypresses)? If so, then yes, TW behaves like this.



    Would this auto-playing 'bot work for the PC version as well? 'Twould be quite interesting and neat to see [​IMG]
     
  11. "If this input handling holds true for the Gamecube version, it will be easier than expected to construct a robot that destroys the game."


    Excuse me if this makes me look stupid. I haven't played the game in ages, but there's an endless mode in Tetris Worlds?
     
  12. Not really for score or anything, but you can play level 15 in a loop repeatedly until you get bored.
     
  13. Re: "Tetris Worlds" for PC: Anomalies and Hacks

    Sorry to dig up this old message thread; added a few things (shown in BOLD RED)
     
  14. Edo

    Edo a.k.a. FSY

    Re: "Tetris Worlds" for PC: Anomalies and Hacks

    Thank you so much for this! I always thought that the DAS rate and initial delay were inextricably linked and couldn't be tweaked independently! Haha, now to dig out my old hacked TET2001.TWS with sega rotation :biggrin:
     
  15. Re: "Tetris Worlds" for PC: Anomalies and Hacks

    You're quite welcome!

    I myself was also happy to stumble upon this; as to me, TW for PC always felt like a... I dunno... a sluggish turd LOL?

    After finding that, I've edited all of my TWS script files to:

    MaxMovementsPerSecond 30

    and my TWConfig.ini file to:

    FIRSTREPEATDELAY=4

    To me (at least), this feels more like Tetris should! :) I'm not sure what the default "FIRSTREPEATDELAY" setting is (as it's hardcoded in the execuatble), but it was WAY too fast for my liking, and the default "MaxMovementsPerSecond 15" and "MaxMovementsPerSecond 10" in the TWS script files was too slow.


    P.S. Another in the EXE (for the "[GAME]" section of the "TWConfig.ini" file):

    NEXTSTYLE

    No idea what that one does, I saw no effect when adding it (not sure what the value for that entry should be as well).


    Heh, some text all by itself in the EXE (directly below all of the "[GAME]" section stuff):

    BASLUS-20247TW

    What the hell is that LOL?!


    (edit) May have just answered my own question -> http://www.google.com/search?num=100&hl=en&safe=off&q=BASLUS ... prolly a leftover from when they ported the game to WinDoZe.
     
  16. Re: "Tetris Worlds" for PC: Anomalies and Hacks

    I think your post would be better served as a wiki article. I'd like to maybe document the runtime script language used to control the gameplay, crucial to making new game modes. There's also more complex parts of the TWS format, such as pattern matching (used to detect T-Spins), and of course how the internal system for describing rotations translates into SRS.
     
  17. Re: "Tetris Worlds" for PC: Anomalies and Hacks

    Sounds good :) Should I simply add another section to the existing entry in the wiki for TW?


    That would be great! :)
     
  18. Re: "Tetris Worlds" for PC: Anomalies and Hacks

    I'd start with a new page, something like "Tetris Worlds Hacks", with a link to it on the Tetris Worlds page. Covering all the user-modifiable parts of Tetris Worlds will be a pretty sizable amount of documentation.

    There's also Tetris Zone, which uses an extended version of Tetris Worlds' Tengine, but even after decrypting the script files, I've had a hard time figuring out the semi-compiled format, beyond seeing the same data for the rotation system as Tetris Worlds.
     
  19. Re: "Tetris Worlds" for PC: Anomalies and Hacks

    A-OK. I'll try to create the new page tonight.


    Yeah, the TZ script files are still pretty much unusable after decrypting; as like you said, they're still in a semi-compiled format. The decrypter/encrypter command line utility works quite nicely for the graphics though :)

    Hehe, as a non-programmer with no access to compilers, I found this site -> http://www.delorie.com/djgpp/compile which allowed me to compile the source for the utility online :)


    BTW, here's a little something to play around with; "NIFSkope v1.0.21 for Windows" -> http://sourceforge.net/projects/nif....21/nifskope-1.0.21.4886-windows.exe/download .

    This utility allows you to view (and I suppose edit as well) all of the "NIF" files in Tetris Worlds. The "NIF" files are "NetImmerse" file format, and make up all of the hardware accelerated graphics for the game. All of the "NIF" files are located within the various subdirectories of the "Tetris Worlds\Assets" directory of the game.

    P.S. The "BMP" format images within the same subdirectories are the graphics for the software renderer (although you have to manually edit the "TWConfig.ini" to enable software graphics mode, and there are a few visual issues/glitches when the game is ran in that mode).
     

Share This Page