Help - Search - Members - Calendar
Full Version: Replay
Game Maker Community > Games > Game Maker Creations > Tools & Applications
J-Factor


Name: Replay
Category: Engine/Example
Size: ~8kb
Version: GM6.gif (Registered)
Download Link: Replay v0.1

What:

Many arcade games include an "attract mode" featuring a recorded demo of gameplay. Replay demonstrates easy and efficient replay/demo recording and playback.

There are two files included:

1. Replay v01.gm6
2. replay.rpl

The first file is the Replay .gm6 example, the second is a replay I recorded.

Make sure you read the Game Information!

Why:
  • Add an "arcade feel" to your game.
  • Record a tutorial for your game.
  • Allow people to share replays of your game (as seen in the game "N").

How:

User input is recorded each step. To save space, the state of each key is stored in a single bit. As the game records 1 byte per step, 8 different keys can be recorded (how many games require >8 keys?).

Many games also require random numbers. GM's built-in random function cannot be seeded, which prevents its use in replays as there is no way to replicate a series of random numbers. As such, a pseudo random number generator has been included.

How big can a replay grow?:

The replays generated by this engine are extremely small.

1 Byte is recorded per step. Using a general value of 60 for FPS:

PRE
1  * 60   = 60 bytes per second;
60 * 60 = 3600 bytes per minute;
3600 * 60 = 216000 bytes per hour;

216000 / 1024 = ~210kb for a 1 hour long replay!


Although, I doubt anyone will record a replay for that long.

Credits:

Pseudo Random Number Generator - Eric Burgess aka EricDB

Thanks.
Alex
very nice! Oh i see how you've done it. Very smart indeed! Not sure if it will work on all games though.

How about FPS games which use mouse look?
J-Factor
You're right - this would not work for all game types. For that I would have to save each frame as an image, which would produce massive filesizes. I initially meant for this system to be extremely compact, allowing people to share replays easily (or perhaps make a database of replays).

However, I may make a minor update which also records the mouse's position. That would add an extra 4 bytes per step which shouldn't matter too much.
Alex
Yeah i think anything could be made using this technique. Hope to see some more versions wink1.gif
dadio
Very nice indeed. Easy to use too. Good job!
softhunterdevil
May be you make a lib for it...

I have the idea to record each step of an object
teej
cool! another Jfactor creation

it seems like everything is well coded.
the ds_queues are put to great use in the scripts
Kapser
This is seriously great engine. I got nothing else to say that good job for this extremely fine work, this could be very helpfull to many people!
masterm
hahaha the judge is here 10/10(no gliches)
J-Factor
Thanks for the encouraging comments guys. I'm glad this is up to the calibur of my previous works.

QUOTE (softhunterdevil)
May be you make a lib for it...


I haven't dabbled with Lib Maker before and I might not for some time. Although, I welcome anyone else to take a shot at it!
Bowex
yay.... someone already made this before, but far far in the past....and this one is much better =)
Nice engine !
lalle_calle
the only problem is that you have limit the numbers of keys with can esely be changed but still
very nice 7 of 10
J-Factor
QUOTE (lalle_calle @ May 16 2006, 03:32 AM)
the only problem is that you have limit the numbers of keys with can esely be changed
*


Actually, the number of keys allowed by the system has to be a constant value. I choose 8 because it is the smallest value (1 byte) and should accommodate most games. How many games use more than 8 keys?

Besides, with enough technical know-how someone could easily modify the number of bytes saved to increase the number of keys (e.g. 2 bytes = 16 keys).

Thanks.
gamereality
It doesn't work. After a number of errors such as 'cannot read binary file', 'cannot read byte' and the last recurring error 'Division by zero', I had to abort it. Also, when you save your recorded RPL file, and try to load it, it doesn't appear. You have to type in the filename.
gmuser
I had that problem to. it doesnt save the files with an .rpl extension.
Cerafem
don't write me off as a noob, (b/c im not) but how do you change how many bytes it writes to?

I could figure it out myself (im a good learner), but i dont usually have the time.
Big J
WOW! This replay engine is awesome!

10/10.

Here, try this for automatically adding the file extension:

CODE
var nm, ext;

ext = ".rpl";

nm = get_save_filename("Replays *"+ext+"|*"+ext+";","");

if (nm != "")
  if (!string_pos(ext,nm)){
  nm += ext;
}

if (file_exists(nm)){
  if (show_question("Replay File Already Exists. Overwrite?")){
      rp_save(nm);
  }
}else{
  if (nm != ""){
      rp_save(nm);
  }else{
  show_message("You cancelled. Replay not saved.");
  exit;
  }
}

if (!file_exists(nm)){
  show_message("Unable to save... location is read-only or disk is full.");
}
Nonsense_Productions
i was thinking of making something exactly like this. Well you beat me to it
Mice
No!!
I just got ahold of J-Factor's transition engine, and it's simply beautiful, but it seems his site is down and I can't download this! Could someone send me a working link?
Soup42
The link is down! sad.gif
Orc Leader
The last post was Feb 4 2007, 11:31 PM, besides the two you guys made.
Aertcz
The one time I find something useful, the link is down sad.gif
Seems very good as I have long sought a replay engine. If it does what its supposed to do, as you state, Much props given.

210kb for an hour long smile.gif
Better than trying to make a video for an attract mode which can be up to 5MB per video.
Mice
QUOTE (Orc Leader @ Oct 10 2007, 07:00 PM)
The last post was Feb 4 2007, 11:31 PM, besides the two you guys made.
*

yes, i know that, but i was wondering if someone still had it so i could get it somehow, ill pm j-factor (if he's still active on the forums)
Orc Leader
QUOTE (Mice @ Oct 11 2007, 12:48 AM)
QUOTE (Orc Leader @ Oct 10 2007, 07:00 PM)
The last post was Feb 4 2007, 11:31 PM, besides the two you guys made.
*

yes, i know that, but i was wondering if someone still had it so i could get it somehow, ill pm j-factor (if he's still active on the forums)
*



"Last Active 25th August 2007 - 04:10 AM"
CJizzle01
NOOOO!!!! THE LINK IS DOWN!!!!!
Kuchiki
Please upload if anyone still has this, I'm quite interested in this. Does it also work if your game involves random numbers?
Mice
i believe it does, but it uses a different system to generate them
buribalazs
I need this too! I want to make a tutorial for my game. Does anyone know if the author is still hanging around? I am going to start and make my own version while he returns smile.gif

It shouldn't be too hard.
I think you can use the built in random number generator now (in gm7)
there's a command: random_set_seed() if you set this to an exact value, tha game runs the same every time even with generating random numbers. sooo. If you open a file, store the seed, than the bytes he describes...it should work exactly the same all the time. Please PM if you have this!
Mice
yes, pm me too. this would be beyond amazing
Kairos
J-Factor seems to have disappeared recently. Anyway,

Mirror:

http://www.willhostforfood.com/files/79869/Replay.zip
Mice
thanks!
buribalazs
This is some life saving s**t lmaosmiley.gif
hotshotscott
WOW this is amazing! Why did this ever stop??!!??

Scotty
Kairos
It never stopped, that's why he put in Creations.
True Valhalla
THANKYOU FOR THE NEW MIRROR!!

Awesome.
agustusx
anyone have a current link to this? the hostforfood link doesn't seem to work for me
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.