Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Version 4 (modified by wenners, 13 years ago) (diff)

How to create Orxonox Levels

To create a level in Orxonox is really easy. One does not have to program anything or compile the code again, because our levels are created with XML-Files. There the objects in the level can be defined. On this page we explain what one can do with the XML-Files and how to create a new level for Orxonox with them.

The objects we can add are rooms (BSP-files), spacecrafts (OBJ-files) and moving objects (MD2-files). How to that exactly is best explained with the examples below.

If you're interested in creating rooms and BSP-levels check out this page: Maping for Orxonox with GTK-Radiant?

Adding a menu entry

Before you can play a level in Orxonox you have to add the level as a menu entry in the game. To do that you have to alter the DefaultCampaign.oxc file in the data/levels directory (or data/worlds in older versions).

Below there is a example for that file:

<Campaign>
  <name>default</name>
  <identifier>0</identifier>
  <description>The one and only default debug campaign</description>
  <WorldList>

    <GameMenu>
      <identifier>0</identifier>
      <name>GameMenu</name>
      <path>levels/Menu.oxw</path>
      <nextid>1</nextid>
    </GameMenu>

    <SinglePlayerWorld>
      <identifier>1</identifier>
      <nextid>2</nextid>
      <name>Demo Mountain Lake</name>
      <path>levels/sp_demo_mountain_lake.oxw</path>
      <menu-entry>1</menu-entry>
    </SinglePlayerWorld>

    <MultiPlayerWorld>
      <identifier>2</identifier>
      <nextid>0</nextid>
      <path>levels/mp_level_arena.oxw</path>
    </MultiPlayerWorld>

    ...

  </WorldList>
</Campaign>

Now to add your level you have to add an SinglePlayerWorld (or MultiPlayerWorld) entry to the WorldList. Be sure to add an identifier a name and the most important: the path of your OXW-file. The number of the identifier and the menu-entry have to be incremented. Close every <tag> you open.

XML level file (OXW) syntax

Level files have the extension OXW (for OrxonoX World). The order of the things you add does not matter.

Example

<WorldDataFile>
  <name>Meteroid</name>
  <screenshoot>pictures/menu/ss_meteroid_512x512.png</screenshoot>

  <LoadScreen>
    <BackgroundImage>pictures/load_screens/default.jpg</BackgroundImage>

    <ElementCount>16</ElementCount>
    <BackgroundPS>0,0,1.0,1</BackgroundPS>
    <BarPS>.65,.87,.3,.05</BarPS>
    <BarImage>pictures/load_screens/default_bar.png</BarImage>
  </LoadScreen>

  <WorldEntities>

    <TurbineHover>
      <name>Player</name>
      <abs-coor>522,-389,419</abs-coor>
    </TurbineHover>

    <SpaceShip>
      <name>Player2</name>
      <model>models/ships/reap_#.obj</model>
      <abs-coor>312.19, 172.36, 60.74</abs-coor>
    </SpaceShip>
    <SpaceShip>
      <name>Player10</name>
      <model>models/ships/reap_#.obj</model>
      <abs-coor>315.53, 185.09, 14.04</abs-coor>
    </SpaceShip>
    <SpaceShip>
      <name>Player6</name>
      <model>models/ships/reap_#.obj</model>
      <abs-coor>306.53, 190.09, 23.50</abs-coor>
    </SpaceShip>
    <SpaceShip>
      <name>Player14</name>
      <model>models/ships/reap_#.obj</model>
      <abs-coor>330.19, 172.36, 25.74</abs-coor>
    </SpaceShip>

    ...

    <MovieEntity>
      <abs-coor>413.5,183,36.3</abs-coor>
      <name>media/hero.mov</name>
      <fps>15</fps>
      <axis>90</axis>
      <size>75,38.5</size>
    </MovieEntity>

    <SpaceShip>
      <name>Player4</name>
      <model>models/ships/fighter.obj</model>
      <abs-coor>313,181,0</abs-coor>
    </SpaceShip>

    ...

    <TurbineHover>
      <name>Player5</name>
      <abs-coor>324,174,2</abs-coor>
    </TurbineHover>
    <TurbineHover>
      <name>Player9</name>
      <abs-coor>309,188,42</abs-coor>
    </TurbineHover>

    ...

    <SkyBox>
      <name>Sky</name>
      <Materialset>pictures/sky/simple_space</Materialset>
      <Size>10000</Size>
    </SkyBox>

    <ModelEntity>
      <name>comet</name>
      <abs-coor>300,50,-400</abs-coor>
      <model>models/comet.obj, 2.5</model>
    </ModelEntity>
    <ModelEntity>
      <name>comet2</name>
      <abs-coor>0,0,400</abs-coor>
      <model>models/comet.obj, 1</model>
    </ModelEntity>

    ...

    <Terrain>
      <name>Meteroit</name>
      <abs-coor>300,50,0</abs-coor>
      <model>models/environments/meteorit.obj, 2.5</model>
    </Terrain>

  </WorldEntities>

  <Music>sound/music/allgorythm-once_upon_a_time_in_a_small_club.ogg</Music>

    <LightManager>
    <Lights>
      <Light>
       <diffuse-color>1,1,1</diffuse-color>
       <abs-coor>300,800,0</abs-coor>
      </Light>
    <Light>
       <diffuse-color>1,1,1</diffuse-color>
       <abs-coor>100,200,50</abs-coor>
      </Light>
    </Lights>
    <ambient-color>1,1,1</ambient-color>
  </LightManager>

  <GraphicsEngine>
    <GraphicsEffect>
        <LenseFlare>
          <name>lense flare</name>
          <add-flare-texture>pictures/lense_flare/sun.png</add-flare-texture>
          <add-flare-texture>pictures/lense_flare/lens2.png</add-flare-texture>
          <add-flare-texture>pictures/lense_flare/lens1.png</add-flare-texture>
          <add-flare-texture>pictures/lense_flare/lens3.png</add-flare-texture>
          <add-flare-texture>pictures/lense_flare/lens4.png</add-flare-texture>
          <add-flare-texture>pictures/lense_flare/lens1.png</add-flare-texture>
          <add-flare-texture>pictures/lense_flare/lens3.png</add-flare-texture>
        </LenseFlare>
    </GraphicsEffect>
  </GraphicsEngine>

</WorldDataFile>

World Entities

Player

Skybox

Weather effects

Music

Lights