Hello, all!
I’m MaximussDev, I created–just kidding, you don’t care. Let’s talk about the module itself.
Before reading, do note that, while ReplayService is completely stable, it’s still in a beta build.
So, What’s ReplayService?
ReplayService is an efficient, optimized, and simple module, made with developers in mind. The API, while constantly expanding, is easy to understand, and quick to implement. Just hit record on the camera, and smile. Kidding, don’t do that. But do start recording with the Module.
It’s as simple as:
ReplayService:StartRecording(int framerate)
*Please note that, using the framerate cap method will only currently save one replay at a time. I’d strongly recommend use of the better method, described below.
What’d you say? Oh, you don’t want a framerate? No problem.
ReplayService:StartRecordingUntilStopped(string key)
Just remember the key. You’re going to need it later, to stop the recording. Don’t know how?
ReplayService:StopRecording(string key)
That’s great and all, but how do I actually…watch the replay? Well, you render it. How?
ReplayService:RenderReplay(key)
It’s that simple. Do note, if you don’t include a key, it’ll default to the same key as the StartRecording() method does. So yeah, do that at your own risk.
But what’s compatibility work?
You’re full of questions. But my job is to answer them, I guess. Here’s a video!
At the time of release, only character animations work, and only with core states. I’m looking to implement support for any object–parts, models, etc. I also plan to work on a WorldReplayService modification that, as it sounds, will replay the entire world. This is still in the planning stage though, so don’t expect it within a few weeks.
That’s Great, But Exactly How Simple is the API?
It’s really simple. Let’s go over it!
Functions
BeginRecording(int length)
Records for a specified length, in frames, under the default key. Note that the module runs at 60 frames per second.
BeginRecordingUntilStopped(string key)
Records until the EndRecording(string key) function is called, under the specified key.
EndRecording(string key)
Ends the recording for the specified key.
RenderReplay(string key)
Renders the replay which was recorded using the sent key. If no key is specified, it assumes the default key is being used.
CheckReplayValidation(string key)
Checks if the specified key is valid. It will return two things–a boolean telling you if the key is valid, and if said boolean is false, a string will also be returned, detailing the reason behind the false boolean.
PlayAnimationOnRig(string animationName, object rig, boolean yields)
Plays an animation, which must be specified in the module’s animationIds table, on the rig, using the specified animationName string. If yields is true, the function will yield all code until the animation is finished, This, by default, is false.
StopAnimationsOnRig(object rig)
Stops all animations that are currently playing on the specified rig.
CheckIfAnimationIsPlayingByName(object rig, string animationName)
Checks if the specified rig is currently playing the animation, specified by animationName. Again, this must be in the module’s animationIds table.
ClearReplayKeyframesByKey(string key)
Clears all saved ReplayKeyframes for the specified key.
DisplayReplayKeyframeData(string key)
Displays all keyframe data. If this is in Studio, it will simply print the table. If it’s in game, it will display every single keyframe for the key, which WILL fill up the developer log. I’d recommend only running this in studio if you’re using this for a full game, to reserve the ability to diagnose errors without tons of scrolling (at least, in live servers).
ClearReplayKeyframes()
Clears all saved ReplayKeyframes for all keys.
Clean(string key)
Cleans up all keyframe parts in the Workspace, for the specified key. Note that this already happens by default, at the end of the Render function. I’d recommend using this only for cleaning a replay before it ends.
CleanAll()
Cleans up all keyframe parts in the Workspace. Note that each key is already cleared at the end of their rendering.
GetReplayKeyframesInTableForm(string key)
Returns a dictionary of keyframes for the specified key.
GetAllReplayKeyframesInTableForm()
Returns a dictionary of keyframes for all keys being used.
GetBuild()
Returns the build of the module. You shouldn’t need to access this unless you’re modifying it, but feel free.
That’s basically all of the functions for the ReplayService API (on release). I plan on having functions like:
- skip to a certain position in a replay
- pause/resume a replay
- save setting configurations to a file.
How Can I Install ReplayService Into My Game?
It’s so easy. Like, beyond easy. You can download the plugin here (refrain from downloading, please use the Uncopylocked place and take the module out of ReplicatedStorage, for now), and it will automatically install ReplayService’s most recent build into your game. After you install, it will warn you in Studio every time it detects a new update. Don’t worry, it won’t spam you. It only warns you once per launch of studio.
*Do note, you should probably go through the Settings after installing. It’s in the module which will install (it’ll install itself in ReplicatedStorage). You can change where the dummy directory is, which is the dummy that will clone, and load the appearance of the player who was being recorded. Also note that this can only run on the client at the moment, but I am working on a Server Sided update.
Want a demo? Check that out here. The place is uncopylocked.
*excuse the messy code, made it in a few minutes to showcase the module
Thanks everyone for reading, and please leave feedback–it’d mean more than you know. Enjoy ReplayService!
Please note that using ReplayService requires you to credit Maximuss Technologies, or MaximussDev, for the project. Thanks for the understanding!
Also note that, if you modify ReplayService, feel free to message me here, or on Twitter (MaximussDev), with a link to your modified script, and I’ll add you to a list of officially-endorsed modifications, so you’re recognized as a secure source!
Officially Endorsed Modifications
None have been created…yet. Your modification could be the first!