openOMSI GitHub Discord
Content formats

Docs / Reference / Content formats

Common rules

3 min readEdit this pagedocs/FORMATS.md

On this page
  1. Text encoding
  2. The [keyword] block format
  3. File names
  4. Content roots

These rules apply to every text format below.

Text encoding#

Files Encoding
global.cfg, tile_x_y.map, chrono *.map, *.chronoterrrelevant, situations .osn, the personnel file .odr UTF-16 LE with a byte-order mark (FF FE)
Everything else The author's ANSI code page

OMSI reads ANSI files in the system's code page. Stock content is Windows-1252, but a mod uses its author's: Windows-1251 for Russian mods (LiAZ, PAZ, the Scania Citywide cockpit), 1250 for Polish and Czech ones. Some newer files are UTF-8.

openOMSI has no system code page, so it decides per file:

  1. Valid UTF-8 is read as UTF-8.
  2. Windows-1251 when at least half the letters from 0xC0 up stand in runs of three or more (Russian words; German has at most two in a row, as in "Größe").
  3. Windows-1250 when letters that are symbols in 1252 (ł ą ś Ł Ś Ż) stand next to letters.
  4. Windows-1252 otherwise.

A font may have been made for another code page than the text it shows, so a glyph is also looked up as the same byte in 1251, 1250 and 1252.

Line endings are CR LF. Numbers use . as decimal separator and may have an exponent (6.21874087223886E-7).

The [keyword] block format#

Almost every text file (.bus, .ovh, .sco, .sli, .cfg, .hof, .ttp, .ttl, .ttr, .owt, .oop, .odr, .otp, .osn, .dsc, .hum, ...) is a list of keyword blocks:

Anything here is a comment.

[friendlyname]
Bus stop sign

[mesh]
sign.o3d

The original .bus header says it: the program ignores everything except keywords such as [mesh] that stand alone at the start of a line. The lines that follow are the parameters, one per line. Then the program searches for the next keyword.

openOMSI reads them the same way:

  • A keyword line is the whole line. No leading or trailing whitespace: an indented [keyword] is a help text or a switched-off block in the stock files (the SD202 cabin's [exit] help, the F90's second rear axle, the EN92's fourth door-slam sound).
  • A keyword OMSI knows must be spelled as OMSI spells it: [matl_noZwrite], [LOD], [NightMapMode], [noDistanceCheck]. A mod's [matl_nozWrite] or [NoMapLighting] is free text. Keywords OMSI does not know are compared without regard to case.
  • Parameter lines are read verbatim, in order. An empty line is a legal, empty parameter.
  • Free text between blocks is ignored.
  • Sub-commands (attach_trans and attach_rot_* after [new_attachment]; origin_*, anim_*, offset, delay, maxspeed after [newanim]) are lines of their own anywhere after their block. The stock Timetable_Terminus_Pole_S.sco has its attach_trans after [complexity].
  • -<DISABLED>- ... -<ENABLED>-, each alone on its line, switches blocks off in .bus/.ovh, .sco, model.cfg, passengercabin.cfg, paths.cfg, .hum and envir.cfg.

Exceptions: .hof cuts trailing tabs, spaces, CR/LF and " off every line (the stock depot files are spreadsheet exports). ailists.cfg lower-cases its lines.

File names#

File names inside content files resolve as Windows resolves them:

  • \ and / both separate folders.
  • Names compare without regard to case, umlauts included.
  • A folder name loses one trailing dot; the last name loses all trailing dots and spaces (Ahlheim's anz-oben.jpg.).

A name with non-ASCII letters may have changed on the way.

A zip stores a name without its UTF-8 flag in the code page of the computer that made it (CP866 on a Russian one), and the unpacker guesses another: the Scania's верх.png arrived as óąÓň.png (CP866 read as CP852). openOMSI also looks for a name as its bytes in CP437, CP852, 1252 or 1250 read again in CP866, 1251, 1250 or 1252.

Content roots#

openOMSI's content folder, mounted archives and the OMSI 2 installation are searched as if they were copied over each other, highest priority last (see Mods).

One exception: a vehicle pack (Vehicles/<folder>) present in two roots in two versions does not mix. The copy in a higher-priority root patches the loaded pack only when it has no .bus/.ovh/.zug of its own, or only ones that pack has too. A pack with vehicles the other lacks is another version: its files are only used for what the vehicle's own pack lacks.

Example: Ahlheim V5 bundles its own Citaro Facelift next to an installed older one. Mixed, the Citaro ran the installed pack's varlists and constfiles under its own scripts, and its displays stayed dark.

Something wrong or missing? Fix it on GitHub or open an issue.

↑↓ to move↵ to open