How do demo recording works?
by Manoel Neto · in Torque Game Engine · 01/19/2005 (9:21 am) · 6 replies
Hi,
I am working on a game where the character can pilot a vehicle with boost and jump capability. There will be races, and I need the opponents to jump and use boost properly. I can encode the boost and jumping setttings on the path markers, but I would like to know if I can record a "demo" and playback it on a bot. That way I could run the same track many times and record several demos, and have the opponents movement appear less mechanic.
But I never used demo recording, and I don't see much references on how it works. Can anyone help?
I am working on a game where the character can pilot a vehicle with boost and jump capability. There will be races, and I need the opponents to jump and use boost properly. I can encode the boost and jumping setttings on the path markers, but I would like to know if I can record a "demo" and playback it on a bot. That way I could run the same track many times and record several demos, and have the opponents movement appear less mechanic.
But I never used demo recording, and I don't see much references on how it works. Can anyone help?
About the author
Recent Threads
#2
Maybe I can add some code to the keybind functions to store the key values and the time elapsed since the recording began into a scriptObject, dump it to a text file, and then add code to the AiPlayers to parse the data and update the aiMove according.
01/20/2005 (9:38 am)
Ah, I see. So I need a custom solution.Maybe I can add some code to the keybind functions to store the key values and the time elapsed since the recording began into a scriptObject, dump it to a text file, and then add code to the AiPlayers to parse the data and update the aiMove according.
#3
01/20/2005 (11:11 am)
I would suggest storing the car's position, steering value, etc. once a tick as a starting point. Then find a way to play it back. That might be efficient enough of a representation that you can use it as is, or you might have to do do some optimization.
#4
01/20/2005 (11:22 am)
Well, the problem is that this ins't a car, it's a horse. The player can slap it for boost and it can jump. How do I store those actions too?
#5
01/20/2005 (11:19 pm)
Write 'em out as values into the stream. For the tick where the slap or jump happens, write a bit out as high, otherwise low. Then read back and when you get to a high bit trigger the same action that frame.
Associate Kyle Carter