The Daily Click ::. Downloads ::. Miscellaneous ::. Raycaster collision fix test
 

Raycaster collision fix test
Author: Disthron Submitted: 18th October, 2010 Favourites:0
Genre: Miscellaneous Downloads: 85
Rated:


Edited By Disthron on 10/19/2010

Hi everyone,

I've been having trouble with the Clear Sky ray casting example in that on slower PCs the collision detection was very poor. And if I tried to do my multi-layered extension trick it escalated the problem even more. On my slowest machine there was no collisions detected at all!

So I've been fiddling around with it trying different things trying to fix the wall bug.

Anyway, this is just a very rough test that I'd like people to try out. I'm particularly interested to here from people who were getting the wall bug frequently. To see if they are still getting it, or at least less frequently.

Anyway, in this demo use the directional keys and the space bar. Thanks.

Review This Download



 


http://www.filefront.com/17404968/Colision-Fix-Test.zip (4.73 mkb )



Posted by UrbanMonk 19th October, 2010

I tested it.

Didn't get the bug.

But it did move jittery.
 
Posted by Disthron 19th October, 2010

UrbanMonk, thanks for letting me know. the reason for the jitteryness is because I replaced the movement with a standard race car movement. I'm still working on it, playing around with different movements to get a smoother result.
 
Posted by UrbanMonk 19th October, 2010

Not a good idea.

It'd be better just to fix the old movement.

Since all the walls are either horizontal or vertical sliding collisions with a 360 engine should be easy.

record the x and y position into variables before you update the position.

After the position is updated check for collisions around the player.

If the player is colliding on the horizontal axis restore the originally recorded X Position.

Then do the same for the Y.

Voila!


I don't know how the original example's code worked, but if the collisions stopped working on older computers it could be because the movement was timer based. This could cause the player to move farther every loop with a lower framerate and miss the collision point completely.

The Built-in movements are notorious for this. Avoid them when you can.
 
Posted by Disthron 22nd October, 2010

@UrbanMonk

I've tried but I don't really understand how the old collision system worked. I've tried to figure it out, it used a fast loop and it tried to push the player out of the wall when it was overlapping the wall, or at least I think it did. But it doesn't actually use a movement. It's all worked out with numbers so there is no "speed" and you can't "stop" it. or at least I haven't figured a way to.

Also, it's not that the machenes are old, they are just slow. The slowest one being a net book I bought early this year. It worked fine most of the time on my machine, and some of the time on my more powerful laptop and not at all on the net book.

This example works on the net book, albeit very slowly.

Do you think it might help if I posted the example minus the ray casting extension?
 
Posted by Disthron 28th October, 2010

@UrbanMonk

Hi, I tryed the 360 movement object and so fare it's working really well. Thanks for suggesting it.
 

 



Author

Favourite



Advertisement

Worth A Click