Oni Central Forum

A forum for the Oni community

You are not logged in.

#1 08/22/11 15:08

EdT
Moderator
From: Los Angeles, CA
Registered: 01/13/07
Website

Creating the Lair - A level tutorial

murolair.jpg

This tutorial will describe the process I used in making Muro's Lair.  I choose Sketchup since it was easy to make buildings in a short period of time.  The learning curve is lower than other 3D programs, also, there are a number of video tutorials to help you get started: http://sketchup.google.com/training/videos.html

Further, OniSplit has been updated to support the dae produced by Sketchup, so you can quickly import your level into Oni without any modifications to the dae file.

When using Sketchup for the first time, select the template you want to use, either "Meters" or "Feet and Inches".  Oni uses real life measurements, so an object 10 feet tall, or 9 meters wide in Skectchup will be that size in Oni.

Keep in mind that Sketchup uses white for the front of a face and blue for the back.  Oni recognizes only the front face of a polygon, the back face will be rendered as invisible and there is no collision with it. If you need to change the face, Right click and select "Reverse Faces".

Note: Other 3D programs can be used to make the environment for your level. Personally, I know that environments created in XSI or Cheetah3D import into Oni.  Best thing to do is to make a very simple level, such as a textured ground plane, export as a dae file and see if it gets imported into Oni correctly.

Part 1) Creating the environment.

To start off, make a large ground plane, then use the command "Make Group", this will keep your other work from interacting with the ground.  Also, this would be a good time to open the Layers window and create a new layer called ground. Right click on the ground plane and select "Entity Info", in that window select the ground layer.

ground.jpg

One important thing to note with layers, layers are used only to show or hide geometry.  This can be helpful in viewing and editing your model.  In the Lair, I had layers for the ground, 1st floor, 2nd floor, 3rd floor, 1st ceiling, 2nd ceiling and 3rd ceiling.

Now geometry in a layer is not separated from other geometry in the model. So even though the geometry is hidden, you can accidentally change or affect it (I learned this the hard way).  I later found this video that explains it: http://www.youtube.com/watch?v=7swKSFCE3AU

To make the walls, I used the technique in this video: http://www.youtube.com/watch?v=K_dpOuPsI0k

Now this screenshot is not the actual layout of the Lair (I'm not posting any spoilers).

floor1.jpg

To make the doors, I created a 6' x 9' rectangle and used the push/pull tool to make the opening.  The reason for the larger than normal size is so that the opening will be recognized by OniSplit when making the pathfinding grids. 

You can also use the push/pull tool to make other openings such as windows or loading doors.

Note: Currently, OniSplit cannot add the animated doors that are in the game.

A ramp was made from a rectangle and rotated to reach the 2nd floor.  The ramp needs to extend slightly above the top of the 1st floor.  Otherwise, during the game as you go up the ramp, you will get stuck at the top of the ramp and have to jump to continue.

Once the 1st floor is finished, hide the ground layer, select all the parts of the 1st floor and "Make Group" then put it in its own layer.

To make the ceiling, I created a rectangle that matched the outside dimensions of the 1st floor and used the push/pull tool to make it several inches thick since it would be a combo ceiling and roof.  The ceiling was made into a group and put on its own layer.

The same process was repeated for the 2nd and 3rd floors.

Texturing

The standard Sketchup has a limited choice of textures.  I found a bonus pack of 626 textures: http://sketchup.google.com/intl/en/down … acks6.html

After you finish texturing the environment, go to the Materials Window, select the dropdown menu "Colors in Model" then select "Purge Unused." This will remove extra textures that you may have tried but did not use. I'm not sure where that is on the Windows version.  You should also delete the solid colors in the list.

lairtextured.jpg

If you need to change the scale of the texture, double click on the texture, you will get an Edit Material panel where you can set the size of area the texture will cover.

materials.jpg

Export the environment and it's ready to be imported into Oni…  I wish it was that easy, however, there are somethings you need to do before that can happen.  This will discussed in part 2 of the tutorial.

Troubleshooting

As you are texturing the environment and if you see something like this in Sketchup

overlap.jpg

It will look like this in the game

overlapgame.jpg

This problem occurs when you have 2 planes which overlap each other.  In this case the floor plane overlaps the ground plane.  To fix this, you can deletes or reverse the face of one of the planes.  What I did was on the ground plane, I used the "Lines" tool and traced the outside of the building, this produced a rectangle on the ground and then I reversed the face of it.

Last edited by EdT (08/23/11 08:08)

Offline

#2 08/22/11 15:08

EdT
Moderator
From: Los Angeles, CA
Registered: 01/13/07
Website

Re: Creating the Lair - A level tutorial

Part 2) Preparing the environment for Oni

badenv.jpg

What happened to my level??? Simple answer, it was not ready to be imported into Oni smile

