Ludeon Forums

Ludeon Forums

  • October 20, 2019, 11:44:24 PM
  • Welcome, Guest
Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Add more text file references to Global RulePack  (Read 143 times)

Elevator

  • Drifter
  • **
  • Posts: 67
  • Refugee
    • View Profile
Add more text file references to Global RulePack
« on: April 28, 2018, 05:43:07 PM »

In-game story generators take some words from textfiles. References to these text files are given in Defs\RulePackDefs\RulePacks_Global.xml.
The rules look like this:
Code: [Select]
  <RulePackDef>
    <defName>GlobalUtility</defName>
    <rulePack>
      <rulesStrings>
      ...
      </rulesStrings>
      <rulesRaw>
        ...
        <li Class="Rule_File">
          <keyword>color</keyword>
          <path>Words/Nouns/Colors</path>
        </li>
        <li Class="Rule_File">
          <keyword>animal</keyword>
          <path>Words/Nouns/Animals</path>
        </li>
        <li Class="Rule_File">
          <keyword>animalgroup</keyword>
          <path>Words/Nouns/AnimalGroups</path>
        </li>
        <li Class="Rule_File">
          <keyword>weapon</keyword>
          <path>Words/Nouns/Weapons</path>
        </li>
        ...
    </rulesRaw>
  </rulePack>
</RulePackDef>

However, some languages require more than one form of such words. E.g. animal words are used in different contexts in several cases (nominative, genitive, accusative) in both plural and singular forms.
Luckily, these text file references are allowed to be overriden in localizations (via DefInjections):

Code: [Select]
<GlobalUtility.rulePack.rulesRaw.7.keyword>animal</GlobalUtility.rulePack.rulesRaw.7.keyword>
<GlobalUtility.rulePack.rulesRaw.7.path>Words/Nouns/Animals</GlobalUtility.rulePack.rulesRaw.7.path>

<GlobalUtility.rulePack.rulesRaw.8.keyword>animal_accusative</GlobalUtility.rulePack.rulesRaw.8.keyword>
<GlobalUtility.rulePack.rulesRaw.8.path>Words/Nouns/Animals_accusative</GlobalUtility.rulePack.rulesRaw.8.path>

<GlobalUtility.rulePack.rulesRaw.9.keyword>animal_plural</GlobalUtility.rulePack.rulesRaw.9.keyword>
<GlobalUtility.rulePack.rulesRaw.9.path>Words/Nouns/Animals_plural</GlobalUtility.rulePack.rulesRaw.9.path>

We use this technique widely! It gives a lot of flexibility and make generated stories expressive and rich! Without it generated text were poor, incoherent and unreadable.
Unfotunately this technique has a major drawback: the number of overridable keywords is very limited and insufficient. I work on the Russian localization and we really need more file-ref-rules to override.

I believe that's easy to implement by just adding to RulePacks_Global.xml lines like:
Code: [Select]
 
        <li Class="Rule_File">
          <keyword>dummy</keyword>
          <path>Words/Empty_file</path>
        </li>
        <li Class="Rule_File">
          <keyword>dummy</keyword>
          <path>Words/Empty_file</path>
        </li>
        <li Class="Rule_File">
          <keyword>dummy</keyword>
          <path>Words/Empty_file</path>
        </li>
        <li Class="Rule_File">
          <keyword>dummy</keyword>
          <path>Words/Empty_file</path>
        </li>
        <li Class="Rule_File">
          <keyword>dummy</keyword>
          <path>Words/Empty_file</path>
        </li>
        <li Class="Rule_File">
          <keyword>dummy</keyword>
          <path>Words/Empty_file</path>
        </li>
 

It will be a convenient and easy way to improve quality of translations for all languages! Thank you in advance!
« Last Edit: April 28, 2018, 06:01:31 PM by Elevator »
Logged