123
-=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- (c) WidthPadding Industries 1987 0|734|0 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-
Socoder -> Blitz -> Age old Collision problems!

Wed, 12 Dec 2007, 17:06
Forklift_Fred
I know, I know. Everyone's been there and it's probably the most common problem area but I've spent the last few hours practically tearing my hair out on what should be a simple thing.

If the snowman hits anything it should turn and move off in a different direction (Or keep turning until it is clear to move again) All it actually does is stop and turn on the spot!



Am I missing the point or what?

I've tried EntityCollided() but it makes no difference.

I've tried using MeshesIntersect() but it just passes through!

So why, when the snowman is facing away from the wall (even if I turn it 180), does it still think it has collided and turn again instead of move away?

(I know I haven't given you the Collisions() and EntityType() etc but the collisions are registering OK - it just seems to be getting stuck)

-=-=-
Come rain or shine...
Wed, 12 Dec 2007, 19:10
magicman
unfortunately im going to have to ask to see the rest of your code, i think the problem lies outside of that function...

-=-=-
Stuff... Yeah...
Thu, 13 Dec 2007, 03:30
Jayenkai
Logically, the code above should work.
I blame general 3D nastyness that it doesn't

Sounds like it's stuck against the wall. Are you not meant to pull it back a little after a collision? (Jay knows very little about 3D stuff, having only ever really coded JNKPlat in 3D, which used 2D methods anyway!)

-=-=-
''Load, Next List!''
Thu, 13 Dec 2007, 03:32
Forklift_Fred
Thanks, some how I thought that would be the case...

Any ideas what it might be? I'll post the lot if I have to but why should it detect the collision and stop (or slide depending on what I have it set to) but then get stuck? There's very little involving the snowman.

I'll try extracting just the snowman's code and see if it works... If it doesn't, I'll post it

-=-=-
Come rain or shine...
Thu, 13 Dec 2007, 05:55
Toaster
Hmm your most likely setting up your collisions wrong giving them the wrong types and setting stuff up wrong I know I forgot to add one number somewhere and I couldnt find the problem anywhere! So make sure you go over your collision code carefully to see if you can find any miss types/errors. With out the rest of the collisions source I cant really help you out much more then that.

-Toaster
Thu, 13 Dec 2007, 09:34
mindstorm8191
I think I remember trying to use collision detection for certain things. You might try using UpdateWorld immediately after you move the snowman, as collisions aren't calculated until UpdateWorld happens... if I remember correctly.

You might also try moving the snowman back just a little if there's a collision, to get the snowman away from the wall enough to avoid continuous collisions.

-=-=-
Vesuvius web game
Thu, 13 Dec 2007, 14:15
power mousey
yes, I agree with magicman.
Or perhaps those portions of code...which you
suspect could not be working right.

by the way....
are snowman and snowmanmesh Global??
or do you have to pass these objects in the function?


|edit| knowing me and my writng/posting style
I don't mean Global in the sense of Global Warming or Global in the sense of Christmas traditions and Jack Frost and Frosty the Snowman as such.
But Global in the sense of Global variables.
ahhhhhhhh True. |edit|

Thu, 13 Dec 2007, 16:57
Forklift_Fred
Right, thanks guys. Unfortunately, since my last post, I've shut down my PC and the damn thing won't start again! No power at all (PSU has been tested as OK so it's been identified as a MotherBoard problem.)

This means that I've been unable to get back to my code.

I have, however, worked on my laptop and re-written the essence of the snowman code using a sphere and cubes. I can not get it to fail!

I've tried UpdateWorld before calling the snowman update and after and it doesn't seem to matter. UpdateWorld before moving technically makes the collision detection a cycle out but it still works.

The entities are set as global otherwise it wouldn't move them at all (again I tested this) I tried moving back a step or several steps but it didn't make any difference, the damn thing still spins on the spot!

The collisions should be set up properly as they are the same as the player (snowmen are AI, hence turning when they hit a wall) and that works fine. As I say, it detects the collision and turns as it is supposed to but it doesn't move away. I wonder if I have the entity radius set too big... but then it would 'hit' the wall and turn sooner since it is only moving 0.1...

I can't see it being the Blitz collision detection either because I tried it with MeshesIntersect() and again it turned but didn't move away.

I am thoroughly annoyed by this and my PC dying but until I get my PC working again I can't get to the code to play with it!

Knowing my luck, I've missed out a w somewhere and typed snoman (I know I did on several occasions, even here...)

I'll report back when I can.

Thanks again for the advise everyone.

-=-=-
Come rain or shine...
Thu, 13 Dec 2007, 21:29
power mousey

I wish you show more of your code.
Perhaps we could understand a little
bit better and perhaps help you out more.

Like the inital set ups
and a little bit of your main or game loop...

anyway..may these thoughts and speculations
help you Fred:

how did you initially place and move the snowmanmesh
and walls as well as the snowman itself. Are you checking
and comparing collisions and boundaries on a current orientation, absolute orientation or a mixed orientation with the snowman, wall, and snowmanmesh.
perhaps the snowman entity hasn't moved far away yet and the snowmanmesh keeps registering/returning the number of collisions since the last updateworld.

are you(the snowman) still in the bounding region
in relation of the snowmanmesha nd the snowman.
True, the snowman has turned and even is facing away from the wall. But still is it in the positional bounding region
of the snowmanmesh and snowman??
With both the X and Z positional axises.

this could be one of the problems...
or some things to think about.




Fri, 14 Dec 2007, 08:18
Paul
I havent really done any 3d coding, but maybe you need to reset the colliosons.
//Paul
Fri, 14 Dec 2007, 14:53
Forklift_Fred
Again, thank you. I'm struggling with fixing my PC and finishing Xmas shopping so have still not been able to get back to this.

My PC is running with a new motherboard but it is limited due to driver issues and I can't connect to the internet so I still can't post any more code.

I'll take a look when I get back and see if I can put any of this advice into practice but I'm working tomorrow so I probably won't be back to post here until late, if not Sunday.

I wish I could help you help me but right now I'm in limbo

-=-=-
Come rain or shine...
Fri, 14 Dec 2007, 16:52
Forklift_Fred
Genius update!

I am now back up and running (minus CD/DVD drives but I barely use them anyway!) I copied the drivers from the driver CD to my USB stick (which is new and I keep forgetting about!) and step by step got everything working again

As for the Snowman, I've had a quick look and replaced the mesh with a simple sphere and lo and behold it now works! Still walks partly into the wall but once it's turned it walks away so for now I'm back in control, just need to check EntityRadius.

|edit| I've just put the snowman mesh back in and it's working! Set it to animate again... still working!
The player isn't colliding now though so either I changed something or the problem's migrated!!! |edit|



Thank you all for your patients and (I assume ) understanding. The week has suddenly ended with a positive turn and I apologise for wasting your time!

If I can't get the player colliding again I will be back though

-=-=-
Come rain or shine...
Fri, 14 Dec 2007, 17:40
power mousey

wasting our time....my time??

Nonsense!


thru what you say and share, we learn
and talk and also discover a little more
of your topic at hand.

by the way, I had a problem with a sound...
a cat meow. And the way it played when a key was pressed,
would slow down the other animations too.
I would ask some people here..but where I got the answer I don't know?? It just come out of the blue....I resolved it with setting up its own sound timer.
But I wouldn't hesitate to ask..if everything else failed at the time.

cheers
power mousey
Fri, 14 Dec 2007, 18:08
Forklift_Fred
To put this one to bed (and myself, looking at the time!)

For whatever reason, I now have the player using ellipsoid-to-polygon collisions but the snowman needs ellipsoid-to-box. No idea why. Possibly the number of faces on the walls (they are now simply scaled cubes but I did try modeling them to get extra faces which, I think, kind of worked) but the player collides no problem... maybe it's the roundness of the snowman but at least it's working now.

Ultimately, I've decided, I shouldn't have used a pivot as the snowman mesh's parent... I only did because CyberSeth's controller code does (since I couldn't be bothered to look at making my own just yet I used an example I had to get me started. I don't know what he did that makes it work but now I'm moving the snowman mesh directly everything is how it should be. I realised this when the snowman sank through the ground and positioning it (the pivot) didn't work. Remove the pivot, remove the problem!

Problem solved, lesson learned, case closed.



-=-=-
Come rain or shine...
Fri, 14 Dec 2007, 18:18
power mousey

thank you for the case.
And for the lesson learned too.
For future reference about pivots,
and those diffrent types of collisions.
Thanks.


cheers,
power mousey