Recording movement for ingame playback

Hi community is it possible to record the movement of my charector in realtime in unity?

and then play it back as a cut scene in unity in real time.

for example i wish to drive around my world interact with the world and play all the movements i created as a cut sceneis it possible?

It sure is possible, but how you’ll be able to do it depends largely on the implementation of your game (which depends on the type of game you’re implementing).

What I’ll be doing for Traces of Illumination is record the “key events” (mostly the commands the player issues, like “turn left, turn right, use power-up XY”), with time and location - and store those on the database server that the game server is connected to (so this is all handled server-side). Then, I can “reload that session” and replay it.

I’ve already done some experiments with “just setting up a staged scene” in the Unity editor, and that’s working pretty nicely (some of this can be seen in the third tutorial) - but there are also some inaccuracies which make it a little bit tricky (in a game like Traces of Illumination, that’s a problem - in other games, you might live with those inaccuracies without a problem, in still other games, inaccuracies might be completely unacceptable).

As far as I can see, inaccuracies create most trouble when you’re dealing with physics (stuff bumping around) because there, those inaccuracies might add up to an unacceptable level.

Another question is obviously, what you want to record. I’m using “commands” (with locations for “error correction”), but sometimes recording some sort of “keyframes” might also make sense. The advantage of using “commands” is that you should be able to use most of the existing game logic for replaying the “sessions”.

I have a recorder script that does this.</shameless plug>

I would honestly strongly recommend against keystroke recording except for the simplest, most predictable of games. Recording position data is easier and far more reliable (and compressible)

That recorder script looks cool. I guess for simply recording and replaying character movement, that’s probably the ideal solution.

Considering a more general use case, though: How would it handle instantiation of objects, e.g. if you shoot projectiles, cast spells (e.g. with particle effects) or the like?

I guess in most cases, some combination of recording position data and commands will probably yield the best results, even though one could consider “position change” simply one specific type of event (it makes sense to separate that from other events, though, as it usually occurs much more frequently).

Re-reading my original posting, I just noticed that I expressed myself in a way that’s probably easy to misunderstand: With “key events”, I didn’t refer to keyboard events, but “key events to the game play” - in other words, those events that matter most in respect to replaying. So, my recommendation was not to record keystrokes but thinking about what specific kinds of events make most sense to be recorded (which is much more abstract than keystrokes).

Like, if for instance you have some enemy AI that does certain things with a certain randomness (e.g. shoot at player), and others in a deterministic manner, it may make sense to just record the random based decisions while relying on the usual gameplay logic to handle the deterministic stuff.

Thanks for the reply Guys

Jashan you mentioned the third tutorial?
were is that located buddy?

and starmanta loveing the record feature script private messaged you

In this Web player, if you’re new to the camera controls, you should probably do tutorial 2 first :wink:

I used an early version of the approach mentioned in my previous posting in steps 3 (Jump), 4 (Smoke), 8 (Shoot Trace) and 9 (Bullet Time) of that tutorial 3. That early approach only uses time, I’ve now extended that to also use location.

Hi jashan love the game! great music top game play likeing it lots

but regarding tutorial links was thinking you would be directing me to a tutorial on how to implement the record features in unity.

anyway glad that I had a quick spin of your game kudos its ace dude Highly recomend it to the community

to the younger community members check out the DVD TRON

Hey StarManta,

I think I am late here, your script is not available now. Can you provide it again?

Rahuxx

I came across this post - sigh another lost script… anyhow after some research I found this brackeys tutorial that spells out how to Record Movements without recording KeyPresses. The method employed records position and rotation data. The video also covers playback and essential usage of FixedUpdate rather than Update. As usual Brackeys rocks!