In a state-based system, you replay the states by reading the frames in order and applying the saved values to your GameObjects. If the player is Object 1 and the boomerang is Object 2, the memory would look like this: So, for frame two you’d store these values: When Unity processes the next frame of gameplay, both objects move. A state is a snapshot of the properties of an entity.įor example, in a Unity game, you might want to record and replay the position of the player character and their awesome boomerang weapon.Īt frame 1, you’d record these positions: When you record with a state-based system, you capture a sequence of states. SO, what’s the difference? What is State-based Replay? While they do the same thing, each approach has its pros and cons. There are two popular types of replay systems: State-based and input-based. This won’t be a big issue anyway as you’ll update the states every frame.Ĭhoosing the Approach: State-based or Input-based Player input will still be active during the replay playback.This tutorial doesn’t cover saving and loading a sequence from the disk. The system will record the sequence in RAM.Pressing Record again will overwrite the previous sequence. The system will only capture one sequence at a time.Replay means to play back the captured sequence, in the same order, from the beginning.Record means to capture a sequence of frames rendered by the game.:] What is a Replay System?Ī replay system is an in-game system that lets the player record a gameplay sequence and replay it, just like recording a video with a phone and playing it again. The buttons update when you click them, but the system doesn’t actually record or replay anything yet. Control Birdy by using the left and right arrows and space bar to jump.Ĭlick the Start recording / Stop recording and Start replay / Stop replay buttons. Birdy is part of the Asset Store package Sprite Pack #1 – Tap and Fly by G.E. The platform sprites are from the Asset Store package Free 8-Bit Pixel Pack by Super Icon Ltd. Credits: The upbeat music is from PlayOnLoop.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |