Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/ProwlEngine/Prowl.Echo/llms.txt

Use this file to discover all available pages before exploring further.

The Echo text format is Prowl.Echo’s native human-readable output. Unlike the interop formats (JSON, YAML, XML), the Echo text format encodes every EchoType with a type suffix, so the entire EchoObject tree survives a round-trip without any loss of numeric precision or type information. It is the best choice whenever people need to read or edit the output directly — configuration files, game save files checked into source control, or serialized data you want to inspect at a glance.

Type suffixes

Each numeric value is written with a single-character suffix that identifies its EchoType unambiguously:
SuffixEchoTypeExample
(none)Int42
BByte255B
NsByte-12N
SShort1000S
LLong9000000000L
VUShort60000V
UUInt4000000000U
CULong18000000000000000000C
FFloat3.14F
DDouble2.718281828D
MDecimal1.23456789012345M
Booleans are written as true or false, null as NULL, strings as double-quoted values with standard escape sequences, and byte arrays as [B;<base64>].

Writing

To a string

WriteToString() returns the full serialized representation as a plain C# string:
EchoObject echo = Serializer.Serialize(myConfig);
string text = echo.WriteToString();

// text might look like:
// {
//   "version": 2,
//   "gravity": -9.81F,
//   "maxPlayers": 16B,
//   "levelName": "Highlands"
// }

To a file

WriteToString(FileInfo) writes the text directly to disk using UTF-8 encoding:
echo.WriteToString(new FileInfo("config.echo"));

Via IFileFormat extension methods

EchoTextFormat.Instance exposes the full IFileFormat extension API if you want to use a file path string or a byte[]:
// Write to a file by path string
EchoTextFormat.Instance.WriteToFile(echo, "config.echo");

// Write to a byte[] (UTF-8 encoded)
byte[] bytes = EchoTextFormat.Instance.WriteToBytes(echo);

Reading

From a string

EchoObject.ReadFromString(string) parses the Echo text format and reconstructs the full EchoObject tree, preserving all type suffixes:
string text = File.ReadAllText("config.echo");
EchoObject echo = EchoObject.ReadFromString(text);

From a file

EchoObject.ReadFromString(FileInfo) reads the file from disk before parsing:
EchoObject echo = EchoObject.ReadFromString(new FileInfo("config.echo"));

Via IFileFormat extension methods

EchoObject echo = EchoTextFormat.Instance.ReadFromFile("config.echo");

Complete round-trip example

1

Serialize your object

var settings = new GameSettings
{
    MasterVolume = 0.8f,
    TargetFps    = (short)120,
    Fullscreen   = true,
    SaveSlot     = (byte)3
};

EchoObject echo = Serializer.Serialize(settings);
2

Write to Echo text

echo.WriteToString(new FileInfo("settings.echo"));
The file on disk will be human-readable:
{
  "MasterVolume": 0.8F,
  "TargetFps": 120S,
  "Fullscreen": true,
  "SaveSlot": 3B
}
3

Read back from the file

EchoObject loaded = EchoObject.ReadFromString(new FileInfo("settings.echo"));
4

Deserialize back to your type

GameSettings restored = Serializer.Deserialize<GameSettings>(loaded);
// restored.MasterVolume is EchoType.Float  → float  0.8
// restored.TargetFps    is EchoType.Short  → short  120
// restored.Fullscreen   is EchoType.Bool   → bool   true
// restored.SaveSlot     is EchoType.Byte   → byte   3

What a compound looks like

The Echo text format uses {...} for compounds and [...] for lists. Keys are always double-quoted strings. Values carry their type suffix inline:
{
  "name": "Player",
  "position": {
    "x": 12.5F,
    "y": 0.0F,
    "z": -3.75F
  },
  "inventory": [
    {
      "itemId": 101,
      "count": 5B
    },
    {
      "itemId": 204,
      "count": 1B
    }
  ],
  "flags": [B;AQIDBA==]
}
The Echo text format is stable across Prowl.Echo versions and produces clean line-by-line diffs in version control. Prefer it over JSON or YAML when your config files live in a git repository and need to be reviewed in pull requests.

Use cases

Configuration files

Settings that designers or players edit by hand. The type suffixes make numeric types explicit without sacrificing readability.

Game save files

Human-inspectable saves that can be edited for debugging or speedrunning without a dedicated save-editor tool.

Debugging serialized data

Print any EchoObject with echo.WriteToString() and inspect it in logs or the console to diagnose serialization issues.
EchoTextFormat preserves all EchoType values exactly, including the distinction between int and short, float and double, byte and sbyte, and so on. This makes it the only text format suitable for lossless round-trips. If you need interoperability with external tools instead, see Interop Formats.

Build docs developers (and LLMs) love