Console spew tracing for Game Editor applications

You must understand the Game Editor concepts, before post here.

Console spew tracing for Game Editor applications

Postby kellyrey » Tue Jan 02, 2007 8:49 am

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
Attachments
Tracing.zip
(271.38 KiB) Downloaded 300 times
kellyrey
 
Posts: 20
Joined: Tue Dec 19, 2006 9:56 pm
Score: 2 Give a positive score

Postby Novice » Tue Jan 02, 2007 9:25 am

I get an error when I try to run GE console
The application failed to start because the application configuration is incorrect.
Why do i always get stuck?
User avatar
Novice
 
Posts: 399
Joined: Mon Aug 29, 2005 10:54 am
Location: Relative
Score: 5 Give a positive score

Postby kellyrey » Tue Jan 02, 2007 4:40 pm

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
kellyrey
 
Posts: 20
Joined: Tue Dec 19, 2006 9:56 pm
Score: 2 Give a positive score

Postby Novice » Tue Jan 02, 2007 5:36 pm

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.
Why do i always get stuck?
User avatar
Novice
 
Posts: 399
Joined: Mon Aug 29, 2005 10:54 am
Location: Relative
Score: 5 Give a positive score

I think I figure this out...

Postby kellyrey » Tue Jan 02, 2007 7:16 pm

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
Attachments
GE Console.zip
(33.21 KiB) Downloaded 326 times
kellyrey
 
Posts: 20
Joined: Tue Dec 19, 2006 9:56 pm
Score: 2 Give a positive score

Postby Novice » Tue Jan 02, 2007 11:49 pm

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.
Why do i always get stuck?
User avatar
Novice
 
Posts: 399
Joined: Mon Aug 29, 2005 10:54 am
Location: Relative
Score: 5 Give a positive score

Im glad it worked!

Postby kellyrey » Wed Jan 03, 2007 3:10 am

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
kellyrey
 
Posts: 20
Joined: Tue Dec 19, 2006 9:56 pm
Score: 2 Give a positive score

Postby Kodo » Wed Jan 03, 2007 1:16 pm

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!
User avatar
Kodo
 
Posts: 449
Joined: Thu Oct 20, 2005 8:20 pm
Location: UK
Score: 23 Give a positive score

Postby makslane » Wed Jan 03, 2007 1:38 pm

After release of the new interface, I will be able to develop a complete debug environment.
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

any schedule on the next version?

Postby kellyrey » Thu Jan 18, 2007 5:16 pm

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.
kellyrey
 
Posts: 20
Joined: Tue Dec 19, 2006 9:56 pm
Score: 2 Give a positive score


Return to Advanced Topics

Who is online

Users browsing this forum: No registered users and 1 guest