Skip to content

FileFormats MagicFile

htmlcoderexe edited this page Jul 17, 2020 · 2 revisions

MagicFiles store heavily structurised game data, such as various abilities characters can use, templates for character classes, item templates, crafting recipes and loot tables.

The current implementation is not using any form of named tags, values are just read in a particular order assumed correct. Minor error handling is currently present, but currently the assumption is that the files are well-formed.

Data is serialised and deserialised using .NET's BinaryWriter - anything that has a working implementation should be able to handle the files by simply calling the appropriate ReadXXX/Write(XXX) functions of BinaryWriter, however there are a few custom datatypes built from the primitives.

For the sake of interoperability with anything else, see notes on BinaryWriter.

The datatypes currently used:

Dictionary<string, float>, used by multiple file types. It is written as follows:

int Number of entries

followed by that number of

string Key then float Value

Arrays are written the same way, but with entries just following each other as each "record" is a single data item.

Ability File (abilities.gdf)

It is an array of ModularAbility, therefore starts with a single int specifying number of Abilities written.

Each Ability consists of the following:

string ID

string Name

string Description

int Icon (could pack this into a short but why complicate code)

Dictionary<string, float> Base Values

Dictionary<string, float> Growth Values

An array of SkillEffect.

A SkillEffect in turn consists of the following:

string Effect Type

float Base Time

float Delta Time

float Base Duration

float Delta Duration

An array of string Parameters.

Clone this wiki locally