Before you can import your environment into Oni, there are some preparations needed.  Obviously, you want your AI's to fight, so we need to make a bnv model that will hold the pathfinding grids.  The bnv model should correspond with the horizontal planes and ramps of the environment where you want pathfinding grids.  Here's how…

Making the BNV model
Create a new document for the bnv. Double click on the group to "Edit Group", then select the ground plane and "Copy", now go to the bnv document and "Paste in Place". This process is repeated for the 1st, 2nd, 3rd floors and ramps. You will have something like this:

bnv.jpg

The bnv model cannot have any materials associated, so be sure to remove all materials and colors from the model.

Currently, the BNV is made up of 6 polygons. The larger polygons need to be sub-divided into smaller polygons.  Otherwise, Oni will crash if there are too many AI's on a single bnv at one time. How large should each bnv area be?  At this point, I don't know the maximum size of the bnv

Anyways, using the "Lines" tool, I subdivided the planes.

bnv_subdivided.jpg

You can also use the basic command of -room:extract AKEVlair.dae -out:rooms.dae to create a bnv model automatically. However, the rooms command is at an early stage so there are limitations.

Here is the bnv created created by the rooms command.
rooms.jpg

As you can see, the rooms command leaves every polygon from the original level.  So while this may be suitable for pathfinding grids, it would be impossible to add ghost quads to it, look at all the triangles in there.  I could not find a way to reduce the number of polygons within Sketchup.  But again it has its uses, I created the bnv for the Hexagon level using this command. 

So far we have prepared the bnv model for pathfinding grids.  However, if you want the AI's to patrol, then you need to add ghost quads to the bnv model. ghost quads are vertical planes between each bnv, which tells the AI that they can cross into the next bnv.

To make things easier, I made the ground, 1st floor, 2nd floor and 3rd floor into separate groups.  This prevents the vertical planes from merging with them.  I made a single vertical plane and aligned it with the ground along one line, next I subdivided the vertical polygon at each intersection.

ghostquads2.jpg

See how the lines on the vertical plane matches the lines on the ground?  Once the first vertical plane or ghost quad was made, it was grouped and copies were made for the other ones. 

Here is how the bnv looks with ghost quads added.
ghostquads.jpg
Now with ghost quads in place your AI can patrol.

Preparing the environment for Oni

At this moment, the ground and floors consist of one plane. However, the ground and floors need to be subdivided into smaller polygons. How small?  I don't know the exact answer.  All I know is if the polygons are large, you will get a bouncing effect as you stand or walk and then you will fall through the ground. (This affects PC users and Mac users with the PPC version, the Mac Intel is not affected)

I sub-divided the ground and floors using the Lines tool.  Again, select the ground, then "Edit Group" then make the sub-divisions.  I divided the ground into 64 polygons.

Here is how it looks after the ground and floors are sub-divided:

subdivided.jpg

Currently, OniSplit does not support Sketchup groups. Before the environment can be imported, all the groups need to be ungrouped or "Explode" in Sketchup terms.  This is where the most frustration can occur.  When Sketchup "Explodes" the environment, sometimes, polygons from different groups get merged together.  You may not notice this until you have the environment in-game and then you wonder, "what happened to the wall or ceiling, where did it go?"

Here is my workaround for the problem of merged polygons.  Make 2 new documents, one will be a transition and the other the target. "Copy" a group for example "ground" from the original file, "Paste in Place" in the transition document. "Explode" the group, "Select All" the elements of the group. "Cut" and then "Paste in Place" in the target document. Repeat the process until all the groups are in the target document.

Converting to .oni files.

Export the environment as 3D Model, in the Options window select "Triangulate All Faces" and "Export Texture Maps". Export as AKEVlair.

Now go back to the bnv model, export as 3D Model, however, unselect "Triangulate All Faces" and "Export Texture Maps". Export as lair_bnv.

With both dae files in the same folder, issue the OniSplit command
-grid:create lair_bnv.dae  AKEVlair.dae -out:output

Here is the result:

grids.jpg

This will produce the file lair_bnv_bnv.dae and the folder grids in the output folder.  Move both into the same folder as AKEVlair.

Now issue the OniSplit command -create:akev output AKEVlair.dae lair_bnv_bnv.dae

This will produce the file AKEVlair.oni

The process to convert the files is simplified using Oni LevelTools: http://oni.bungie.org/community/forum/v … hp?id=2082

Just for fun, here is part of the bnv for the TCTF level:
tctf_bnv.jpg
Can you imagine the time and effort it took to make the bnv model?

As a side note, Sketchup can view most of the AKEV from the original game.  However, some levels crash Sketchup.

Next step Creating the Level.

Offline

#3 08/22/11 15:08

EdT
Moderator
From: Los Angeles, CA
Registered: 01/13/07
Website

Re: Creating the Lair - A level tutorial

Part 3) Creating the level.

A basic level needs the following files:
AISA, Settings for "ai_0" character
AKEV, Level environment
BINACJBOCharacter, Spawnable characters
ONLV, Level settings
TXMP, Textures for AKEV

