PDA

View Full Version : I drew a timer. However, ....



ShadowTiger
02-11-2003, 11:20 PM
I have a puzzle room in which you have to move blocks to the block trigger in less than.. um.. a number of seconds. (I haven't counted yet.) Instead of having the player count, I just drew an interesting little timer. It's a half-arsed little contraption, but it would work, for the time being anyway. The timer consists of a a little flood of red pixels disappearing from a small container. That's all, nothing really complicated like an hourglass. It's just red pixels turning black.

And before I continue, you should know that I have a totally filled container with about 4 frames of animation set to turn into the timer so it'll actually start. This was intentioned to prevent the problem, but it doesn't seem to be working. I was hoping that it would cause the animation to start fresh from the beginning becuase the combo had changed. But it didn't. :rolleyes:

The thing is, during no test run did the timer actually start filled, like it does when I set its animation. Actually, it appears to be completely random. Once, it started halfway filled. The next test run, it was totally empty, then stopped because I had it combo cycle to an empty container. (Quite intentional, and I suppose this might work, but I haven't tested it. I assume it runs a full 40 frames, regardless of which frame it starts at. :sweat: ) So basically, the animation starts anywhere at random, therefore making the timer totally inneffecive.

It would be the equivalent if I had actual numbers counting down from 40, but when Link appears on the screen, it would start at 26. Weird.

C-Dawg
02-12-2003, 03:03 AM
It doesnt start at random. When you enter a screen, all combos, placed or not, start animating. If you trigger the "timer" to appear at some point AFTER link enters the screen (through combo animation or other source) then the timer will appear partway through it's sequence.

-C

StarFox
02-12-2003, 03:31 AM
This is why you usually want each combo in an cycle to have the same number of frames and same animation speed. For some strange reason, you can't increase the number of frames and proportionately decrease the animation speed, or vice versa. For example, if one combo has 36 frames animating at a speed of 10, you can't have another combo in the series that has 18 frames that animates at the speed of 20 (Twice as long for each frame to animate). I thought this would work, but it doesn't seem to. Does anybody have an answer to why this doesn't work? Or maybe I'm just doing it wrong.

The way around this is to let each frame have it's own seperate combo rather than make a single combo that has a long animation. This way, it'll go from combo to combo, and since each combo has only one frame, the cycle will hit each frame.

ShadowTiger
02-12-2003, 08:50 AM
Wow. Thanks for the advice everyone. So, instead of doing that, I'm going to have to get about 42 or so individual combos? :odd: Um, OK. Thanks.

And since we're already talking about this, about how many seconds would be equal to 40 frames of animation set to a speed of about 25? I have it set to about 3750 ticks, I think.

C-Dawg
02-12-2003, 09:11 AM
Originally posted by StarFox
I thought this would work, but it doesn't seem to. Does anybody have an answer to why this doesn't work? Or maybe I'm just doing it wrong.


No, you're not doing anything wrong- I had the same problem. I beleive the problem is that when something combo animates, you end up with some amount of time, probably 1 tic, inserted into the animation time per tile that you animate over. I suspect this is the stuation because, in my experience, cells set up in this way DO match- AT FIRST... and get progressively worse over time, then eventually end up wrapping around and matching for one animation set again.

I havnt played around to figure out exactly how much time this delay, but it could be worthwhile to investigate.


Originally posted by StarFox

The way around this is to let each frame have it's own seperate combo rather than make a single combo that has a long animation. This way, it'll go from combo to combo, and since each combo has only one frame, the cycle will hit each frame.

Not... exactly. You dont need a single combo per frame. First, you need to identify where the smallest combo in the cell is. In BH4s case, there might be a placeholder combo that shows before the timer starts, and this probably is the smallest piece. You need to divide the combo animation of the cell into combos each with the same AU as the combo with the smallest number of animation frames. Understanding AU to be animation speed and animation frames taken together.

-C

StarFox
02-12-2003, 09:15 PM
Hmm... didn't even think of that. But I do see a flaw. Let's say you originally have 4 combos in your cell, and that they all animate at the same speed. The first combo has 4 frames, the second has 12, the third has 14, and the fourth has 16. If you were to divide that up into 4-frame combos (since the smallest combo has 4 frames), the 14-frame combo wouldn't divide properly. You'd have 2 frames left over, throwing the animation off.

What you should look for is the greatest common factor of all the combos. In this case: 2. Each of your original combos can be divided into 2 frame combos. Go ahead and do just that: divide each of your combos into several 2-frame combos. Each combo should start at the beginning of its animation.

This is all assuming, of course, that the first combo of the cell is on the screen when you enter the room. If the first combo is a secret combo, there's no telling what frame it'll be on when you trigger it to appear. This means the first combo must be one frame, and it follows that the rest of the combos must also be one frame so the animation of each combo starts on the first (and only) frame.

In response to the delay between combos, I'll look at it when I get the chance. If I find out for sure, I'll be sure to tell you guys. ;)

C-Dawg
02-13-2003, 12:51 PM
-Posted in Error-

-C

C-Dawg
02-13-2003, 12:52 PM
Yes, you're right- it's more correct to divide the cell into combos using the GCF. But if I were in the situaton you have described, I would "fudge" my 14-tile combo to 16 and use 4, since it cuts down on my work immesurably. So yea, use the GDF, but make your cell so that the GCF corresponds to the size of the smallest necessary combo in the chain. More efficent that way :)

-C

ShadowTiger
02-13-2003, 04:01 PM
Hmm.. Thanks, everyone! I hope that I can make good use of this knowledge later.

I just have one last question, and to be honest, I'm not completely sure it was answered, though I will check again. When Link enters the room, the animation starts not on frame 1, but on frame 26 of 40, or anywhere really. So therefore, I am beginning to think that all animation frames are constantly cycling. Why else would it start there? It's not really an error on my part, unless there's some kind of bizarre mistake that causes total randomness. :weirdo: :goofy: It's just that instead of starting on frame 1, it starts totally randomly at any of the 40 frames. That's why I wanted to make sure that it would start fresh by using a combo cycled timer to start from a blank full, to start the timer, so it would HAVE to start at frame 1. But it doesn't even do that! :eek: It's just weird, is all.