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

    • OrbWeaver

      Does anyone actually use the Normalise button in the Surface inspector? Even after looking at the code I'm not quite sure what it's for.
      · 6 replies
    • Ansome

      Turns out my 15th anniversary mission idea has already been done once or twice before! I've been beaten to the punch once again, but I suppose that's to be expected when there's over 170 FMs out there, eh? I'm not complaining though, I love learning new tricks and taking inspiration from past FMs. Best of luck on your own fan missions!
      · 4 replies
    • The Black Arrow

      I wanna play Doom 3, but fhDoom has much better features than dhewm3, yet fhDoom is old, outdated and probably not supported. Damn!
      Makes me think that TDM engine for Doom 3 itself would actually be perfect.
      · 6 replies
    • Petike the Taffer

      Maybe a bit of advice ? In the FM series I'm preparing, the two main characters have the given names Toby and Agnes (it's the protagonist and deuteragonist, respectively), I've been toying with the idea of giving them family names as well, since many of the FM series have named protagonists who have surnames. Toby's from a family who were usually farriers, though he eventually wound up working as a cobbler (this serves as a daylight "front" for his night time thieving). Would it make sense if the man's popularly accepted family name was Farrier ? It's an existing, though less common English surname, and it directly refers to the profession practiced by his relatives. Your suggestions ?
      · 9 replies
    • nbohr1more

      Looks like the "Reverse April Fools" releases were too well hidden. Darkfate still hasn't acknowledge all the new releases. Did you play any of the new April Fools missions?
      · 5 replies
×
×
  • Create New...