Super ZZT Land
- bitbot
- Official Clamp School Defender
- Posts: 328
- Joined: Thu Mar 01, 2012 3:00 am
- Location: earthbound
- Contact:
Re: Super ZZT Land
How about a memory card game like in SMB3?
Last edited by bitbot on Sun Oct 07, 2012 7:28 pm, edited 1 time in total.
Re: Super ZZT Land
*POW* *CLANK* *PING*
- bitbot
- Official Clamp School Defender
- Posts: 328
- Joined: Thu Mar 01, 2012 3:00 am
- Location: earthbound
- Contact:
Re: Super ZZT Land
Hah, good one! Also stumbled on this ridiculous speed run:
http://www.youtube.com/watch?v=z5o3d104SKQ#movie_player
Can I get some help with randomization?
http://www.youtube.com/watch?v=z5o3d104SKQ#movie_player
Can I get some help with randomization?
Last edited by bitbot on Sun Oct 07, 2012 7:31 pm, edited 2 times in total.
Re: Super ZZT Land
You can use randomization with 2^x or 4^x possibilities depending on how you code the objects. How many possibilities were you looking for? If it isn't exactly one of those numbers, then some choices will have to be more likely than others.
#BECOME <color> OBJECT also works in SuperZZT, but it does not in ZZT.
If that is the layout you are going to use, for the white border, you can save objects by using Web instead, and you can place an object on top of the web with the same color and character without messing it up (web checks for adjacent webs under objects too)
#BECOME <color> OBJECT also works in SuperZZT, but it does not in ZZT.
If that is the layout you are going to use, for the white border, you can save objects by using Web instead, and you can place an object on top of the web with the same color and character without messing it up (web checks for adjacent webs under objects too)
Re: Super ZZT Land
you can get 1 out of 3 if you discard the 4th result
@rnd3
#end
:rnd
#change red invisible empty
#put rndp rndne red invisible
#if blocked w #one
#if blocked e #two
#if blocked s #three
#rnd
:one
:two
:three
Actually in thinking about it, it might be a good (the only?) use for the bottom row #put bug.
edit: oh yeah, szzt I'm guessing that bug does not exist there.
@rnd3
#end
:rnd
#change red invisible empty
#put rndp rndne red invisible
#if blocked w #one
#if blocked e #two
#if blocked s #three
#rnd
:one
:two
:three
Actually in thinking about it, it might be a good (the only?) use for the bottom row #put bug.
edit: oh yeah, szzt I'm guessing that bug does not exist there.
*POW* *CLANK* *PING*
- bitbot
- Official Clamp School Defender
- Posts: 328
- Joined: Thu Mar 01, 2012 3:00 am
- Location: earthbound
- Contact:
Re: Super ZZT Land
Saxxon wrote:You can use randomization with 2^x or 4^x possibilities depending on how you code the objects. How many possibilities were you looking for?
Okay, so would two randomization objects (3x3) create 9 combinations?Commodore wrote:you can get 1 out of 3 if you discard the 4th result
Useful tip!Saxxon wrote:#BECOME <color> OBJECT also works in SuperZZT, but it does not in ZZT.
- Quantum P.
- Level 17 Accordion Thief
- Posts: 1433
- Joined: Fri Sep 12, 2003 1:41 am
- Location: Edmonds, WA
- Contact:
Re: Super ZZT Land
Can't remember if I've shared it before, but here's a simple random number generator (replace gems with the counter of your choice):
This will give you from 0 to 15 gems. Using counter math, you can fine-tune the range fairly easily; here's a modification that causes it to pick between 1 and 10 (you can make it much simpler if you don't care about fairness):
I find this very convenient, but it has the disadvantage of taking up a counter and displaying a number to the player. If the random choice has to be kept secret from the player, you might want to do something to disguise the number (e.g., add some magic constant to it), or generate some decoy numbers.
For shuffling algorithms (and randomizing bitbot's card-matching game is a shuffling problem), the standard is the Fisher-Yates shuffle. It goes like this: (1) march through the list in order, and (2) for each thing in the list, swap it with a random something that comes later in the list. That will produce an unbiased shuffle, but I don't know how much work it would be in ZZT. A simple-but-not-100%-correct algorithm may be good enough.
My advice is to think about this: what is the best way to swap two cards? As soon as you have the ability to swap two arbitrary cards, your randomization problem is effectively solved. You could even make it part of the game, to make it more challenging: every so many turns, two cards light up and swap.
Where/how are you storing the values of the cards?
Code: Select all
'object blocked to east, unblocked to north
:choose
#if blocked rndne give gems 1
#if blocked rndne give gems 2
#if blocked rndne give gems 4
#if blocked rndne give gems 8
Code: Select all
'gems range: [0, 15]
#take gems 10 success
'gems range: [0, 5]
#take gems 4
#take gems 2
#take gems 1
'gems == 0; now we can try again
#choose
:success
'gems range: [0, 9]
#give gems 1
For shuffling algorithms (and randomizing bitbot's card-matching game is a shuffling problem), the standard is the Fisher-Yates shuffle. It goes like this: (1) march through the list in order, and (2) for each thing in the list, swap it with a random something that comes later in the list. That will produce an unbiased shuffle, but I don't know how much work it would be in ZZT. A simple-but-not-100%-correct algorithm may be good enough.
My advice is to think about this: what is the best way to swap two cards? As soon as you have the ability to swap two arbitrary cards, your randomization problem is effectively solved. You could even make it part of the game, to make it more challenging: every so many turns, two cards light up and swap.
Where/how are you storing the values of the cards?
- bitbot
- Official Clamp School Defender
- Posts: 328
- Joined: Thu Mar 01, 2012 3:00 am
- Location: earthbound
- Contact:
Re: Super ZZT Land
Wow QP, great info.Quantum P. wrote:Can't remember if I've shared it before, but here's a simple random number generator (replace gems with the counter of your choice):
This will give you from 0 to 15 gems. Using counter math, you can fine-tune the range fairly easily; here's a modification that causes it to pick between 1 and 10 (you can make it much simpler if you don't care about fairness):Code: Select all
'object blocked to east, unblocked to north :choose #if blocked rndne give gems 1 #if blocked rndne give gems 2 #if blocked rndne give gems 4 #if blocked rndne give gems 8
I find this very convenient, but it has the disadvantage of taking up a counter and displaying a number to the player. If the random choice has to be kept secret from the player, you might want to do something to disguise the number (e.g., add some magic constant to it), or generate some decoy numbers.Code: Select all
'gems range: [0, 15] #take gems 10 success 'gems range: [0, 5] #take gems 4 #take gems 2 #take gems 1 'gems == 0; now we can try again #choose :success 'gems range: [0, 9] #give gems 1
For shuffling algorithms (and randomizing bitbot's card-matching game is a shuffling problem), the standard is the Fisher-Yates shuffle. It goes like this: (1) march through the list in order, and (2) for each thing in the list, swap it with a random something that comes later in the list. That will produce an unbiased shuffle, but I don't know how much work it would be in ZZT. A simple-but-not-100%-correct algorithm may be good enough.
My advice is to think about this: what is the best way to swap two cards? As soon as you have the ability to swap two arbitrary cards, your randomization problem is effectively solved. You could even make it part of the game, to make it more challenging: every so many turns, two cards light up and swap.
Where/how are you storing the values of the cards?
The shuffle algorithm sparks my curiosity, but I'll keep it simple. I could use ammo as a counter and flags to store the card values. Thanks a lot!
Re: Super ZZT Land
If you can manage to keep an iteration of random number generation under 32 commands, you can hide the value from the player (as this is the maximum number of commands that can be run by the OOP interpreter per cycle).
This is one command when it fails and two when it succeeds.
Object order is important. You would want your random number generator to be the lowest possible object number, and the object that cleans up the value as the highest object number.
Code: Select all
#if blocked rndne give gems 1
Object order is important. You would want your random number generator to be the lowest possible object number, and the object that cleans up the value as the highest object number.
- bitbot
- Official Clamp School Defender
- Posts: 328
- Joined: Thu Mar 01, 2012 3:00 am
- Location: earthbound
- Contact:
Re: Super ZZT Land
I'm satisfied. What do you think of the updated crane game?Commodore wrote:digging the updated screenshot of the match game.
I appreciate the tips. No one knows ZZT quite like you.Saxxon wrote: Object order is important. You would want your random number generator to be the lowest possible object number, and the object that cleans up the value as the highest object number.
Last edited by bitbot on Sun Nov 11, 2012 4:27 am, edited 1 time in total.
Re: Super ZZT Land
did you use the webs like i did for the wire? Does it work better than I had it? That was my biggest sticking point about the engine.
*POW* *CLANK* *PING*
- bitbot
- Official Clamp School Defender
- Posts: 328
- Joined: Thu Mar 01, 2012 3:00 am
- Location: earthbound
- Contact:
Re: Super ZZT Land
Yup. This is good use of web. The update simply has tighter animation.Commodore wrote:did you use the webs like i did for the wire? Does it work better than I had it? That was my biggest sticking point about the engine.
No need for me to go heavy duty randomizing the card game. Keep It Simple Stupid.
TODO:
=====
-map engine
-battle system 2.0
-finish levels+bonus
-ending
-testing
-polish
Completion Status:
================
Graphics: 75%
Music: 99%
Level Design: 33%
Programming: 33%
Overall: 66%
- bitbot
- Official Clamp School Defender
- Posts: 328
- Joined: Thu Mar 01, 2012 3:00 am
- Location: earthbound
- Contact:
Re: Super ZZT Land
Bird's-eye view of overworld map (wip)
Commodore gets his own island:
Commodore gets his own island: