| 01-21-2003, 01:53 AM | #1 |
Nope its not tetris defense, this is an actual tetris game made in warcraft. It only took about 12 hours of coding and testing, but thats because i've already made one of these in java earlier on. Anyway, i thought it would be cool to post it. This isnt a "retail map" and it isnt really a trigger or a utility, but rather just a demonstration of just how far we can take WC if we want. So i think this is the right forum for it. If anyone wants to use this, i suspect it would make an excellent minigame for their RPG's. You can post questions about modifying the map here, but i put in a fairly large amount of comments. Heres a screenshot: ![]() So heres a bit on how it was made: The game uses wisps for blocks, each are assigned to a different player besides player 1 to give them a multicolor appearance. The blocks are saved in an array of locations and an array of units, which i call a "floater". This by tetris standards is the set of combinations of 4 blocks arranged so that all blocks share an adjacent edge with at least 1 other block. The Floaters fall down at an increasing rate in a trigger with a .1 interval. The trigger uses a real to count up a small real til it reaches a "threshold" and then it proceeds to drop the floater by one. Everytime the floater moves, each of its 4 elements has to be tested for collision in the direction it moves, this includes player control, rotation, etc. If that test fails the player cant move it if hes trying to move it, and the block will hit bottom and become part of the game world if the game is moving it. Rotation is done with a three dimensional array of locations, each one specifies 4 coordinates of one of the 7 floaters in one of its 4 states. Line checking is done with a three-tier loop, one of which is wrapped in a function. Whenever a piece drops, all the lines are checked to see if any of them have been completed. When one is completed the loop drops all the lines above it. It uses many levels of functions, to try to break this problem down. The reason for this is to separate the procedures in your mind and to reuse the procedures in other functions. One of the huge problems with jass though is that we cant have those functions span across multiple triggers (unless you use SuperIkI's method). So to compensate for this, ive kept these functions identical save for a 2 or a 3 at the end of their names. Thats it, ask questions if you have them. Feel free to use this in your maps, i would like some credit visible to your users if you do, but even if you don't, be sure to leave the comments within the engine triggers themselves. The comments explain how to move the game area around (change the GetGameScreenCoords1-3 Functions) at the top of the 3 triggers. You can also change the existing floaters in the initdata trigger, as well as the size of the game boundary. Note, dont add any new floaters or add any blocks to the floaters, (unless you really know what you are doing). The map doesnt have complete support for that yet. This was just a diversion from my next map, but i promise that future versions will be much more versitile. Adding more floaters isnt too difficult, you just look for lines such as: Code:
set udg_Floater_NextNum = GetRandomInt(0, 6) set udg_Floater_NextState = GetRandomInt(0, 3) The next version will have this replaced with a function so it can be edited more easily. Adding new floaters is a bit more difficult: (basically the way to do it is to use global variables to specify the number of states and the number of floater types and whenever you see a line such as this: Code:
udg_Floater_CurrentNum * 16 + newState * 4 Code:
udg_Floater_CurrentNum * 20 + newState * 4 This line will correctly index 4 point, 5 state floaters. Anyway, if i get a lot of questions on this, ill post a more complete tutorial, but for now just enjoy! ( And its back to the regular maps for me :P) Btw, This could also make a good multiplayer game. Imagine a scenario where completing lines does random and awful things to your enemies as you race to get 15 lines in a type of tournament setting. Ill probably implement this later. But for now, i Hope you Enjoy the demo. Sincerely, FM_TertiaryEye PS: (This code is written 100% from scratch) |
| 01-21-2003, 02:14 AM | #2 |
Guest | OMG! Your're a stud. |
| 01-21-2003, 02:34 AM | #3 |
Guest | That looks awesome. I want to test it out. When are you going to realease it. |
| 01-21-2003, 02:42 AM | #4 |
A working version is attached to the thread. What i meant by releasing it later. Was that i wanted to create a more easily modifiable version. One where you can have multiple games just by changing a variable or two, and where you can make your own blocks, and specify your own units without digging through the code. Thats what ill release sooner or later. |
| 01-21-2003, 04:42 AM | #5 |
Guest | thats really fun goodjob on it, hey i wonder in the triggers how do u get rid of the Events Condition's , actions things so u can type stuff i never knew that you can program Visual Basic into WE i must learn this crap lol, just tell me how you got blank triggers so i can type and crap in em. Very nice map:D |
| 01-21-2003, 04:45 AM | #6 |
Thanks AS ;) ================================= thats really fun goodjob on it, hey i wonder in the triggers how do u get rid of the Events Condition's , actions things so u can type stuff i never knew that you can program Visual Basic into WE i must learn this crap lol, just tell me how you got blank triggers so i can type and crap in em. Very nice map ================================= Edit ->> Convert to custom text, there are a lot of jass tutorials around. But i think the easiest way to learn it is to just convert triggers that you know to custom text to see how they look. From there you can pretty much figure everything else out. And for a good reference open up blizzard.j and common.j they list (almost) all the functions that you can use. FM_TertiaryEye |
| 01-21-2003, 05:00 AM | #7 |
Guest | Thanks alot:D PS. your really good at Visual Basic (Right? visual basic(Custom text)) you should write a tutorial on how to do custom text that would be cool:D PPS. what does "udg" mean? in custom text...? |
| 01-21-2003, 10:05 AM | #8 |
Guest | Uh oh... Now you're giving me ideas... I've written Tetris in Basic, in QBasic, in Visual Basic, in Java, and in good ol' C++.... I've been so busy on writing my RPG campaign, I never thought of making some simpler games.... Well done :) |
| 01-21-2003, 11:00 AM | #9 |
AfterShock: =========================== PS. your really good at Visual Basic (Right? visual basic(Custom text)) you should write a tutorial on how to do custom text that would be cool =========================== Ok, that might be a good idea, I don't see any basic custom text tutorials around aside from the everything you wanted to know about custom text thread and DKSlayers Jass FAQ. Ill write one when i get the next FMVH beta out. =========================== PPS. what does "udg" mean? in custom text...? =========================== All global variables are preceeded with "udg_" in custom text. It's anyones guess as to what udg stands for but thats how you access global variables. Also, sounds are prefaced with "gg_snd_", triggers are prefaced with "gg_trg", and rectangles (regions), are prefaced with "gg_rct". FM_TertiaryEye |
| 01-21-2003, 11:03 AM | #10 |
Guest | i c, thanks and i look forward to seeing ur new FMVH soon and tutorial:D |
| 01-21-2003, 12:37 PM | #11 |
Your map is great, the triggers seem flawless and it's just as good as any tetris I've player but you NEED to change those controls, try getting it so you can use keypad or something, I know it would be hard to do but clicking and moving just isnt fast enough. Also the terrain that it is on HAS to go, seomtimes it looks like theres still space on the far right or far left, I try to put a vertical thing there and it just gets stuck. I got to level 33 :D I give this map 8.5/10 (for now, until you fix those) |
| 01-21-2003, 01:06 PM | #12 |
Fyre, ============================== Your map is great, the triggers seem flawless and it's just as good as any tetris I've player but you NEED to change those controls, try getting it so you can use keypad or something, ============================== Well as you may already know, warcraft doesnt have built-in keyboard support. I could use ESC for rotation, and maybe use the FPS controller when they release it to the general public later on. (Check this thread for keyboard control issues) http://www.wc3campaigns.com/forums/s...light=keyboard But a way around this is to use control + unit number to assign the wolves to a quick key unit or whatever blizzard calls it. I would assign the left, right and rotate controls to "1", "2", and "3" respectively (or 8, 9, 0). This will let you control the game with just one hand. (This is one of the main reasons the game doesnt start til you tell it to, so people can set up their quick keys) ============================== I know it would be hard to do but clicking and moving just isnt fast enough. Also the terrain that it is on HAS to go, seomtimes it looks like theres still space on the far right or far left, I try to put a vertical thing there and it just gets stuck. ============================== Well, if you take a look at the screenshot in the first post, you will see that there is an outline of the gameplay area in the gray border. Once you get used to it, its pretty easy to determine where the gameplay area is. (And as you know you cant slide units too close to a cliff, which is what those walls are) But if someone wants to mod it, then they can make the gameplay area more rigidly defined. And not use cliffs either, which will probably help. ============================== I give this map 8.5/10 (for now, until you fix those) ============================== Lol, well thanks, but in truth its just a demonstration, otherwise it would be in the retail maps section. Anyway, im glad you enjoyed part of it, and hopefully it can inspire someone. FM_TertiaryEye |
| 01-21-2003, 01:20 PM | #13 |
Guest | Very cool man. I did a tetris clone a while ago in C++, one of the easier games to make...but to do it in warcraft, man that's sick. Great job. Break. |
| 01-21-2003, 05:42 PM | #14 |
Damnit, I was about to start working on a War3 tetris game. =( |
| 01-21-2003, 07:49 PM | #15 |
You could use my old FPS key detection where you have a building always selected with up to 11 units it can build and have it detect if a unit was issued order equal to "convert unit name to order" then perform whatever action remove the building and recreate it instantly. Set a units hotkeyto whatever. By th way anyone ever blizzard starcraft tetris map. Damn was that triggerfull. With no variables it was nearly as mamoth as GoldenUrg's chess map for SC. Anyway good job on the map and for future reference the right forum is a subforum off this one. Map/trigger depository. Just FYI. |