Here are the basic files in xml, I included the BINACHAR that is used with Oni Zen Garden. http://edt.oni2.net/Lair_Tutorial/Basic_level_files.zip

AISA file does not need to be modified. 
Modify the ONLVLevel file for your level. 

  <Name>bslfoldername</Name>  (Name of IGMD folder containing the BSL files)
  <Environment>AKEVname</Environment> (Name of level environment)
  <SkyBox>ONSKnight</SkyBox> (Other options are ONSKafternoon, ONSKsunset, ONSKcrapsky)

BINACJBOCharacter can be used as is, though the player's team is set as RogueKonoko

Putting the files together

For testing purposes, I put all the files (AISA, AKEV, BINACJBOCharacter, ONLV, TXMPs, after they have been converted to .oni files) in the level5_Final folder inside the GameDataFolder and then level5_Final was rebuilt using AETools, Oni LevelTools or OniSplit GUI can be used on the PC. This will use The Airport Part Deux level.  For completed levels we should start using the levels 20+, it will require the creation of ONLDlevel files and the persist.dat file modified.  There will be more information about this later.

Before converting the textures from Sketchup or any other source be sure to check the image size.  It should be 128x128, 256x256 or 512x512.

BSL folder
Don't forget to create a bsl folder for your level. A sample folder is included inside the Basic_files zip  The player is set to spawn at the coordinates 0 0 0, ai2showgrids and chr_show_bnv are set to on.

We have successfully imported our new level with pathfinding grids!
success.jpg

Troubleshooting
The level starts loading, but around 5-10%, Oni crashes.  This is always a result of a TXMP file missing from the level folder.

The level crashes right before or after the level loads.  On the PC, it could be a texture larger than 512x512 was imported.  Macs have support for up to 1024,1024 textures.

The "character BNV index" displays a large number!  That means there is no bnv at that location, you will need to check your bnv model.

Offline

#4 08/22/11 15:08

EdT
Moderator
From: Los Angeles, CA
Registered: 01/13/07
Website

Re: Creating the Lair - A level tutorial

Part 4) Flags, Weapons, Particles and more

chr_debug_characters=1 is your friend in this part of the tutorial.  All of the following files require you to position something, somewhere in the level and chr_debug_characters=1 will constantly update your current coordinates and direction you are facing.

Note: Thanks to Paradox-01 for the wiki pages

BINACJBOFlag
Allows you to set specific locations in the level. In the BSL we can use them to teleport characters: chr_teleport Muro 102, weapons: weapon_spawn w3_phr 45, powerups: powerup_spawn ammo 153

       <Object Id="6708" Type="FLAG">
         <Header>
                <Flags>0</Flags>
                <Position>376 0 400</Position>
                <Rotation>0 90 0</Rotation>
            </Header>
            <OSD>
                <Color>0 255 0</Color>
                <Prefix>19800</Prefix>
                <FlagId>130</FlagId>
                <Notes>Entry</Notes>
            </OSD>
        </Object>

The 3 tags that need to be edited are Position: x,y,z coordinates, Rotation: direction the flag will face (only the y value will be set) and FlagId: each flag must be numbered differently. I like to use the Notes to identify the flag.

One nice feature of the latest Mac version is the command show_flags=1

show_flags.jpg

This is just a basic introduction, for more detailed information on flags, see this page: http://wiki.oni2.net/OBD_talk:BINA/OBJC/FLAG

BINACJBOTrigger Volume
Trigger Volumes are areas that when entered can "trigger" all sorts of events, such as Save Points, spawning characters, starting scripts.

        <Object Id="8745" Type="TRGV">
            <Header>
                <Flags>0</Flags>
                <Position>105 0 25</Position>
                <Rotation>0 0 0</Rotation>
            </Header>
            <OSD>
                <Name>firstfloor</Name>
                <Scripts>
                    <Entry>save_point_1</Entry>
                    <Inside />
                    <Exit />
                </Scripts>
                <Teams>1</Teams>
                <Size>25 20 25</Size>
                <TriggerVolumeId>1</TriggerVolumeId>
                <ParentId>0</ParentId>
                <Notes />
                <Flags>1</Flags>
            </OSD>
        </Object>

Tags that need editing are Position: x,y,z coordinates, Name: name of trigger, Scripts: name of script that will run, Teams: who can trigger the event, Size: size of trigger volume from the x,y,z position, TriggerVolumeId: each trigger volume must be numbered differently and the last Flags: options for the trigger volume.

When you enter this trigger volume as the player you will trigger the script save_point_1 in the bsl.

In the bsl the script would look something like this:

func void save_point_1(string player_name)
{
    if (save_point ne 1)
        {
        dmsg "Save point 1"
        save_game 1 autosave
        }
}

Next time you load the level you will see Save Point 1 listed, now in the bsl you will need code like this:

if (save_point eq 1){
        restore_game
        dmsg "Save point 1 loaded"
                }

Within the brackets you can have additional bsl code.

For more detailed information on trigger volumes, see this page: http://wiki.oni2.net/OBD_talk:BINA/OBJC/TRGV

BINACJBOPowerUp, BINACJBOWeapon
These 2 files provides another option to spawn weapons or powerup, this time using x,y,z coordinates.

In the BINACJBOPowerUp file:
        <PWRU Id="8167">
            <Header>
                <Flags>0</Flags>
                <Position>160 180 167</Position>
                <Rotation>0 0 0</Rotation>
            </Header>
            <OSD>
                <Class>Ammo</Class>
            </OSD>
        </PWRU>

In the BINACJBOWeapon file:
        <WEAP Id="8240">
            <Header>
                <Flags>0</Flags>
                <Position>120 10 17</Position>
                <Rotation>180 0 0</Rotation>
            </Header>
            <OSD>
                <Class>w8_mbo</Class>
            </OSD>
        </WEAP>

Tags that need editing are Position: x,y,z coordinates and Class: what will be spawned at the coordinates

For more detailed information on powerups and weapons, see the pages:
http://wiki.oni2.net/OBD_talk:BINA/OBJC/PWRU
http://wiki.oni2.net/OBD_talk:BINA/OBJC/WEAP

BINACJBOParticle
This file is used to position particles in the level.

        <PART Id="8306">
            <Header>
                <Flags>0</Flags>
                <Position>213 20 -14</Position>
                <Rotation>0 0 0</Rotation>
            </Header>
            <OSD>
                <Class>env_bomb_e01</Class>
                <Tag>bomb</Tag>
                <Flags>13</Flags>
                <Decal>
                    <XScale>1</XScale>
                    <YScale>1</YScale>
                </Decal>
            </OSD>
        </PART>

Tags that need editing are Position: x,y,z coordinates, Class: name of particle, Tag: name used in bsl.

boom.jpg

Just having a little fun, combining the above particle, with the following Trigger Volume entry

        <Object Id="8745" Type="TRGV">
            <Header>
                <Flags>0</Flags>
                <Position>220 0 170</Position>
                <Rotation>0 0 0</Rotation>
            </Header>
            <OSD>
                <Name>boom</Name>
                <Scripts>
                    <Entry>boom</Entry>
                    <Inside />
                    <Exit />
                </Scripts>
                <Teams>1</Teams>
                <Size>40 20 40</Size>
                <TriggerVolumeId>3</TriggerVolumeId>
                <ParentId>0</ParentId>
                <Notes />
                <Flags>1</Flags>
            </OSD>
        </Object>

Plus this bsl code, gets you that screenshot :-)

        func void boom(string player_name)
{
        particle bomb do explode
}

To see the Trigger Volume on a Mac use the command show_triggervolumes=1

For more detailed information on particles, see this page: http://wiki.oni2.net/OBD_talk:BINA/OBJC/PART

BINACJBOTrigger
This will set the position and type of laser triggers.

        <TRIG Id="8136">
            <Header>
                <Flags>0</Flags>
                <Position>252 2 760</Position>
                <Rotation>90 90 180</Rotation>
            </Header>
            <OSD>
                <Class>trigger_long</Class>
                <TriggerId>1</TriggerId>
                <Flags>40</Flags>
                <LaserColor>0 0 255</LaserColor>
                <StartPosition>0</StartPosition>
                <Speed>1</Speed>
                <EmitterCount>3</EmitterCount>
                <Offset_0075>0</Offset_0075>
                <Offset_0077>0</Offset_0077>
                <Events>
                    <ActivateTurret TargetId="1" />
                </Events>
            </OSD>
        </TRIG>

Tags that need editing are Position: x,y,z coordinates, Rotation: direction the lasers will face and how it will move, Class: type of trigger, TriggerId: each trigger must be numbered differently Speed: 0 no movement, 1 slow, 2 fast, EmitterCount: number of laser emitters Event: what will take place when triggered.  Optional, LaserColor: RGB values.

The hardest part in setting up triggers was pointing them in the correct direction.  After much testing here are the Rotation numbers for each direction.

Triggerface0.jpg

Laser Direction 0
<Rotation>0 90 0</Rotation> Moves left of position
<Rotation>180 90 0</Rotation> Moves right of position
<Rotation>270 90 0</Rotation>Moves above position
<Rotation>90 90 0</Rotation> Moves below position

Laser Direction 90
<Rotation>0 180 0</Rotation> Moves left of position
<Rotation>180 180 0</Rotation> Moves right of position
<Rotation>270 180 0</Rotation>Moves above position
<Rotation>90 180 0</Rotation> Moves below position

Laser Direction 180
<Rotation>0 270 0</Rotation> Moves left of position
<Rotation>180 270 0</Rotation> Moves right of position
<Rotation>270 270 0</Rotation>Moves above position
<Rotation>90 270 0</Rotation> Moves below position

