WINDOWS Test BuildCompiled on MSVC 2012 update 4
Debug Console Test Build (based on r10475)
github branch/fork-z64555/debug_consoleShort Tutorial of Use:
1. Run the build.
2. Get to the login screen.
3. Press Shift+Enter to bring up the console.
4. Type in and enter
help To list available commands and general usage.
You may use the same key combination (Shift+Enter) almost anywhere in the game to bring up the console, this will currently pause game execution until you leave the console.
CAUTION: Usage of the debug console in multiplayer games may crash to desktop or otherwise cause unexpected behavior. This will eventually
TM change.
It is planned to separate the console to a different thread, so that the game may run in the background. There will be a "pause" command to pause/unpause the game.
(rambling drivel follows)
-=Introduction=-
When I first discovered the FreeSpace Open Debug Console in November of 2013, I found it to be the answer to the problem of needing a way with directly interacting with the FSO engine, especially in terms of debugging new features. The debug console allows developers to check how things are going here and there, all that was needed was run a debug build, get past the opening credits, and hit Shift+Enter almost anywhere in the game to access the console. From here, they could monitor the value of a specific variable and even set them to any arbitrary value.
The F1 help overlay, for instance, has a number of DCFs (debug console functions) to adjust the polylines that draw between the help text and the region of button that they're describing. With a bit of work, something like this could be done for the HUD gauges to aide in their design, in-game. A developer could try nudging the ETS gauge here and there and take it for a test run, and not have to end the game, edit a .tbl, and reboot to see the changes. The debug console also allows testing of otherwise difficult or complex aspects of the codebase. It appears a number of multiplayer-related DCFs were implemented by them to test their lag simulation and how well the engine handled the vigors of networking. Without the debug console, these functions are otherwise inaccessible and useless.
However, by the time I found the console, it was ill maintained and little known. The interface was an abysmal 80x25 letterbox on any resolution of the game, and could only scroll down through a page at a time through the help list. Add to that, the console's command line parser had little to no type safety, making it quite easy to CTD over an otherwise small mistake of entering a float when a DCF needed an integer, or a long when it needed a ubyte. If the console was to live up to its potential, something drastic needed to be done.
Like, a complete rewrite of the parser, and a brand new renderer for the console itself.
-=Overview of Changes=-
The parser now uses a syntax and grammar quite similar to what's found in parselo, and features heavy usage of dc_optional_string's and dc_maybe_stuff's. The latter mentioned are, what I think, novel in grabbing optional arguments from the command line.
The console renderer is still in-game at the moment. A future goal for the console is obviously to have its own window, as with the debug_window that spews the fs2_open.log, but that's outside the scope of this project.
(a.k.a. I don't have enough time to fool with it just yet)The console renderer now features some essentials, like a proper word wrap and the ability for tab alignment (although with FSO's non-monospace fonts, that's pretty much pointless at this time), and the ability to scroll through the output history. Also, the console takes up the entirety of the FSO's screen, and is no longer limited to the 80x25 letterbox.
I tried as much as I could to update the existing DCFs to use the new parsing functions, but there may be bits here and there that I might have missed. I've included quite a few doxygen comments, too. Most should be up to date, but again I might've missed some bits here and there. This will change within the week or so.
-=Ending Note=-
Closing out, I'd like to have as many people looking at this as possible, because I feel that the console is just too good of a tool to _not_ use. Thanks for your interest.
