Author Topic: [Feature request] More detailled feedback from hud parsing  (Read 4584 times)

0 Members and 1 Guest are viewing this topic.

[Feature request] More detailled feedback from hud parsing
As I've been fooling around with hud_gauges.tbl, it has come to my attention that hudparse gives very little info when something in the table goes wrong. Usually, the only message I get from an invalid entry is "Invalid gauge found in hud_gauges.tbl", which gives very little info regarding what went wrong and where.

I was wondering if someone familiar with the parsing code could take a look and see whether it would be possible to provide more useful feedback, at the very least what line threw the warning.



I've also noticed that the parser doesn't complain about otherwise bogus sections, see as the one below (copied from Wing Commander Saga's hud table).
Code: [Select]
#Ship Gauges

    $Ship:                              F-66A Thunderbolt VII
        $Default:                       (1024 768)
            $Gauge:                     Hardpoints
                $HP_Silhouette:         (0 0)
                    +Image:             hp_sil_thunderbolt
                $HP_PBank1_L:           (49 20)
                $HP_PBank1_R:           (69 20)
                $HP_PBank2_L:           (39 33)
                $HP_PBank2_R:           (79 33)
                $HP_PBank3_L:           (29 41)
                $HP_PBank3_R:           (89 41)
                $HP_SBank1:             (19 64)
                $HP_SBank2:             (60 40)
                $HP_SBank3:             (102 64)
                $HP_SBank4:             (0 0)
                $HP_SBank5:             (0 0)
                $HP_SBank6:             (0 0)
#End
I get the feeling that this is also something FSO should warn the modder about.

EDIT - Second issue is expected behavior.
« Last Edit: August 06, 2014, 02:41:07 am by X3N0-Life-Form »

 

Offline AdmiralRalwood

  • 211
  • The Cthulhu programmer himself!
    • Skype
    • Steam
    • Twitter
Re: [Feature request] More detailled feedback from hud parsing
I'm working on a patch for the first issue; if you want a test build, I can get one to you in... several hours, probably.
Ph'nglui mglw'nafh Codethulhu GitHub wgah'nagl fhtagn.

schrödinbug (noun) - a bug that manifests itself in running software after a programmer notices that the code should never have worked in the first place.

When you gaze long into BMPMAN, BMPMAN also gazes into you.

"I am one of the best FREDders on Earth" -General Battuta

<Aesaar> literary criticism is vladimir putin

<MageKing17> "There's probably a reason the code is the way it is" is a very dangerous line of thought. :P
<MageKing17> Because the "reason" often turns out to be "nobody noticed it was wrong".
(the very next day)
<MageKing17> this ****ing code did it to me again
<MageKing17> "That doesn't really make sense to me, but I'll assume it was being done for a reason."
<MageKing17> **** ME
<MageKing17> THE REASON IS PEOPLE ARE STUPID
<MageKing17> ESPECIALLY ME

<MageKing17> God damn, I do not understand how this is breaking.
<MageKing17> Everything points to "this should work fine", and yet it's clearly not working.
<MjnMixael> 2 hours later... "God damn, how did this ever work at all?!"
(...)
<MageKing17> so
<MageKing17> more than two hours
<MageKing17> but once again we have reached the inevitable conclusion
<MageKing17> How did this code ever work in the first place!?

<@The_E> Welcome to OpenGL, where standards compliance is optional, and error reporting inconsistent

<MageKing17> It was all working perfectly until I actually tried it on an actual mission.

<IronWorks> I am useful for FSO stuff again. This is a red-letter day!
* z64555 erases "Thursday" and rewrites it in red ink

<MageKing17> TIL the entire homing code is held up by shoestrings and duct tape, basically.

 
Re: [Feature request] More detailled feedback from hud parsing
That would be nice, thank you :)

 

Offline AdmiralRalwood

  • 211
  • The Cthulhu programmer himself!
    • Skype
    • Steam
    • Twitter
Re: [Feature request] More detailled feedback from hud parsing
Test build that should provide more useful complaints about invalid gauge types (uses error_display(), so you get filename and line number, as well as downgrading to a Warning if -noparseerrors is used): [EDIT: Deleted]

