Jump to content
The Dark Mod Forums

Difficulty names


Recommended Posts

After fixing a crash when showing the Difficulty editor, I noticed that the difficulty setting names on the tabs were set to meaningless placeholder strings:

readableeditor.png.a3bf36adb156c1a1efc83f2e982c3030.png

I first though this was another bug, but it seems these strings come directly from the mod data. DarkRadiant looks for an entity def called difficultyMenu, which can be found in def/tdm_difficulty.def. In this entity def, we have:

	"diff0default"			"#str_03000"		// Easy
	"diff1default"			"#str_03004"		// Medium
	"diff2default"			"#str_03011"		// Difficult

So the user-friendly default names are commented out, and the actual names that DarkRadiant sees are placeholder strings (presumably intended to be translated, but AFAIK DarkRadiant does not handle translation of mod resources).

I wonder if this is by design? Does anybody see user-friendly default difficult names in the Difficulty editor, or is this only happening on my system?

If this is a problem for everyone, I can see two possible solutions:

  • Fix the names in the entity def (less work for me, but might mess up mod translation, if that is actually a thing).
  • Move the default names somewhere else. For example, they could go directly in the DarkRadiant .game file. This does mean they would not be tightly bound with the mod data, so they would need to be updated manually if a decision was made to change the default names, but since they are only defaults (map authors can override them) maybe this does not matter.
  • Like 1
Link to comment
Share on other sites

I encountered this too. Only see the strings. This was my first time using the difficulty editor so I thought it was normal and really inconvenient, ha 

Link to comment
Share on other sites

I think Tels did this years ago to support his translation work.  I don't think it was well thought through.

  • Like 1
Link to comment
Share on other sites

I think I see the problem here. There are three possible configurations, but all of them have significant drawbacks:

  • The current solution: default difficulty names are translatable, but DarkRadiant doesn't parse the mod-specific translation data, so they show in the interface as string table entries rather than useful text.
  • Default difficulty names are translatable, and DarkRadiant does parse the mod-specific translation data. Presumably ideal from a user perspective, but it's a huge amount of work. DarkRadiant supports translation already of course, but it's using GNU Gettext, whereas this all.lang appears to be entirely a mod-specific custom format that will need its own parsing code, and then we have to map DarkRadiant's language (specified by the standard country codes like de) into the English name for the language (!) in order to load german.lang, then possibly do something with the character mapping in the associated .map file...
  • Default difficulty names are untranslated. They will show correctly in the interface, but DR will then write the untranslated name into the map data (so the map will just specify "Easy" instead of "str_03000"), which means that the actual difficulty names shown in game will never be translated correctly even if every other part of the map is.

So there isn't really an easy solution, especially when considering that any changes must not break existing maps.

In fact I'd be tempted to go with the following nasty hack: DarkRadiant contains hard code to map the particular string table entries into English names. So when we read "str_03000" we just map it to "Easy" at the GUI level, leaving the original string table entry in the map file. Not an elegant solution but it's probably better than having useless placeholder strings in the UI for years, and I assume the placeholder is at least stable (i.e. guaranteed not to change) because this would break all existing maps.

  • Like 1
Link to comment
Share on other sites

I implemented a simple translation based on string values added into the darkmod.game file. Not quite as bad as hard-coding (since they can be changed without recompiling), and much less work than processing the entire mod translation data.

difficultyfixed.png.9a8f136851a9e9d26a318cb1242446d7.png

  • Like 3
Link to comment
Share on other sites

  • 5 weeks later...

Seeing as I was poking around in the Difficulty editor anyway, I went ahead and implemented editing of difficulty names, which is apparently supported by the mod but hadn't yet made it into the DR interface.

The layout is slightly changed to use a dropdown instead of tabs, which makes it possible to add a custom edit button:

diff1.png.c2de9da37f0375f0228c66fe8111512d.png

Clicking on the edit button shows a simple dialog in which you can edit the current name:

diff2.png.bd935129c33b083235d83d13296a43f6.png

The changes are then reflected in the dialog and saved into the current map:

diff3.png.d1738618b1475fa8fbc4e725c5137a59.png

I haven't tested it in game but I assume it should work because I'm writing the changes to the spawnargs specified by the wiki (and already used by DR to display the difficulty names, even if you couldn't edit them).

  • Like 2
Link to comment
Share on other sites

Should be working ok, but you have to type in the #strNNNN number yourself. The id will get written to worldspawn just as if you typed it in manually in the Entity Inspector. You need to use different string IDs than the ones used by the mod, of course, otherwise it won't make much sense.

Link to comment
Share on other sites

Nothing has changed regarding the translation behaviour.

If you leave the difficulty names at their defaults, they will be translated by the mod as before. DarkRadiant does not write anything into the map in this case.

If you use a custom name, that name will be written into the map and used exactly as written, as Greebo says. If you use a completely new name, like "Wakka wakka", I assume the mod is not going to be able to translate that because it won't have a string table entry, but you are free to enter a suitable string table ID if you want to use a modified name that is already recognised by the mod.

These are the strings I could find in the mod definitions, which suggest (although I have not tested) that all of these string table entries could be used for appropriate translated difficulty names:

	"#str_03000"	"Easy"
	"#str_03001"	"Casual"
	"#str_03002"	"Novice"
	"#str_03003"	"Beginner"
	"#str_03004"	"Medium"
	"#str_03005"	"Normal"
	"#str_03006"	"Challenging"
	"#str_03007"	"Expert"
	"#str_03008"	"Master"
	"#str_03009"	"Veteran"
	"#str_03010"	"Hardcore"
	"#str_03011"	"Difficult"
	"#str_03012"	"Hard"
	"#str_03013"	"Apprentice"
	"#str_03014"	"Professional"
	"#str_03015"	"Braggard"

 

 

  • Like 2
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.

  • Recent Status Updates

    • Ansome

      Finally got my PC back from the shop after my SSD got corrupted a week ago and damaged my motherboard. Scary stuff, but thank goodness it happened right after two months of FM development instead of wiping all my work before I could release it. New SSD, repaired Motherboard and BIOS, and we're ready to start working on my second FM with some added version control in the cloud just to be safe!
      · 0 replies
    • Petike the Taffer  »  DeTeEff

      I've updated the articles for your FMs and your author category at the wiki. Your newer nickname (DeTeEff) now comes first, and the one in parentheses is your older nickname (Fieldmedic). Just to avoid confusing people who played your FMs years ago and remember your older nickname. I've added a wiki article for your latest FM, Who Watches the Watcher?, as part of my current updating efforts. Unless I overlooked something, you have five different FMs so far.
      · 0 replies
    • Petike the Taffer

      I've finally managed to log in to The Dark Mod Wiki. I'm back in the saddle and before the holidays start in full, I'll be adding a few new FM articles and doing other updates. Written in Stone is already done.
      · 4 replies
    • nbohr1more

      TDM 15th Anniversary Contest is now active! Please declare your participation: https://forums.thedarkmod.com/index.php?/topic/22413-the-dark-mod-15th-anniversary-contest-entry-thread/
       
      · 0 replies
    • JackFarmer

      @TheUnbeholden
      You cannot receive PMs. Could you please be so kind and check your mailbox if it is full (or maybe you switched off the function)?
      · 1 reply
×
×
  • Create New...