Problem with collisions in my level


I’ve run into a wall. More precisely, my problem is not being able to run into a wall. Or the floor. I built a level of a cave in Blender and exported it with Chicken. Then to test it I replaced the world level in the RoamingRalph tutorial with my level. It didn’t work then, so I searched the forums for answers and found out I have to add the line { Polyset keep descend } to the egg file (using Notepad). That still didn’t work though, so I spent some more time pondering it but I’m still stuck. Shouldn’t the same CollisionRay in the RoamingRalph tutorial work in a different level? Someone please help.

Also, what does the “/start_point" part of “ralphStartPos = self.environ.find(”/start_point”).getPos()" do? I had to change that line of code because it gave me an error when I compiled it. Could that be part of my problem?

Thanks in advance,

What exactly doesn’t work? Do you get placed on top of the cave? Or doesn’t anything collide at all? If you uncomment the showCollisions line, does it show something is colliding? Could you maybe give us your model?

About start_pos: It’s a mesh called “start_pos” with a single vertex positioned where the Ralph model has to start at when running the file.

Most of the time I get placed far above the cave floor. I’ve tried changing my position, but that doesn’t work. I just get stuck in the floor. When I am stuck above the level I appear to be able to move forward a slight amount, but then I get blocked. No use being able to run in the air, though, anyway…

When I show the collision line, I can see the collisions with the ray below, just like it should be. Could be that I can’t move forward because the ground is too steep? Although I don’t think it really is, it could be. I can solve that problem once I have Ralph on the ground.

Yes, I’d be willing to share my model with you. But I don’t know how to do that via the forums…

Ack, now I’m having a new problem. When I try to compile the script, my program stops responding and I get the following error in the command line:

Assertion failed: _current_index + sizeof(tempvar) <= _datagram->get_length() at line 277 of of c:\temp\mkpr\built\include\datagramIterator.I

That same line keeps getting written on the command prompt window until I terminate the program. Has anyone seen this before?

Well, now I’m no longer having that second problem. I’m not exactly sure what fixed it. What I did was save the .blend file in the same place I export the .egg. I can’t see why that would make a difference, but maybe. But I still can’t make the collision work…

I am not sure that the following is correct, but maybe it helps.
If I remember correctly, Roaming Ralph sample uses collision ray that starts far above Ralph’s head. Ralph is set there where it hits the “terrain” mesh. If you use this code, maybe (I am not sure, it needs testing) the collision ray hits your cave twice: at the floor, and at the ceiling, and sets your actor on the highest point - right above the ceiling, actually. You don’t see the ceiling because you face the back side of the ceiling polygons (it is culled and invisible). So, it may appear that the actor is somewhere in air, standing on nothing.

~sigh~ I can’t believe this… It was such a simple problem…

What you said lead me to it, birukoff. Actually, though, my cave doesn’t even have a ceiling yet, otherwise your theory would be a good one. But I realized when you said “terrain” mesh that I had to name the mesh in my model the same thing it was named in the code… So… I did… and… it worked…

I feel like such an idiot…

I think we should update the samples to make it more flexible and logical.
Instead of the naming requirement for the collision model, we could requires a simple tag on the model. (that could be the same name)

This way we could have several model participating to the environnement and so on…

What do you think?

Good idea!