• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

FrameDef and debugging

Status
Not open for further replies.
Level 26
Joined
Aug 18, 2009
Messages
4,097
Not many people took a look into the UI\FrameDef .fdf files, which is why I know of no tutorial for them. But part of it is kinda obvious. They allow to somewhat alter the UI ingame, like position and scale. The problem is that those files are not overshadowable within the map, only through mpq/local files.

Even if this blocks effective use for the public, it might prove handy for the development process because you can extend some displays. I was tired of debug messages spamming the screen and wondered what else would have space for large strings. Multiboard -> would not be better, quests -> the standard frame def is quite limited. I shrinked the objectives/enlarged the description box and increased the max amount of lines. This could now be used as some output space but for real-time debugging, instantly seeing the msg and timestamp is better.

The way I am doing it now does not have to do with the frames but might be interesting nonetheless. My debug function writes preload files. Everytime the map is run, it reads a local file "index" that contains the last sessionId. That value is incremented and the index file gets replaced on mapInit. All debug outputs are then stored under a session-unique path. To boost performance, every ~500 lines, it creates a new file because PreloadGenEnd always does w+ on the path and unloads the whole preload buffer instead of appending. My new method now is that parallel to the game, I start a tool that waits for a signal from the game, then reads the current sessionId and begins listening to the outputs of the associated path. It prints them in a normal cmd.exe that I can easily watch in background while playing wc3 in windowed mode. As mentioned, it should contain a timestamp of the game timer. Permanently outputting it seems ridiculous, more so since writing debug files is still slow. Therefore, it would be nice to have the timer visible in wc3.

I noticed that the multiboard title's text is centered. Changing it all the time would make it flicker. But it can hold two lines so timer string + "\n" + actual title seems okay. Adjusting the MultiBoard.fdf a little would ensure that the text does not overlap the borders. You can as well set the text alignment there though. Really, .fdfs should replaceable. You only have to pay attention not to cause fatal errors.
 
Status
Not open for further replies.
Top