VU Community Forums

BattleRecorder - Record and play back your matches

Description

BattleRecorder is a work-in-progress mod that allows you to record your matches and play them back at a later time. It can also be used as a way to create in-game scripted sequences (such as the extraction sequence seen in the Infection mod.

Currently, it supports recording of the following:

  • Players, their movement, and actions
  • Vehicles, their movement, and their interactions with players
  • Team and squad compositions
  • Received player damage

What’s not being recorded yet:

  • Vehicle damage
  • Map destruction
  • Player deaths
  • Players spawning in vehicles
  • Chat messages

Usage

This mod can be used in two ways: via an RCON client or by other mods.

RCON usage

This mod registers the following RCON commands:

battlerecorder.record

Starts recording the current match.

battlerecorder.stop

Stops recording the current match.

battlerecorder.save <name>

Can be called after calling stop and currently prints a serialized version of the recorded match in the server console. In the future, it will save the demo locally with the given name.

battlerecorder.replay

Replays the most recently recorded match. In the future, it will replay a match with the specified name.

API usage

You send specific VEXT events to use the BattleRecorder from your own mods. Currently only a limited set of events are supported, but they will be revamped in the future.

br:load(id: string, data: string)

By providing serialized match data in the br:load event (the same data that the battlerecorder.save RCON command prints), you can start load a recording, assigning it a specific id, that you can later play back.

br:play(id: string)

Start playing a previously loaded recording with the associated id.

br:stop(id: string)

Stop playing a previously loaded recording with the associated id.

Download

The latest version can be found here:

battlerecorder.zip (41.8 KB)

You can also find it on Github:

11 Likes

Amazing! Is the sampling rate equal to server tickrate, or less?

1 Like

It’s equal and as it stands playing back at a different tickrate than the recording won’t work (it’ll just stutter around).

1 Like

I have never thought in my life that i will see something like this in this game. Great thing! :smile:

Mod was updated with various round restart bug fixes for the playback component and a new API. The original post contains more details about the API.