Multi-pass performance recording and replay

I’ve just finished the first iteration of the performance recording and replay mechanics in Gavit: now user actions can be captured and turned into a matinee using an external application.

Let’s say there is a fire truck which is a “machine” in Gavit. The truck has two main, controllable features: the body which can be driven around and the water cannon which can be aimed and fired. These translate to “machine components” inside the machines: each component monitors one particular input (like x360 left stick or the mouse). In this example the vehicle itself could react to the left stick while the water cannon to the right one.

And now let’s assume that I’m not very good at driving and aiming at the same time as I can only really pay attention to one thing at a time. Also, as will be the case in the short video bellow, I might have lot more entities to control than input devices and/or fingers. To work around these limitations multi-pass performance recording and replaying is used:

In each machine component one can define where the component should get the raw input data from: live input devices or matinee. Regardless of the source, the input can be recorded into a JSON file. (Recording can be disabled per component or in the parent machine.)

So the workflow for our fire truck would look like this:

- Enable live input for truck body, disable input for water cannon.
- Start the game and drive around.
- Convert the produced recording into matinee data which can be pasted back to the map.
- Link the fire truck machine to the matinee.
- Enable matinee input for the truck body, enable live control for the water cannon.
- Start the game, aim and put out fires while the truck is driving around on autopilot following the recorded route.
- Convert the recorded clip into matinee data and replace the old one.
- Enable matinee input for the cannon too.
- Move on to other things knowing that the fire truck will replay your performance from then on.

To stress test the system I set up a machine with 16 components (colored balls), each of them controlled by the left x360 stick. I started the game several times, each time controlling only one ball. When I was happy with the result then I converted the recorded performance into matinee data, put the ball on autopilot and focused on the next one.

Finding a way for the last two balls through the crowd was rather difficult. I had to restart the map a dozen times, it felt like an action puzzle game.

The recording rate is a machine property and was set to 60 Hz in this case which produced 500K/s clip files. For interpactors and kactors transformation data is also saved and converted into movement tracks in matinee.