Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Code Snippets / Prince of Persia Rewind Time effect

Author
Message
Blanked
20
Years of Service
User Offline
Joined: 27th Mar 2004
Location: UK
Posted: 23rd Apr 2004 01:43 Edited at: 23rd Apr 2004 02:01
HEre's a code snippet that allows you to rewind time like in PoP.

Yeah i no its a lot but thats just for 60 seconds---> Dim Time(3600,3600,1)



M00NSHiNE
20
Years of Service
User Offline
Joined: 4th Aug 2003
Location: England, UK
Posted: 23rd Apr 2004 16:43
Wow, that array must take up a lot of memory

Peter H
20
Years of Service
User Offline
Joined: 20th Feb 2004
Location: Witness Protection Program
Posted: 23rd Apr 2004 19:15 Edited at: 23rd Apr 2004 19:15
so this just stores the position and angle of ONE object for 60 seconds....try to do this in a real game and you'll get a big headache


Formerly known as "DarkWing Duck"
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 23rd Apr 2004 19:31
To be a little constructive...it's a good start. You could take it further...

Record only changes in speed/direction, and time it ocurred. This has 3 advantages...

1. Less memory usage
2. Less CPU time writing to the arrays
3. Less processor hogging when replaying.

The code would be more complex, but I'm sure this could be wrapped up in a function that could poll multiple objects, and become a very useful routine.

BatVink
http://facepaint.me.uk/catalog/default.php AMD 3000+ Barton, 512Mb Ram, 120 Gig Drive space, GeForce 5200 FX 128 Mb, Asus A7N8X Mobo.
Terms & Conditions apply
Blanked
20
Years of Service
User Offline
Joined: 27th Mar 2004
Location: UK
Posted: 23rd Apr 2004 20:03
Yeah i might start developing something like that
I was inspired by that Acoders competition on time.

anyways here's a version that records 5 objects at one time and uses less memory



Peter H
20
Years of Service
User Offline
Joined: 20th Feb 2004
Location: Witness Protection Program
Posted: 23rd Apr 2004 20:05
Quote: "I was inspired by that Acoders competition on time."

ah. ha! i thought so...i'm entering into that comp are you?


Formerly known as "DarkWing Duck"
Blanked
20
Years of Service
User Offline
Joined: 27th Mar 2004
Location: UK
Posted: 23rd Apr 2004 20:07
Maybe, i'm not quite sure what kind of game to make so i'll keep it at the back of my mind somewhere.

Login to post a reply

Server time is: 2024-05-13 19:54:54
Your offset time is: 2024-05-13 19:54:54