September 28, 2013

UDK logging tips (1)

Game logging is a very important thing. So, I want to share some things I'm using to make it comfortable and informative.

1. `Location macros

Use 'Location macros to get actor instance name and class/function location of log event. F.e.:

2. Custom log macroses

In Globals.uci file of your game package (it should be placed in .\Development\Src\MyGame\ folder, not inside Classes folder!) you can add macros like that:

Now you'll be able to use `LogAI(...) when you want to log some AI events (for example). Of course you can customize message as you want.

The great point of using this macros is that you can suppress its output into console by adding simple config in DefaultEngine.ini file:

Once you've decided that you needn't this type config in console all the time anymore (f.e. you've finished hard debug work on AI), you can suppress it, and vice versa.

3. Remember Object's debug functions

ScriptTrace()GetFuncName()DebugBreak(..) are your best friends!

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.