Laser Direction 270
<Rotation>0 0 0</Rotation> Moves left of position
<Rotation>180 0 0</Rotation> Moves right of position
<Rotation>270 0 0</Rotation>Moves above position
<Rotation>90 0 0</Rotation> Moves below position

For more detailed information on triggers, see this page: http://wiki.oni2.net/OBD_talk:BINA/OBJC/TRIG

BINACJBOTurret
This will set the position and type of turrets.

         <TURR Id="8148">
            <Header>
                <Flags>9</Flags>
                <Position>251 80 751</Position>
                <Rotation>0 180 0</Rotation>
            </Header>
            <OSD>
                <Class>phr_turret_wall</Class>
                <TurretId>1</TurretId>
                <Flags>0</Flags>
                <TargetedTeams>Konoko</TargetedTeams>
            </OSD>
        </TURR>

Tags that need editing are Position: x,y,z coordinates, Rotation: direction the turrets will face, Class: type of turret, TurretId: turrets can have the same id number.  For example a single laser trigger can activate 4 different turrets if they have the same TurretId. TargetedTeams: which team will be targeted.

For more detailed information on turrets, see this page: http://wiki.oni2.net/OBD_talk:BINA/OBJC/TURR

BINACJBOPatrol Path
You must have ghost quads in your bnv model for patrols to work.

<PATR Id="1622">
            <Header>
                <Flags />
                <Position>-362.968719 -36.5009766 1110.47681</Position>
                <Rotation>0 0 0</Rotation>
            </Header>
            <OSD>
                <Name>guarddoor</Name>
                <PatrolId>1</PatrolId>
                <ReturnToNearest>0</ReturnToNearest>
                <Points>
                    <MovementMode Mode="Walk" />
                    <Loop>
                         <MoveToFlagLookAndWait Frames="500" FlagId="105" Rotation="60" />
                        <MoveToFlagLookAndWait Frames="500" FlagId="104" Rotation="60" />
                        <MoveToFlagLookAndWait Frames="500" FlagId="105" Rotation="60" />
                        <MoveToFlagLookAndWait Frames="500" FlagId="106" Rotation="60" />
                    </Loop>
                </Points>
            </OSD>
        </PATR>

Name: guarddoor can be used with the BSL command ai2_dopath,  PatrolId: must be unique, used in BINACHAR, Loop: Contains the instructions on how the AI will perform the patrol.  In this example the AI moves to each flag stops, looks around then moves to next flag.

In the BINACHAR, you will need to edit these lines:

                <Job>
                    <Type>Patrol</Type>
                    <PatrolPathId>1</PatrolPathId>
                </Job>

There are many options on how an AI will patrol the path, see the wiki for more details.
http://wiki.oni2.net/OBD_talk:BINA/OBJC/PATR

Offline

#5 08/22/11 15:08

EdT
Moderator
From: Los Angeles, CA
Registered: 01/13/07
Website

Re: Creating the Lair - A level tutorial

Part 5) Adding objects to the environment

Currently, there are 3 ways to add objects to the level.
1) Add them directly to the environment
2) Export to 2 separate dae files, one with the environment and the other with the objects.  Some programs allow you to hide layers when exporting. For example, you can hide the environment layer and export only the objects.
3) Use the FURN objects with the level importer (See part 6)

The advantages of 1 and 2 is that you can see exactly where the objects are placed.  I used method 1 for the junkyard and starting the Lair.  However, Sketchup fails in this regards.  I added some objects from Oni to the environment, as you can see here:

su_objects.jpg

It added 18 more textures to the model.  However, when I exported to dae, it produced 225 separate texture files!  It made multiple copies of the same texture. That's ridiculous.  So if you are using Sketchup exclusively method 3 is the only choice for you.

Where do I get the objects?
For methods 1 and 2, you can copy the objects from other Oni levels.  Extract the AKEV from a level, you will get 3 dae files, env, bnv and objects.  For example here are the objects from the EnvWarehouse_obj.dae file and imported into Sketchup.

wh_objects.jpg

You can also find objects on Turbosquid or Google's 3D Warehouse and put them in your level.  One word of caution, you must use low-poly objects.  If you use objects with medium or high polygons, then, while in-game and if you as the player gets close to that object, it causes problems with the Oni engine and you will fall through the ground.  An example of this is the Ninjabot or the Iron Demon in the Junkyard level.

Offline

#6 08/22/11 15:08

EdT
Moderator
From: Los Angeles, CA
Registered: 01/13/07
Website

Re: Creating the Lair - A level tutorial

Part 6) Level Importer - Beta

level_importer.jpg

Are those working doors? Yes!

OniSplit now has a level importer, I am starting to explore it but wanted to share it with everyone.
First of all get the files: http://edt.oni2.net/Lair_Tutorial/level_importer.zip

