Page 1 of 1

Console spew tracing for Game Editor applications

PostPosted: Tue Jan 02, 2007 8:49 am
by kellyrey
Well since I could not find one I wrote a simple console variable value and spew tracing system. This is of course a developer project and is not overly polished.

This system consists of two parts:

a win32 console application called GE Console and,
a game editor global script file called trace.c.

The win32 console application must be run from your game editor project folder, not the data folder. This is because GE Console looks for the spew trace file trace.log in the same folder where it resides.

All you have to do with trace.c is add it to your game editor project. There are a couple of tutorials here that explain how to do this in game editor.

The accompanying zip contains these as well as an example and a document describing their use. Basically this allows you to see the value of variables and timing that functions are called interactively while your game is running.

The example game editor file shows a couple of actors that write info to the console or clear it when clicked with the left mouse button.


Good luck and I hope it helps.

Kelly

PostPosted: Tue Jan 02, 2007 9:25 am
by Novice
I get an error when I try to run GE console
The application failed to start because the application configuration is incorrect.

PostPosted: Tue Jan 02, 2007 4:40 pm
by kellyrey
Can you give me some more details about how you are starting GE Console.exe? Operating system, user security level and how you tried to start it?

Thanks
k

PostPosted: Tue Jan 02, 2007 5:36 pm
by Novice
I have windows XP, windows firewall disabled, I use zone alarm but it doesn't block the program.
I copied it to my project folder and ran it (double clicked it), then got the error.
Tried to run it from elsewhere also got an error.

I think I figure this out...

PostPosted: Tue Jan 02, 2007 7:16 pm
by kellyrey
turns out this message while 'technically' correct is very miss leading. What it means is that one of the 'required' DLLs was not linked into the exe and so has to be dynamically loaded at run time. The problem with this is that MS's recommended solution is to build a setup project from the generated manfiest. While this probably makes sense for normal applications for simple 20 line of code utilities like this it does not.

In the past under VC2003 the default win32 console project automatically set the linker up to generate an exe with the needed functions linked. Under VC2005 it turns out this is not the case by default now everything is loaded at run time.

Long story short I think I was able to generate an exe with all of the required parts linked. At least this version does in fact run on my tset machine that does not have VC installed.

The accompaning zip includes the exe as well as the updated vcproj so you dont need to guess what settings to use if you want to build the exe yourself.

LMK if you still have problems.

Thanks
k

PostPosted: Tue Jan 02, 2007 11:49 pm
by Novice
Thanks it works perfectly! No more debugging text actors for me! :D

It would work even better if each variable was displayed in a separate column, it looks kinda messy like this.

Makslane should definitely implement something like this in the next version of GE.

Im glad it worked!

PostPosted: Wed Jan 03, 2007 3:10 am
by kellyrey
I am currently working on command window enhanced version with a simple expression evaluator that will allow interactive query and setting of variable values. Similar to the developer studio's command window.

for example to see the contents of an actor you would type something like:
? MyActor

or

? MyActor.x

would display the appropriate data.

It will also provide the ability to set the value of a variable with an assignement for example:

MyActor.strength = 25;
myActor.intelegence = 10 + 3 + MyActor.HitPoints;

With one debug hook or the ability to force an external int it would be a 'no brainer' to implement the best method Ive found so far is to implement a low res timer that updates about every .1 MS.

On a side note I will be happy to work on this with Makslane if it would help get something like this in the next version.

kelly

PostPosted: Wed Jan 03, 2007 1:16 pm
by Kodo
Thanks for the great work kellyrey!

I'm sure many of us would make use of this addition and I’d really love to see it in the next release of GE! I know I would have found it incredibly useful on my last project as debugging at the moment can be a really tedious pain in the neck.

The addition of Break Points and the ability to step through user code while the game is running are a few of the other things I'd like to see which would be very useful! You programmer types know exactly what I mean ;) Because GE gives the user the ability to approach things manually using C it lifts the boundaries of what's possible way above other game editors, these new features would really help establish it as a more viable development environment for professional developers!

PostPosted: Wed Jan 03, 2007 1:38 pm
by makslane
After release of the new interface, I will be able to develop a complete debug environment.

any schedule on the next version?

PostPosted: Thu Jan 18, 2007 5:16 pm
by kellyrey
I stopped working on my next debugger hack since makslane is planning on working on one some time in the future but if that is a year out it may make sense to continue to enhance the trace console in the mean time.