What exactly is the second problem? The fact that "#Ship Gauges" isn't a valid section header? I don't think there are any tables in FSO that will actually complain about bogus section headers like that; stick that on the end of just about any table and FSO should ignore it. Heck, you could append an entire Shakespearean play to the end of most (if not all) tables and FSO wouldn't even notice, because it just stops caring once it's parsed the relevant data.
« Last Edit: August 08, 2014, 10:25:17 am by AdmiralRalwood »
Ph'nglui mglw'nafh Codethulhu GitHub wgah'nagl fhtagn.

schrödinbug (noun) - a bug that manifests itself in running software after a programmer notices that the code should never have worked in the first place.

When you gaze long into BMPMAN, BMPMAN also gazes into you.

"I am one of the best FREDders on Earth" -General Battuta

<Aesaar> literary criticism is vladimir putin

<MageKing17> "There's probably a reason the code is the way it is" is a very dangerous line of thought. :P
<MageKing17> Because the "reason" often turns out to be "nobody noticed it was wrong".
(the very next day)
<MageKing17> this ****ing code did it to me again
<MageKing17> "That doesn't really make sense to me, but I'll assume it was being done for a reason."
<MageKing17> **** ME
<MageKing17> THE REASON IS PEOPLE ARE STUPID
<MageKing17> ESPECIALLY ME

<MageKing17> God damn, I do not understand how this is breaking.
<MageKing17> Everything points to "this should work fine", and yet it's clearly not working.
<MjnMixael> 2 hours later... "God damn, how did this ever work at all?!"
(...)
<MageKing17> so
<MageKing17> more than two hours
<MageKing17> but once again we have reached the inevitable conclusion
<MageKing17> How did this code ever work in the first place!?

<@The_E> Welcome to OpenGL, where standards compliance is optional, and error reporting inconsistent

<MageKing17> It was all working perfectly until I actually tried it on an actual mission.

<IronWorks> I am useful for FSO stuff again. This is a red-letter day!
* z64555 erases "Thursday" and rewrites it in red ink

<MageKing17> TIL the entire homing code is held up by shoestrings and duct tape, basically.

 
Re: [Feature request] More detailled feedback from hud parsing
Test build that should provide more useful complaints about invalid gauge types (uses error_display(), so you get filename and line number, as well as downgrading to a Warning if -noparseerrors is used): http://deviance.duckish.net/downloads/FS2_Open_hudparse_test.7z
Thank you very much sir, I'll test that right away.

Quote
What exactly is the second problem? The fact that "#Ship Gauges" isn't a valid section header? I don't think there are any tables in FSO that will actually complain about bogus section headers like that; stick that on the end of just about any table and FSO should ignore it. Heck, you could append an entire Shakespearean play to the end of most (if not all) tables and FSO wouldn't even notice, because it just stops caring once it's parsed the relevant data.
Hmm, I didn't know that. I guess that's not an issue then :) Thanks for clarifying.

 
Re: [Feature request] More detailled feedback from hud parsing
OK, with no mod selected, I'm getting this:

