<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html lang="en"> <head> <meta HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8"> <link rel="stylesheet" type="text/css" href="style.css"> <TITLE>The Osirion Project - Editing the world</TITLE> </head> <body> <H1> The Osirion Project - Editing the world </H1> <p> One of the goals of the project is to create a game world that is easy to adapt and extend. At the moment of writing, the game reads the world description from <i>ini/world.ini</i> and a list of buyable ships from <i>ini/ships.ini</i>. These ini-files are plain text files that can be edited with any text editor. <p> The world description files are server-side. This means that editing your local copies will not affect the world when you connect to a remote server. Someone connecting to your server will also receive your modified world. <p> I recommend you do not edit the original game data, but to make a copy into your personal osirion directory. The files found in this directory will get precedence over the original game data. Your modified files will be used and the original files can still be updated when a new version is available. <p> On Linux your personal osirion directory is <i>~/.osirion</i>. On windows, your personal osirion directory is the <i>home</i> subdirectory of the main distribution. <h2> File structure </h2> <p> World description files use the windows ini-file syntax. These files contain one or more sections. Every section starts with a section name enclosed in square brackets and contains a list of <i>value=key</i> pairs to describe the properties for the current section. Lines starting with a semicolon are considered comments and are ignored. <p> For example, a section <i>planet</i> describing an iceworld: <pre> ; The iceworld, a very dark and cold place [planet] label=iceworld name=The World of Ice radius=32 texture=planets/iceworld </pre> <h2> world.ini </h2> <p> The <i>world.ini</i> file contains a list of zone labels. A zone is a seperate compartment in the gameworld, like a solar system or a remote sector in space. It contains a single <i>world</i> section containting multiple <i>zone</i> keys. <h3> [world] </h3> <table> <tr> <td class="wide"><i>zone =</i></td> <td class="narrow"><strong>[string]</strong></td> <td>the in-game label of a zone</td> </tr> </table> <p> <i>Note:</i> a label can only contain lowercase letters, numbers and underscores. Any other character is deleted. This applies to any in-game label in any .ini-file. <pre> ; a world.ini example with two zones [world] zone=solarsystem zone=remotesector </pre> <h2> zones/<i>label</i>.ini </h2> <p> Each zone has its own zone description file. The actual name of the file depends on the zone label. If your <i>world.ini</i> contains the line <i>zone=remotesector</i>, the content of the zone with the label <i>remotesector</i> would be described in the file <i>ini/zones/remotesector.ini</i>. <p> The .ini-file containts a list of objects populating that zone, and the basic properties of those objects. In the context of the engine, such an object is called an <i>entity</i>. <h3> [zone] </h3> <p> Every zone description file has a <i>zone</i> section describing a few of its basic properties: <table> <tr> <td class="wide"><i>name =</i></td> <td class="narrow"><strong>[string]</strong></td> <td>the in-game name of the entity</td> </tr> <tr> <td class="wide"><i>sky =</i></td> <td class="narrow"><strong>[string]</strong></td> <td>name of the sky texture in <i>textures/env</i> directory</td> </tr> <tr> <td class="wide"><i>default =</i></td> <td class="narrow"><strong>[bool]</strong></td> <td>mark this zone as the default zone for the game, only one zone can have this key set to yes, can be omitted elsewhere</td> </tr> </table> <pre> ; remotesector.ini ; zone description file for the Remote Sector [sector] name=Remote Sector sky=sky_texture default=no </pre> <h3> [entity] </h3> <p> Entities come in two flavours: basic geometrical shapes and entities with models. Both have a similar definition and set of properties. A simple entity is considered decoration by the engine and won't change direction or location. <p> Every in-game entity should have a <i>label</i> key. If the entity in question is going to be used as a base, or any object the could be referenced in possible scripting, it should have a unique label. The label should be lowercase and not contain spaces. A player-friendly name can be provided through the <i>name</i> key. <table> <tr> <td class="wide"><i>label =</i></td> <td class="narrow"><strong>[string]</strong></td> <td>the in-game label of the entity</td> </tr> <tr> <td class="wide"><i>name =</i></td> <td class="narrow"><strong>[string]</strong></td> <td>the in-game name of the entity</td> </tr> </table> <p> Set the <i>shape</i> key to define a basic geometrical shape: <table> <tr> <td class="wide"><i>shape =</i></td> <td class="narrow"><strong>axis</strong></td> <td>a 3d-axis with X, Y and Z lines. </tr> <tr> <td class="wide"></td> <td class="narrow"><strong>cube</strong></td> <td>a cube</td> </tr> <tr> <td class="wide"></td> <td class="narrow"><strong>diamond</strong></td> <td>a regular octahedron with an axis</td> </tr> <tr> <td class="wide"></td> <td class="narrow"><strong>sphere</strong></td> <td>a polyhedron approximation of a sphere</td> </tr> </table> <p> The size of the entity can be set with the <i>radius</i> key: <table> <tr> <td class="wide"><i>radius =</i></td> <td class="narrow"><strong>[float]</strong></td> <td>the radius of the entity in game units</td> </tr> </table> <p> An entity with a model can be created by setting the <i>model</i> key. The radius of a model is automaticly calculated: <table> <tr> <td class="wide"><i>model =</i></td> <td class="narrow"><strong>[string]</strong></td> <td>filename of the model in the <i>maps/</i> directory, without extension.</td> </tr> </table> <p> The <i>color</i> key sets the primary color of the entity. This color will be used to draw the entity in case of a geometrical shape, or to draw model faces that have the <i>common/entity</i> texture. The default entity colour is white. <p> The <i>colorsecond </i> key can be used to set the secondary color of entities with a model. <table> <tr> <td class="wide"><i>color =</i></td> <td><strong>[float] [float] [float]</strong></td> <td>primary entity color RGB values with in the 0.0 - 1.0 or 0 - 255 range</td> </tr> <tr> <td class="wide"><i>colorsecond =</i></td> <td><strong>[float] [float] [float]</strong></td> <td>secondary entity color</td> </table> <p> The <i>location</i> sets the in-game position: <table> <tr> <td class="wide"><i>location =</i></td> <td><strong>[float] [float] [float]</strong></td> <td>x, y, z values of the entity location, z is up</td> </tr> </table> <p> Orientation can be set thought the <i>direction</i>, <i>pitch</i>, and <i>roll</i> keys: <table> <tr> <td class="wide"><i>direction =</i></td> <td class="narrow"><strong>[float]</strong></td> <td>direction angle the entity is pointing to. 0 degrees is north, 90 degrees is west, default is 0 </tr> <tr> <td class="wide"><i>pitch =</i></td> <td class="narrow"><strong>[float]</strong></td> <td>pitch angle, default is 0<td> </tr> <tr> <td class="wide"><i>roll =</i></td> <td class="narrow"><strong>[float]</strong></td> <td>roll angle, default is 0<td> </tr> </table> <p> An example of an entity with a basic shape: <pre> ; The Galactic origin [entity] label=origin name=Galactic origin shape=axis radius=1 location=0 0 0 ; yellow color=1 1 0 </pre> <p> An example of an entity with a model: <pre> ; Alexandria outpost [entity] label=alexandria name=Alexandria outpost model=stations/alexandria location=-116 -68 16 direction=315 ; light brown color=222 192 145 </pre> <h3> [planet] </h3> <p> A planet is spherical entity with a texture. and a default radius of 32. The planet globe will be rendered with lighting enabled. <table> <tr> <td class="wide"><i>texture =</i></td> <td class="narrow"><strong>[string]</strong></td> <td>name of the planet texture in <i>textures</i> directory</td> </tr> </table> <pre> ; The iceworld, a very dark and cold place [planet] label=iceworld name=The World of Ice texture=planets/iceworld ; a grey-blue colour color =0.5 0.5 0.8 </pre> <h3> [star] </h3> <p> A star is a spherical entity without texture and a default radius of 48. The star globe will be rendered fullbright and serve as the main source of light for the current system. At the moment only one system light source is supported. If you define multiple stars, the last one will serve as light source. <pre> [star] label=whitedwarf name=White Dwarf ; a slightly yellow colour color=1.0 1.0 0.9 </pre> <h2> ships.ini </h2> <p> Definition of the shopping list. </body> </html>