Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: Yarn on January 14, 2017, 08:53:29 pm

Title: Why was the debug window removed?
Post by: Yarn on January 14, 2017, 08:53:29 pm
I noticed that the debug window (which shows what's being written to fs2_open.log, but in real time) was removed sometime after FSO 3.7.4. What was the reason for this?
Title: Re: Why was the debug window removed?
Post by: LaineyBugsDaddy on January 14, 2017, 10:31:37 pm
Because it was, so far as I know, platform specific to Windows. What good is a debug window that can't be used by a large portion of the user base?
Title: Re: Why was the debug window removed?
Post by: AdmiralRalwood on January 15, 2017, 02:44:51 am
Because it was, so far as I know, platform specific to Windows. What good is a debug window that can't be used by a large portion of the user base?
Being Windows-specific isn't reason enough by itself to remove a feature. The commit (https://github.com/scp-fs2open/fs2open.github.com/commit/e0ce4737ec1c7e01829ee2cd4ca51dc9bcd5e7b6) from Antipodes that, as far as I can tell, removed it, claimed it was "unused".
Title: Re: Why was the debug window removed?
Post by: m!m on January 15, 2017, 05:15:30 am
When I cleaned up the outwnd code (the code that is responsible for the debug log) I looked at the debug window code and determined that the code to enable it could never be reached and in my tests it wasn't ever reached. I have no idea how it could have worked before but it may have required some special driver support since it uses some very weird Windows API calls.

I have been thinking about how to reimplement this in a cross-platform way but since we have entered a code freeze now that won't appear in the next release.
Title: Re: Why was the debug window removed?
Post by: Axem on January 15, 2017, 08:21:12 am
I too, mourned its loss. But I did find some other programs to use in the interim. Programs like tailforwin32 (http://tailforwin32.sourceforge.net/index.php) or Snaketail (http://snakenest.com/snaketail/), or even just notepad++ if you already use that (you might need to tick a few other settings first though).
Title: Re: Why was the debug window removed?
Post by: z64555 on January 15, 2017, 10:44:05 am
The debug window was activated from the debug console, or by commandline.
Title: Re: Why was the debug window removed?
Post by: chief1983 on January 15, 2017, 10:47:40 am
If multiple devs were using a feature that the commit message claimed was 'unused', why didn't anyone speak up back then?    :confused:
Title: Re: Why was the debug window removed?
Post by: z64555 on January 15, 2017, 11:16:40 am
How often do you read through the entire wall of commit messages when you are pulling from master?

When I'm focused on a project, I usually don't bother reading the commit messages unless there's a conflict or the changes affected files I'm messing with.


Also, another outwindow that's missing was the joystick raw position data, now I know what happened to it.


At any rate, seeing as the outwnd was Windows specific, now would be a good time to bring up the possibility of making it cross-platform using SDL. Granted, we're in code freeze stage, so the changes would have to be done after the more pertinant bugs have been squashed.
Title: Re: Why was the debug window removed?
Post by: chief1983 on January 15, 2017, 11:31:26 am
I just read all the nightly logs and/or the github merge emails.  Keeps me pretty up to date anyway.  But also I would have thought any users would have noticed it's removal earlier and said something, even if they didn't see the commit.  That was probably the assumption made during its removal too.
Title: Re: Why was the debug window removed?
Post by: m!m on January 15, 2017, 11:33:40 am
A cross-platform solution is a bit complicated since FSO isn't set up to handle multiple windows at the moment. I have done some work in order to make this possible so implementing the debug window shouldn't be an impossible task but it will require some changes to the graphics engine.
Title: Re: Why was the debug window removed?
Post by: chief1983 on January 15, 2017, 11:37:26 am
I wonder if a cross platform solution never really seemed necessary because *nix has "tail -f".  Can just run that in a terminal window alongside fso, sounds like that's what this feature accomplished.
Title: Re: Why was the debug window removed?
Post by: m!m on January 15, 2017, 11:39:38 am
You can do something similar on Windows (Axem showed how to do this) but I would like to extend this second window further once it has been implemented. It would be great to have a second window where the debug console would be displayed so that you wouldn't have to pause the gameplay to use the debug console anymore.
Title: Re: Why was the debug window removed?
Post by: AdmiralRalwood on January 15, 2017, 11:44:37 am
If multiple devs were using a feature that the commit message claimed was 'unused', why didn't anyone speak up back then?    :confused:
Because it was removed in Antipodes, and not a lot of people tested Antipodes until it was merged with master, and how many people looked through that entire changelog?
Title: Re: Why was the debug window removed?
Post by: m!m on January 18, 2017, 09:46:25 am
I have reimplemented the debug window with techniques that will work on all platforms:

(http://i.imgur.com/ufoHOCZ.png)

Since we are currently in a feature freeze period it's not certain that this feature will be merged before the 3.8 release but after that I will definitely submit it for review.
Title: Re: Why was the debug window removed?
Post by: m!m on January 20, 2017, 11:46:28 am
My changes have been merged into the master branch so the new debug window should appear in the next nightly. Please report any issues you encounter.
Title: Re: Why was the debug window removed?
Post by: Spoon on January 20, 2017, 11:58:24 am
I just read all the nightly logs and/or the github merge emails.  Keeps me pretty up to date anyway.  But also I would have thought any users would have noticed it's removal earlier and said something, even if they didn't see the commit.  That was probably the assumption made during its removal too.
It seems to be a reoccuring theme with the SCP that things are just assumed, and not properly communicated...
Title: Re: Why was the debug window removed?
Post by: Yarn on January 21, 2017, 02:53:48 am
You forgot to add -debug_window to the list of command-line options that's sent to the launcher.

I tried the new debug window and immediately noticed some problems:
Title: Re: Why was the debug window removed?
Post by: m!m on January 21, 2017, 03:01:36 am
You forgot to add -debug_window to the list of command-line options that's sent to the launcher.
IIRC, that's how the previous version also presented itself. I assumed that there was a good reason for this decision so I did the same thing.

  • The window fills the screen and isn't resizable.
What default size would you recommend? It's very hard to figure out a good default for these things so I just chose to let it fill the screen.

  • The debug window initially has focus over the game window. I think it should be game window that has focus.
I guess this could be fixed.
Title: Re: Why was the debug window removed?
Post by: Yarn on January 21, 2017, 03:24:52 am
IIRC, that's how the previous version also presented itself. I assumed that there was a good reason for this decision so I did the same thing.
No, the option for the old debug window appeared in the launcher. (If you don't believe me, select a 3.7.4 build in a launcher and look under the Dev Tool section; you should see an option labeled "Display debug window.")

What default size would you recommend? It's very hard to figure out a good default for these things so I just chose to let it fill the screen.
I think 800x600 might be a good place to start. If that's too small, you could make it a little bigger, but I wouldn't go much bigger; not everyone has a high-resolution screen.
Title: Re: Why was the debug window removed?
Post by: m!m on January 21, 2017, 04:53:55 am
I fixed the issues you reported. Here is the PR for that: https://github.com/scp-fs2open/fs2open.github.com/pull/1152

Fixed window sizes almost never work so I made the size of the debug window dependent on the size of the display it was created on. I also made the window resizable which should improve usability.
Title: Re: Why was the debug window removed?
Post by: Yarn on January 23, 2017, 01:22:13 am
The debug window is working better now, and the default size seems right too. If it's not too much trouble, though, having a scroll bar would be nice.

Thanks for reimplementing the debug window!
Title: Re: Why was the debug window removed?
Post by: m!m on January 23, 2017, 02:50:05 am
Unfortunately, a scroll bar is quite a bit of trouble.I'll try to add support for scrolling using the arrow keys and Page Down/Up but a real scroll bar is a lot of work since FSO doesn't have that at the moment.
Title: Re: Why was the debug window removed?
Post by: LaineyBugsDaddy on January 23, 2017, 10:32:00 am
Oddly enough, I actually expected this to be your reply about the scrollbar question above. FSO does not use any OS native widgets, so a scrollbar would require more work than calling on OS native stuff to make a scrollbar. Perhaps wxWidgets could be brought into play for it, but it would be vastly non-trivial to implement.
Title: Re: Why was the debug window removed?
Post by: m!m on January 23, 2017, 10:48:15 am
wxWidgets is not a good solution for the core engine since we don't include it there. At some point we will need a better in-engine GUI framework but at the moment there isn't much we can do about that.
Title: Re: Why was the debug window removed?
Post by: z64555 on January 23, 2017, 11:00:02 am
The WMC GUI used by the lab provides some groundwork, although it is still relatively messy. If we could organize it into resembling a proper library, it might make it more attractive to future GUI development.
Title: Re: Why was the debug window removed?
Post by: AdmiralRalwood on January 23, 2017, 01:07:20 pm
Yes, but it still doesn't contain vertical scrollbars.
Title: Re: Why was the debug window removed?
Post by: niffiwan on January 23, 2017, 03:31:48 pm
what about that lightweight lib that Swifty mentioned in the chromium-in-FSO thread? I mean, rolling our own seems... time consuming?
Title: Re: Why was the debug window removed?
Post by: z64555 on January 23, 2017, 03:34:04 pm
Swifty also made a Slider class within the WMCGUI, which we may be able to tweak a bit to make a scrollbar out of.
Title: Re: Why was the debug window removed?
Post by: m!m on January 24, 2017, 10:26:45 am
Does anyone have experience with CEGUI (http://cegui.org.uk/)? It looks promising after a few minutes of looking over their documentation.