Files
Bubberstation/code/__DEFINES/language.dm
MrMelbertandGitHub 4962a86b95 CSL / Mutual understanding changes (#96774)
## About The Pull Request

1. Redid the formula for calculating mutual language understanding 

Old: `base + (10 * (1 - (min(commonness, 1250) / 500)))`, or in other
words `base + 10% to -15%`
New: `base + max(20 - (commonness / 1000) * 20, -5)`, or in other words
`base + 20% to -5%`

2. CSL strength preference has been changed 

Old: `"90%", "75%", "50%", "33%", "25%", "10%"`
New: `"75%", "50%", "25%"`

3. If you understand a language partially, the icon in chat is
differentiated slightly

<img width="414" height="30" alt="image"
src="https://github.com/user-attachments/assets/16af293a-698e-4ab8-9638-580920a38543"
/>

(Icon subject to change, it's just a `?` spliced with the icon rn)

4. CSL can now be taken by humans, doing so grants you gal-uncommon

5. Fixed a bug where contractions, due to being encoded, would be
treated as lower frequency / rarer and thus be more likely to be
translated

## Why It's Good For The Game

1. The current formula was a bit too harsh and resulted in more words
being translated than you'd expect. The altered formula should make it
less persistent.

2. These values were tweaked according to the new formula. If I left the
90% value it'd mean like every word would get translated and that
defeats the point.

3. Makes things a bit clearer when it comes to partial understanding. 

4. Requested, sounds like fun so why not.

5. Bugfix.


## Changelog

🆑 Melbert
fix: Fixed a bug where contractions were treated as rarer words than
they should be for the sake of partial language understanding
balance: Tweaked the formula of partial language understanding: Less
common words are penalized less, more common words are rewarded more. In
other words more words will be understood on average.
balance: Common Second Language numbers were tweaked according to the
new formula. Now "75%", "50%", "25%".
balance: Humans can now take Common Second Language. Doing so also
grants Galactic Uncommon.
add: Partially understood sentences now get an altered language icon in
chat and runechat, indicating that only some of the words were
translated.
/🆑
2026-07-11 16:52:28 +01:00

63 lines
2.2 KiB
Plaintext

// Language flags
/// Language is never stuttered
#define LANGUAGE_NO_STUTTER (1<<0)
/// Language is speakable without a tongue
#define LANGUAGE_TONGUELESS_SPEECH (1<<1)
/// Language icon is hidden if the language is understood
#define LANGUAGE_HIDE_ICON_IF_UNDERSTOOD (1<<2)
/// Language icon is hidden if the language is not understood
#define LANGUAGE_HIDE_ICON_IF_NOT_UNDERSTOOD (1<<3)
// Returns from display_icon_type
/// Display no icon for this language
#define DISPLAY_LANGUAGE_ICON_NONE 0
/// Display the full icon for this language
#define DISPLAY_LANGUAGE_ICON_FULL 1
/// Display a blended icon for this language, indicating partial understanding
#define DISPLAY_LANGUAGE_ICON_PARTIAL 2
// LANGUAGE SOURCE DEFINES
/// For use in full removal only.
#define LANGUAGE_ALL "all"
// Generic language sources.
/// Language is linked to the movable directly.
#define LANGUAGE_ATOM "atom"
/// Language is linked to the mob's mind.
/// If a mind transfer happens, language follows.
#define LANGUAGE_MIND "mind"
/// Language is linked to the mob's species.
/// If a species change happens, language goes away.
/// If applied to a non-human (no species) atom, this is effectively the same as [LANGUAGE_ATOM].
#define LANGUAGE_SPECIES "species"
// More specific language sources.
// Only ever goes away when dismissed directly.
#define LANGUAGE_ABSORB "absorb"
#define LANGUAGE_APHASIA "aphasia"
#define LANGUAGE_BOUNTYHUNTER "bountyhunter"
#define LANGUAGE_CULTIST "cultist"
#define LANGUAGE_CURATOR "curator"
#define LANGUAGE_GLAND "gland"
#define LANGUAGE_HAT "hat"
#define LANGUAGE_QUIRK "quirk"
#define LANGUAGE_DRINK "drink"
#define LANGUAGE_MALF "malf"
#define LANGUAGE_PIRATE "pirate"
#define LANGUAGE_MASTER "master"
#define LANGUAGE_PAI "pai"
#define LANGUAGE_SOFTWARE "software"
#define LANGUAGE_STONER "stoner"
#define LANGUAGE_VOICECHANGE "voicechange"
#define LANGUAGE_RADIOKEY "radiokey"
#define LANGUAGE_BABEL "babel"
#define LANGUAGE_EMP "emp"
#define LANGUAGE_TONGUE "tongue"
#define LANGUAGE_BLOOD_WORM "blood_worm"
// Language flags. Used in granting and removing languages.
/// This language can be spoken.
#define SPOKEN_LANGUAGE (1<<0)
/// This language can be understood.
#define UNDERSTOOD_LANGUAGE (1<<1)