Announcement: Why not try our official idea generator for inspiration when making puzzles?


Caravel Forum : DROD Boards : Architecture : Play Tetris within DROD
New Topic New Poll Post Reply
Poster Message
VortexSurfer
Level: Delver
Avatar
Rank Points: 90
Registered: 04-04-2004
IP: Logged

File: Tetris_v095.hold (166.2 KB)
Downloaded 117 times.
License: Public Domain
icon Play Tetris within DROD (+2)  
Well, it's been a while for me - You may remember previous holds where I converted some classic puzzles to DROD ("The Palace of Puzzles"). With TCB, possibilities have once again increased dramatically: Sokoban has become almost trivial rather straightforward (as shown here), and many other games are now feasible with the advanced scripting system.

So let me present: Tetris! Yup, you can play this classic game in DROD now (small problem: blocks obviously don't drop by themselves).

Some open issues:
* Block rotation algorithm could be improved.
* Pseudorandomness of the block sequence could also be improved.
* Performance: On my system, there are noticable delays every few turns.

Please let me know if you encounter any other problems (Screenshots would be most helpful I guess)!


[Last edited by VortexSurfer at 04-09-2007 11:52 PM : unfortunate wording rephrased]
04-09-2007 at 08:37 PM
View Profile Send Private Message to User Show all user's posts This architect's holds Quote Reply
Insane
Level: Master Delver
Avatar
Rank Points: 154
Registered: 08-06-2005
IP: Logged
icon Re: Play Tetris within DROD (+1)  
Excellent.
Only once I noticed that a tar baby randomly turned into a Wraithwing while it was at the top of the screen, otherwise there were no errors.

Except me losing. :rolleyes

-Insane
04-09-2007 at 09:23 PM
View Profile Send Private Message to User Visit Homepage Show all user's posts This architect's holds Quote Reply
Sillyman
Level: Smiter
Avatar
Rank Points: 339
Registered: 09-08-2006
IP: Logged
icon Re: Play Tetris within DROD (0)  
Sokoban isn't trivial yet. There are still some bugs to be fixed/features to be worked around...

____________________________
Who, me?
FNORD
04-09-2007 at 09:56 PM
View Profile Send Private Message to User Show all user's posts Quote Reply
VortexSurfer
Level: Delver
Avatar
Rank Points: 90
Registered: 04-04-2004
IP: Logged
icon Re: Play Tetris within DROD (0)  
Insane wrote:
Only once I noticed that a tar baby randomly turned into a Wraithwing while it was at the top of the screen

I am currently unable to reproduce this - Was it a tar baby of an active block? In the topmost line?

04-11-2007 at 01:07 PM
View Profile Send Private Message to User Show all user's posts This architect's holds Quote Reply
Insane
Level: Master Delver
Avatar
Rank Points: 154
Registered: 08-06-2005
IP: Logged
icon Re: Play Tetris within DROD (0)  
VortexSurfer wrote:
Insane wrote:
Only once I noticed that a tar baby randomly turned into a Wraithwing while it was at the top of the screen

I am currently unable to reproduce this - Was it a tar baby of an active block? In the topmost line?

Yes.
Also, sometimes there's a bug that makes Tarbaby blocks go up one square when turning.

I'll try to reproduce it.

-Insane
04-11-2007 at 01:18 PM
View Profile Send Private Message to User Visit Homepage Show all user's posts This architect's holds Quote Reply
VortexSurfer
Level: Delver
Avatar
Rank Points: 90
Registered: 04-04-2004
IP: Logged
icon Re: Play Tetris within DROD (0)  
Insane wrote:
Also, sometimes there's a bug that makes Tarbaby blocks go up one square when turning.

That's a feature: The 2x2 block rotates around one of its tar babies, not around its center. Otherwise, rotating would have no effect at all on these blocks. This may be diffrent in the original tetris version.
04-11-2007 at 04:13 PM
View Profile Send Private Message to User Show all user's posts This architect's holds Quote Reply
Insane
Level: Master Delver
Avatar
Rank Points: 154
Registered: 08-06-2005
IP: Logged
icon Re: Play Tetris within DROD (+1)  
VortexSurfer wrote:
Insane wrote:
Also, sometimes there's a bug that makes Tarbaby blocks go up one square when turning.

That's a feature: The 2x2 block rotates around one of its tar babies, not around its center. Otherwise, rotating would have no effect at all on these blocks. This may be diffrent in the original tetris version.

On another note, how did you do rotating anyways?
Also, I found Ctrl + down to be quite handy for dropping tiles.

-Insane
04-11-2007 at 04:44 PM
View Profile Send Private Message to User Visit Homepage Show all user's posts This architect's holds Quote Reply
VortexSurfer
Level: Delver
Avatar
Rank Points: 90
Registered: 04-04-2004
IP: Logged
icon Re: Play Tetris within DROD (0)  
Insane wrote:
On another note, how did you do rotating anyways?

Rotating is done in the same manner as moving blocks: For each square of the 10x17 playfield, there is a variable containing the state of that square (0 = empty, 1 = 'I' block etc.). Additional variables contain the squares of the active block.

So, whenever a block is moved or rotated, the old positions are set to 0 and the new positions to the respective state.

There are 7x10x17 character scripts (and I would have appreciated some kind of 'import script' functionality for these!) that check the playfield variables and appear/ disappear accordingly (you have to have 7 characters per square for the 7 different block types because you can't turn one character into another).

Another general remark: While scripting has become more powerful with variables, it still is rather laborious. Arrays or pointers in particular would have been a big help for this room.

While now, you have scripts like the following:

if ...
wait until var field = 150
set field_150 = value
if end
<repeat for the other 169 fields>

With arrays, you'd simply write:

set fieldArray[field] = value



OK, that was perhaps more than you ever wanted to know ...


04-13-2007 at 01:32 PM
View Profile Send Private Message to User Show all user's posts This architect's holds Quote Reply
coppro
Level: Smitemaster
Rank Points: 1308
Registered: 11-24-2005
IP: Logged
icon Re: Play Tetris within DROD (0)  
I would suggest using a script to output a repeated text, then pasting that into the character. I know how to do something like that with bash, but there are many many other ways you can do this.
04-13-2007 at 06:06 PM
View Profile Show all user's posts Quote Reply
VortexSurfer
Level: Delver
Avatar
Rank Points: 90
Registered: 04-04-2004
IP: Logged
icon Re: Play Tetris within DROD (0)  
coppro wrote:
I would suggest using a script to output a repeated text, then pasting that into the character. I know how to do something like that with bash, but there are many many other ways you can do this.

It's possible to generate the text in many different ways, that's right, but the pasting-into-the-character part is currently not possible (via the script editor), or is it?

04-13-2007 at 07:14 PM
View Profile Send Private Message to User Show all user's posts This architect's holds Quote Reply
coppro
Level: Smitemaster
Rank Points: 1308
Registered: 11-24-2005
IP: Logged
icon Re: Play Tetris within DROD (0)  
It is. If you make one version of the script, use Ctrl+B to copy script from DROD. The syntax is exacting, so you should probably do that first. After that, you can copy text to the clipboard and Ctrl+Shift+B to paste it into DROD. You can also use this to move script between characters.
04-13-2007 at 08:38 PM
View Profile Show all user's posts Quote Reply
Insane
Level: Master Delver
Avatar
Rank Points: 154
Registered: 08-06-2005
IP: Logged
icon Re: Play Tetris within DROD (0)  
Your method is ingenious.
I thought the characters were actually moving downwards, so I wondered..

-Insane
04-13-2007 at 09:11 PM
View Profile Send Private Message to User Visit Homepage Show all user's posts This architect's holds Quote Reply
VortexSurfer
Level: Delver
Avatar
Rank Points: 90
Registered: 04-04-2004
IP: Logged
icon Re: Play Tetris within DROD (0)  
coppro wrote:
It is. If you make one version of the script, use Ctrl+B to copy script from DROD. The syntax is exacting, so you should probably do that first. After that, you can copy text to the clipboard and Ctrl+Shift+B to paste it into DROD. You can also use this to move script between characters.

Wow, that's good to know! Thanks! Exactly what I was looking for - I see now it's also stated clearly in the help file. Well, I guess I should have looked there first ...

Apparently, you can even declare new variables by pasting a statement containing the respective variable. Neat.

04-13-2007 at 09:19 PM
View Profile Send Private Message to User Show all user's posts This architect's holds Quote Reply
Someone Else
Level: Smitemaster
Avatar
Rank Points: 1306
Registered: 06-14-2005
IP: Logged
icon Re: Play Tetris within DROD (0)  
Do you mind if I work on space invaders?
Because I'm already half done.
04-23-2007 at 11:59 PM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores This architect's holds Quote Reply
Jeff_Ray...
Level: Smitemaster
Avatar
Rank Points: 962
Registered: 05-16-2005
IP: Logged
icon Re: Play Tetris within DROD (0)  
Someone Else: I already made one for the Technology Contest with JtRH... but you could try doing it too...

____________________________
I make Let's Plays too!
Click here to find out my LPs' progress, and find out what I plan to tackle next!

Currently playing:
Click here to view the secret text


My Holds:
-Completed:
Click here to view the secret text

-Work in Progress:
Click here to view the secret text

04-24-2007 at 12:50 AM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores This architect's holds Quote Reply
VortexSurfer
Level: Delver
Avatar
Rank Points: 90
Registered: 04-04-2004
IP: Logged
icon Re: Play Tetris within DROD (0)  
Someone Else wrote:
Do you mind if I work on space invaders?

No at all - I wasn't quite serious about that anyway. Thanks for asking though!
04-24-2007 at 07:38 PM
View Profile Send Private Message to User Show all user's posts This architect's holds Quote Reply
New Topic New Poll Post Reply
Caravel Forum : DROD Boards : Architecture : Play Tetris within DROD
Surf To:


Forum Rules:
Can I post a new topic? No
Can I reply? No
Can I read? Yes
HTML Enabled? No
UBBC Enabled? Yes
Words Filter Enable? No

Contact Us | CaravelGames.com

Powered by: tForum tForumHacks Edition b0.98.8
Originally created by Toan Huynh (Copyright © 2000)
Enhanced by the tForumHacks team and the Caravel team.