The Daily Click ::. Forums ::. Klik Coding Help ::. Slow motion effect using frame rate
 

Post Reply  Post Oekaki 
 

Posted By Message

Sheexy



Registered
  02/04/2003
Points
  332
7th August, 2007 at 00:42:53 -

I kinda want to implement a slow motion ability into a platformer I'm working on, but I really, really don't want to have to rewrite all of my code to get it up and running.

So I pose the question: "Would changing the frame rate in order to get a slow motion effect be a bad idea."

I've been messing around with it a bit and it seems to be working and looking ok.., I'm not committing to it until I get some answers about if it would cause problems or anything.
I figure I can throw together a nice thing that slows it down gradually when you press a button, press the button again and it gradually speeds up yada-yada, and work in a meter so you can't just abuse the power, but that's getting ahead of myself I guess.

So right now the system is basically just:

Button is held down : Set Frame Rate to some low number like 10 or something
Button not held down: Set Frame Rate to like 50 or so

The "Button not held down: Set Frame Rate to 50" is really bugging me, because I don't know how good of an idea that is. Seems like it could cause some awesome problems if the frame rate ever needed to drop itself. I dunno that the game would be straining any computers that hard though, so I dunno.

So anyone know anything about if this would be a stupid answer to slow motion, or a better way to abuse the frame rate into a slow motion effect?


 
n/a

AndyUK

Mascot Maniac

Registered
  01/08/2002
Points
  14586

Game of the Week WinnerSecond GOTW AwardHas Donated, Thank You!VIP Member
7th August, 2007 at 20:13:35 -

Well losing frames seems like a bad way to do it to me.

Why not just make the game pause rapidly?
there might be an extension that can pause the game without bringing up that window message.

 
.

DaVince

This fool just HAD to have a custom rating

Registered
  04/09/2004
Points
  7998

Game of the Week WinnerClickzine StaffHas Donated, Thank You!Cardboard BoxDos Rules!
7th August, 2007 at 20:26:55 -

Recoding parts is the best way, probably: increase all your current physics and animation speed expressions times 10, have a variable called "speed" which is at 10 or something and make the other expressions divide by that, then change this variable whenever to speed up/slow down things.

Of course, this would require you to rewrite/change pretty big parts of your code. But the end result will be a smooth, smooth time changing engine.

 
Old member (~2004-2007).

Sheexy



Registered
  02/04/2003
Points
  332
7th August, 2007 at 20:36:08 -

DaVince: Yeah, that would be the best way to do it for sure, I'm just too lazy to go back and edit it all, haha.

Andy: That pause thing is a really good idea, I didn't even think of that, it would be perfect! I can just use Dine's pause effect that uses a subapp. Brilliant idea!

Thanks for the input you two.

 
n/a

Silveraura

God's God

Registered
  08/08/2002
Points
  6747

Game of the Week WinnerKlikCast StarAlien In Training!VIP Member360 OwnerWii OwnerSonic SpeedThe Cake is a LieComputerChristmas Tree!
I am an April Fool
7th August, 2007 at 20:42:52 -

Another way you could add to the effect, motion blurring (but not over doing it), I mean I can't really explain how it might help, but the way I picture in my head, I just have a feeling it would.

 
http://www.facebook.com/truediamondgame

Sheexy



Registered
  02/04/2003
Points
  332
7th August, 2007 at 21:07:11 -

Good idea Brandon, motion blurring is definitely needed for slow motion action.


Dang, pausing the game for slow motion ALMOST works perfect, the only problem is that since the game is paused it can't catch onto what you're trying to do unless you hit the button at just the right time.
With the framerate slowed the game catches onto what you do a lot faster which is key here.

Dang, that pause idea was so good too.


Guess I'm just gonna have to go back to messing around with framerates, because there is no way I'm retouching all my code.



EDIT////

Nevermind, should have messed around with it more.

Andy, you're awesome! Pause idea is so great. This works so sweet, thanks man!

Image Edited by the Author.

 
n/a
   

Post Reply



 



Advertisement

Worth A Click