Page 1 of 1

Pushing the Limits :: Abstract ZF concepts and techniques

Posted: Fri Nov 23, 2007 6:00 pm
by Redsatori
Design techniques by some of our designers go above and beyond what could be expected from the simple scripting language employed by Zeta Flow. This game is immensely fun, especially when you get to play what others have created. What happens when you want to get into designing yourself, though? At the moment, these boards do not have a lot of resources available to new designers to help them design awe-inspiring levels.

With this in mind, this set of techniques is designed to help new designers create visual effects that are difficult to idealize, and even harder to implement. We will go through a step-by-step procedure to create amazing visuals in Zeta Flow.

Stopping Rotation

If you have played around in the editor, you know there is no command to actually get a piece to stop rotating. In my searches through the level database, I have found some interesting levels. They had the parts seem to stop rotating. The first of this type of level I played was by TestUser. It is called Absolute Defender. Take a look at this level if you haven't already, and you will see what I mean when I say that rotating pieces seem to stop.

We are going to recreate this effect in today's thread. It definitely won't look as good as TestUser has made his levels look, but it will give you a base to work with in order to use this technique in your levels.

First of all, we need a few pieces:

Image
Basic set of pieces for this technique.

You will notice here, that there are two sets of pieces. One set contains two orbs, and a platform. The other set contains one orb and two platforms.

The code for this example is actually quite easy, although it can take a bit of time to figure out. You will need three rotation script calls. The script call we will be focusing on here, is the RotatePart script call. Here is the syntax:

rotatePart, part #, speed, minimum angle, maximum angle, starting angle
Angles are in degrees, as opposed to radians. This makes it a bit easier to figure out the proper angles. Also, if you put in 0 for both the minimum and maximum angles, it will rotate in a circle indefinitely.

Also, you can add more platforms to each of the orbs. Just remember, in order for this to work with multiple platforms, you will need to keep the linking in the right order. The platforms attached to orb #2 are the ones that block the lanes into the core. The platforms attached to orb #3 make the lanes into the core itself.

Here's the code:

Code: Select all

rotatePart, 1, 1.5, 0, 0, 0
rotatePart, 2, -1, -90, 90, 0
rotatePart, 3, .5, 0, 0, 0
One thing to note about this code: You will have to replace the part number in the rotatePart calls with the actual part numbers of the proper orbs. Use the above picture as a guide to figuring out which part number to use.

As you can see, three script calls is all it takes to makes this actually work properly. Once you have this code in place, make your level look like this:

Image
The highlighted piece is attached to orb #2

Go ahead and test play your level to see how it looks.

Now that that is finished, let's dissect our code.

Code: Select all

rotatePart, 1, x, 0, 0, 0
rotatePart, 2, y, -90, 90, 0
rotatePart, 3, z, 0, 0, 0
I have substituted x, y, and z for the actual numbers I used in the script itself. These can vary to suit your tastes. one thing you will have to keep in mind is the relationship each of the values has.

The first script call rotates part #1 in a clockwise cirle starting at 0 degrees, and continues this way indefinitely. The same thing goes for the rotate call for part #3.

The key factor here is the second rotate call. What this call does is rotates the #2 orb from -90 degrees to 90 degrees. It starts at 0 degrees in order to keep the alignment of all the pieces. Once it hits one end of the minimum/maximum angles, it switches directions. It will continue to do this indefinitely.

The relationship between x, y, and z is what really makes this do exactly what we want it to do. If you notice, in the example above, x= 1.5, y= -1, and z= .5. The relationship from a mathematical standpoint is as follows:

abs(x) - abs(y) = abs(z)
abs(1.5) - abs(-1) = abs(.5)


This is because we want the contributing factor to be the removal of unwanted rotation from the level itself. If the value of z equals the value of x - y, then we are on the right path. To see just how effective this is, go ahead and input some numbers of your choosing. You can use numbers that don't add up properly to see the effect it has on making the level work properly.

A few values to try so you can see how it works:

x=2, y=-1, z=1 This example fits the criteria to remove rotational motion.
x=3, y=-1, z =1 This example does not fir the criteria to remove rotational motion.

One last thing to note before I leave you for today. The y value needs to be the opposite sign of the x and z values. This allows it to rotate against the flow of the rotation. If you want it all to be rotating slower, simply lower the values while keeping them consistent. If you want the blocking portion to move slower, lower its speed value while increasing the z value or lowering the x value to keep things in order.

Most importantly, play around with this and have fun with it. Experiment with it. Figure our new and interesting applications for it.

Edit: You can view a working model of this effecthere.

Posted: Tue Dec 11, 2007 9:26 am
by Mouzi
Yay, I finally got it working :P

It's an addition to the whole rotation pausing trick; setting the length of the pause!

