Jump to content

A replay of the last death


Driggero

Recommended Posts

Hey guys. Recently a friend and I thought it would be a good idea to make a death replay mode, essentially showing a short replay of how you died. This would be for the Race gamemode and using a kill script I created.

My question is simply can it be done? GTA SA had a replay feature built in: http://gta.wikia.com/Replay so I can't see it as being impossible. But whether MTA has any functions that take advantage of that I don't know.

Any information you can give me on this would be appreciated :)

Link to comment

A probably way is to kept the server recording (as shooter games do) and delete all recordings every 1min.. if a player dies, then send him the replay... but still, very hard.

eg: every half a second, save player ped's pos and rot, and make a table. timer to delete the last object every 0.5 seconds. :idea: (this makes possible the recording part)

Now, the hard part comes to the graphic show, you would need to set a camera matrix in another dimension (supposing you will need to have the objects loaded) on the Player Ped, aiming to the attacker (getrotation, aim, etc) and then display it creating a ped with movement.

All this in a loop, wich will be EXTREMLY hard, but amazing if done.

Link to comment
  • Moderators

Recording client side, yes but that would mean constant rendering player locations and save them of the last 10 second.

Sample:

60 alive players.

Max 60 frames per sec.

600 = 60 x 10 sec

Data: 600 x positions, 600 x rotations, 600 x aim positions.

This data x 60.

I would say wastage of the performance, but yes it is possible.

Link to comment

Recording 60 frames per second? What the hell are you going to do with that much?

My estimates:

10 players in range

Recording at 10 FPS

12 frequently updated values for position, position velocity, rotation, rotation velocity (race gamemode)

10 players x 10 FPS x 12 values = 1200 values per second to write

1200 x 10 s = 12000 values in RAM to store

Link to comment

Thanks everyone for the replies. A good friend of mine linked me this resource: https://community.multitheftauto.com/in ... ls&id=7790 Which is everything I needed to make it for my own uses.

As CrystalMV said it records the player's pos/rot/vel and stores them in tables. (I don't know what rotation velocity is, this resource doesn't use it and it seems accurate enough). Also it stores the locations every frame, which on my team's server would mean 50 a second. I'll try it out with 10 saves a second and see how fluid the motion is.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...