Jump to content
The Dark Mod Forums

Crash probably related to issue 0002811 - plus a patch


Zbyl
 Share

Recommended Posts

This is a bug that occurs on current (29 Jan 2013, rev. 5694) SVN code. Proposed solutions are in this post.

 

It's probably related to:

0002811: Font loading does not fall back to English

http://bugs.angua.at/view.php?id=2811

 

Reproduction:

After changing language to polish and restarting TDM, the following happens:

 

SetupFonts() in idDeviceContext::Init() can't find fonts for polish language. It does not fall back to loading english fonts.

Lack of ANY fonts loaded causes a crash while loading GUI (in idDeviceContext::SetFontByScale() exactly).

I've attached the stack trace.

 

I have three solutions for this problem:

 

1. I've attaches a patch (I18N.cpp.patch.txt). However:

- it uses a hard coded value "fonts/english",

- it requires #str_04127 to be translated properly for all languages with their own fonts - this is actually an advantage, IMHO.

 

2. I've also attached an alternative patch (DeviceContext.cpp.patch.txt) that solves this problem. It also uses a hard coded value "fonts/english", and is not as good as the first one.

 

3. Third solution is to require for translation of #str_04127 to be present in all languages that do not have their own fonts. Translations such as Polish have to be fixed.

 

I actually think that the first solution is the best one, because it's the most bullet-proof (no risk of crashes, ever).

 

(I wanted to edit the original issue, but I don't have permission.)

stacktrace.txt

DeviceContext.cpp.patch.txt

I18N.cpp.patch.txt

Link to comment
Share on other sites

Hi, thanx for the headsup and the patch!

 

I've looked into why Polish would not fallback to the English fonts, and can see why it could do that - the intention was that if #str_04127 is not translated, it falls back to the value of #str_04127 in english. The code instead uses "fonts/language", which is proper for any other language (like Japanese), but would be invalid for Polish (since it must use English fonts).

 

So I think the issue can equally easily be patched by adding the mission value for #str_04127 to the polish dictionary.

 

HOWEVER, this is what actually is happening. The polish dictionary already contains:

 

    "#str_04127"    "fonts/english"		 // the path to the font files, western languages all use english, while russian etc use their own

 

So, on my system, this works already and the same entry is present in the file we shipped with v1.08 (and such a big bug would not have escpated us).

 

I'm curious, why does it not work on your system?

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

No harm done :) Was this a problem with the updater?

 

If you find other bugs, such detailed reports are always welcome :)

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

Hmm, think I've also fixed this in my branch (since there is a more serious issue that the internationalization requires the dynamic link to be correct else the engine will fall over.).

 

Erm, there is nothing to fix, the system works as intended (it picks the language the strings file says, or it falls back to "lang/LANGUAGE"). So what did you "fix"?

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recent Status Updates

    • freyk

      Some years earlier i created some launchers for TDM. uploaded today some new sourcecode and executables on my github repo.
       
      · 0 replies
    • Epifire

      Say, I know it's been a while since the site got overhauled from the crash. But did we ever figure out if/how to get the recent topics & replies list back? It's not a total deal breaker but it was nice for becoming a thread creeper again...


      · 2 replies
    • Epifire

      Some of you who've been on the TDM discord know I was out of work last Winter, just putting in hrs for the developer portfolio. Currently I've been working a seasonal job to pay the bills and now I'm finally in my last week before I get bumped off. Things will be tight but I'm planning a long off period to make as much content as I can. Big plans in Unreal Engine as well as my most ambitious TDM collab yet! Never been so excited to be a stuck at home to pursue my life's work. With a lotta time and maybe some luck, I'm hoping to get enough art work done that I may start applying around to studios.
      · 4 replies
    • STiFU

      I finally got around to play Prey and I truly loved it. It is an incredible homage to System Shock and Deus Ex. While the gameplay is not en par with those two titles, the game makes up for that with its well written lore and story. The whole "world" just feells so authentic and it features a ton of really god environmental story-telling. Recommended for every immersive sim fan, i.e., everyone on this forum.
      · 2 replies
    • jaxa

      Alder Lake has arrived:
      https://forums.thedarkmod.com/index.php?/topic/18055-2016-cpugpu-news/page/15/&tab=comments#comment-466190
       
      · 0 replies
×
×
  • Create New...