Creating A Replay System In Unity

  Рет қаралды 9,217

Game Dev Guide

Game Dev Guide

Күн бұрын

Пікірлер: 30
@dreamisover9813
@dreamisover9813 Ай бұрын
it has been a while but the tutorials/topics covered here are always so high quality!
@tientam779
@tientam779 29 күн бұрын
Well said!
@captainnoyaux
@captainnoyaux Ай бұрын
Braid (Anniversary edition is gorgeous) is an incredibly sophisticated rewind system (the game is based around that) one of the best system I ever saw
@neonmarblerust
@neonmarblerust Ай бұрын
Cool stuff. Aiming for replays can be a good way to ensure the game-play-system is well handled and cleanly implemented.
@Draxi_1
@Draxi_1 Ай бұрын
I didn't really need to know how to make this kind of stuff but I enjoyed watching the video so much and it was so well put together I might add something like that to my game :D Thank you so much, amazing work.
@feyakut
@feyakut Ай бұрын
What I instantly thought of was to save less frequently and fill in some of the frames by looking at the previous and next saved frames. This may look weird in some cases, but if you save frequently enough I think it can cut the save data size and the required processing power in half.
@evilbritishguy3581
@evilbritishguy3581 Ай бұрын
What about using Animation Curves i.e. each snapshot where data changes, a new key frame is created. Once a recording has completed, you can then optimise the animation curve to only contain the key frames you need to maintain the same animation curve so playback still works.
@AnEmortalKid
@AnEmortalKid Ай бұрын
For the playback, you also have to disable/ignore user input right (just so a player can't tinker with it)? I guess maybe that's what you do when you press watch replay, the gameplaycontroller turns into 'replay mode' and a user can no longer control it.
@lounic8221
@lounic8221 Ай бұрын
Interresting choice, I would rather capture an initial state and record all inputs as event metrics as well as a used seed for randomization. Then recreate the initial state of captured scene and playback (simulate) all recorded input (events).
@gamesscow
@gamesscow Ай бұрын
to get the same behaviour every time the game engine physics would need to be deterministic though and I don't think Unities physics engine is
@libiroli
@libiroli Ай бұрын
Daaaamn!! Super complicated and useful feature made accessible to us plebs. Appreciate it!! Just to review at a high level: 1) SnapshotInfo stores specific info of each snapshottable object 2) SnapshotData stores list of all SnapshotInfos 3) ReplayContainer stores all SnapshotDatas. But why did you make this an SO? Thank you again!!! Wishlisted CoC
@romancalderon
@romancalderon Ай бұрын
I'm thinking he went with an SO as the container as a way for the serialized data to be persisted between (editor) play sessions and so it can be viewable in the inspector. It's a good way to do it too since it's all built-in to the engine.
@GameDevGuide
@GameDevGuide Ай бұрын
Yep, exactly! As I mentioned in the voiceover it's basically just dealer's choice, I like it because I can see it independently in the project so it's useful for me for debugging (and for the video) How did you wishlist it? It doesn't have a steam page yet. Are you from the future?
@libiroli
@libiroli Ай бұрын
@@GameDevGuide Thanks for the answer! Yeah I commented and then saw it has no Steam page. I will WL when it does. I've learned a lot from your videos over the years.
@Galaxy_World
@Galaxy_World Ай бұрын
insane
@AnEmortalKid
@AnEmortalKid Ай бұрын
It's probably correct in your impl, but in the video i think LoadNextSnapshot was wrong, at least from the code you show here, it basically gets stuck in a loop at snapshot zero, since you have "m_hasNextSnasphot = replayContainer.GetSnapshot(snapshotIndex)" (the same index we just loaded), i think that should be snapshotIndex+1 (peek ahead 1 snapshot)
@k0cc425
@k0cc425 Ай бұрын
you could get extra performance by not using guids for object IDs, and instead only relying on ints,; his can be easily achieved by creating a singleton which issues these IDs - it's not the biggest optimization, but can rack up some frames when you record a large number of objects
@BlueJDev
@BlueJDev Ай бұрын
I imagine this could be adjusted to add a "sands of time" function to the game for users to correct their mistakes?
@trecmthw
@trecmthw 27 күн бұрын
I've been looking for something like this for the longest time. I had a solution but the algorithm to find the snapshot was too slow.
@jankrajewski6170
@jankrajewski6170 Ай бұрын
Giving that frame data for each object is a struct and mostly information are just prymitives, it realy asks for some parallelization using jobs and burst
@alexleonardkrea
@alexleonardkrea Ай бұрын
Very cool!
@LoneLuminaryDev
@LoneLuminaryDev Ай бұрын
gotchu man i think i was close tho
@expired___milk
@expired___milk Ай бұрын
why would you need to record velocity and angular velocity? Shouldn't position and rotation suffice?
@GameDevGuide
@GameDevGuide Ай бұрын
We want to make sure that the physics objects continue moving correctly between frames we've captured. If we just record the position and rotation alone, it could end up with the object behaving incorrectly.
@expired___milk
@expired___milk Ай бұрын
@ So the physics kind of act as interpolation to the incomplete set of snapshots?
@twinjuke
@twinjuke Ай бұрын
@@expired___milk yes, just like you would do for multiplayer games as well
@Meowzors
@Meowzors Ай бұрын
I wonder how this would work for instantiated objects
@GameDevGuide
@GameDevGuide Ай бұрын
It's a little bit more work, but I'm actually using this for handling traffic that I instantiate at runtime. As long as you give your objects a unique id, you can use a manager to handle instantiating, and assigning the IDs in your saved replay to a fresh instance upon load.
@3xic317
@3xic317 25 күн бұрын
preparing for the influx of valorant comments
@amrsaied8696
@amrsaied8696 Ай бұрын
Someone mention riot games
11 Things You (Probably) Didn't Know You Could Do In Unity
13:49
Game Dev Guide
Рет қаралды 158 М.
Using and Customizing Unity's NEW Behavior Graph
22:47
git-amend
Рет қаралды 29 М.
Enceinte et en Bazard: Les Chroniques du Nettoyage ! 🚽✨
00:21
Two More French
Рет қаралды 42 МЛН
How Strong Is Tape?
00:24
Stokes Twins
Рет қаралды 96 МЛН
Top tips for scripting in Unity 2022 LTS | Tutorial
13:43
Introducing Clay - High Performance UI Layout in C
35:19
Nic Barker
Рет қаралды 231 М.
Optimizing my Game so it Runs on a Potato
19:02
Blargis
Рет қаралды 726 М.
The genres I recommend for new gamedevs
13:23
BiteMe Games
Рет қаралды 18 М.
When Optimisations Work, But for the Wrong Reasons
22:19
SimonDev
Рет қаралды 1,2 МЛН
No-engine 2D rendering in 600 lines of code
23:21
Randy
Рет қаралды 78 М.
AI Learns to Play Dodgeball
10:59
AI Warehouse
Рет қаралды 1,5 МЛН
No One Hires Jr Devs So I Made A Game
39:31
ThePrimeTime
Рет қаралды 371 М.
Enceinte et en Bazard: Les Chroniques du Nettoyage ! 🚽✨
00:21
Two More French
Рет қаралды 42 МЛН