Error prompt:
Code: [Select]
ships.tbl(line 235):
Error: Required token = [#End], [$Subsystem:], or [$Ship], found [$Name:                          GTF Hercules]

ntdll.dll! ZwWaitForSingleObject + 21 bytes
kernel32.dll! WaitForSingleObjectEx + 67 bytes
kernel32.dll! WaitForSingleObject + 18 bytes
fs2_open_3_7_1_SSE2-DEBUG.exe! SCP_DumpStack + 354 bytes
fs2_open_3_7_1_SSE2-DEBUG.exe! Error + 229 bytes
fs2_open_3_7_1_SSE2-DEBUG.exe! error_display + 369 bytes
fs2_open_3_7_1_SSE2-DEBUG.exe! required_string_one_of + 561 bytes
fs2_open_3_7_1_SSE2-DEBUG.exe! parse_ship_values + 23790 bytes
fs2_open_3_7_1_SSE2-DEBUG.exe! parse_ship + 939 bytes
fs2_open_3_7_1_SSE2-DEBUG.exe! parse_shiptbl + 364 bytes
fs2_open_3_7_1_SSE2-DEBUG.exe! ship_init + 556 bytes
fs2_open_3_7_1_SSE2-DEBUG.exe! game_init + 1679 bytes
fs2_open_3_7_1_SSE2-DEBUG.exe! game_main + 519 bytes
fs2_open_3_7_1_SSE2-DEBUG.exe! WinMain + 328 bytes
fs2_open_3_7_1_SSE2-DEBUG.exe! __tmainCRTStartup + 296 bytes
fs2_open_3_7_1_SSE2-DEBUG.exe! WinMainCRTStartup + 13 bytes
kernel32.dll! BaseThreadInitThunk + 18 bytes
ntdll.dll! RtlInitializeExceptionChain + 99 bytes
ntdll.dll! RtlInitializeExceptionChain + 54 bytes

fs2_open.log
Code: [Select]
==========================================================================
DEBUG SPEW: No debug_filter.cfg found, so only general, error, and warning
categories can be shown and no debug_filter.cfg info will be saved.
==========================================================================
FreeSpace 2 Open version: 3.7.1
Passed cmdline options:
  -3dshockwave
  -soft_particles
  -post_process
  -fb_explosions
  -rearm_timer
  -targetinfo
  -3dwarp
  -ship_choice_3d
  -weapon_choice_3d
  -warp_flash
  -output_sexps
  -output_scripting
Building file index...
Found root pack 'C:\Freespace 2\FS2OGGcutscenepack.vp' with a checksum of 0x84396e99
Found root pack 'C:\Freespace 2\multi-mission-pack.vp' with a checksum of 0x377695e0
Found root pack 'C:\Freespace 2\multi-voice-pack.vp' with a checksum of 0xd50e7442
Found root pack 'C:\Freespace 2\Root_fs2.vp' with a checksum of 0xce10d76c
Found root pack 'C:\Freespace 2\smarty_fs2.vp' with a checksum of 0xddeb3b1e
Found root pack 'C:\Freespace 2\sparky_fs2.vp' with a checksum of 0x164fe65a
Found root pack 'C:\Freespace 2\sparky_hi_fs2.vp' with a checksum of 0xa11d56f1
Found root pack 'C:\Freespace 2\stu_fs2.vp' with a checksum of 0xd77da83a
Found root pack 'C:\Freespace 2\tango1_fs2.vp' with a checksum of 0x4c25221e
Found root pack 'C:\Freespace 2\tango2_fs2.vp' with a checksum of 0x86920b82
Found root pack 'C:\Freespace 2\tango3_fs2.vp' with a checksum of 0x705e8d71
Found root pack 'C:\Freespace 2\warble_fs2.vp' with a checksum of 0xd85c305d
Searching root 'C:\Freespace 2\' ... 127 files
Searching root pack 'C:\Freespace 2\FS2OGGcutscenepack.vp' ... 10 files
Searching root pack 'C:\Freespace 2\multi-mission-pack.vp' ... 110 files
Searching root pack 'C:\Freespace 2\multi-voice-pack.vp' ... 307 files
Searching root pack 'C:\Freespace 2\Root_fs2.vp' ... 157 files
Searching root pack 'C:\Freespace 2\smarty_fs2.vp' ... 10 files
Searching root pack 'C:\Freespace 2\sparky_fs2.vp' ... 3027 files
Searching root pack 'C:\Freespace 2\sparky_hi_fs2.vp' ... 1337 files
Searching root pack 'C:\Freespace 2\stu_fs2.vp' ... 2355 files
Searching root pack 'C:\Freespace 2\tango1_fs2.vp' ... 32 files
Searching root pack 'C:\Freespace 2\tango2_fs2.vp' ... 15 files
Searching root pack 'C:\Freespace 2\tango3_fs2.vp' ... 10 files
Searching root pack 'C:\Freespace 2\warble_fs2.vp' ... 52 files
Found 13 roots and 7549 files.
Setting language to English
Game Settings Table: Using Standard Loops For SEXP Arguments
Game Settings Table: Using standard event chaining behavior
Game Settings Table: External shaders are DISABLED
Initializing OpenAL...
  OpenAL Vendor     : Creative Labs Inc.
  OpenAL Renderer   : Software
  OpenAL Version    : 1.1

  Found extension "ALC_EXT_EFX".

  Sample rate: 44100 (44100)
  EFX enabled: NO
  Playback device: Generic Software on Haut-parleurs (Realtek High Definition Audio)
  Capture device: Microphone (Realtek High Defini
... OpenAL successfully initialized!
Failed to init speech
Initializing OpenGL graphics device at 1280x1024 with 32-bit color...
  Initializing WGL...
  Requested WGL Video values = R: 8, G: 8, B: 8, depth: 24, stencil: 8, double-buffer: 1
  Actual WGL Video values    = R: 8, G: 8, B: 8, depth: 24, stencil: 8, double-buffer: 1
  OpenGL Vendor    : NVIDIA Corporation
  OpenGL Renderer  : GeForce GT 630/PCIe/SSE2
  OpenGL Version   : 4.4.0

  Using extension "GL_EXT_fog_coord".
  Using extension "GL_ARB_multitexture".
  Using extension "GL_ARB_texture_env_add".
  Using extension "GL_ARB_texture_compression".
  Using extension "GL_EXT_texture_compression_s3tc".
  Using extension "GL_EXT_texture_filter_anisotropic".
  Using extension "GL_ARB_texture_env_combine".
  Using extension "GL_EXT_compiled_vertex_array".
  Using extension "GL_EXT_draw_range_elements".
  Using extension "GL_ARB_texture_mirrored_repeat".
  Using extension "GL_ARB_texture_non_power_of_two".
  Using extension "GL_ARB_vertex_buffer_object".
  Using extension "GL_ARB_pixel_buffer_object".
  Using extension "GL_SGIS_generate_mipmap".
  Using extension "GL_EXT_framebuffer_object".
  Using extension "GL_ARB_texture_rectangle".
  Using extension "GL_EXT_bgra".
  Using extension "GL_ARB_texture_cube_map".
  Using extension "GL_EXT_texture_lod_bias".
  Using extension "GL_ARB_point_sprite".
  Using extension "GL_ARB_shading_language_100".
  Using extension "GL_ARB_shader_objects".
  Using extension "GL_ARB_vertex_shader".
  Using extension "GL_ARB_fragment_shader".
  Using extension "GL_ARB_shader_texture_lod".
  Using extension "GL_ARB_texture_float".
  Using extension "GL_ARB_draw_elements_base_vertex".
  Found special extension function "wglSwapIntervalEXT".

Compiling new shader:
   Loading built-in default shader for: soft-v.sdr
   Loading built-in default shader for: soft-f.sdr
Shader features:
   Depth-blended Particles
Compiling new shader:
   Loading built-in default shader for: soft-v.sdr
   Loading built-in default shader for: soft-f.sdr
Shader features:
   Distorted Particles

  Compiling post-processing shader 1 ...
   Loading built-in default shader for: post-v.sdr
   Loading built-in default shader for: post-f.sdr
  Compiling post-processing shader 2 ...
   Loading built-in default shader for: post-v.sdr
   Loading built-in default shader for: blur-f.sdr
  Compiling post-processing shader 3 ...
   Loading built-in default shader for: post-v.sdr
   Loading built-in default shader for: blur-f.sdr
  Compiling post-processing shader 4 ...
   Loading built-in default shader for: post-v.sdr
   Loading built-in default shader for: brightpass-f.sdr
  Compiling post-processing shader 5 ...
   Loading built-in default shader for: fxaa-v.sdr
   Loading built-in default shader for: fxaa-f.sdr
  Compiling post-processing shader 6 ...
   Loading built-in default shader for: post-v.sdr
   Loading built-in default shader for: fxaapre-f.sdr
  Compiling post-processing shader 7 ...
   Loading built-in default shader for: post-v.sdr
   Loading built-in default shader for: ls-f.sdr

  Max texture units: 4 (32)
  Max elements vertices: 1048576
  Max elements indices: 1048576
  Max texture size: 16384x16384
  Max render buffer size: 16384x16384
  Can use compressed textures: YES
  Texture compression available: YES
  Post-processing enabled: YES
  Using trilinear texture filter.
  OpenGL Shader Version: 4.40 NVIDIA via Cg compiler
... OpenGL init is complete!
Size of bitmap info = 742 KB
Size of bitmap extra info = 48 bytes
ANI cursorweb with size 24x24 (25.0% wasted)
GRAPHICS: Initializing default colors...
SCRIPTING: Beginning initialization sequence...
SCRIPTING: Beginning Lua initialization...
LUA: Opening LUA state...
LUA: Initializing base Lua libraries...
LUA: Beginning ADE initialization
ADE: Initializing enumeration constants...
ADE: Assigning Lua session...
SCRIPTING: Outputting scripting metadata...
SCRIPTING: Beginning main hook parse sequence....
Wokka!  Error opening file (scripting.tbl)!
TABLES: Unable to parse 'scripting.tbl'!  Error code = 5.
SCRIPTING: Inititialization complete.
SCRIPTING: Splash screen overrides checked
SCRIPTING: Splash hook has been run
SCRIPTING: Splash screen conditional hook has been run
Using high memory settings...
Wokka!  Error opening file (interface.tbl)!
WMCGUI: Unable to parse 'interface.tbl'!  Error code = 5.
Dutifully ignoring the extra sound values for retail sound 36, 'l_hit.wav'...
Dutifully ignoring the extra sound values for retail sound 37, 'm_hit.wav'...
Windows reported 16 joysticks, we found 0
Current soundtrack set to -1 in event_music_reset_choices
Wokka!  Error opening file (armor.tbl)!
TABLES: Unable to parse 'armor.tbl'!  Error code = 5.
ships.tbl(line 235): Error: Required token = [#End], [$Subsystem:], or [$Ship], found [$Name:                          GTF Hercules]

ERROR: ships.tbl(line 235):
Error: Required token = [#End], [$Subsystem:], or [$Ship], found [$Name:                          GTF Hercules]

File: parselo.cpp
Line: 333
Freeing all existing models...

 

Offline AdmiralRalwood

  • 211
  • The Cthulhu programmer himself!
    • Skype
    • Steam
    • Twitter
Re: [Feature request] More detailled feedback from hud parsing
Whoops; sorry, apparently that build included another thing that happened to be broken. I thought I'd compiled it with just the hudparse changes, but apparently not. Please stand by while I fetch a proper test build...

EDIT: [EDIT2: Deleted] now contains a build containing nothing but latest trunk and the hudparse changes.
« Last Edit: August 08, 2014, 10:25:34 am by AdmiralRalwood »
Ph'nglui mglw'nafh Codethulhu GitHub wgah'nagl fhtagn.

schrödinbug (noun) - a bug that manifests itself in running software after a programmer notices that the code should never have worked in the first place.

When you gaze long into BMPMAN, BMPMAN also gazes into you.

"I am one of the best FREDders on Earth" -General Battuta

<Aesaar> literary criticism is vladimir putin

<MageKing17> "There's probably a reason the code is the way it is" is a very dangerous line of thought. :P
<MageKing17> Because the "reason" often turns out to be "nobody noticed it was wrong".
(the very next day)
<MageKing17> this ****ing code did it to me again
<MageKing17> "That doesn't really make sense to me, but I'll assume it was being done for a reason."
<MageKing17> **** ME
<MageKing17> THE REASON IS PEOPLE ARE STUPID
<MageKing17> ESPECIALLY ME

<MageKing17> God damn, I do not understand how this is breaking.
<MageKing17> Everything points to "this should work fine", and yet it's clearly not working.
<MjnMixael> 2 hours later... "God damn, how did this ever work at all?!"
(...)
<MageKing17> so
<MageKing17> more than two hours
<MageKing17> but once again we have reached the inevitable conclusion
<MageKing17> How did this code ever work in the first place!?

<@The_E> Welcome to OpenGL, where standards compliance is optional, and error reporting inconsistent

<MageKing17> It was all working perfectly until I actually tried it on an actual mission.

<IronWorks> I am useful for FSO stuff again. This is a red-letter day!
* z64555 erases "Thursday" and rewrites it in red ink

<MageKing17> TIL the entire homing code is held up by shoestrings and duct tape, basically.

 
Re: [Feature request] More detailled feedback from hud parsing
Seems to be working as intended so far, thank you very much. Until this goes into trunk, would it be possible to have a patch file?

  

Offline AdmiralRalwood

  • 211
  • The Cthulhu programmer himself!
    • Skype
    • Steam
    • Twitter
Re: [Feature request] More detailled feedback from hud parsing
Ph'nglui mglw'nafh Codethulhu GitHub wgah'nagl fhtagn.

schrödinbug (noun) - a bug that manifests itself in running software after a programmer notices that the code should never have worked in the first place.

When you gaze long into BMPMAN, BMPMAN also gazes into you.

"I am one of the best FREDders on Earth" -General Battuta

<Aesaar> literary criticism is vladimir putin

<MageKing17> "There's probably a reason the code is the way it is" is a very dangerous line of thought. :P
<MageKing17> Because the "reason" often turns out to be "nobody noticed it was wrong".
(the very next day)
<MageKing17> this ****ing code did it to me again
<MageKing17> "That doesn't really make sense to me, but I'll assume it was being done for a reason."
<MageKing17> **** ME
<MageKing17> THE REASON IS PEOPLE ARE STUPID
<MageKing17> ESPECIALLY ME

<MageKing17> God damn, I do not understand how this is breaking.
<MageKing17> Everything points to "this should work fine", and yet it's clearly not working.
<MjnMixael> 2 hours later... "God damn, how did this ever work at all?!"
(...)
<MageKing17> so
<MageKing17> more than two hours
<MageKing17> but once again we have reached the inevitable conclusion
<MageKing17> How did this code ever work in the first place!?

<@The_E> Welcome to OpenGL, where standards compliance is optional, and error reporting inconsistent

<MageKing17> It was all working perfectly until I actually tried it on an actual mission.

<IronWorks> I am useful for FSO stuff again. This is a red-letter day!
* z64555 erases "Thursday" and rewrites it in red ink

<MageKing17> TIL the entire homing code is held up by shoestrings and duct tape, basically.

 
Re: [Feature request] More detailled feedback from hud parsing
Thanks again.

 

Offline AdmiralRalwood

  • 211
  • The Cthulhu programmer himself!
    • Skype
    • Steam
    • Twitter
Re: [Feature request] More detailled feedback from hud parsing
The version of the patch in the test build I uploaded earlier is now in trunk as of r10978, so I've deleted the test build from my hosting.
Ph'nglui mglw'nafh Codethulhu GitHub wgah'nagl fhtagn.

schrödinbug (noun) - a bug that manifests itself in running software after a programmer notices that the code should never have worked in the first place.

When you gaze long into BMPMAN, BMPMAN also gazes into you.

"I am one of the best FREDders on Earth" -General Battuta

<Aesaar> literary criticism is vladimir putin

<MageKing17> "There's probably a reason the code is the way it is" is a very dangerous line of thought. :P
<MageKing17> Because the "reason" often turns out to be "nobody noticed it was wrong".
(the very next day)
<MageKing17> this ****ing code did it to me again
<MageKing17> "That doesn't really make sense to me, but I'll assume it was being done for a reason."
<MageKing17> **** ME
<MageKing17> THE REASON IS PEOPLE ARE STUPID
<MageKing17> ESPECIALLY ME

<MageKing17> God damn, I do not understand how this is breaking.
<MageKing17> Everything points to "this should work fine", and yet it's clearly not working.
<MjnMixael> 2 hours later... "God damn, how did this ever work at all?!"
(...)
<MageKing17> so
<MageKing17> more than two hours
<MageKing17> but once again we have reached the inevitable conclusion
<MageKing17> How did this code ever work in the first place!?

<@The_E> Welcome to OpenGL, where standards compliance is optional, and error reporting inconsistent

<MageKing17> It was all working perfectly until I actually tried it on an actual mission.

<IronWorks> I am useful for FSO stuff again. This is a red-letter day!
* z64555 erases "Thursday" and rewrites it in red ink

<MageKing17> TIL the entire homing code is held up by shoestrings and duct tape, basically.