How do I add in-game replay, or server-side demorec function?

There no demo support in UE4 for now, you would need to make one yourself, by recording events and replicate them

In UE4 is there the opportunity to do server-side demo-rec?

I want to be able to set up the server to record a 3-5 minute session and then play it back as a spectator. I want to be able to change the cameras as it plays back.

ie. In a car racing game, I want to be able to do a replay from different camera positions around the track like Gran Turismo or Forza.

I’m not interested in just screen capture. It is essential that I can replay the same events and move the camera.

Thanks!

no demo support in UE4 for now

So does that mean it remains a possibility or is that a definite “no, it’ll never happen”?

Yes it a possibility and very high actually considering UT community wants that for new UT

Demo Recording (Network Replay Capture) was added in 4.6. The only documentation I can find is from the release notes:

This allows you to save an “instant replay” of your gameplay! It captures your game’s network stream to a “demo” file that you can play back later or share with others. You can even use time-warping to slow down your game or fast-forward through it quickly.

Demo recording works automatically with any Unreal Engine game that is networking-enabled.

  • To start recording, use the console command DemoRec
  • To play back a previously recorded game, use the console command DemoPlay
  • Try using the slow-motion and fast-forward features! Use the console command Demo.TimeDilation .
  • For example, to play back at half speed use Demo.TimeDilation 0.5.
  • The ShooterGame sample has been updated with built-in support for browsing saved replays using the new “Demos” in-game menu. Check it out! (Note that you still have to use DemoRec to save a replay, first.)

There’s mention of bHandleDedicatedServerReplays in the GameMode doc and this question may be of use.