Game Development Community

Torque 3D 3.0MIT Camera Crash - SOLVED

by To-mos · in Torque 3D Professional · 08/23/2013 (5:41 pm) · 9 replies

Hello again fellow garage gamers I have a strange problem with default unaltered Torque 3D 3.0. When I create a camera on a level or even have one already in it the engine crashes instantly. I downloaded the latest torque opened up the full template went to world editor and it crashed as soon as I made a camera with a default Observer Datablock. After that I tried an empty template, same thing. I then tried generating a project and it STILL crashes right off the bat. I have no idea why it would be doing that and this is very troublesome, does anyone have any ideas as to why this would be happening?
i.imgur.com/wbQ0TB3.png


#1
08/23/2013 (5:44 pm)
What does the console say?

Ron
#2
08/23/2013 (5:47 pm)
If the console isn't saying much, you could do trace(1); in the console to get a better behind the scenes look for the scripting engine. It will report all of the script execution of functions to the console.

But check the console first. And if you have any recursive functions being called, prepare for console spam when using trace.
#3
08/23/2013 (5:54 pm)
Jeff, you are of course correct...

here is what I got at the end of the console:

*** Control Object Changed
Win32Window::WindowProc - resetting device due to window size change.
GFXPCD3D9Device::reset - depthstencil 4afb160 has 2 ref's
--- Resetting D3D Device ---

This tells me that the 'observer' camera mode tries to override the current mode. Since this would require a reset of the canvas, it crashes and yes, this is a true bug. Since it does not crash in 1.2 or 2.0. Maybe it has something to do with the render pipe changes that were made to accommodate some of the newer input devices in 3.0. (just spit-balling the issue at this point).

Ron
#4
08/23/2013 (5:57 pm)
This is without a trace less verbose output of the Full template on the empty terrain mission, it doesn't look to suspicious time to try a trace.
*** Phase 3: Mission Lighting
Mission lighting done
Mapping string: MissionStartPhase3Ack to index: 2
Mapping string: MissionStart to index: 8
Mapping string: SyncClock to index: 9
Mapping string: RefreshWeaponHud to index: 10
Mapping string: SetAmmoAmountHud to index: 11
Mapping string: ryder.png to index: 12
Mapping string: MsgClientJoin to index: 13
Mapping string: Welcome to the Torque demo app %1. to index: 14
Mapping string: Visitor to index: 15
*** Initial Control Object
Activating DirectInput...
Win32Window::WindowProc - resetting device due to window size change.
GFXPCD3D9Device::reset - depthstencil 1f569a0 has 2 ref's
--- Resetting D3D Device ---
Time spent in toggleEditor() : 1.045 s
*** Control Object Changed
Mapping string: Orange to index: 16
Here is the same level with trace(1) enabled don't know if it looks strange so far
Entering GammaPostFX::preProcess(1379)
Leaving GammaPostFX::preProcess() - return 
Entering GammaPostFX::setShaderConsts(1379)
Leaving GammaPostFX::setShaderConsts() - return 
Entering SpawnSphere::onEditorRender(4248, 2319, false, false)
Leaving SpawnSphere::onEditorRender() - return 
Entering GammaPostFX::preProcess(1379)
Leaving GammaPostFX::preProcess() - return 
Entering GammaPostFX::setShaderConsts(1379)
Leaving GammaPostFX::setShaderConsts() - return 
Entering SpawnSphere::onEditorRender(4248, 2319, false, false)
Leaving SpawnSphere::onEditorRender() - return 
   Entering ObjectBuilderGui::onOK(ObjectBuilderGui)
      Entering Editor::validateObjectName(blabla, 0)
      Leaving Editor::validateObjectName() - return 1
      Entering ObjectBuilderGui::buildMemento(ObjectBuilderGui)

is there anyway to get a more in depth look at it maybe?
#5
08/23/2013 (5:59 pm)
haha with a more trained eye there is lots I overlooked. So any plan of action from you guys or the devs on what the fix would be?
#6
08/23/2013 (6:14 pm)
uhm, looks to me like FlyMode is defaulting to a virtual camera mode that is NOT properly set.

Check both camera.cpp and camera.h and see how the camera is handled within the virtual mode (FlyMode). (wow, almost sound like a 'code guy' there.)

Also, keep in mind, T3D is a HUGE code base so sometimes, it's difficult to test all 'scenarios' and it looks like this is one of those things that did not get tested prior to release, sorry for that.

Ron
#7
08/23/2013 (6:18 pm)
Alright I'm still learning the engine and am quite a newbie to its structure but I'll look around there to see if I spot anything significant. If anyone wants to weigh in on the issue that would help cause knowing me I might break it trying to fix it. But here we go! LEEROOYYYY JENNNKKINNSS
#8
08/23/2013 (10:01 pm)
FYI this crash has already been fixed in the Development branch. It has yet to be merged into the Master.

github.com/GarageGames/Torque3D/pull/420

I dug into the issue and for some reason setTransform is getting called before onAdd, which seems odd to me...

Edit: After a little more digging, I found a way to fix the crash via script as well. Check the above link for my comment on the pull request.
#9
08/23/2013 (11:21 pm)
Problem solved with this merge

https://github.com/GarageGames/Torque3D/commit/cec14272b64726085441003c5aee78e97f73e12f