Showing Tips for Players

From The DarkMod Wiki
Jump to navigationJump to search

By Geep, 2026

TDM has experimented with momentarily-visible "tip" information, as a form of awareness and clarification of available features, and "continuing education" beyond the Training and two official FMs.

Random Lore and Tips While Loading

This feature was introduced circa 2011 in TDM 2.04 with Springheel's "A Score to Settle", and refined thru 2017 with TDM 2.07 (see bugtracker "0002807: Random GUI quotes not showing during load").'

One motivation here is to fill your thumb-twiddling time with something besides watching a progress bar. How about showing a sentence of lore, and then a tip? The mechanism depends on the FM itself providing a specific type of GUI. The content of messages shown could be FM-specific, but are often generic.

Appearance

Consider the Official FM "St. Lucia". During game launch, immediately after the briefing video, you will see the FM's background image during. Look for two successive text strings at screen bottom.

Mechanism

During loading, the engine updates a "map_loading" float (range [0...1], representing percent loaded) for the benefit any GUI providing a progress bar.

But also, specifically for our concerns here, when loading starts, the engine (i.e., Game_local.cpp’s LoadMap function) looks just for <FM>/guis/map/<FM map name>.gui. If found, the engine generates "random_value" (another float in range [0..1]) and calls that GUI’s named event OnRandomValueInitialised.

Turning to what that GUI then does, consider the official FM St. Lucia's implementation. In "saintlucia.gui", there are two windowDefs named "TextFlavour" (for lore) and "TextLoading" (for tips). These have identical code, defining the same rectangle for text at the bottom of the screen. Except TextFlavor is visible first (when map_loading < 0.7), then TextLoading (map_loading >= 0.7). For every load, the particular text pair to be shown (out of 10 possibilities) is initialized in routine "onNamedEvent OnRandomValueInitialised" by code like...

if ("gui::random_value" < 0.1)
{
set "TextFlavour::text" "The Builder Church is deeply intertwined with the politics of the Empire.";
set "TextLoading::text" "Tip:  Hit the Use key after frobbing a body to shoulder it.";
}
else if ("gui::random_value" < 0.2)
...

(LoadMap also sets a "quickloading" Boolean to true when the same map is being reloaded. This allows GUI scripts to distinguish between a quickload and a full load, so they might choose to show only short messages.)

Other Examples

Both "St. Lucia" and the earlier "A Score to Settle" serve up Lore and Tips. Official FM "A New Job" uses the same mechanism, but no lore is shown; instead, FlavourText also gets "Tip:" strings.

Pluses & Minuses

This feature was useful when introduced. But as loading times have shortened, due to faster chips and solid-state drives, the time to read these messages is often insufficient, except perhaps for the largest of FM maps. Otherwise, modifying an FM's GUI to show only 1 load-time message instead of 2 (and none on quick loading) may sometimes be a good idea.

Also, depending on FMs (other than the official ones) to display tips to raise awareness of FM-independent features can be problematic when the features themselves evolve. A follow-on 2017 idea to make Tips independent of FMs ("0004619: Add Tool Tips to "Press Attack to Start" screen?") was not pursued.

I18N Aspects

In all 3 examples mentioned, the text strings are hard-coded in English in the GUI file, so look within to review the full set of lore and tips.

However, #str_ids would work, and perhaps are used for random loading of translated text in other FMs. As of TDM 2.14, in all.lang, defined in [English] are:

  • 20 flavour strings (#str_01000 - #str_01019)
  • 13 tips strings (within #str_01050-01062)

Translations of these into supported languages exist but are incomplete.

Early provisioning of these I18N strings largely drew from the embedded English strings of "A Score to Settle". In the updated two official FMs, only few of the "Tips:" still match those listed in all.lang; most are newer. (For more see "0002813: Make mission loading tips part of TDM and translatable").

Development of this feature was led by Obsttorte in 2021, with considerable feedback about tooltip message content. (See Displaying Tooltips for Menu Entries , which also discusses the mechanism.)

Appearance

The Main Menu/Settings interface displays various half-pages on the right side of the screen, leaving the left side with just the TDM background slideshow. Against this, TDM can show informative text (informally, "tool tips") about particular settings. For a given setting, defined by a short prompt on the left side of a row, mouse-hovering over the selectable choice field on the right side of the row will show a unique, relevant tool tip. Not all items have tool tips, and numeric sliders generally do not.

When first introduced, there was a main menu setting "Show Menu Tooltips". But given how given how unintrusive these tooltips were, it was decided to just leave them on and free up a settngs row for a more important item. As of 2.14, there is still a DarkMod.cfg setting "tdm_show_menu_tooltips" to disable them.

I18N Aspects

As of 2.14, the great majority (but not quite all) of setting prompts and tooltips are represented by #str_ids, and present in multiple languages.

In-Game Tips

In 2021, Wesp5's "Ingame tooltips feedback" broached this topic (plus feedback about Settings Tooltips).

Subsequently, snatcher's 2023 proposal "Global Player Tip System" included an available drop-in prototype mod, discussed here. (The link itemizes the tooltips implemented). Further development is not on-going.

Appearance

With snatcher's mod .pk4 in place in the TDM folder, once the player appears in the game, short tips start being offered in response to player actions. To draw your attention, a tip slides in, parks for a fixed duration at the righthand screen edge, then disappears. It's in small white handwritten text on a transparent background. A narrow block of body text is surmounted by a top border and all-caps title. Each tip only gets displayed once during a mission's play-thru.

Mechanism

A tip is triggered by a specific state changes. The scripting polls for this 4 times per second. It detects when a given weapon type is selected (10 cases), or tool type is acquired or selected (7 cases). This is straightforward. Other "general" situations (8 cases) are more complex. For example, some cases consult the player's "immobilization" dictionary, maintained largely by the physics engine. Did the player just start to do something that immobilizes other actions, e.g., from using a weapon while lockpicking? Then time for the "lockpicking" tip, if not given already.

Plus and Minuses

The individual messages provided are short and pithy. Some are rather abstract (what objects are TOGGABLES? And sure, "...press USE...", but suppose you forgot what's your physical key for that?) A few message could be subdivided into multiple randomly-selected tips. But tips arriving too late or too early is a larger problem.

One reviewer felt the prototype's system "might be fine for new players" if made optional. But "feels kind of intrusive and gives tips at moments where you don't need them and will forget them anyway until the moment they become important".

It is pretty hard to infer what tip a player would most benefit from, from sparse situational awareness data... in this case, only about what generic activity the player's character is starting to do at a given moment, with no broader context. (One could dream of an artificial intelligence model trained on TDM game plays, personalized with a model of the player's knowledge, and tracking the player's in-world progress and problems.)

I18N Aspects

The prototype script hard-codes the title and body phrases. If global in-game tips functionality was made part of the core TDM, then all.lang (and generated files) could include its phrases; otherwise, a separate way to incorporate translations would be needed.