Author Topic: Let's do something clever with $minimum version:  (Read 2800 times)

0 Members and 1 Guest are viewing this topic.

Offline General Battuta

  • Poe's Law In Action
  • 214
  • i wonder when my postcount will exceed my iq
Let's do something clever with $minimum version:
$Minimum version: is an amazing feature. It lets us tell the game 'hey, you need at least 3.7.3.20151121 to run.'

Unfortunately, we just added this feature. So if you're trying to run BP today with a build from 6 months ago...your build is too old to tell you that you need a new version.

HOWEVER.

What happens if we try to load  a mod with $minimum version defined on an old build? We get

Code: [Select]
game_settings.tbl(line 1):
Error: Missing required token: [#END]. Found [#GAME SETTINGS] instead.

ntdll.dll! ZwWaitForSingleObject + 21 bytes
kernel32.dll! WaitForSingleObjectEx + 67 bytes
kernel32.dll! WaitForSingleObject + 18 bytes
fs2_open_3_7_3_SSE2_2015_nov20.exe! <no symbol>
fs2_open_3_7_3_SSE2_2015_nov20.exe! <no symbol>
fs2_open_3_7_3_SSE2_2015_nov20.exe! <no symbol>
fs2_open_3_7_3_SSE2_2015_nov20.exe! <no symbol>
fs2_open_3_7_3_SSE2_2015_nov20.exe! <no symbol>
fs2_open_3_7_3_SSE2_2015_nov20.exe! <no symbol>
kernel32.dll! BaseThreadInitThunk + 18 bytes
ntdll.dll! RtlInitializeExceptionChain + 99 bytes
ntdll.dll! RtlInitializeExceptionChain + 54 bytes

Because it doesn't know what to do with #GAME SETTINGS.

How stupid/amazing would it be to add a line before #GAME SETTINGS that said #UPDATE TO NEW BUILD!

That way, we'd be able to kind of retrofit an error message into old builds!

 

Offline jr2

  • The Mail Man
  • 212
  • It's prounounced jayartoo 0x6A7232
    • Steam
Re: Let's do something clever with $minimum version:
Ingenious!

 

Offline m!m

  • 211
Re: Let's do something clever with $minimum version:
#GAME SETTINGS is optional. You could remove it which will lead to older builds showing the minimum version option as the invalid token.

 

Offline The E

  • He's Ebeneezer Goode
  • Moderator
  • 213
  • Nothing personal, just tech support.
    • Steam
    • Twitter
Re: Let's do something clever with $minimum version:
I don't see how this is better than (or even different to) what we're doing right now with the $Minimum Version tag in game_settings.tbl.
If I'm just aching this can't go on
I came from chasing dreams to feel alone
There must be changes, miss to feel strong
I really need lifе to touch me
--Evergrey, Where August Mourns

 

Offline jr2

  • The Mail Man
  • 212
  • It's prounounced jayartoo 0x6A7232
    • Steam
Re: Let's do something clever with $minimum version:
Unfortunately, we just added this feature. So if you're trying to run BP today with a build from 6 months ago...your build is too old to tell you that you need a new version.

HOWEVER.

What happens if we try to load  a mod with $minimum version defined on an old build? We get

Code: [Select]
game_settings.tbl(line 1):
Error: Missing required token: [#END]. Found [#GAME SETTINGS] instead.

ntdll.dll! ZwWaitForSingleObject + 21 bytes
kernel32.dll! WaitForSingleObjectEx + 67 bytes
kernel32.dll! WaitForSingleObject + 18 bytes
fs2_open_3_7_3_SSE2_2015_nov20.exe! <no symbol>
fs2_open_3_7_3_SSE2_2015_nov20.exe! <no symbol>
fs2_open_3_7_3_SSE2_2015_nov20.exe! <no symbol>
fs2_open_3_7_3_SSE2_2015_nov20.exe! <no symbol>
fs2_open_3_7_3_SSE2_2015_nov20.exe! <no symbol>
fs2_open_3_7_3_SSE2_2015_nov20.exe! <no symbol>
kernel32.dll! BaseThreadInitThunk + 18 bytes
ntdll.dll! RtlInitializeExceptionChain + 99 bytes
ntdll.dll! RtlInitializeExceptionChain + 54 bytes

Because it doesn't know what to do with #GAME SETTINGS.

How stupid/amazing would it be to add a line before #GAME SETTINGS that said #UPDATE TO NEW BUILD![/i]

That way, we'd be able to kind of retrofit an error message into old builds!

 

Offline The E

  • He's Ebeneezer Goode
  • Moderator
  • 213
  • Nothing personal, just tech support.
    • Steam
    • Twitter
Re: Let's do something clever with $minimum version:
You do realize that I know how this engine works, how its various settings are coded, and how it reacts to error conditions, right? What Battuta wants to have is already supported because the "#Game Settings" line is strictly optional, if you start a game_settings.tbl with just the $Minimum Version tag, it will do exactly what battuta wants.

So, again,
I don't see how this is better than (or even different to) what we're doing right now with the $Minimum Version tag in game_settings.tbl.

Battuta's recommendation is not a good idea in my opinion, frankly. It introduces a line to a tbl that would quickly be relegated to being a cargo-cult thing that we'd have to keep dragging around forever that doesn't accomplish anything that the existing mechanisms don't already cover.

When we see a parsing error during troubleshooting, we already know that there are only two possible sources for that error. One, that whoever wrote the tbl made a typo somewhere or confused the order of entries or forgot a required setting. Two, that the build used does not support a given feature, in which case an update will fix it.

The minimum version tag is meant to catch all errors of category two as soon as possible, and while errors thrown during the transition phase from 3.7.2 ro 3.7.4 will still require some amount of engine knowledge to figure out, going forward they'll hopefully be readable by users.
« Last Edit: November 22, 2015, 09:03:42 am by The E »
If I'm just aching this can't go on
I came from chasing dreams to feel alone
There must be changes, miss to feel strong
I really need lifе to touch me
--Evergrey, Where August Mourns

 

Offline General Battuta

  • Poe's Law In Action
  • 214
  • i wonder when my postcount will exceed my iq
Re: Let's do something clever with $minimum version:
It'll say 'minimum version' (which is nice!) but it won't provide an imperative on how to fix it, since the error won't read as far as the version number, will it?

 

Offline jr2

  • The Mail Man
  • 212
  • It's prounounced jayartoo 0x6A7232
    • Steam
Re: Let's do something clever with $minimum version:
You do realize that I know how this engine works, how its various settings are coded, and how it reacts to error conditions, right? What Battuta wants to have is already supported because the "#Game Settings" line is strictly optional, if you start a game_settings.tbl with just the $Minimum Version tag, it will do exactly what battuta wants.

So, again,
I don't see how this is better than (or even different to) what we're doing right now with the $Minimum Version tag in game_settings.tbl.

:confused:  but you want the rest of game_settings for when you're running a normal build, to hold the game settings in, right?  I think I don't understand exactly what you're trying to say; can you elaborate?

Quote from: http://www.hard-light.net/wiki/index.php/Game_settings.tbl
The game_settings.tbl, also known as mod.tbl, defines options that can be changed globally.

 

Offline The E

  • He's Ebeneezer Goode
  • Moderator
  • 213
  • Nothing personal, just tech support.
    • Steam
    • Twitter
Re: Let's do something clever with $minimum version:
It'll say 'minimum version' (which is nice!) but it won't provide an imperative on how to fix it, since the error won't read as far as the version number, will it?

Code: [Select]
game_settings.tbl(line 1):
Error: Missing required token: [#END]. Found [$Minimum Version: 3.7.2] instead.

ntdll.dll! ZwWaitForSingleObject + 12 bytes
KERNELBASE.dll! WaitForSingleObject + 18 bytes
fs2_open_3_7_3_AVX.exe! SCP_DumpStack + 213 bytes
fs2_open_3_7_3_AVX.exe! Error + 230 bytes
fs2_open_3_7_3_AVX.exe! error_display + 202 bytes
fs2_open_3_7_3_AVX.exe! required_string + 109 bytes
fs2_open_3_7_3_AVX.exe! parse_mod_table + 2481 bytes
fs2_open_3_7_3_AVX.exe! mod_table_init + 53 bytes
fs2_open_3_7_3_AVX.exe! game_init + 362 bytes
fs2_open_3_7_3_AVX.exe! game_main + 330 bytes
fs2_open_3_7_3_AVX.exe! WinMain + 222 bytes
fs2_open_3_7_3_AVX.exe! __scrt_common_main_seh + 253 bytes
KERNEL32.DLL! BaseThreadInitThunk + 36 bytes
ntdll.dll! RtlUnicodeStringToInteger + 595 bytes
ntdll.dll! RtlUnicodeStringToInteger + 542 bytes

If I'm just aching this can't go on
I came from chasing dreams to feel alone
There must be changes, miss to feel strong
I really need lifе to touch me
--Evergrey, Where August Mourns

 

Offline jr2

  • The Mail Man
  • 212
  • It's prounounced jayartoo 0x6A7232
    • Steam
Re: Let's do something clever with $minimum version:
Hmm.  Yeah, if they were paying attention during install, they should be able to figure that out (i.e., they didn't just check everything that looked necessary / interesting and hit next).

Some users shut their brains off when they realize they're reading an error message though (because they know they don't know very much at all to do with computers / "I'm not good at technology"<- well, you're not good at much you don't put your mind to... so,, I guess accurate. :)  )


EDIT: Actually, if they are aware enough to notice the minimum version and read the title screen of the window, they will figure it out.  I'm not too optimistic about that either, but at least all the info is readily available to them.
« Last Edit: November 22, 2015, 09:21:58 am by jr2 »

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: Let's do something clever with $minimum version:
Yeah but even if we followed Battuta's suggestion you'd still get

Code: [Select]
game_settings.tbl(line 1):
Error: Missing required token: [#END]. Found [#UPDATE TO NEW BUILD!] instead.

ntdll.dll! ZwWaitForSingleObject + 12 bytes
KERNELBASE.dll! WaitForSingleObject + 18 bytes
fs2_open_3_7_3_AVX.exe! SCP_DumpStack + 213 bytes
fs2_open_3_7_3_AVX.exe! Error + 230 bytes
fs2_open_3_7_3_AVX.exe! error_display + 202 bytes
fs2_open_3_7_3_AVX.exe! required_string + 109 bytes
fs2_open_3_7_3_AVX.exe! parse_mod_table + 2481 bytes
fs2_open_3_7_3_AVX.exe! mod_table_init + 53 bytes
fs2_open_3_7_3_AVX.exe! game_init + 362 bytes
fs2_open_3_7_3_AVX.exe! game_main + 330 bytes
fs2_open_3_7_3_AVX.exe! WinMain + 222 bytes
fs2_open_3_7_3_AVX.exe! __scrt_common_main_seh + 253 bytes
KERNEL32.DLL! BaseThreadInitThunk + 36 bytes
ntdll.dll! RtlUnicodeStringToInteger + 595 bytes
ntdll.dll! RtlUnicodeStringToInteger + 542 bytes

And that's not a very readable error message for the sort of user we're talking about. And if we edit this into the code, then we'd end up having to support it forever, which seems rather pointless.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

[ Diaspora ] - [ Seeds Of Rebellion ] - [ Mind Games ]

 

Offline AdmiralRalwood

  • 211
  • The Cthulhu programmer himself!
    • Skype
    • Steam
    • Twitter
Re: Let's do something clever with $minimum version:
It'll say 'minimum version' (which is nice!) but it won't provide an imperative on how to fix it, since the error won't read as far as the version number, will it?
I know The_E addressed this particular example, but in general, just FYI, the "found" token will show the next 32 characters (or until the end of the line/file, whichever is sooner). "$Minimum Version: " is 18 characters; that leaves 14 characters that will be displayed (so, unless people preface their version numbers with an awful lot of spaces, we should be fine).
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.

 

Offline General Battuta

  • Poe's Law In Action
  • 214
  • i wonder when my postcount will exceed my iq
Re: Let's do something clever with $minimum version:
Ooh, ok. Clever!

Kara, unfortunately I think that's as readable as we're going to get with this hack.

 

Offline The E

  • He's Ebeneezer Goode
  • Moderator
  • 213
  • Nothing personal, just tech support.
    • Steam
    • Twitter
Re: Let's do something clever with $minimum version:
And I think that that hack is fundamentally unnecessary and not a good idea.
If I'm just aching this can't go on
I came from chasing dreams to feel alone
There must be changes, miss to feel strong
I really need lifе to touch me
--Evergrey, Where August Mourns

 

Offline General Battuta

  • Poe's Law In Action
  • 214
  • i wonder when my postcount will exceed my iq
Re: Let's do something clever with $minimum version:
But...the hack is already in the engine, right? You just showed how we can make the error show minimum version even on old builds.

 

Offline The E

  • He's Ebeneezer Goode
  • Moderator
  • 213
  • Nothing personal, just tech support.
    • Steam
    • Twitter
Re: Let's do something clever with $minimum version:
I was referring to the "#UPDATE TO NEW BUILD" thing.
If I'm just aching this can't go on
I came from chasing dreams to feel alone
There must be changes, miss to feel strong
I really need lifе to touch me
--Evergrey, Where August Mourns