Aiplayers fall through terrain
by Noah Dyer · in Torque Game Engine · 02/02/2006 (12:23 pm) · 4 replies
I'm using Torque 1.3. A while back, while I was working on other parts of my games, I did something that causes AIplayers to fall through the terrain when they move. Because I didn't notice it when it first happened, I'm not sure what I might have done that would cause this. I haven't intentionally messed with the AIPlayer class or the PlayerData class. Any thoughts about what might be causing this? Kork falls through the ground as soon as the mission begins. If I create other bots, they will will land appropriately. I can call many of their functions without problem, but if I try to move them via followPath() or setMoveDestination() they fall through the terrain.
A separate but related issue is that I can call the aimAt() function, but if I call fire() or singleShot() the game freezes (but I don't get a popup about an exception or anything). Any thoughts about that?
Finally, I can find aiPlayer.cc, but I can't find aiPlayer.h and I don't see a an AIPlayer declaration anywhere else. Is it declared somewhere, or do you not need a class declaration or something?
A separate but related issue is that I can call the aimAt() function, but if I call fire() or singleShot() the game freezes (but I don't get a popup about an exception or anything). Any thoughts about that?
Finally, I can find aiPlayer.cc, but I can't find aiPlayer.h and I don't see a an AIPlayer declaration anywhere else. Is it declared somewhere, or do you not need a class declaration or something?
#2
I would love to solve this problem myself, but as I mentioned in the first post of this thread, I can't figure out where AIplayer and its members and methods are declared, how it inherits from player, etc. If somone can point me in the right direction, I'll be happy to pick up from there.
02/06/2006 (1:12 pm)
OK, I've narrowed the problem down a bit. I took a fresh install of Torque and did the above resource, which did in fact cause kork to start falling through the as as he starts following the path. If I block out the code that starts him following the path, he will stay on the surface, but if I instruct him to move, he falls through.I would love to solve this problem myself, but as I mentioned in the first post of this thread, I can't figure out where AIplayer and its members and methods are declared, how it inherits from player, etc. If somone can point me in the right direction, I'll be happy to pick up from there.
#3
in stock TGE 1.3, aiPlayer.h is a sibling of aiPlayer.cc, in ...\engine\game.
02/06/2006 (1:27 pm)
Sounds like path updating is no longer checking to make sure to place the player on the terrain surface.in stock TGE 1.3, aiPlayer.h is a sibling of aiPlayer.cc, in ...\engine\game.
#4
02/09/2006 (11:24 am)
Well, I fixed the error in a way that, for me at least, was unexpected. I went through the code changes and couldn't find anything that should have broken the AIPlayer class. Ultimately I noticed that the constructor for AIPlayer didn't initialize the Player constructor. So I simply changed the following in aiplayer.ccAIPlayer::AIPlayer()to
AIPlayer::AIPlayer() : Player()To my surprise this seems to have resolved my problem. I'll make a comment in the above resource as well. Thanks for the help.
Torque Owner Noah Dyer