Problem with Turrets
by kcpdad · in Torque 3D Professional · 04/30/2011 (1:45 pm) · 0 replies
I'm working on porting the turret resource to the preview SDK and ran into this problem.
I'm using the default vehicle instead of the player and a port of this resource..
When running the debug engine I immediately get an assertion when adding an AITurret to a map near the vehicle.
AssertFatal( !mSearchInProgress, "SceneContainer::castRayBase - Container queries are not re-entrant" );
The stack trace is
As far as I can tell this happens because findobjects() is called by the vehicle class to see it collided with a trigger, when it does then the AITurret code checks to see if the vehicle is in the line of sight, that second container search call causes the assertion:
The TGE container searches didn't seem to have reentrant check.
I'm not sure if I'm doing something wrong or this is a new restriction. It seems to be the latter so I'm not sure how to get this to work as originally intended.
For now I'll disable the LOS check.
thanks
I'm using the default vehicle instead of the player and a port of this resource..
When running the debug engine I immediately get an assertion when adding an AITurret to a map near the vehicle.
AssertFatal( !mSearchInProgress, "SceneContainer::castRayBase - Container queries are not re-entrant" );
The stack trace is
test_project_DEBUG.dll!Platform::debugBreak() Line 17 C++
test_project_DEBUG.dll!SceneContainer::castRayBase(unsigned int type=0, const Point3F & start={...}, const Point3F & end={...}, unsigned int mask=16397, RayInfo * info=0x0012bde0) Line 853 C++
test_project_DEBUG.dll!SceneContainer::castRay(const Point3F & start={...}, const Point3F & end={...}, unsigned int mask=16397, RayInfo * info=0x0012bde0) Line 819 + 0x1a bytes C++
> test_project_DEBUG.dll!AITurret::isInLOS(GameBase * obj=0x06ac4028) Line 591 + 0x20 bytes C++
test_project_DEBUG.dll!AITurret::testObject(GameBase * enter=0x06ac4028) Line 467 + 0xc bytes C++
test_project_DEBUG.dll!AITurret::potentialEnterObject(GameBase * enter=0x06ac4028) Line 484 + 0xc bytes C++
test_project_DEBUG.dll!Trigger::potentialEnterObject(GameBase * enter=0x06ac4028) Line 685 C++
test_project_DEBUG.dll!Vehicle::findCallback(SceneObject * obj=0x0656e748, void * key=0x06ac4028) Line 1422 + 0x14 bytes C++
test_project_DEBUG.dll!SceneContainer::findObjects(const Box3F & box={...}, unsigned int mask=2162720, void (SceneObject *, void *)* callback=0x107a79ab, void * key=0x06ac4028) Line 456 + 0xd bytes C++
test_project_DEBUG.dll!Vehicle::checkTriggers() Line 1407 C++
test_project_DEBUG.dll!Vehicle::updatePos(float dt=0.0040000002) Line 1119 C++
test_project_DEBUG.dll!Vehicle::processTick(const Move * move=0x118e67f8) Line 771 + 0x21 bytes C++
test_project_DEBUG.dll!WheeledVehicle::processTick(const Move * move=0x00000000) Line 771 C++
test_project_DEBUG.dll!StdServerProcessList::onTickObject(ProcessObject * pobj=0x06ac40c0) Line 357 C++
test_project_DEBUG.dll!ProcessList::advanceObjects() Line 252 C++
test_project_DEBUG.dll!ServerProcessList::advanceObjects() Line 162 C++
test_project_DEBUG.dll!StdServerProcessList::advanceObjects() Line 370 C++
test_project_DEBUG.dll!ProcessList::onAdvanceObjects() Line 156 + 0x19 bytes C++
test_project_DEBUG.dll!ProcessList::advanceTime(unsigned int timeDelta=203) Line 220 + 0xd bytes C++
test_project_DEBUG.dll!serverProcess(unsigned int timeDelta=203) Line 223 + 0x19 bytes C++
test_project_DEBUG.dll!processTimeEvent(int elapsedTime=203) Line 145 + 0x9 bytes C++
test_project_DEBUG.dll!fastdelegate::FastDelegate1<int,void>::InvokeStaticFunction(int p1=203) Line 1018 + 0xe bytes C++
test_project_DEBUG.dll!fastdelegate::FastDelegate1<int,void>::operator()(int p1=203) Line 990 + 0x1a bytes C++
test_project_DEBUG.dll!Signal<void __cdecl(int)>::trigger(int a=203) Line 462 C++
test_project_DEBUG.dll!Journal::Call<Signal<void __cdecl(int)>,int>(Signal<void __cdecl(int)> * obj=0x02390440, void (int)* method=0x107c4b64, int a=203) Line 542 + 0xa8 bytes C++
test_project_DEBUG.dll!JournaledSignal<void __cdecl(int)>::trigger(int a=203) Line 64 + 0x12 bytes C++
test_project_DEBUG.dll!TimeManager::_updateTime() Line 30 C++
test_project_DEBUG.dll!fastdelegate::FastDelegate0<void>::operator()() Line 905 + 0x16 bytes C++
test_project_DEBUG.dll!Signal<void __cdecl(void)>::trigger() Line 445 C++
test_project_DEBUG.dll!Process::processEvents() Line 78 C++
test_project_DEBUG.dll!StandardMainLoop::doMainLoop() Line 577 + 0x5 bytes C++
test_project_DEBUG.dll!torque_enginetick() Line 103 + 0x5 bytes C++
test_project_DEBUG.dll!TorqueMain(int argc=2, const char * * argv=0x010bce60) Line 370 + 0x5 bytes C++
test_project_DEBUG.dll!torque_winmain(HINSTANCE__ * hInstance=0x00400000, HINSTANCE__ * __formal=0x00000000, char * lpszCmdLine=0x00161f3b, HINSTANCE__ * __formal=0x00000000) Line 445 + 0x17 bytes C++
test_project_DEBUG.exe!WinMain(HINSTANCE__ * hInstance=0x00400000, HINSTANCE__ * hPrevInstance=0x00000000, char * lpszCmdLine=0x00161f3b, int nCommandShow=1) Line 47 + 0x16 bytes C++
test_project_DEBUG.exe!__tmainCRTStartup() Line 263 + 0x2c bytes C
test_project_DEBUG.exe!WinMainCRTStartup() Line 182 CAs far as I can tell this happens because findobjects() is called by the vehicle class to see it collided with a trigger, when it does then the AITurret code checks to see if the vehicle is in the line of sight, that second container search call causes the assertion:
The TGE container searches didn't seem to have reentrant check.
I'm not sure if I'm doing something wrong or this is a new restriction. It seems to be the latter so I'm not sure how to get this to work as originally intended.
For now I'll disable the LOS check.
thanks
About the author
Hobbyist working on a tank game when time allows. Play the prototype at => http://www.sytrept.com/60tons/