A collission problem

Blitz3D Forums/Blitz3D Programming/A collission problem

Tricky(Posted 2004) [#1]
Hi there...

I'm running a test for a new game I'm going to start on soon. (As soon as "The Fairy Tale" is finished).

I made this game in a 3D environment, however I decided to make the characters and some obstacles (like tables and chairs in a room) in sprites to save me (and most of all my girlfriend who's doing the graphics) a lot of work.

Now it comes, when I've tried to code the game that way, that the player sprite cannot go through walls and obstacles using the "Collision" command (and all related commands to that one). Problem is, walking through the walls (made with a Maplet mesh) is indeed blocked, but the collissions against the obstacles (which are like the player both sprites) is not detected and the player walks straight through the obstacles. (I did put in gravity in the obstacles, and the collision with the floor on that one is detected).

My question is, did I do something wrong or is Blitz the problem. And if so, do you have some recommendations to get this problem solved?


Sledge(Posted 2004) [#2]
I would normally never get into the situation where I was testing collisions between sprites. Each sprite would have a parent entity (a cube normally) with its alpha set to zero and that would be used to test collisions... there are two reasons for this: I don't trust sprites to behave like entities because they aren't normal entities (hence the separate scale command) and I like to divorce game mechanics from the graphics as much as possible.

EDIT: Oooh, also you didn't say if both entity types were in motion... that's a real problem in Blitz and might be what's causing you grief. I think the solution is to either run each type's collision on different updateworld()'s or fall back to entitydistance.


Tricky(Posted 2004) [#3]
Coming up with a a diffrent entity (which players won't see) is one that crossed my mind soon after I made this post, but one I have not yet tried.

About both types being in motion. All I the movement I made in the obstacles is that they fall down (I did this so I could be a little lazy in level development, not having to pinpoint the height exactly). However this problem already occurred before I put the gravity in the obstacles, but I'll take you two diffrent "updateworlds" suggestion in mind if trouble occurs after I tried the "invisible entity" strategy...


Rob(Posted 2004) [#4]
Use EntityBox collision type.


Tricky(Posted 2004) [#5]
Thanks for your post, BloodLocust, but I've got the problem covered now. :)

Coming up with cubes being made invisble with EntityAlpha solved my problem as obstacles are now no longer to be walked straight through.

Thanks a lot for your trouble, everyone ;)