Be a Supporter!

As:dynamic Fps

  • 6,249 Views
  • 40 Replies
New Topic Respond to this Topic
Paranoia
Paranoia
  • Member since: Apr. 22, 2005
  • Offline.
Forum Stats
Member
Level 35
Game Developer
Response to As:dynamic Fps 2006-09-05 12:50:32 Reply

Erm... was that guy who got deleted anyone memorable? And if so, what did he do?


BBS Signature
Depredation
Depredation
  • Member since: Sep. 5, 2005
  • Offline.
Forum Stats
Member
Level 17
Game Developer
Response to As:dynamic Fps 2006-09-05 12:53:50 Reply

At 9/5/06 12:50 PM, _Paranoia_ wrote: Erm... was that guy who got deleted anyone memorable? And if so, what did he do?

Me?

At 9/5/06 12:20 PM, -dELta- wrote: sshhhh, i got coursework to do :p once there is a deadline, ill be sure to fit it in, till then, i wont be able to properly concentrate on it

Sorry :(. Lets say the deadline is on the 15th of Sep. Will that give you enough time to your coarsework and the part? If not, tell me and i'll change the date :D.


BBS Signature
Paranoia
Paranoia
  • Member since: Apr. 22, 2005
  • Offline.
Forum Stats
Member
Level 35
Game Developer
Response to As:dynamic Fps 2006-09-05 12:57:41 Reply

At 9/5/06 12:53 PM, Depredation wrote:
At 9/5/06 12:50 PM, _Paranoia_ wrote: Erm... was that guy who got deleted anyone memorable? And if so, what did he do?
Me?

Noo, the one further up the thread. I didn't see any posts here flagged as deleted before, so I assume it's recent...


BBS Signature
Depredation
Depredation
  • Member since: Sep. 5, 2005
  • Offline.
Forum Stats
Member
Level 17
Game Developer
Response to As:dynamic Fps 2006-09-05 14:50:06 Reply

At 9/5/06 12:57 PM, _Paranoia_ wrote: Noo, the one further up the thread. I didn't see any posts here flagged as deleted before, so I assume it's recent...

Lol, sorry about that. I can't remember who he was now, :(.


BBS Signature
Hoeloe
Hoeloe
  • Member since: Apr. 29, 2004
  • Offline.
Forum Stats
Member
Level 37
Game Developer
Response to As:dynamic Fps 2007-03-14 17:22:09 Reply

Ok, i have a decent knowledge of AS and i can't see how this fits into the timeline :S

Suppose i wanted some script to, say, slow down everything? how would i do that?


Song of the Firefly is on Steam Greenlight and Kickstarter. Give them a look and support the project!
------------------------------

BBS Signature
dELtaluca
dELtaluca
  • Member since: Apr. 16, 2004
  • Offline.
Forum Stats
Member
Level 20
Blank Slate
Response to As:dynamic Fps 2007-03-14 18:08:40 Reply

At 3/14/07 05:22 PM, Hoeloe wrote: Suppose i wanted some script to, say, slow down everything? how would i do that?

that was discussed earlier, to just generally apply it to everything, you would just iterate through all the hierarchy:

rather than. movieclip.nextFrame();

you would have:

var stack:Array = new Array(_root);
while (stack.length != 0) {
var m:MovieClip = stack[0];
for (var it in m) {
if (m[it] instanceof MovieClip && m[it] != _root) {
stack.push(m[it]);
}
}
m.nextFrame();
stack.shift();
}

---------------------------------------------
------------
---------------------------------------------
------------
---------------------------------------------
------------
---------------------------------------------
------------

Alternatively i recently thought of a new method of dynamic fps control, note that like the previous method, sound is still not possible.

Basicly rather than using an Interval which is still prone to lag, you base everything off of time, even if it runs super slowly, things will still appear to respond as they should be.

the basic principle is this:

var pt:Number = getTimer();
var cframe:Number = 1;
function onEnterFrame():Void {
var fjump:Number = (getTimer()-pt)*0.001*fps;
if (fjump>=1) {
pt = getTimer();
cframe += int(fjump);
if(cframe>_totalframes) cframe -= _totalframes;
gotoAndStop(cframe);
}
}

even if there is lag occuring, the animation will still run as fast as it should be, even if it means that it is occasionaly skipping frames altogether!

if you adjust it to allow for negative values aswell, you can even have things running in reverse:

(taking from Dad's Home, great movie, love it, got to use it :p hope he don't mind)

http://denvish.net/ulf/140307/79674_fpslol.ph p

its 300kb roughly


using ShamelessPlug; NapePhysicsEngine.advertise();

BBS Signature
Hoeloe
Hoeloe
  • Member since: Apr. 29, 2004
  • Offline.
Forum Stats
Member
Level 37
Game Developer
Response to As:dynamic Fps 2007-04-21 11:31:56 Reply

i still don't get this.....

i want to make a pause menu by setting the FPS of every object to 0

how would i go about doing that? these just don't seem to work...


Song of the Firefly is on Steam Greenlight and Kickstarter. Give them a look and support the project!
------------------------------

BBS Signature
GustTheASGuy
GustTheASGuy
  • Member since: Nov. 2, 2005
  • Offline.
Forum Stats
Member
Level 08
Blank Slate
Response to As:dynamic Fps 2007-04-21 12:26:58 Reply

It's complicated if you don't use a centralized time loop, k?


BBS Signature
Hoeloe
Hoeloe
  • Member since: Apr. 29, 2004
  • Offline.
Forum Stats
Member
Level 37
Game Developer
Response to As:dynamic Fps 2007-04-22 05:44:12 Reply

Doesn't matter how complicated it is, i must know how to do it!

or what you get is this:

Crash Bandicoot without a pause menu


Song of the Firefly is on Steam Greenlight and Kickstarter. Give them a look and support the project!
------------------------------

BBS Signature
benjadaninja
benjadaninja
  • Member since: Sep. 16, 2005
  • Offline.
Forum Stats
Member
Level 18
Animator
Response to As:dynamic Fps 2007-09-29 19:55:37 Reply

This will be perfect for slow motion power-ups, thanks alot!

sandypaw
sandypaw
  • Member since: Jun. 28, 2007
  • Offline.
Forum Stats
Member
Level 10
Blank Slate
Response to As:dynamic Fps 2007-09-29 21:41:17 Reply

At 9/29/07 07:55 PM, benjadaninja wrote: This will be perfect for slow motion power-ups, thanks alot!

Nice bump! Very important!


=3