Ghost car kit

Discuss scenes and videos made with Algodoo.

Ghost car kit

Postby Kilinich » Sun Dec 20, 2015 11:32 pm

Recently, I've upload phunlet, which gives you easy way to add vehicle race recording/playing functionality.

Rating: rated 5
Filesize: 5.03 kB
Comments: 9
Ratings: 1
download


As usage example, I've update some old scenes:

Rating: rated 8.6
Filesize: 0.7 MB
Comments: 27
Ratings: 21
download

Rating: rated 9
Filesize: 255.38 kB
Comments: 30
Ratings: 32
download


How it works:

You've got 4 components:

1) Ghost car box
It's a shadow copy of your vehicle. It plays pre-recorded data of position, velocity, angle and shows how previous record was set.
You could give it any shape or texture (to looks like a transparent car for example). On race start it tries to read "SceneTitle_ghost.rec" file to a property _data, and/or play existing _data records. It add two functions: scene.my.ghostStartPlay and scene.my.ghostBestTime (self-explaining).

2) Racing recorder
It's a recording device, it store pos, vel, angle of vehicle (you need to glue it to car's center). Once race start, it records every move and if after finish time was better - saves _data into "SceneTitle_ghost.rec" file. Precision of recording (and amount of data) could be adjusted via _deviation variable. Typical value for real world cars is 0.5-1m. It add functions: scene.my.ghostStartRecord and scene.my.ghostFinishRecord (self-explaining).

3 and 4) Start and FInish boxes
It's kinda buttons, to start and finish race. You could use your own, it calls scene.my.ghostStartPlay, ghostStartRecord, etc.
Just place it in empty space, or hinge somewhere so car could collide with it on start and finish. After collision it's disappear.
Dream of Algodoo as game development engine...
User avatar
Kilinich
[Best bug reporter 2010]
 
Posts: 2098
Joined: Mon Aug 31, 2009 8:27 pm
Location: South Russia

Re: Ghost car kit

Postby pnvv » Mon Dec 21, 2015 2:52 am

I couldn't get it to work.

I had the track all set up with the start and finish boxes, but the ghost car doesn't move.
Image

(/)(°,,,°)(/)
User avatar
pnvv
 
Posts: 670
Joined: Tue Aug 26, 2014 11:46 pm
Location: Disunited States of America

Re: Ghost car kit

Postby Xray » Mon Dec 21, 2015 4:44 am

kilinich -- Very good explanation! Thanks. :thumbup:
User avatar
Xray
 
Posts: 500
Joined: Sun Jun 17, 2012 6:12 am
Location: USA

Re: Ghost car kit

Postby Kilinich » Mon Dec 21, 2015 7:28 am

pnvv wrote:I couldn't get it to work.

I had the track all set up with the start and finish boxes, but the ghost car doesn't move.

Well, you must record driving at least once.
After that, if you want to add pre-recording info to scene, copy record list from .rec file in scenes folder to _data variable of ghost car geom.
Dream of Algodoo as game development engine...
User avatar
Kilinich
[Best bug reporter 2010]
 
Posts: 2098
Joined: Mon Aug 31, 2009 8:27 pm
Location: South Russia

Re: Ghost car kit

Postby pnvv » Tue Dec 22, 2015 2:26 am

Kilinich wrote:Well, you must record driving at least once.
After that, if you want to add pre-recording info to scene, copy record list from .rec file in scenes folder to _data variable of ghost car geom.

OK, I think I figured it out.

I went racing with some buggies on the dakar track and had lots of fun, and I figured out it's easier to just add a texture to the ghost car instead of cutting it out :P
Image

(/)(°,,,°)(/)
User avatar
pnvv
 
Posts: 670
Joined: Tue Aug 26, 2014 11:46 pm
Location: Disunited States of America

Re: Ghost car kit

Postby Kilinich » Tue Dec 22, 2015 10:52 am

Yea, looks great!
Dream of Algodoo as game development engine...
User avatar
Kilinich
[Best bug reporter 2010]
 
Posts: 2098
Joined: Mon Aug 31, 2009 8:27 pm
Location: South Russia


Return to Scenes

Who is online

Users browsing this forum: No registered users and 4 guests