Erratic collisions

Blitz3D Forums/Blitz3D Beginners Area/Erratic collisions

Hujiklo(Posted 2004) [#1]
I have my collisons rigged up in my FPS test map and for the most part they work great.
I'm only having major problems with the regards the player colliding with enemies. The zombie enemies are simply copies of an anim mesh kept in a Type - so far only 6 are present.
Now the zombies collide with the map and themselves great. They collide and slide when they hit the player which is also great..However, the player only collides with the zombies on and off at a whim. If the zombies are walking towards me then I can pretty much all of the time just walk straight through them like they are not there. If they are standing around then collisions tend to work better and if they are crouching they work better still! I've tried ellipsoid to ellipsoid, ellipsoid to box, ellipsoid to polygon - I've tried making the zombe radius's huge so I'm not supposed to even be able to get near them but I'm getting the same on and off results.

I cannot figure for the life of me why collisions are work so swell everywhere else except when it comes to checking the player with the zombies.

Can anybody please shed any light on my problem - my hair is falling out here from trying everything I can think off...even wearing a dress whilst whipping a melon doesn't work.

Am I doing something wrong?.. is there an order to checking collisons that I don't know about or something?


GfK(Posted 2004) [#2]
You need to set up TWO types of collision.

The first detects collisions between yourself/zombie.
The second detects collisions between zombie/yourself.

If you've only done the first one, then you will be able to stand still and the zombies will never collide with you.


Hujiklo(Posted 2004) [#3]
Thanks Gfk..i already have set up the collisions logically with a check for the zombie/player and player/zombie - hence my amazing big mystery - why does it only work for the zombie/player check and very, very erratically for the other one....more to the point-even if I have collided I can sort of push into the zombie and eventually go through it like it's made of marmalade or something instead of a completely solid object.


dynaman(Posted 2004) [#4]
Blitz cannot handle collisions between two moving objects, one has to be stationary. The way around this was to do two update worlds or some such.

Move the zombies and then update world. Then move the players and update world. Finally do the renderworld.

I could be totally off - I have not done much 3D work, but somebody will probably read this and sort you out correctly!


Hujiklo(Posted 2004) [#5]
Dynaman - I tried the update world trick, it just makes the zombies move twice as fast...and collisons are still working only one way!...but how they heck do we get around the moving collisions then - this is a new one on me!!


jhocking(Posted 2004) [#6]
Blitz handles moving objects colliding pretty well if you're doing sphere to sphere collision detection. Otherwise, you'll probably want to get a third party collision detection library like nuclear glory (look in the Toolbox.)

One thing to note is that collision detection only works if the objects are not already within each other's collision radius. You may be doing something in your code that moves entities too close together before activating collision detection. Are you turning collision detection on/off for entities and/or are you using ClearCollisions?


Hujiklo(Posted 2004) [#7]
Jhocking - it's the ellipsoid to ellipsoid collisions that are the worst for me in this case...I'm really wondering what to try here....


Who was John Galt?(Posted 2004) [#8]
if the zombies are moving twice as fast using dynaman's suggestion, I figure you must be moving them on both update worlds. If you only move them on one, I can't see any reason why it shouldn't work.


GfK(Posted 2004) [#9]
Didn't someone mention ages ago that there was a problem of some sort with ellipsoid collisions? Has it ever been fixed?


Hujiklo(Posted 2004) [#10]
Falken - I set a global so that the zombie types are supposedly moved every other world update - however they are updated twice regardless...if I set the global to a value that means they should never ever be updated - they animate twice as fast but do not move...anyhow i can pretty much walk through them if i keep pushing - it's as if the updateworld call automatically re-runs all entity data again.


WolRon(Posted 2004) [#11]
The UpdateWorld command has an anim. parameter you can use.

UpdateWorld [anim_speed#]


Who was John Galt?(Posted 2004) [#12]
I don't really understand. Update world just does all the movements for everything you asked to move - If you haven't told the zombies to move I can't see how.....

What do you mean by setting the global?

Is this exactly what you're doing every loop?
Start:
Move player
Updateworld()
Move zombies
Updateworld()
Jump to start

No need to unset or reset collisions each loop. If that's what you're doing and it's still not working, the problem could be with ellipsoid collisions (I've no experience with these). I recommend using sphere (not stretched ellipsoid)collisions to start with and see if that works. How are u animating them?


Hujiklo(Posted 2004) [#13]
Thanks for help guys. Using the anim parameter in 'updateworld' could turn into a real pain depending on which anim sequence is playing etc..they're all mostly tweaked to different speeds - but right now they'd move twice as fast anyhow!
Falken that is exactly what I tried - same result, the enemies all move twice as fast... as do I.
I set a global variable that changed it's value after each 'updateworld' so that the enemy types 'update function' would only update on one of the values....it still went twice as fast with regards the anims...eitherway the collisions were the same - totally unreliable with moving entities.
This is one serious major blow to me - I really would have though such a bug would have been tackled with great speed as it's so fundemental to 3d games. However, not many people seem to have complained about it which makes me wonder does anybody have a suitable workaround?
I've written to support to try and get an official answer to this problem - i.e. can we rely on Blitz collisions to perform consistently?


Ross C(Posted 2004) [#14]
Sorry if this has been mentioned, but if your using sphere to sphere collisions, just do an entitydistance check. If need be, use diferent pivots for the distance check. Only problem is you won't get any collision response.


Hujiklo(Posted 2004) [#15]
Yes Ross I'm just figuring out now whether or not i should interpolate the player's speed to his maximum and minimum depending on his distance to another entity, say within the range of a metre also to tie that in with his facing direction with regards the entity closest....trouble is there could be lots of zombies all around him...it's making my head pound just thinking about it...sigh


Hujiklo(Posted 2004) [#16]
Hmmm...I'm mighty tempted by that Nuclear glory collisions system - anybody have any experience with that at all?


Hujiklo(Posted 2004) [#17]
Dammit - couldn't wait. I just bought the nuclear glory dll system.
I will be sure to let everyone know if it solves my problems or not!


Hujiklo(Posted 2004) [#18]
Wow! Got to say, now that I've set up basic ellipsoid collisions wih Nulcear-Glory, that it's sweeter than a honey addict's urine sample...with five sugars thrown in.

Poly-collisions suck monkey poo through a dirty drain pipe though....i set my player and zombies to use Ellipsoid to poly collison for the level and the frame rate dropped from 60 frames a second to less than 8 frames...something seriously not happening right there I think.
However - player to baddies is excellent...worth $15 just for the tranquil sleep it allows - no more gnashing and grinding of teeth for me where collisons are concerned - phew!

Thanks for the help though - much appreciated