Game Development Community

GetIntVariable corrupting metrics?

by John Cooney · in Torque Game Engine · 06/09/2006 (12:20 pm) · 3 replies

I was trying out an old resource, used for creating a faux LOD on particle rendering:

http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=3920

In short, it reads a series of Pref values from the client/prefs.cs that tell it what distances to render particles at, then it determines the distance to the camera, and chooses whether to render or not.

Note: I had to put the prefs in defaults.cs rather than prefs.cs, because prefs.cs kept deleting my entries (perhaps it's generated each game?).

The system seems to work pretty well, and the best test is to watch the framerate ( metrics(fps) ). However, as soon as I create particles, the TextOverlayControl is overwritten with the value of the most recently-read Pref variable.

Has anybody seen this? Do you know how it gets corrupted? Better question, how do I stop it? :)

#1
06/12/2006 (10:09 am)
No takers?
#2
06/12/2006 (10:16 am)
Are you sure that you didn't miss something in that resource? This kind of stuff can happen when a memory allocation goes wrong or you did something wrong with your pointers.
#3
06/12/2006 (4:33 pm)
Pretty sure. If I comment out everything except this line:

S32 levelLoD1 = Con::getIntVariable("$pref::particles::LoD1", 32000);

I still get the same bug.

I know this is the kind of thing that comes up with corrupted memory, but I can't figure out how that call would change the response of a function call.

Here's an oddity. When this bug manifests itself, I can get it to return the view based on the direction the camera is facing. . . This is just too wierd. If I'm looking in the direction of a particle, it appears. Otherwise, I get my framecounter back.

Maybe some other display is inhabiting the same screen real estate?

Don't worry about this one, guys. It's obviously a me-specific bug. I'll work it out.

Thanks, though.