Put the folder li_test and OniSplit.exe in the install folder of Edition.  Note: This version of OniSplit has changed some of the xml tags, so xml files made with previous version may not work.  You will have to extract the .oni filea as xml to get the new tags.

There is also a textures folder in the li_test folder, those are the textures needed for this level.  Put them in the level folder that you will be using.

Put the test folder in the IGMD folder.

The basic OniSplit command for the level importer is: -create:level li_test/out li_test/test.xml 
This will the output the level files to the out folder inside the li_test folder.  Then you can move the files to the level folder, for example level5_Final or level7_Final, as long as you have not installed any of the level packages such as the Arena or Maze.

Currently, I am using the command -create:level ../GameDataFolder/level5_Final li_test/test.xml  This puts all the files into the level5_Final folder.

Compile or build level 5 and play The Airport Part Deux.  If you move toward the building you will enter a trigger volume which will explode the bomb.

Here is a brief introduction to the process.  The file test.xml is the master file, the name of the environment and bnv are entered in here.  The objects.xml file has all the BINAOBJC that are currently supported and can be imported.  The other types such as BINACHAR has to be imported manually.

The object type <FURN> uses the OFGA files found in the classes folder.  Currently, only those OFGA objects can be imported into the level.

Textures have to be manually imported.  I suppose you could move all the TXMP files in the classes folder to your level folder.  Remember, if Oni crashes at 5-10% of level load, that means you are missing textures in the level folder.

The files in the classes folder came from the tools.dat file.

The following BINA files only work with the level importer command.

BINACJBODoor

        <DOOR>
            <Header>
                <Flags></Flags>
                <Position>225 0 -73</Position>
                <Rotation>0 0 0</Rotation>
            </Header>
            <OSD>
                <Class>PWmed</Class>
                <DoorId>1</DoorId>
                <KeyId>0</KeyId>
                <Flags>InitialLocked InDoorFrame</Flags>
                <Center>0 35 0</Center>
                <ActivationRadius>30</ActivationRadius>
                <Texture1></Texture1>
                <Texture2></Texture2>
                <Events/>
            </OSD>
        </DOOR>

The tags that need to be edited are Position: x,y,z coordinates, Rotation: direction the door will face, Class: the type of door. Door types can be found in the classes folder. DoorId: each door must be numbered differently; Flags: the status of the door, others are Manual, DoubleDoor, InitialOpen.  Texture1: for custom door texture.

BINACJBOConsole

        <CONS>
            <Header>
                <Flags></Flags>
                <Position>270 0 -65</Position>
                <Rotation>0 0 0</Rotation>
            </Header>
            <OSD>
                <Class>console0</Class>
                <ConsoleId>23</ConsoleId>
                <Flags>InitialActive</Flags>
                <InactiveTexture>_con_INACTIVE</InactiveTexture>
                <ActiveTexture>_con_RL_FLOOR1</ActiveTexture>
                <TriggeredTexture>_con_USED</TriggeredTexture>
                <Events>
                <UnlockDoor TargetId="1" />
                <Script Function="change_lights" />
                </Events>
            </OSD>
        </CONS>

The tags that need to be edited are Position: x,y,z coordinates, Rotation: direction the door will face, Class: the type of console, other types are console_alarm, console_data and console_small_wu_roof.  ConsoleId: each console must be numbered differently; Flags: the status of the console, others are None and IsAlarm.  Inactive, Active and Triggered Textures are the texture that will be shown in those states.

Under the Events tag, there are a number of things that can occur when the console is triggered.  Take a look at the BINACJBOConsole from a level to see some options.

In this example, the console will unlock DoorID 1 and will change the color of the Doorlight by a BSL function.

func void change_lights(string ai_name)
{
    sleep 60
    particle lock46_locklight01 do start
}

The doorlight is located in the BINACJBOFurniture file and looks like this:
        <FURN>
            <Header>
                <Flags>Gunk</Flags>
                <Position>250 10 -72</Position>
                <Rotation>0 0 0</Rotation>
            </Header>
            <OSD>
                <Class>DOORLIGHT</Class>
                <Particle>lock46</Particle>
            </OSD>
        </FURN>

Offline

#7 08/22/11 15:08

EdT
Moderator
From: Los Angeles, CA
Registered: 01/13/07
Website

Re: Creating the Lair - A level tutorial

Part 7) Level Importer Master file information

The level importer uses a "master" file to control the contents of the level.  Here is the master file for the parkour level.

<?xml version="1.0" encoding="utf-8" ?>
<Oni>
    <Level SharedPath="../classes">
        <Environment>
        <Model>
            <Import>AKEVparkour.dae</Import>
        </Model>
        <Rooms>
            <Import>parkour_bnv.dae</Import>
        </Rooms>
         <Textures>
                <Import>textures.xml</Import>
        </Textures>
        </Environment>
        <Sky>clear</Sky>
        <Objects>
            <Import>BINACJBOCharacter.xml</Import>
            <Import>BINACJBOFlag.xml</Import>   
            <Import>BINACJBOFurniture.xml</Import>     
            <Import>BINACJBOConsole.xml</Import>     
            <Import>BINACJBODoor.xml</Import> 
            <Import>BINACJBOTurret.xml</Import>
            <Import>BINACJBOTrigger.xml</Import>
            <Import>BINACJBOTriggerVolume.xml</Import> 
            <Import>BINACJBOParticle.xml</Import> 
             <Import>physics.xml</Import>
        </Objects>
    </Level>
</Oni>

Explanation:
<Level SharedPath="../classes"> 
This is the path to the "classes" folder which has all the files (TXMP, M3GM, OBAN, OFGA) for consoles, doors and furnitures for the level.

<Model>
    <Import>AKEVparkour.dae</Import>
</Model>
The path and file name of the level's geomety. If needed, Onisplit can import multiple daes which compose the level.

<Rooms>
    <Import>parkour_bnv.dae</Import>
</Rooms>
The path and file name of the level's BNV.

<Textures>
    <Import>textures.xml</Import>
</Textures>
The textures file is used to set the flags or characteristics of the AGQG or quads of a level based on the texture.  For example, if you want a quad to be two-sided like glass the flag would be set to Transparent.  If you want an invisible quad, set the flag to Invisible.  The acid pool in the lab uses the flag NoCollision.

Sample textures.xml file:
<?xml version="1.0" encoding="utf-8" ?>
<Oni>
    <Textures>
        <Texture Name="TXMPwalkway">
            <GunkFlags>Transparent</GunkFlags>
            <Format>RGBA</Format>
            <Image>images/TXMPwalkway.tga</Image>
        </Texture>
         <Texture Name="TXMPGOO">
            <GunkFlags>NoCollision</GunkFlags>
            <Format>BGRA4444</Format>
            <Image>images/TXMPGOO.tga</Image>
        </Texture>
         <Texture Name="TXMPdeepwater">
            <GunkFlags>Danger NoCollision Transparent</GunkFlags>
            <Format>RGBA</Format>
            <Image>images/TXMPdeepwater.tga</Image>
        </Texture>
    </Textures>
</Oni>
AI's are supposed to avoid any quads flagged as "Danger"

<Sky>clear</Sky>
The name of the skybox used for the level.

<Objects>
    <Import>BINACJBOCharacter.xml</Import>
    <Import>BINACJBOFlag.xml</Import>   
    <Import>BINACJBOFurniture.xml</Import>     
    <Import>BINACJBOConsole.xml</Import>     
    <Import>BINACJBODoor.xml</Import> 
    <Import>BINACJBOTurret.xml</Import>
    <Import>BINACJBOTrigger.xml</Import>
    <Import>BINACJBOTriggerVolume.xml</Import> 
    <Import>BINACJBOParticle.xml</Import> 
    <Import>physics.xml</Import>
</Objects>
The path and file name of any BINACJBO which has custom data for the level. If for example, there are no doors or consoles in the level, then those files can be removed from the objects section. 

<Import>physics.xml</Import>
This file is used to set the flags for the physics of an object in Oni.  However, there are bugs in the Oni engine in this area.  For example, if a crate object is set with Newton, you may be able to move it around, but you can not stand on it.

Sample physics.xml file:
<?xml version="1.0" encoding="utf-8"?>
<Oni>
    <Physics>
        <Object Name="object_ball">
            <ScriptId>1</ScriptId>
            <Geometry>soccerball</Geometry>
            <Flags>FaceCollision</Flags>
            <Physics>Newton</Physics>
            <Position>37 -77 -800</Position>
            <Rotation>0 0 0</Rotation>
        </Object>
    </Physics>
</Oni>

Last edited by EdT (04/07/12 20:04)

Offline

#8 08/22/11 15:08

Mukade
Member
From: Ottawa, Ontario - Canada
Registered: 05/29/07

Re: Creating the Lair - A level tutorial

Running Riot!! Looking forward to the rest smile
I do kinda want to get into map making, but I have no ideas, and I'm not sure I have the dedication needed to complete such a big project tongue

I also love your laser fence. Does it work??


"He looks mean enough to tear my arm off and beat me to death with it. In fact, he looks mean enough to tear his OWN arm off and beat me to death with it."

Offline

#9 08/22/11 16:08

Nitr0
Member
From: Croatia
Registered: 11/26/10

Re: Creating the Lair - A level tutorial

Do I see doors? o.O
Do they work?


Ninjabar thin

Offline

#10 08/22/11 16:08

Samer
Member
From: Lebanon
Registered: 09/04/09
Website

Re: Creating the Lair - A level tutorial

thanks Edt smile


Join our Oni Facebook Group
Check My YouTube Channel for my Oni Videos.
Check My Wiki page for all my stuff

Offline

#11 08/22/11 17:08

Lukas Kreator
Member
Registered: 05/07/10

Re: Creating the Lair - A level tutorial

