Box2D Forums

It is currently Sat May 25, 2013 6:42 am

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Tue Nov 29, 2011 10:18 pm 
Offline

Joined: Tue Nov 15, 2011 9:55 pm
Posts: 17
Does anyone know of a quick hack for 2.1a to fix the wheel bounce at high speeds when driving over boxes of exactly the same elevation/dimensions? I don't know how to convert the Box2D 2.2 edge code to AS3.

That edge catching bug is a big problem. It makes it so you can't have high speed vehicles. I can't use chain shapes because everything in the game is built out of boxes and triangles.

Another thought... Maybe reduce the hit area of each box side to 99.5% so it doesn't occur. Any thoughts?


Top
 Profile  
 
PostPosted: Wed Nov 30, 2011 8:32 am 
Offline

Joined: Tue Jun 24, 2008 8:25 pm
Posts: 1517
Location: Tokyo
Unfortunately that's more than just a quick hack...
If the boxes are part of a larger (tiled?) terrain then maybe you could give them extra edges so that they slope more gradually upwards... this is gonna need a picture:
Attachment:
bevel.png
bevel.png [ 10.85 KiB | Viewed 1832 times ]

Although that wouldn't be so quick, I believe it fulfills the 'hack' requirement :)
But I'm guessing that if you could mess around with your shapes this easily, then you would be using larger ones instead of many small boxes in the first place?


Top
 Profile  
 
PostPosted: Wed Nov 30, 2011 4:14 pm 
Offline

Joined: Tue Nov 15, 2011 9:55 pm
Posts: 17
Ohhh, genius... That should work. Good drawing, but the real implementation should only need like a 3 pixel slope and not as much length. Will test this hack and tune it in. :mrgreen:

In my tiling engine I will put this in and try it out...
Psedocode:
if (this tile has a tile to the left and right of the same elevation){
use sloped edge box shape
} else {
use normal square box shape
}

And I probably should add right sloped and left sloped boxes too for platform ends... This fix is a piece of cake if it works.


Top
 Profile  
 
PostPosted: Thu Dec 01, 2011 1:45 am 
Offline

Joined: Tue Nov 15, 2011 9:55 pm
Posts: 17
Yep, worked like a charm... Thanks man! :D

However, in order to get it to work perfectly I had to extend the ramp section sideways 95% across each block on each side, and the ramp section seems optimal at 1.5 pixels height with 95pixels in length... Talk about a shallow ramp! LoL...


Top
 Profile  
 
PostPosted: Thu Dec 01, 2011 2:23 am 
Offline

Joined: Tue Jun 24, 2008 8:25 pm
Posts: 1517
Location: Tokyo
Cool! Actually I didn't think it would work too well but this is very similar to the 'ghost' segments that b2EdgeShapes have to prevent things from catching on them, so I thought it might be worth a try.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group