Game Development Community

Torque's Profiler?

by Cosmic Logic · in Torque X 2D · 10/22/2010 (5:11 am) · 1 replies

I'm trying to use torque's profiler but I'm getting an exception as soon as I start profiling (by pressing F2):

System.Collections.Generic.KeyNotFoundException was unhandled
The given key was not present in the dictionary.

at

GarageGames.TorqueX.Framework.dll!GarageGames.Torque.Util.Profiler.StartBlock Line 557 C#
GarageGames.TorqueX.Framework.dll!GarageGames.Torque.Util.Profiler.StartBlock Line 495 C#
GarageGames.TorqueX.Framework.dll!GarageGames.Torque.XNA.TorqueEngineComponent.OnStartDraw Line 535 C#
GarageGames.TorqueX.Framework.dll!GarageGames.Torque.GameUtil.TorqueGame.Draw Line 397 C#

Anyone else having this problem? I've never touched the profiler before. This is the first time I've tried to use it.


EDIT:

I jimmy rigged it by changing:

Profiler.cs (TorqueCoreutil)

if (!isRoot)
                        thisBlockInstance = _currentBlockInstance._childHash[thisBlock.Name] as ProfilerCodeBlockInstance;
                    else
                        thisBlockInstance = _rootBlockInstanceHash[thisBlock.Name] as ProfilerCodeBlockInstance;

to

// get the existing block instance
                    if(!isRoot) {
                        if(_currentBlockInstance._childHash.Count > 0)
                            try {
                                thisBlockInstance = _currentBlockInstance._childHash[thisBlock.Name] as ProfilerCodeBlockInstance;
                            } catch { }
                    } else {
                        thisBlockInstance = _rootBlockInstanceHash[thisBlock.Name] as ProfilerCodeBlockInstance;
                    }

thisBlockInstance = _currentBlockInstance._childHash[thisBlock.Name] as ProfilerCodeBlockInstance; was the line that was throwing the exception


Now, as soon as I turn on the profiler the speed of the game goes aaaall to hell. Is this normal?


EDIT:

Turns out it's slow because it's spamming silent exceptions like craazy. Turns out my jimmy rigging came to no avail.

Any thoughts?

#1
10/22/2010 (6:40 am)
<delete, added to the original post>