Data Structure & Modifications – Take On Mars
Lou Montana (talk | contribs) m (Text replacement - "<tt>([^= ]+)<\/tt>" to "{{hl|$1}}") |
Lou Montana (talk | contribs) m (Remove <youtube> tag) |
||
Line 1: | Line 1: | ||
{{TOC|side}} | {{TOC|side}} | ||
{{Youtube|4s5CQ8YL-sA|{{tkom}}: Data Structure tutorial|center|600}} | |||
{{Feature|informative|The following is a transcription of the video's audio track.}} | |||
== Scripts and Files == | == Scripts and Files == | ||
Line 36: | Line 35: | ||
Scripts for entities, the free fly camera and vehicle configs are all located within the {{hl|scripts/}} folder. For example, the ‘entities.h’ file contains definitions of basic entities used by the game, such as the base ‘GameEntity’ definition from which all Take On Mars entities are parented. So to speak, this folder is the real ‘nuts-and-bolts’ of Take On Mars. | Scripts for entities, the free fly camera and vehicle configs are all located within the {{hl|scripts/}} folder. For example, the ‘entities.h’ file contains definitions of basic entities used by the game, such as the base ‘GameEntity’ definition from which all Take On Mars entities are parented. So to speak, this folder is the real ‘nuts-and-bolts’ of Take On Mars. | ||
== Directories == | == Directories == | ||
Line 118: | Line 118: | ||
{{GameCategory|tkom}} |
Latest revision as of 16:35, 7 March 2022
Scripts and Files
First off, let’s start up the loader and extract the game data to a directory of our choice. This will allow us to see exactly what is in Take On Mars. The game’s pack files contain all game data including scripts and models.
Keep in mind that this only extracts the data and is not launch-able. You can place any of this data into a mod or addon.
Two script files are of particular interest, ‘script.c’ and ‘CCGame.c’. These two files are the core files loaded directly from the internal game engine.
script.c
The first, ‘script.c’, is loaded on game engine start, including when you start up Workbench, and contains core functions and entity definitions via includes.
CCGame.c
The latter script, ‘CCGame.c’, is loaded when the game mechanics are initialized, and contains extended entity functions and most importantly, the campaign, also via includes.
Modifying these two scripts allows you to change the entire game if desired, and can allow you to make a completely different type of game, be it Real-Time Strategy or First-Person Shooter, making Take On Mars a truly sandbox platform to build upon.
proto.h
The ‘proto.h’ script is also very important, containing the Script API function definitions from the engine. This is the first place to look when searching for all the functions that handle creating physics objects, dealing with them, and so on.
entities.xml
In addition to this, the ‘entities.xml’ file is used by the Game Editor in the Workbench editing suite to define the editable parameters of each entity type. This file is also loaded directly by the engine.
Scripts for entities, the free fly camera and vehicle configs are all located within the scripts
Directories
Vehicle configs are located in the scripts
The controller scripts contain practically all functionality of individual vehicles. The afore-mentioned configs define individual parts of the vehicle, what model to use, their toughness, joints that bind them together and also which scripts to use.
These scripts then make the vehicle what it is, so a 6 wheeled rover is made to act as such using these controller scripts. This also means you can make an airship, airplane, or rocket ship as you see fit.
Translations
Next, strings are saved in an .XML file for each language and are located in the scripts
Models
Models are stored as binarized .XOB files in the obj
Sound Files
Sound files may be stored as .WAV or .OGG, and are located in the sounds
Configuring sounds may be done in a text editor or in the Workbench editing suite using the Sound Editor. Settings will be covered in another chapter, now we will look at textures and material definitions.
Textures
Textures are stored as .TGA and .DDS files. Textures can be stored anywhere, but for organizational purposes Take On Mars has them separated between GUI textures and model textures.
Textures for models are usually stored in the same location as the .XOB model file and are also usually stored as .DDS to conserve disk space. Associated with model textures are also material definitions.
Materials
Models do not directly link to a texture file, but rather a material definition, sometimes referred to as a material shader. These shaders work with several textures at once, including normal maps, environment maps and so on, giving the artist maximum control over how his model is displayed in-game.
Similar to the way sounds are loaded, materials have a core file, ‘materials.h’ in the materials
GUI textures on the other hand are stored in the gui
The textures
Particle effects are stored as .PTC files in the particle
Graphical User Interface (GUI) data is stored in the gui
Fonts
Game fonts are stored in the gui
Animations
Animations for vehicles, characters and cameras are stored in the anm
Physics
Next, the physics
Cutscenes
The cutscenes
Next up, the worldspat
Moving on, the worlds
In the worlds
Additionally, you will also find text-editable .PLA files in the worlds
Some files are not stored in the game’s .PAK files, and are left unpacked directly in the game’s steam directory under <STEAM LOCATION>
Here you will find the game’s scenario files in the Scenarios
Scenario files are searched for dynamically by the game’s scripts, so a new scenario is located automatically by the game.
Next, videos are stored as .WMV files in the videos
The configlists
The worlds