Amazing, EdT! You are already better than me at level modding! big_smile You found out by yourself about layers and the "purge unused" option.
Your tutorial will be surely better than mine. I'll make sure to link it in that wiki page, unless you already have done so.


@Nitr0:

Note: Currently, OniSplit cannot add the animated doors that are in the game.

Offline

#12 08/22/11 18:08

Nitr0
Member
From: Croatia
Registered: 11/26/10

Re: Creating the Lair - A level tutorial

Yes Lukas I know that but I thought he menaged to add them somehow...


Ninjabar thin

Offline

#13 08/22/11 20:08

Lukas Kreator
Member
Registered: 05/07/10

Re: Creating the Lair - A level tutorial

Oh, sorry then.

Offline

#14 08/22/11 20:08

quarkmac
Member
From: Wisconsin, USA
Registered: 01/14/07
Website

Re: Creating the Lair - A level tutorial

Ed you rock


We Don't Give The Crescent Moon Kick Nearly As Much Credit As It Deserves!

Offline

#15 08/23/11 00:08

EdT
Moderator
From: Los Angeles, CA
Registered: 01/13/07
Website

Re: Creating the Lair - A level tutorial

Thanks, I'll will be slowly updating the tutorial as I learn what is needed to get a level up and running.

Mukdae: Those are the moving laser triggers for the turrets above.

Offline

#16 08/23/11 02:08

Mukade
Member
From: Ottawa, Ontario - Canada
Registered: 05/29/07

Re: Creating the Lair - A level tutorial

Well, yeah, I figured that part out :-/
I just was wondering if it actually works? With the turrets and all


"He looks mean enough to tear my arm off and beat me to death with it. In fact, he looks mean enough to tear his OWN arm off and beat me to death with it."

Offline

#17 08/23/11 21:08

EdT
Moderator
From: Los Angeles, CA
Registered: 01/13/07
Website

Re: Creating the Lair - A level tutorial

Parts 2 and 3 have been added smile

Mukade, yes the triggers work with the turrets.

Offline

#18 08/23/11 21:08

Lukas Kreator
Member
Registered: 05/07/10

Re: Creating the Lair - A level tutorial

Very cool! And thanks for linking to my program wink

Offline

#19 08/24/11 21:08

EdT
Moderator
From: Los Angeles, CA
Registered: 01/13/07
Website

Re: Creating the Lair - A level tutorial

Part 4 has been posted.

Offline

#20 08/25/11 11:08

Lukas Kreator
Member
Registered: 05/07/10

Re: Creating the Lair - A level tutorial

This tutorial is a great advancement. We can, thanks to EdT, put almost anything from the original levels into our own.

I'll try making a new level based on your tutorial. I might still have problems with shapes and groups, though, as I tend to use more architecture than cool stuff hmm

Last edited by Lukas Kreator (08/25/11 11:08)

Offline

#21 08/25/11 11:08

EdT
Moderator
From: Los Angeles, CA
Registered: 01/13/07
Website

Re: Creating the Lair - A level tutorial

Great news, here is the latest version of OniSplit that supports groups: http://mods.oni2.net/node/38

Doors import has not been added, but it is being worked on.

Now I have to update the tutorial smile

[Updated direct link to version of OniSplit, which was deleted, to node link. -I]

Last edited by Iritscen (12/30/12 19:12)

Offline

#22 08/25/11 13:08

Lukas Kreator
Member
Registered: 05/07/10

Re: Creating the Lair - A level tutorial

Yay! That is great!

I guess it won't import components, will it?

Last edited by Lukas Kreator (08/25/11 15:08)

Offline

#23 08/25/11 16:08

Lukas Kreator
Member
Registered: 05/07/10

Re: Creating the Lair - A level tutorial

BINACJBOCharacter.xml in your basic pack is not working for me...

Actually, seems it is not needed for the level to work.

EDIT: I was trying to make a level. Things are still being displaced. It is as annoying as before sad
The .dae seems perfect, but there are no groups after exporting.
EDIT 2: Nevermind, but I had to explode everything and stuff merged.

Last edited by Lukas Kreator (08/25/11 16:08)

Offline

#24 08/25/11 17:08

EdT
Moderator
From: Los Angeles, CA
Registered: 01/13/07
Website

Re: Creating the Lair - A level tutorial

It seems that v58 changes how the xml is written, you will need to extract another BINACHAR.oni to xml and use that or change <ObjectCollection> and  </ObjectCollection> to <Objects> and </Objects>

Did you rotate the group after you made it?  The workaround for me was to explode the group and then group again.  As long as the other items around it are in groups, then nothing will get merged.

Offline

#25 08/26/11 10:08

Lukas Kreator
Member
Registered: 05/07/10

Re: Creating the Lair - A level tutorial

I'll try doing that, but no, I didn't rotate it after grouping. And sorry for double posting.

Offline

Board footer

Powered by FluxBB