See here.
The one on the top rotates most often, next comes the one on the left and so on.

You can easily determine how often it should rotate,
the rotation speed and in which angles it should stop.
Also the speed or the angles are not affected by the pause length.



Or did someone already know how to do this? :D
I didn't.

Posted: Wed Dec 12, 2007 6:44 pm
by swartzer
Ok, how did you do that? I can't figure it out. (Of course, I haven't had much time to mess around with ZetaFlow lately.)

Posted: Thu Dec 13, 2007 7:36 am
by Mouzi
Here is the code for the slowest part in the example:
  • rotatePart, 1, 1, 0, 0, 0
    rotatePart, 2, 9, 0, 0, 0
    rotatePart, 2, -10, 0, 330, 0
Determines the pause length.
Higher number, shorter pause and vice versa.

Rotation speed.
Will get doubled because of the trick, so for example if you want speed to be 5 it has to be set as -2.5

Must be speed / 2 - pause length.
In this example it is
20 / 2 - 1 = 9

The angle to stop at.
The speed affects this one because it goes one frame over the determined angle.


And the explanation?
Well starting from the beginning:
Part 1 starts rotating at speed 1 which also rotates part 2 at speed 1 because it's connected.
Part 2 speed is added by 9 on the second line which makes the total speed 10.
Then, on the third line, part 2 speed is reduced by 10 which makes it stop, so at the beginning of the level the part 2
seems to be stopped, but because the zero angle is determined by the parent part
(which is part 1 in this case) its angle is actually changing.
On the line three we also stated that when part 2 would reach angle
330 the rotation determined by this line changes it's direction,
which means that the part 2 will go at speed 20.
And eventually it will reach the angle 330 because of part 1.

I am not sure if it really goes this way, but this is how I see it :D
Correct me if I'm wrong. (I have a feeling that I may be a bit.)


(Here are the other parts from the example)

Code: Select all

rotatePart,4,2,0,0,0
rotatePart,5,8,0,0,0
rotatePart,5,-10,0,320,0

rotatePart,7,3,0,0,0
rotatePart,8,7,0,0,0
rotatePart,8,-10,0,300,0

rotatePart,10,4,0,0,0
rotatePart,11,6,0,0,0
rotatePart,11,-10,0,280,0

Some cool uses for this would be for example a survival level where you have to survive for something like 1-2 minutes and then the level would change. Or then I had an idea about a level with maybe 3 different ships where only one of them is visible and then the visible one would change with certain interval :P

Both good ideas IMO and I know how to make them, but I don't have the imagination to create the ships or the survival thing :/
As I've already said I suck on the creative and gameplay side of making levels.

Posted: Thu Dec 13, 2007 7:58 am
by Geiss
Impressive work, Mouzi. I don't think I'd have ever figured that out on my own.

Posted: Thu Dec 13, 2007 4:13 pm
by swartzer
That makes sense. I will need to do it myself in the editor before I'll fully grasp it, I think.

As for a survival level, didn't you do that "you have one minute" level? You could just do something like that, and at the end of the time period, rotate some new parts in from offscreen.

BTW, I have never managed to beat that level; firing nonstop at the clock has no effect before time runs out. Is there a trick I'm missing?

Posted: Thu Dec 13, 2007 8:38 pm
by Mouzi
No that one minute level is just opposite of surviving.
It was basically just an art level. It shouldn't be beatable.

Posted: Thu Dec 13, 2007 9:07 pm
by Geiss
You can almost survive by circling around the clock once the laser goes off but you run out of space at noon, lol.

Posted: Sat Dec 15, 2007 3:28 pm
by Geiss
I played a really lame level with a ton ship following lasers mounted in the center of the boss earlier today. I almost survived to make a second loop around it but one of the lasers is offset just enough that I can't make it. >:(

Posted: Sat Dec 15, 2007 5:39 pm
by swartzer
If you're talking about "Thing", I managed to beat it after five or six tries. That one offset laser doesn't always kill you. That's still a lame level because it's more luck than skill, though, and I rated it only one star.

Posted: Sat Dec 15, 2007 5:42 pm
by Geiss
Bravo, Swatzer, I knew it could be done.

My keys aren't as responsive as I would like sometimes otherwise I think I could done it too.

Posted: Tue Jan 22, 2008 5:45 pm
by Sasadad
Mouzi wrote:Here is the code for the slowest part in the example:
  • rotatePart, 1, 1, 0, 0, 0
    rotatePart, 2, 9, 0, 0, 0
    rotatePart, 2, -10, 0, 330, 0
Great work, Mouzi! Thanks for the link to this topic, BTW. I made a level, here, using that kind of code. Oddly, instead of just stopping, mine rotates slowly backwards then whips forwards again. Maybe I didn't get something about your explanation... :?: