Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
2
Question by Somian · Mar 15, 2012 at 06:58 AM · ghost

Record "ghost" in car racing game

Hi there,

I was wondering how to record a "ghost" of the player driving a vehicle.

What comes into mind is to write the translation and rotation of my car into some sort of array every tick and then, when re-playing simply moving a "ghost" type along the exact positions from the array.

Is this how it is normally done in actual video games?

Comment
Add comment · Show 3
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image tanoshimi · Oct 15, 2013 at 10:59 AM 0
Share

@Fattie - one thing you forgot to mention, and that @Somian might want to notice - is that "ghost" player replays are protected under patent owned by $$anonymous$$idway .... http://www.gamasutra.com/view/feature/1489/hard_drivin_hard_bargainin_.php

avatar image Fattie · Oct 15, 2013 at 11:07 AM 0
Share

Hi @tano, that's a fascinating legal point, thanks for the link. Note that --- say --- the idea of a "mouse" or basic "touch screen" concepts are in hot legal dispute, in certain jurisdictions. Note too that that "submarine patent" covers the general concept of doing ghost racing, it has nothing to do with the implementation of it. Under discussion here is how to implement it.

FTR on the legal front, I've worked on many large racing and car games for various entities, and everyone ignores this patent issue (much as with a "mouse" or "certain touch screen concepts" or the "gif patent issues".)

avatar image tanoshimi · Oct 15, 2013 at 11:11 AM 0
Share

You're right - I think it's very unlikely that the patent owner will bother knocking on the door of your average Unity developer making a racing game who, in all likelihood, is likely to be completely unaware that they were infringeing a patent ;) But, lack of knowledge is no defence against the law, and I think it's a little known fact so I just thought I'd bring it up here!

3 Replies

· Add your reply
  • Sort: 
avatar image
5
Best Answer

Answer by Fattie · Aug 19, 2013 at 01:17 PM

http://answers.unity3d.com/questions/327275/how-do-you-record-the-movement-of-an-object-and-th.html

"What comes into mind is to write the translation and rotation of my car into a (List) every tick and then, when re-playing simple moving a "ghost" type along the exact positions from the array."

Yes, it's that simple. That is exactly how it is done in every car game.

To get you going, just work at 10hz, that is fine for any race game. But feel free to try 50, 5, 20, or whatever you want.

"That sounds slow to me, though :X"

It's rather bizarre that you would think that! It uses what can only be described as "zero" computing power. You're only setting a few variables a few times a second. Things like "the physics engine" would, literally, use perhaps 10 MILLION TIMES more calculation power.

Again this question comes up a lot and it is very strange. So party on, and do exactly what you first thought. You were right. You simply save the position (and any other data you want - rotation, whether the door is open, etc etc.)

Comment
Add comment · Show 17 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image POLYGAMe · Nov 08, 2013 at 08:56 PM 0
Share

Haha, thanks, Fattie! I just did the math and worked out that a 2$$anonymous$$ replay that had all the variables (car and wheel rotations and positions) stored 60 times a second would only be around 500kb. And you don't even need to move the car between points, just set its transform and rotation. Hardly a memory killer. I was trying to work out how to make my game deter$$anonymous$$istic but I simply don't need to. :D This system probably wouldn't be great for REALLY long replays, but perfect for my game with shorter stages. $$anonymous$$uch easier than I thought :)

avatar image Fattie · Nov 09, 2013 at 08:51 AM 0
Share

As I said, it's an incredibly well-explored engineering question. And it's very simple, fundamentally it's only a few lines of code. Try it out and see how you go. $$anonymous$$ake it very easy to TUNE the Hz rate at which you save the data. You actually don't need to bother that often. As little as 10 can work fine. Enjoy

avatar image meat5000 ♦ · Nov 09, 2013 at 09:02 AM 0
Share

Indeed. Less points for the win. Slap in some interpolation on playback so you don't see any jumps.

avatar image Fattie · Nov 09, 2013 at 09:08 AM 0
Share

Just FWIW $$anonymous$$eat (having worked on this engineering many, many times on popular games you have often played), just purely in my experience you generally don't need any interpolation. It's worth noting that - say - something like "playing the background music" would use - literally - 10s, perhaps THOUSANDS (!) of times more computing power than this. Something like "the sound effect engine" or "the engine for drawing the score on the screen" or "handling all the buttons and controls" would use, easily, a $$anonymous$$ILLION TI$$anonymous$$ES more computing power than this. The whole thing is a non-issue: it's really strange that (I've seen on forums) people often oddly think it will be some sort of problem. Anyways - enjoy!

avatar image Fattie · Nov 09, 2013 at 10:09 AM 1
Share

dude you'd definitely just store it on parse.com - so easy

i strongly, strongly recommend fooling around with parse.com - it's amazing and incredibly simple.

(you could also use apple's game thing I think, or any other "BaaS")

Also - just from experience - i've found say 30 - 40 kb is typical for a race for one vehicle. (it's amazing what a low frame rate you can get away with.)

but most importantly - you can compress the file, if needs be! they compress down to nothing. intriguingly, this is mathematically similar to interpolating!!

Show more comments
avatar image
0

Answer by SamohtVII · Feb 21, 2019 at 05:46 AM

This may be an old thread but i have created exactly what's described and put it on the asset store

https://assetstore.unity.com/packages/tools/integration/ghost-recording-and-replay-script-138922

I have been using it for my current game and works perfectly.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by mbcampos · Sep 06, 2021 at 09:36 AM

the other way is save the players actions (power, brake, etc) + time in a array. And load with as a car player with another tag. The good point is, less data, less complexity and more realist. Will be a real car working as a recorded player action.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

14 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Why SSAO creates ghosts on non-billboard grass? 0 Answers

Running Trail Ghost Behind 2 Answers

Effects On An Entire Scene 1 Answer

Time Trial & Ghosting 1 Answer

Remove Ghost image on android 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges