Thriveopedia

From Thrive Developer Wiki
Revision as of 18:07, 6 November 2023 by Buckly (talk | contribs) (Formatting)
Jump to navigation Jump to search


The Thriveopedia is our in-game information store. It contains details about game concepts and, if opened from within a game in progress, the player's world and its organisms. Much of the information in the Thriveopedia is scraped directly from this wiki.

Updating Wiki Content

The pages from this wiki currently duplicated in the Thriveopedia are:

The game does not fetch page content at runtime, but instead requires a developer to periodically run the wiki updating script to add recent changes to the game files. To do so, run the following command from the root of the Thrive repo:

dotnet run --project Scripts wiki

This performs the following actions:

  1. Fetches HTML from the pages in the above list.
  2. Converts the main article content from each page into Godot-compatible BBCode (see below).
  3. Generates a JSON file defining the structure of each page, including translation keys for heading and body text.
  4. Runs the localisation update script to add these keys to translation files.
  5. Inserts the original page content for each key into the English translation file.

Important information for wiki editors: the script assumes some aspects of the HTML page structure and will ignore content that doesn't conform to the following format, perhaps even failing or producing nonsense output in the process. To avoid this, content intended to be scraped for the Thriveopedia must use only the following formatting features:

  • Unformatted text
  • Bold text
  • Italic text
  • Heading level 2
  • Unordered lists (bullet points) with no nested listing

If you want to use any other formatting, e.g. for info boxes that should not be scraped for the Thriveopedia, you can safely wrap the content which uses it in a <div> tag and the script will ignore it.

To use our custom BBCode words in-game, you simply have to use that word as it appears in-game (including correct casing) and make it bold, e.g. Glucose will be affixed with the glucose icon in-game. At the time of writing, this only works for compounds.