asset structure - GoldhawkInteractive/X2-Modding GitHub Wiki

Asset Structure

Asset Structure: In Xenonauts-2, game assets are grouped first by Content Pack (the base pack is xenonauts for core game assets), then by Asset Type (with a TypePrefix and optional TypePostfix defined in code), and then by the game Screen context in which they’re used. For example, an asset will live in the following path: xenonauts/<TypePrefix>/<Screen>/<TypePostfix>/*/<Name>.<Ext>. Screen folders include groundcombat, aircombat, strategy, mainmenu, loading, mapeditor, or shared common for multi-screen assets. Below is an overview of all top-level asset-type directories (TypePrefixes) in the Xenonauts-2 xenonauts content pack, with an explanation of their use and subcategories:

Visual and Prefab Assets

  • prefab/ – Contains Unity prefab assets (GameObjects) for 3D models and entities. These include characters, vehicles, props, etc., often organized further by screen and context. (For example, ground combat unit prefabs are under prefab/groundcombat/actor/… as described later.)

  • animation/ – Stores Unity animation clip assets. Any skeletal or object animations are placed here.

  • model/ – Contains 3D model files or meshes. This includes imported mesh assets (e.g. .fbx files) used for objects and characters.

  • material/ – Holds Unity material assets, defining surface properties (shaders, textures) for models.

  • shader/ – Contains shader files (e.g. .shader or shader graphs) used for rendering effects.

  • assetbundle/ – Contains the compiled Unity-typed assets. To override Unity assets, you will need to construct an AssetBundle and AssetBundleManifest - which the resolvement will then pick up on.

UI and 2D Assets

  • texture/ – Contains 2D image assets such as textures and sprites. This includes UI images, spritesheets, and any in-game 2D graphics.

  • ui/ – Contains UI prefab assets, such as Unity UI layouts, interface panels, and other UI elements.

  • font/ – Stores font assets used by the UI, like .ttf or Unity font assets.

Audio Assets

  • audio/ – Contains audio assets. By default this includes sound effect and music files (e.g. .wav/.ogg clips) mapped to the audio type. There are two notable subcategories under audio/ defined in the asset config: mixer/ for Unity AudioMixer assets (audio mixing settings), and materials/ for audio material JSON files. Audio material files (in audio/materials) define acoustic surface properties (e.g. footstep sounds on various materials) via the AudioMaterial type.

Scenes and Maps

  • scene/ – Contains Unity scene files (.unity). This is used for full Unity scenes such as the Main Menu or other standalone scenes that are part of the game build. In general, these are used during design.

  • map/ – Contains game map data. Xenonauts-2 uses a custom Artitas map format for tactical missions. Map files (e.g. levels for ground combat missions) are stored here, usually under map/groundcombat/<folder> for various maps (often grouped by tileset or mission type).

    • mapeditor/workspace - Contains the Parcels from which maps are constructed.

Narrative Scripts

  • ink/ – Contains Ink story files (.ink) for interactive narrative, dialogues, or tutorials. For example, tutorial or event story scripts are stored here (e.g. ink/groundcombat/tutorial.ink for an in-mission tutorial, or ink/strategy/... for geoscape text events).

Game Data Assets

  • template/ – Contains JSON template files, which define game entities, configurations, and other gameplay data (characters, items, research, etc.). Templates are a core part of the game’s data-driven design. See the detailed breakdown in the next section.

  • parameters/ – Contains JSON files for screen parameters and configuration objects (classes implementing IScreenParameters). These are high-level configurations used to set up or tweak a screen’s behavior (for example, defining scenario setups or default settings for a new game).

  • data/ – Contains miscellaneous structured data files (generally JSON) that support game systems, such as lookup tables, definitions, and other non-entity data. The data folder is subdivided by category (TypePostfix) to group related data types. For example, enums/ holds DataLoadedEnumDefinition files (definitions of game enum values), taxonomies/ holds TaxonomyDefinition files (defining categories/classifications of objects), and constants/ contains JSON of various constant values used by the game. See the detailed breakdown in the next section.

  • text/ – Contains plain text files or simple data not in JSON. This is used for raw text resources and lists. (name lists or other simple collections).

  • assembly/ – Contains compiled code libraries (if any) packaged with the content. This is primarily used for mod support – e.g. a mod content pack could include a .dll and its .pdb here to add game code.

Template Directory Structure (Detailed)

Below are the first two levels of subdirectories under template/ per screen, with their purpose:

❗️TODO: These are not yet complete.❗️

  • groundcombat/ – Ground Combat templates. This contains all templates for units, items, etc., used in ground combat missions.

    • actor/ – Ground combat actor templates, i.e. combat unit definitions. These are typically split further by {species}/{group}/{rank}/{name}.json

    • item/ – Ground combat item templates, covering weapons, armor, and equipment used in tactical missions. These are often organized by item type. For example, item/armour/, item/weapon, etc.

    • masters/Master prototype templates for ground combat. “Masters” are base template definitions usually used for inheritance or as archetypes. For instance, masters/actor/ might hold base actor templates (common properties for all soldiers or all aliens), and masters/item/ might hold base item templates (shared properties for weapons, etc.). These master JSONs aren’t directly used in-game but define default values that other templates derive from.

    • weights/ – Contains AI weight tables in JSON form.

    • tutorial_notifications/ – Templates for ground combat tutorial pop-ups or notifications. This folder contains JSON files that define tutorial messages or events that trigger during ground combat (for example, the first time the player breaches a door, etc.).

  • strategy/ – Strategy (Geoscape/base management) templates.

    • activities/ - Anomolies that occur on the strategy

    • actor/ – Strategy-layer actor templates. Unlike ground combat actors, these represent characters in the strategic context (e.g. soldiers, scientists, engineers, VIPs for missions, etc.).

    • construction/ - The buildings, personnel slots & power slots for geobase construction.

    • item/ – Strategy-layer item templates. These are items as they exist in the strategy layer (for equipping, inventory, manufacturing, etc.). Many will mirror the ground combat items but in strategic form. For example, armors in strategy have corresponding templates under item/armour/ (with the same species/group structure as their groundcombat counterparts).

    • projects/ – All concepts that can be completed (prerequisites) and upon completion cause some effect. (Research, Engineering, Phases, Research, Region Bonus)

    • xenopedia_entries/ – Templates for Xenopedia articles (in-game encyclopedia/lore entries). Each Xenopedia entry is a template containing the title, text, images, etc., for a lore or research entry unlocked during gameplay.

    • geo_regions/ – Definitions of geographic regions on Earth (for the Geoscape). These templates likely define areas of the globe, nation groupings, funding regions, etc. They are used by the strategy layer for UFO activity, funding, and territory control mechanics but also biome distribution etc.

Data Directory Structure (Detailed)

The xenonauts/data/ directory contains supporting data files in JSON (and some CSV). These are organized by screen context as well, or in common for global data. Below are the first two levels of subdirectories under data/, with explanations of each category (TypePostfix) where known:

  • common/ :

    • enums/ – Enumeration definitions. Each JSON here (of type DataLoadedEnumDefinition) defines a set of enumerated constants used by the game (for example, definitions of armor types, damage types, hook tags, etc.). These allow designers to add new enum values without code changes. (As an example, the “hooks” for attachment points on units are defined in a JSON in this folder.)

    • taxonomies/ – Taxonomy definitions. Taxonomies are hierarchical categorizations of game objects (for instance, categorizing aliens into species, weapons into classes, etc.). JSON files here (type TaxonomyDefinition) define those category trees for use in game logic and the editor.

    • constants/ – Game constant values. These JSON files (type SerializedConstants) contain tunable constants (balance numbers, gameplay tuning values) that can be loaded and easily tweaked. Instead of hard-coding values, the game reads them from here – things like damage formulas or economic constants might live in these files.

    • localization/ – Localization data. Within this, the locales/ subfolder holds CSV files for each language’s strings. (e.g. localization/locales/en.csv, fr.csv, etc.). These CSVs (type LocalizationTable) contain all the translated text for the game’s UI and dialogues. Additionally, the root localization/ folder may contain master.xlsx or other source files for translations (which are excluded from the game build).

    • (There may also be a common/prerequisites or common/effects in theory if some prerequisites were global, but in practice prerequisites/effects are under strategy, see below.)

  • strategy/ – Data used by the Strategy layer (geoscape). Key subfolders:

    • soldier_info/ – Contains data about soldiers and personnel, such as the Backer soldiers list. For example, soldier_info/backers_list.json holds the list of Kickstarter backer names and details used to generate soldiers.

    • nationality_profile/ – Definitions of nationalities for soldiers. Each JSON (type NationalityProfile) defines a nationality’s properties – including country name, demonym, flag icon reference, name lists, etc. These profiles are used when generating soldiers to assign them a nationality, with appropriate names and portraits.

    • portrait_codes/ – Portrait code mappings. These JSON files map certain attributes to portrait sets or image identifiers.

    • mission_definitions/ – Definitions for mission types and scenarios. Each JSON here (type MissionDefinition) describes a mission setup on the strategic layer – e.g. UFO Crash Site, Terror Site, Base Defense, etc. It includes parameters like what map to use, what enemies spawn, win conditions, etc. These definitions feed into the game when those missions are triggered. (For example, there might be crash_site.json, terror_site.json, etc., each detailing that mission’s setup.)

    • player_spawn_tables/ – Player/enemy spawn tables for missions. These JSON files (type PlayerSpawnTable) define the composition of forces (squads) that participate in missions. For instance, a spawn table might specify what units the Xenonauts team brings and what units the aliens have for a given mission type or difficulty.

    • prerequisites/ – Shared prerequisites. These JSON files define conditions required to unlock projects or actions that are shared.

    • effects/ – Shared effects. For instance, a “Funding Bonus” effect or an “Alien Invasion Panic” effect could be defined here and triggered by game events.

    • template_producers/ – Template producer configurations generally used to describe UFO crews

⚠️ **GitHub.com Fallback** ⚠️