AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Suggestions / Requests (https://forums.alliedmods.net/forumdisplay.php?f=12)
-   -   How to save player movement and recreate it later (https://forums.alliedmods.net/showthread.php?t=336149)

bigdaddy424 01-30-2022 18:54

How to save player movement and recreate it later
 
I was looking online for a kz plugin that records the player's movement that saves it and recreates it using a fake player, basically acting as a demo recorder. I came around a similar one to this but demos where recorded locally and uploaded on online sites which were done years ago but it's not what im looking for. Any suggestions, some place to start, or any function that i can hook up these movements is appreciated.

Natsheh 01-31-2022 05:16

Re: How to save player movement and recreate it later
 
Creating a dynamic array, and using entity think with length of 0.1 seconds seems reasonable length of time? then you copy player position, +animation, +viewangles into the array.

fysiks 01-31-2022 21:36

Re: How to save player movement and recreate it later
 
The best way to get a demo on the server side is to use an HLTV to record a demo. This is a built-in feature of the HLTV. It won't cause issues that a plugin may cause and you can play back the demo easily with just your client game.

Quote:

Originally Posted by Natsheh (Post 2770026)
Creating a dynamic array, and using entity think with length of 0.1 seconds seems reasonable length of time? then you copy player position, +animation, +viewangles into the array.

That could very likely create a massive memory usage.

bigdaddy424 02-01-2022 00:23

Re: How to save player movement and recreate it later
 
Quote:

Originally Posted by Natsheh (Post 2770026)
Creating a dynamic array, and using entity think with length of 0.1 seconds seems reasonable length of time? then you copy player position, +animation, +viewangles into the array.

I was about do this but on a server with around 20 players active during the day it would probably lag and crash like @fysiks mentioned.
Quote:

Originally Posted by fysiks (Post 2770116)
The best way to get a demo on the server side is to use an HLTV to record a demo. This is a built-in feature of the HLTV. It won't cause issues that a plugin may cause and you can play back the demo easily with just your client game.

Will I be able to read the contents of the demo without the map ending? I was thinking adding a fake player to replay what the #1 ranked player did, like many csgo kz servers have these bots and you just spectate them to see how the ended up first on the leaderboard.

Natsheh 02-01-2022 05:45

Re: How to save player movement and recreate it later
 
Quote:

Originally Posted by fysiks (Post 2770116)
The best way to get a demo on the server side is to use an HLTV to record a demo. This is a built-in feature of the HLTV. It won't cause issues that a plugin may cause and you can play back the demo easily with just your client game.



That could very likely create a massive memory usage.

Indeed it does, but you can use it carefully per player.

fysiks 02-01-2022 22:31

Re: How to save player movement and recreate it later
 
Quote:

Originally Posted by bigdaddy424 (Post 2770126)
Will I be able to read the contents of the demo without the map ending? I was thinking adding a fake player to replay what the #1 ranked player did, like many csgo kz servers have these bots and you just spectate them to see how the ended up first on the leaderboard.

No, a demo is a file that you would load into your game as if you were joining an HLTV server to watch all players play the game. You would probably need to do something like what Natsheh said to be able to play it back live.

bigdaddy424 02-02-2022 00:00

Re: How to save player movement and recreate it later
 
Quote:

Originally Posted by Natsheh (Post 2770026)
Creating a dynamic array, and using entity think with length of 0.1 seconds seems reasonable length of time? then you copy player position, +animation, +viewangles into the array.

Found this gem on github
https://github.com/MichaelKheel/ProKreedz
It records and saves all those info into a text file and uses arrays to save player pos and viewangles and all that.

JocAnis 02-02-2022 19:52

Re: How to save player movement and recreate it later
 
created long time ago
you can use this one by Kpoluk: https://kz-rush.ru/en/forum/topic/64/


All times are GMT -4. The time now is 03:16.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.