XML:ONLV: Difference between revisions

From OniGalore
Jump to navigation Jump to search
mNo edit summary
m (→‎Level files hierarchy: um, what is AKEB? is it AKBA? =^_^=)
 
(174 intermediate revisions by 8 users not shown)
Line 1: Line 1:
{{XML_File_Header | type=ONLV | prev=ONLD | next=ONSK | name=Oni Game Level}}
{{XML_File_Header | prev=ONLD | type=ONLV | next=ONSK | name=Oni Game Level}}
{{finish}}{{update}}
;Todo list
 
* tips with cutscene charas: sync pelvis OBAN and partner TRAM
* notes on camera and film import ?
* more information / updates for exported xml files
 


__TOC__
__TOC__




==Level releases, forum threads and wiki pages==
ONLV and AKEV should not be extracted as XML unless it is for the purpose of trouble shooting or research. The extracted XMLs cannot be used for level creation.
;Custom levels that have been created so far
* [http://oni.bungie.org/community/forum/viewtopic.php?id=2357 Old China] (12/5/12)
* [http://oni.bungie.org/community/forum/viewtopic.php?id=2302 Boss Battle] (18/3/12)
* [http://oni.bungie.org/community/forum/viewtopic.php?id=2242 Parkour Challenge 2] (23/1/12)
* [http://oni.bungie.org/community/forum/viewtopic.php?id=2235 Parkour Challenge] (16/1/12)
* [http://oni.bungie.org/community/forum/viewtopic.php?id=2001 Mini-Partenon] (25/7/11)
* [http://oni.bungie.org/community/forum/viewtopic.php?id=1957 Hexagon] (3/7/11)
* [http://oni.bungie.org/community/forum/viewtopic.php?id=1938 Junkyard] (23/6/11)
* [http://oni.bungie.org/community/forum/viewtopic.php?id=1736 Arena] (8/11/10)
* [http://oni.bungie.org/community/forum/viewtopic.php?id=1506 Maze] (15/2/10)
 
;OCF threads about level creation
* '''[http://oni.bungie.org/community/forum/viewtopic.php?id=2087 "Creating the Lair - A level tutorial"]'''
* [http://oni.bungie.org/community/forum/viewtopic.php?id=1515 "Creating new levels"]
* [http://oni.bungie.org/community/forum/viewtopic.php?pid=33838 "Create levels with pathfinding grids"]
* [http://oni.bungie.org/community/forum/viewtopic.php?id=2000 "More questions about levels"]
* [http://oni.bungie.org/community/forum/viewtopic.php?id=2003 "Sketchup tutorials for making levels"]
* [http://oni.bungie.org/community/forum/viewtopic.php?pid=37252#p37252 "Modding Existing levels - Beta" ("Moveable furniture" post)]
 
;Wiki pages about levels
* [[AE:Levels]]
* [[AE:Lightmapping_levels]]
* [[SketchUp_tutorials_and_tips|SketchUp tutorials and tips]]
 
;Free texture resources
* [http://www.tutorialsforblender3d.com/Textures/Textures_index.html various game textures]
* [http://forums.epicgames.com/threads/603122-Remus-high-resolution-skydome-texture-pack skies and objects of the solar system]
* [http://blenderartists.org/forum/showthread.php?224065-New-High-resolution-sky-pack-for-Blender skies] <!-- (http://www.wuala.com/Olson/Photos/Optikz_360_Skies/) -->
* [http://blenderartists.org/forum/showthread.php?24038-Free-high-res-skymaps-%28Massive-07-update!%29 skies]
* [http://www.cgtextures.com/ CG Textures for 3D]
 
 
==Concept phase==
Be aware of limitation of level and engine.
 
* triangle limit of a game level: ca. 520.000 (500.000 to be on save side)
* when the triangles are packed too tight then the cam will look at too many of them and glitches appear: the visible GQs limit is ca. 16.000, sooner or later higher numbers will cause render bugs and call BSL message "Exceeded max visible GQs ''number''" (you can decrease the gs_farclipplane_set value to avoid that problem)
* characters are visible ''only'' within 4099|4099|4099 and -4099|-4099|-4099 world units
* geometry stops at ca. X=4228|Z=4228 and -4228|-4228 (height not tested)
* chr_debug_spheres = 1 visualizes collision spheres of characters, then you can check if they fit through a new entrance
 
 
==Level import with onisplit [http://mods.oni2.net/node/38 0.9.82.0]==
'''Demo files'''
 
Demo files can be downloaded [http://dl.dropbox.com/u/1869/lab.zip here].
 
First put the new "OniSplit.exe" into the second "lab" folder alongside the xml files.
 
There's a "build.cmd" file. Those two are the important lines:
 
onisplit -create:level out lab.xml
onisplit -import:pc out level3_Final.dat
 
The first line create the *.oni files from a master.xml file, in this case "lab.xml". If final, the oni files can be put into a new AE package.
 
The second line creates level archives which can be used '''for fast tests'''. They don't require you to install a package.
 
Instead of "nosep" you can now also use "pc" for the import. Mac does still use "sep".
 
If the game crashes while loading (at ca. 5-10% progress), check if all textures were inside the "out" folder.
 
You can extract the AKEV file to xml, then search for "TXMP".
 
"TXMP_marker_door" and "TXMP_marker_ghost" will be missing in the demo's "out" folder.
 
You can add this between the other two lines in the build.cmd to prevent a crash.
onisplit -create:txmp out env/markers/*.tga
 
 
===The master xml file===
File paths can be either absolute or relative.
 
The '''master xml file name''' determine the '''bsl folder name''' and the '''AKEV and ONLV file name''' in the output folder.
 
 
'''Mandatory files''' for level import:
* ''level_environment''.dae
* ''level_bnv''.dae
* ''level_textures.tga/jpg
* Character.xml or AISA with player
* ONSK name in <Sky> (can be fake name)


If you want to create a new level check out the '''[[Creating a level|corresponding tutorial]]'''.


==ONLV==
{| class="wikitable" width="100%"
{| class="wikitable" width="100%"
!width=150px| XML tag
!width=150px| XML tag
!width=120px| content type
!width=120px| Content type
! description
! Description
|-
|valign="top"| <ONLV id="...">
|valign="top"| integer
| ONLV's instance number. Should be 0.
|-
|valign="top"| <Name>
|valign="top"| char[64]
| Name of BSL '''folder'''.
: Save game slot and level number are defined inside [[XML:ONLD|ONLD]].
|-
|valign="top"| <Environment>
|valign="top"| link
| Link to [[XML:AKEV|AKEV]] via '''file''' name (AKEV''name'', don't use file suffix .oni)
: Level geometry.
|-
|valign="top"| <Objects>
|valign="top"| link
| Link to [[#OBOA|OBOA]] via '''instance''' number (#''N'').
: The OBOA instance holds doors, animated objects (usually for cutscenes) and pushable objects (which are not used the original game due to unfinished physics code).
|-
|valign="top"| <SkyBox>
|valign="top"| link
| Link to [[XML:ONSK|ONSK]] via '''file''' name (ONSK''name'', don't use file suffix .oni)
: This is the skybox.
|-
|-
| <?xml version="1.0" encoding="utf-8"?>
|valign="top"| <Characters>
|valign="top"| float, flag
|valign="top"| link
|valign="top"| Ignore this.
| Link to [[XML:AISA|AISA]] via '''file''' name (AISA''name'', don't use file suffix .oni)
: This "AI Setup Array" is an alternative character list. [[XML:BINA/OBJC/CHAR|BINACHAR]] is more powerful.
|-
|-
| <Oni>
|valign="top"| <ObjectQuadMap>
| -
|valign="top"| link
|
| Link to [[#ONOA|ONOA]] via '''instance''' number (#''N'').
: This "Object Array" holds functional objects – doors, furniture, turrets, triggers and consoles. In addition, it appears that the engine only searches for door-type objects.
|-
|valign="top"| <Particles>
|valign="top"| link
| Link to [[#ENVP|ENVP]] via '''instance''' number (#''N'').
: These "Environment Particle" are traditionally only used for door lock lights and particles used by [[XML:OFGA|OFGAs]].
|-
|-
|valign="top"| <Level SharedPath="...">
|valign="top"| <Corpses>
|valign="top"| link
|valign="top"| link
| The master xml file can link to other xml files, most of them are [[OBD:BINA/OBJC#OBJC_types|BINACJBO]] files. The file type gets declared inside the file, so the file name itself doesn't have to contain the type. Ergo, "BINACJBOCharacter.xml" can be given a simpler name like "Character.xml".
| Link to [[#CRSA|CRSA]] via '''instance''' number (#''N'').  
: This is a "Corpse Array". It's used to spawn dead characters such as Chung in Chapter 1.
|}


Some resources used by those xml files can be found in a "shared" folder. OniSplit copies textures and "physics" objects into the output folder; furniture objects will be integrate into the AKEV. Unused resources in the shared folder will be ignored. That way the final level archive / AE package contains only necessary files which saves the end-user space.
==OBOA==
Used for movable/moving objects.


In the demo are various subfolders in shared folder: consoles, doors, furniture, triggers and turrets.
{| class="wikitable" width="100%"
Following file types comes there without their file prefixes: CONS, DOOR, TRIG, OFGA. OniSplit recognize them nonetheless.
!width=150px| XML tag
!width=120px| Content type
! Description
|-
| <OBOA id="...">
| integer
| Instance ID. Should be 1.
|-
|-
| <Environment>
| <Objects>
| -
| -
|
| Array of <OBOAObject> tags.
|-
|-
| <Model>
| <OBOAObject>
| -
| -
| See [[#<Model>|HERE]] for detailed information.
| There are always 32 empty objects plus those that are actually used
|-
| <Geometry>
| "#" + integer
| Link to M3GA instance. Doors have two separate models: an animated and a static one. If this <Geometry> links to a door, it will be the animated model.
|-
|-
| <Import Path="..."/>
| <Animation>
| link
| link
|
| OBAN''name''.
|-
|-
| <Node Id="...">
| <Particle>
| string
| # + integer
| informative (space for notes so to say)
| Link to ENVP instance. There can be multiple ENVP instances – one for a lock light and others for additional particles.
|-
|-
|valign="top"| <ScriptId>
|valign="top"| <Flags>
|valign="top"| integer
|valign="top"| flags
| Tested with BSL command ...
: [[#<Model>|env_show Id 1]] (use 0 to hide)
: [[#Breakable glass with BSL recognition|env_broken Id [Id]]] (if also second Id is used then objects in that range get counted e.g. 3001, 3018 = 18)
: [[#Texture exchange|env_texswap Id texture]] (no file prefix/suffix allowed)
: [[#env_shade|env_shade Id Id R G B]]
|-
|valign="top"| <GunkFlags>
|valign="top"| flag
|
|
;AGQG (Gunk) flags (trimmed list)
: None
see ''onisplit -help enums'' for more flags
: InUse
:None
: NoCollision (any effect? no collision is default behavior)
:NoCollision
: NoGravity
:NoObjectCollision
: FaceCollision (for doors)
:NoCharacterCollision
:NoDecal
:TwoSided
:Invisible
|-
|-
|valign="top"| <Rooms>
| <DoorGunkId>
|valign="top"| -
| int32
| For detailed information see [[#<Rooms>|HERE]].
| The index of the door frame GQ (only used for door objects)
 
For Google Sketchup BNV tutorial see [http://oni.bungie.org/community/forum/viewtopic.php?pid=36760#p36760 HERE].
|-
|-
| <Import Path="..."/>
| <DoorId>
| link
| int32
| File path to *.dae file. BNV data, used to create pathfinding.
| Only used for doors; in the case of double doors, both doors have the same ID and they are flagged as "InUse FaceCollision"
|-
|-
| <Textures>
|valign="top"| <PhysicsType>
| -
|valign="top"| flags
|
|
: None
: Static
: Linear (pushable object)
: Animated (animated via OBAN)
: Newton (same as Linear)
|-
| <ScriptId>
| int32
| Scripting ID; used by BSL function '''obj_create'''; "65535" means not used.
|-
|-
| <Texture Name="...">
| <Position>
| string
| vector
| TXMP file name to generate.
| Float x3. Not used for animated objects.
|-
|-
|valign="top"| <Format>
| <Rotation>
|valign="top"| flag
| quaternion
|
| Float x4. Not used for animated objects.
:BGR
:RGBA
:BGR555
:BGRA5551
:BGRA4444
|-
|-
|valign="top"| <GunkFlags>
| <Scale>
|valign="top"| flag
| float
|
| Not used for animated objects.
;AGQG (Gunk) flags (trimmed list)
see ''onisplit -help enums'' for more flags
:None
:NoCollision
:NoObjectCollision
:NoCharacterCollision
:NoDecal
:TwoSided
:Invisible
|-
|-
| <Image>
| <Transform>
| link
| matrix
| File path to *.tga/jpg file.
| Float 3*3 + 3 more floats for the X Y Z position of the object. For more information on the matrix, see [[OBD:CRSA]]. Used for animated objects.
|-
|-
|valign="top"| <Sky>
| <Name>
|valign="top"| string
| char[64]
| ONSKfile.oni (without file pre- and suffix)
| Name of the object; informational only.
|}


The import doesn't work with an empty tag. <Sky>clear</Sky> helps here; any other fictional name will also do.
==ONOA==
Used by static objects (imported by object list).


For detailed information see [[XML:ONSK|HERE]].
{| class="wikitable" width="100%"
!width=150px| XML tag
!width=120px| Content type
! Description
|-
|-
| <Objects>
| <ONOA id="...">
| -
| integer
|
| Instance ID.
|-
|valign="top"| <Import>
|valign="top"| link
| File path. Supported files:
: [[XML:BINA/OBJC/CHAR|Character.xml]] (has to contain player character if there's no AISA file with it)
: [[XML:BINA/OBJC/CONS|Console.xml]]
: [[XML:BINA/OBJC/DOOR|Door.xml]]
: [[XML:BINA/OBJC/FLAG|Flag.xml]]
: [[#Furniture.xml|Furniture.xml]]
: [[XML:BINA/OBJC/NEUT|Neutral.xml]]
: [[XML:BINA/OBJC/PART|Particle.xml]]
: [[XML:BINA/OBJC/PATR|PatrolPath.xml]]
: [[#Physics.xml|Physics.xml]]
: [[XML:BINA/OBJC/PWRU|PowerUp.xml]]
: [[XML:SNDD#BINACJBOSound.xml|Sound.xml]]
: [[XML:BINA/OBJC/TRIG|Trigger.xml]]
: [[XML:BINA/OBJC/TRGV|TriggerVolume.xml]]
: [[XML:BINA/OBJC/WEAP|Weapon.xml]]
|-
|-
| <Films>
| <Elements>
| -
| -
|
| This is an int32 array for the <ONOAElement> tags.
|-
| <Import>
| link
| File path to *.xml file. OniSplit creates a [[XML:FILM|FILM]] file from it. Used for characters in cutscenes.
|-
|-
| <Cameras>
| <ONOAElement>
| -
| -
|
|
|-
|-
| <Camera Path="...">
|valign="top"| <ObjectId>
| link
|valign="top"| integer
| File path to *.dae file. OniSplit creates an OBAN file from it. Used for cutscenes.
| Object ID and type to which this quad belongs (see AKEV's [[XML:AKEV#AGQG|AGQG]] for details).
: Actual object IDs can also be found in BINA/OBJC/####.
|-
|-
| <Animation Name="..."/>
| <QuadList>
| string
| "#" + integer
| Name for the OBAN file.
| Link to IDXA instance. Each object has its own IDXA instance.
|}
 
 
This is a '''trimmed''' version of the master file "lab.xml" from the demo. It's meant to give you a first impression. -- We might upload a smaller demo someday with all features nonetheless.
 
<?xml version="1.0" encoding="utf-8" ?>
<Oni>
    <Level SharedPath="../shared">
        <Environment>
            <Model>
                <Import Path="env/lab_env.dae"/>
                <Import Path="env/lab_bomber_window.dae"/>
                <Import Path="env/lab_motorcycle.dae">
                    <Node Id="motorcycle">
                        <ScriptId>9</ScriptId>
                        <GunkFlags>NoCollision</GunkFlags>
                    </Node>
                </Import>
            </Model>
            <Rooms>
                <Import Path="env/lab_bnv.dae"/>
            </Rooms>
            <Textures>
                <Texture Name="GOO">
                    <Format>bgra4444</Format>
                    <GunkFlags>NoCollision</GunkFlags>
                    <Image>env/images/GOO.tga</Image>
                </Texture>
            </Textures>
        </Environment>
        <Sky>sunset</Sky>
        <Objects>
            <Import>Character.xml</Import>
            <Import>Furniture.xml</Import>
            <Import>TriggerVolume.xml</Import>
            <Import>Physics.xml</Import>
        </Objects>
        <Films>
            <Import>films/BomberKonRun01.xml</Import>
            <Import>films/BomberKonRun02.xml</Import>
        </Films>
        <Cameras>
            <Camera Path="cameras/BomberCam01.dae">
                <Animation Name="BomberCam01"/>
            </Camera>
            <Camera Path="cameras/BomberCam02.dae">
                <Animation Name="BomberCam02"/>
            </Camera>
        </Cameras>
    </Level>
</Oni>
 
 
====<Model>====
This tag is mandatory (it must be present to avoid errors); the model section contains one import path to the AKEV (level) geometry (*.dae) and can contain additional import paths for exceptions (*.dae).
 
Data from the demo:
 
                <Import Path="env/lab_env.dae"/>
                <Import Path="env/lab_motorcycle.dae">
                    <Node Id="motorcycle">
                        <ScriptId>9</ScriptId>
                        <GunkFlags>NoCollision</GunkFlags>
                    </Node>
                </Import>
 
The motorcycle has here script id 9. You can show and hide the object with bsl command env_show whereby the second parameter means true or false.
 
env_show 9 1
env_show 9 0
 
 
EdT demonstrates [http://youtu.be/Em6wa5JTQNM here] env_show. The objects have collision.
 
 
The last original level (syndicate mountain compound) has a big satellite dish platform that can be made hidden. Obviously, such objects/areas can be made to have pathfinding too.
 
 
;More possible applications of env_show:
* grids in front of ventilation shafts (a little door object could be an alternative)
* ground/ceiling/objects for cutscenes that become partially destroyed
* destrucable walls [http://www.youtube.com/watch?v=qgJUbPWX5yE like in Deus Ex 3] (trigger volume, replacing punch anim with punch-through-wall anim)
 
 
=====Breakable glass with BSL recognition=====
Broken env objects can be recognized by bsl command ''env_broken (ID_1, ID_N)''. However, this whole thing requires additional code to work.
 
An example is the training level. Let's determine how we can set up such a thing.
 
First we need a [[XML:BINA/OBJC/TRGV|trigger volume]] like in level 1.
 
        <TRGV Id="11495">
            <Header>
                <Flags>Locked</Flags>
                <Position>-714.6615 -298 -555.2073</Position>
                <Rotation>0 0 0</Rotation>
            </Header>
            <OSD>
                <Name>tv75</Name>
                <Scripts>
                    <Entry></Entry>
                    <Inside>targets_gone</Inside>
                    <Exit></Exit>
                </Scripts>
                <Teams>255</Teams>
                <Size>400 31 270</Size>
                <TriggerVolumeId>75</TriggerVolumeId>
                <ParentId>0</ParentId>
                <Notes></Notes>
                <Flags>PlayerOnly</Flags>
            </OSD>
        </TRGV>
 
Now we need some BSL code.
 
var int inside_target_function;
func void enter_target_function(void)
{
    dprint enter_target_function
    inside_target_function = 1;
}
func void exit_target_function(void)
{
    dprint exit_target_function
    inside_target_function = 0;
}
func void targets_are_not_gone(void)
{
# CB: turn off the trigger volume and sleep for a second
# so as not to cause hideous performance loss
trigvolume_enable tv75 0
sleep 60
trigvolume_enable tv75 1
}
func void targets_gone(string ai_name)
{
if(inside_target_function eq 0)
{
enter_target_function() # catch other "targets_gone" functions to let them do nothing
var int num_broken = env_broken(3001, 3018);
# if you only one target use scheme: env_broke(3001, 3001)
if (num_broken eq 18)
{
targets_are_gone();
}
if (num_broken < 18)
{
targets_are_not_gone(); # to set check interval to one second
}
exit_target_function
}
}
func targets_are_gone
{
trigvolume_enable tv75 0
# [...]
}
 
;Explanation:
 
Player enters the TV, "targets_gone" gets triggered. The variable "inside_target_function" should be 0 be default, so we are entering now the first if statement. Next, we can assume that the player didn't destroy all glass objects, so "num_broken" will be less than 18: "targets_are_not_gone" gets called.
 
The TV function "targets_gone" would be triggered every frame but "targets_are_not_gone" increases the pause between checks: The TV gets deactivated for 60 frames. Then the TV becomes enabled again and will start anew until all glass objects got destroyed or player left the TV.
 
Unnecessary "targets_gone" functions will do nothing because "inside_target_function" was set to 1 by the first one.
 
"targets_are_gone" eventually disables the TV to prevent memory overflow, the function contains also all things "[...]" that you want to happen after the glass target broke.
 
 
=====Texture exchange=====
BSL command [[BSL:PC_vs._Mac_Comparison_(table)|supported]] by PC and Mac:
: env_texswap ID texture
 
Might be useful to switch on/off static and animated textures. (News screen: running or off or smashed. Lava stream: flowing or stagnating or cooled down. Etc.)
 
 
=====[http://softimage.wiki.softimage.com/xsidocs/tex_vcolor_CreatingColoratVerticesCAVMaps.htm Vertex shading]=====
Observation: The sniper tower from level 19 Syndicate Mountain Compound can be isolated and re-imported as it is. It will appear quite dark.
 
If we remove "_color" from the object the shadows will be gone next time we import the tower.
 
Mod Tool: Explorer [8]
 
Object
  |
  +-- Polygon Mesh
        |
        +-- Cluster
              |
              +-- Polygon
              |    |
              |    +-- [...]
              |
              +-- NodeProperties
                    |
                    +-- '''_color'''
                    +-- texcoord (Explicit UVWs)
                          |
                          +-- Vertex_Color_Def
 
So, how do we modify that data?
 
 
'''Single object shading'''
 
If there's already a vertex color property you can use Shift + W to activate "Paint Vertex Color Tool". With Control + W you can change the brush color. R + Hold Click + Move Mouse let you change the Brush size. The more vertices (points) you have the more detailed you can make the shadows/colors. But keep in mind that too many polygons can destroy collision which make characters fall through the ground.
 
If there's no vertex color property the first use of Shift + W will create that property. But you can also manually create it via Property > Color at Vertices Map.
 
Here you can see one of my [http://youtu.be/zWT0-LsjjBU early attempts of vertex shading]. --[[User:Paradox-01|paradox-01]] ([[User talk:Paradox-01|talk]]) 18:18, 16 March 2013 (CET)
 
 
'''Level-wide shading'''
 
{| style="float:right"
|[http://i305.photobucket.com/albums/nn207/unknownfuture/Oni_Galore_Images/3D_modding/light_test_modtool_zps9c453b41.png http://i305.photobucket.com/albums/nn207/unknownfuture/Oni_Galore_Images/3D_modding/light_test_modtool_tn_zps9a3a3f2e.png]
 
[http://i305.photobucket.com/albums/nn207/unknownfuture/Oni_Galore_Images/3D_modding/light_test_ingame_zps08118244.png http://i305.photobucket.com/albums/nn207/unknownfuture/Oni_Galore_Images/3D_modding/light_test_ingame_tn_zps967c06a9.png]
|}
 
To get a general shading/lightning you can set up light sources. "Infinite" lights are useful as global lighting while "Light Box", "Point", "Neon" and "Spot" are more suitable as local light sources. They can be accessed via Primitives > Light.
 
By default a Mod Tool scene has one Infinite light but it doesn't shine in every direction so you might want to add more Infinite lights. Let's say one Infinite light for each direction (+X, -X, +Y, -Y, +Z, -Z) with an intensity of circa 0.25 (night) or 0.75 (day).
 
The illumination of those lights can be integrated into the vertex color property. There's some information [http://oni.bungie.org/community/forum/viewtopic.php?pid=29089#p29089 at OCF], the quoted information is somewhat triple so don't get confused by it: at first detailed, then summarized, then a checklist.
 
Basically you can go with the checklist:
 
* Property > Color At Vertices Map
* Property > Render Map
* In render map property page, under Sampling select Vertices Only
* Under Surface Color choose Enable, then in the box below select Vertex _Color, if that option does not appear click on the New button next to it.
* Under Map select Illumination only
* Finally, click on the button Regenerate Maps...
 
This must be done for all objects separately.
 
: [https://dl.dropbox.com/u/139715/OniGalore/vertex_color_script.txt There's a script] which can apply vertex color and render maps to all '''selected''' objects. Load it into the script editor [alt] + [4] and hit [F5] to run it. (Be sure the script language was set to vb script.)
: The variable "overwrite_VC" can be changed.
:: With "1" all existing CAV maps of selected objects will be overwritten. This can take some time.
:: With "0" only selected objects without CAV maps will be the script's target.
 
 
'''Notes on ModTool view modes'''
* "Constant" let you see the colors of the vertex shading only.
* "Textured Decal" let you see object textures only.
* "Shaded" let you see the illumination only.
* "Textured" let you see the textured object with illumination and vertex shading.
 
 
'''env_shade'''
 
If you use env_shade use it with caution. It completely overwrites the vertex shading.
 
# BSL command
# env_shade obj_id obj_id R G B
# examples
env_shade 7 7 # object 7 will be black
env_shade 7 7 0 0 0 # object 7 will be black
env_shade 7 7 .31 .999 .5 # object 7 will be quite green
env_shade 7 10 1 1 1 # object 7, 8, 9, 10 lose all their shading
 
 
=====Shadow casting objects=====
Advantage: this can give the level a more realistic impression.
 
Disadvantage: High amount of new textures needed.
 
How to create shadow maps:
 
* http://www.game-artist.net/forums/support-tech-discussion/5622-burning-shadows-onto-texture-xsi.html
<!-- http://caffeineabuse.blogspot.de/2008/12/cast-shadow-only-lights-in-xsi.html might be also interesting -->
 
Notes on map options:
* "Surface color and illumination": outputs used texture with added shadows
** can be used to replace original texture
* "illumination only": output a texture that only contains the shadows
** can be used on a new overlying, transparent surface
 
For other approaches see [[AE:Lightmapping_levels|HERE]].
 
 
====<Rooms>====
The Room tag is mandatory. It contains an import path to BNV data (*.dae) which is used to create pathfinding grids. For technical information on BNV see [[OBD:AKVA|HERE]].
 
For example:
<Import Path="env/lab_bnv.dae"/>
 
BNV consist of 2 parts: rooms and ghost quads. (What again does BNV stand for?)
 
* Those ''rooms'' are in fact horizontal planes, they are used to determine the area where pathfinding will be calculated. Areas without ''rooms'' won't have pathfinding at all.
* ''Ghosts'' are vertical planes. You need a ''ghost'' to connect two parallel ''rooms''.
* Actually, those horizontal and vertical planes can have any name and don't need any texture.
* During pathfinding calculation OniSplit creates a new folder called "temp" and a subfolder "grids". There again is a file "''levelname''_grids.dae". That file contains ''rooms'' with textures "bnv_grid_''N''.tga" marking obstacles in the pathfinding. ''Ghosts'' will have a transparent texture "'''_marker_ghost'''.tga". You get those things also when you export a level. Transparent ''ghosts'' make it easier to see the rest of your level if you have many of those planes.
* In Mod Tool ''ghosts'' and ''rooms'' can be grouped under a null object. Right-click the null object to select all its children, then use "Selection Only [x]" as saving option. That way all the planes can be quickly saved to a *.dae file.
 
 
;Danger quads
You can influence the pathfinding creation of dangerous zones with danger quads. Read on [[#marker textures|HERE]].
 
Another kind of influence is the [[#<Model>|gunk flag]] IgnoreGrid. It can be used to let OniSplit ignore the object during pathfinding creation. The grids in that place will be white.
 
 
;Tolerance values
* horizontal distance from ''room'' to ''ghost'': 1
* vertical distance from ''room'' to ''ghost'': 18
* ''ghost'' horizontal dimension must be bigger than 0
* under optimal circumstances pathfinding works on a plane that is +4 world units above or -0,5 beneath the pathfinding grid
* normally characters can't pass low verticals like at staircases/curbs if those don't have a ramp, near ground level Y=0 is an exception where characters are allowed to step on a plane that is 4 world units above pathfinding grid; higher planes need a ramp
* max degree of ramp you can go on is 70°; bigger degrees make characters slide down a bit and then fall through to death
 
 
[[Image:Pathfinding_grid.JPG|thumb|200px|right|''ai2_showgrids = 1'' in action]]
;BSL commands
* chr_show_bnv = 1
:: shows number of bnv the player is standing on
* ai2_showgrids = 1
:: shows pathfinding grids
* ai2_chump
:: spawns a friendly striker that follows the player if possible, makes also pathfinding grids visible
 
 
====<Textures>====
=====... used for exceptions=====
This tag is mandatory. Textures become imported as they are; in the texture section you declare exceptions.
 
                <Texture Name="GOO">
                    <Format>bgra4444</Format>
                    <GunkFlags>NoCollision</GunkFlags>
                    <Image>env/images/GOO.tga</Image>
                </Texture>
 
* There you can give a texture a special format, for example "bgra4444", to make it transparent.
* Use gunkflag "TwoSided" to make surfaces visible from both sides.
* If the texture comes with gunkflag "NoCollision" then all objects with that texture will have no collision. Characters would fall through it.
 
Both makes sense, let's say, for a water-like substance. The biolab use this for an area with green acid.
 
{| style="float:right"
|[http://i305.photobucket.com/albums/nn207/unknownfuture/Oni_Galore_Images/3D_modding/making_a_surface_transparent_and_twosided_zpsa8950d1f.png http://i305.photobucket.com/albums/nn207/unknownfuture/Oni_Galore_Images/3D_modding/making_a_surface_transparent_and_twosided_tn_zpsae6709f0.png]
|}
|}


Where do the links go to again?


'''TwoSided and transparent objects'''
ONOA <ObjectId> -> AKEV AGQG -> BINA/OBJC/#### by type and ID
 
ONOA <QuadList> -> ONOA IDXA -> AKEV AGQG by order
It's also possible to set this in Mod Tool. Use one image source for diffuse and transparency.
 
It won't work with two image sources even if both sources use the same image. See screenshot if you are still unsure about this.
 
 
=====Regular textures=====
OniSplit automatically imports textures of objects in the [[#<Model>|<Model> section]]. Those objects could be considered as AKEV core geometry.
 
 
'''one texture per object'''
 
Furniture and Physics objects are allowed to have only one texture per object.
 
AKEV core geometry can have one texture or multiple textures - that's up to you to decide.
 
 
'''multiple textures per object'''
[[Image:AKEV_single_object_multiple_textures.png|thumb|200px|right|one object with multiple textures, one per polygon cluster]]
[[Image:AKEV_single_object_multiple_textures_ingame.png|thumb|200px|right|ingame test, blue: twosided<br>glass: twosided and transparent<br>random metal: no flag (onesided)]]
 
Question: How do we apply multiple textures to an AKEV core object?
 
Answer: Once again this is a list for ModTool guys:
* select some polygons
* goto Material > Phong
* hit [7] to open Render Tree
* add a texture and connect "Image" with "Phong", choose "diffuse" as illumination mode
* double-click "Image" to open Material page
* choose texture and UV, fine-tune UV via [alt]+[7]
Repeat this for each cluster you create.
 
 
Caution: textures will be fixed to one set of flags. You can't use the same texture A for an onesided cluster/object B and twosided cluster/object C. You would need to create a different named clone of that texture and apply that to cluster/object C.
 
 
=====Marker textures=====
Marker textures are used to import certain objects with special flags. Import those object alongside [[#<Model>|AKEV core]] geometry.
 
Marker textures aren't imported automatically. Add those textures to the final package / plugin, e.g. by some sort of batch code.
 
onisplit -create:txmp out env/markers/*.tga
 
 
The flags Transparent TwoSided NoOcclusion are only set if the same texture source is used for diffuse and transparency and if transparency setting are enabled. See subsection of "[[#... used for exceptions|... used for exceptions]]": "TwoSided and transparent objects".
 
 
'''danger quads'''
 
The pathfinding grids can have different colors with different meanings.
* white/gray - clear space
* green light - nearwall
* green - semipassable
* green dark - stairs
* blue very light - border 1
* blue light - border 2
* blue - border 3
* blue dark - border 4
* orange - danger
* red - impassable
 
For detailed information on colors see [[OBD_talk:AKVA/0x24#EFFECTS_of_various_pathfinding_grid_tile_types|HERE]].
 
Normally, OniSplit decide how to color the grids. But it's possible to add own danger quads to fine tune zones of great danger. Those orange areas will be generated with the 4 different blue borders around it.
 
Danger quads must have "'''_marker_danger'''" as texture name.
 
Results in flags: Transparent TwoSided NoCollision Invisible NoOcclusion Danger
 
 
'''collision boxes'''
 
AIs can get stuck in detailed geometry. This can be prevented with collision boxes.
 
Just create a box or other simple geometry around the problematic object and apply a textured to it named "'''_marker_barrier'''". Ingame the box will be invisible and has collision so characters can't get through. The pathfinding grid will be red where it comes in contact with the box, red is followed by a light green and then green.
 
Results in flags: Transparent TwoSided Invisible NoObjectCollision NoOcclusion
 
 
'''stairs'''
 
texture: '''_marker_stairs'''
 
Normally, characters can't move on stairs if they contain verticals. In this case you can use a sloping quad that is above or inside the staircases. It's possible to set the desired flags at the <Model> section but doing so and exporting self-made stair ramps is wasted time. So apply simply _marker_stairs to that quad, characters will move on that surface.
 
Results in flags: Stairs Transparent TwoSided Invisible NoObjectCollision NoOcclusion
 
No effect to pathfinding creation. Regularly textured stair geometry (that intersect the marker quad) will be flagged as NoCharacterCollision.
 
 
'''impassable'''
 
texture: '''_marker_impassable'''
 
Results in flags: Transparent TwoSided Invisible NoOcclusion
 
Impassable walls are very similar to collision boxes except that particle can also collide with it. The pathfinding grids will be also red, light green, and green.
 
 
'''blackness a.k.a. jello fix'''
 
texture: '''_marker_blackness'''
 
Results in flags: TwoSided NoCollision
 
Simply black walls. No effect to pathfinding creation.
 
 
'''doors'''
 
texture: '''_marker_door'''
 
Results in flags: DoorFrame Transparent TwoSided NoCollision NoOcclusion
 
Appears not very useful. No effect to pathfinding creation.
 
 
 
====<Objects>====
Information on regular object collections can be looked up here:
: [[XML:BINA/OBJC/CHAR|Character.xml]] (has to contain player character if there's no AISA file with it)
: [[XML:BINA/OBJC/CONS|Console.xml]]
: [[XML:BINA/OBJC/DOOR|Door.xml]]
: [[XML:BINA/OBJC/FLAG|Flag.xml]]
: [[XML:BINA/OBJC/NEUT|Neutral.xml]]
: [[XML:BINA/OBJC/PART|Particle.xml]]
: [[XML:BINA/OBJC/PATR|PatrolPath.xml]]
: [[XML:BINA/OBJC/PWRU|PowerUp.xml]]
: [[XML:SNDD#BINACJBOSound.xml|Sound.xml]]
: [[XML:BINA/OBJC/TRIG|Trigger.xml]]
: [[XML:BINA/OBJC/TRGV|TriggerVolume.xml]]
: [[XML:BINA/OBJC/WEAP|Weapon.xml]]
 
 
=====Furniture.xml=====
The AKEV core geometry is more or less unique while this furniture file adds standard objects (e.g. crates and desks) to it.


==ENVP==
{| class="wikitable" width="100%"
{| class="wikitable" width="100%"
!width=150px| XML tag
!width=150px| XML tag
!width=120px| content type
!width=120px| Content type
! description
! Description
|-
|-
| <?xml version="1.0" encoding="utf-8"?>
| <ENVP id="...">
|valign="top"| float, flag
| integer
|valign="top"| Ignore this.
| Instance ID.
|-
|-
| <Oni>
| <Particles>
| -
| This is an int16 array for the <ENVPParticle> tags. If there's not going to be any contents, you put <Particles /> here.
|-
| <ENVPParticle>
| -
| -
|
|
|-
|-
| <Objects>
| <Class>
| -  
| char[64]
| This tags marks the file as BINACJBO.
| <font color="#777777">BINA3RAP</font>file<font color="#777777">.oni</font> <font color="#777777">(don't use file prefix/suffix)</font>.
|-
| <Tag>
| char[48]
| Particle's scripting name for BSL commands; see [[XML:OFGA#XML_tags|OFGA]] for more information on name composition.
|-
|-
| <Furniture>
| <Transform>
| -
| matrix
| This tags marks the file as FURN.
| Float 3*3 + 3 more floats for the X Y Z position of the particle. For more information on the matrix, see [[OBD:CRSA]].
|-
|-
| <Header>
| <DecalScale>
|
| int32, int32
|
| X Y
|-
|-
|valign="top"| <Flags>
|valign="top"| <Flags>
|valign="top"| flag
|valign="top"| flag
| Optional tag. Ignore it. Those flags were used in the past.
|  
:None
: None
:Locked
: NotInitiallyCreated
:PlacedInGame
|}
:Temporary
 
:Gunk
==CRSA==
{| class="wikitable" width="100%"
!width=150px| XML tag
!width=120px| Content type
! Description
|-
| <CRSA id="...">
| integer
| Instance ID.
|-
|valign="top"| <FixedCount>
|valign="top"| integer
| The array capacity of <Corpses> is larger than the number of "fixed"/"used" corpses in order to allow the engine to store new corpses at runtime. "Fixed" means that those corpses are never overwritten/deleted at runtime – all new corpses are stored after the "fixed" ones. This means that "fixed" <= "used" <= "capacity".
|-
| <UsedCount>
| integer
|-
|valign="top"| <Corpses>
|valign="top"| -
| This is an int32 array for the <CRSACorpse> tags. By default, Oni wants 20 slots for corpses. Unused corpses have their matrix and bounding box filled with zeroes.
|-
|valign="top"| <CRSACorpse>
|valign="top"| -
| [[Authoring_custom_camera_animations|New corpses]] can be made with the BSL command '''make_corpse filename''' and some hex-editing. The pose of the corpse is taken from the player character. The contents of the files thus created can then be inserted as elements in a level's CRSA.
|-
| <CharacterClass>
| link
| [[XML:ONCC|ONCC]]''name''
|-
| <Transforms>
| -
| There are 19 <Matrix4x3> for each <Transforms> (which represents a body part).
|-
| <Matrix4x3>
| matrix
| Float 3x3 + float x3 for the last 3 values (X Y Z position). For more information about the matrix, see [[OBD:CRSA]].
|-
| <BoundingBox>
| -
| Bounding box of the whole corpse.
|-
|-
| <Position>
| <Min>
| float x3
| float x3
| Optional tag. X Y Z position.
|
|-
|-
| <Rotation>
| <Max>
| float x3
| float x3
| Optional tag. X Y Z rotation.
|
|}
 
==M3GA==
There can be one M3GA instance per animated object. Animated meshes of doors are embedded in ONLV. All other animated meshes are stored outside it as M3GM files.
 
{| class="wikitable" width="100%"
!width=150px| XML tag
!width=120px| Content type
! Description
|-
|-
| <OSD>
| <M3GA id="...">
| integer
| Instance ID.
|-
| <Geometries>
| -
| -
|
| This is an int32 array for the <Link> tags.
|-
|-
|valign="top"| <Class>
|valign="top"| <Link>
|valign="top"| link
|valign="top"| link
| File path to an [[XML:OFGA|OFGA]] (*.oni) file. Make sure that the OFGA comes also with the files it needs: M3GM and TXMP.
|
 
: #''N'' (instance number) (for non-door)
OFGA can hold multiple M3GM. That 3d content will be integrate into the AKEV.
: M3GM''name'' (for door)
|-
It can happen that you see here references to DAE files. This happens when the ONLV was created with some older OniSplit version (like 0.9.86.0) and if the ONLV was converted to xml in absence of the resources used by M3GA.
|valign="top"| <Particle>
|valign="top"| string
| This name gets written into <Tag> inside ONLV (ENVP section) and can be used with BSL commands.
 
E.g. you can take control over a particle via "particle BSL_name start". For more commands see [[XML:BINA/OBJC/PART#BSL_support|HERE]].
 
Caution with new OFGA files. The particle name will be composed of 2 parts and always includes an "_" underscore. '''Examples:'''
 
: FURN <Particle>test</Particle> + OFGA <Tag>streetlight</Tag> = '''test_streetlight'''
: FURN <Particle></Particle> + OFGA <Tag>streetlight</Tag> = '''_streetlight'''
: FURN <Particle>test</Particle> + OFGA <Tag></Tag> = '''test_'''
|}
|}


==M3GM==
Read about them here [[XML:M3GM|HERE]]. Note that M3GMs have their own component instances: PNTA, VCRA (x2), TXCA, IDXA (x2). Doors store their animated model in ONLV, while the static model comes from BINACJBODOOR.oni, which also links to M3GM files.


;Example
==IDXA==
 
<?xml version="1.0" encoding="utf-8"?>
<Oni>
    <Objects>
 
        <Furniture>
            <Header>
                <Flags>Gunk</Flags>
                <Position>-62.692 -29 108.35</Position>
                <Rotation>181.522 356.021 178.114</Rotation>
            </Header>
            <OSD>
                <Class>furniture/V_tctf_bigvan.oni</Class>
            </OSD>
        </Furniture>
 
    </Objects>
</Oni>
 
 
=====Physics.xml=====
This file is for objects with "physics". Unlike AKEV core geometry or furniture, those objects can be animated.
 
{| class="wikitable" width="100%"
{| class="wikitable" width="100%"
!width=150px| XML tag
!width=150px| XML tag
!width=120px| content type
!width=120px| Content type
! description
! Description
|-
|-
| <?xml version="1.0" encoding="utf-8"?>
| <IDXA id="...">
|valign="top"| float, flag
| integer
|valign="top"| Ignore this.
| Instance ID.
|-
|-
| <Oni>
| <Indices>
| -
| -
| This is an Int32 array for the <Int32> tags.
|-
|valign="top"| <Int32>
|valign="top"| int32
|
; From ONOA to AGQG elements
: Link to <AGQGQuad>s in [[XML:AKEV#AGQG|AGQG]] by order. (The array in AGQG starts with 0, so for example <Int32>6</Int32> would link to the 7th <AGQGQuad>.)
; From M3GM to PNTA elements
: Read more [[XML:M3GM#PNTA|HERE]].
; From M3GM to VCRA elements
: Read more [[XML:M3GM#VCRA|HERE]].
|}
==Level files hierarchy==
{| width="100%" style="text-align:center; empty-cells: hide"
|width="20%" style="background-color:#CCFFCC;"| (un)colored cell = file
|width="20%" style="background-color:#CCFFCC; background-image: repeating-linear-gradient(-45deg, transparent, transparent 10px, rgba(255,255,255,.5) 10px, rgba(255,255,255,.5) 20px);"| striped cell = embedded instance
|width="20%"|
|width="20%"|
|width="20%"|
|}
{|class="wikitable" width="100%" style="text-align:center"
|style="background-color:#DDDDDD;"| ONLV
|width="20%"|
|width="20%"|
|width="20%"|
|width="20%"|
|-
| [[Image:Chart fork right.gif]]
|style="background-color:#CCCCFF;"| AKEV
|
|
|
|-
| [[Image:Chart descend.gif]]
| [[Image:Chart fork right.gif]]
|style="background-color:#CCCCFF; background-image: repeating-linear-gradient(-45deg, transparent, transparent 10px, rgba(255,255,255,.5) 10px, rgba(255,255,255,.5) 20px);"| PNTA
|
|
|-
| [[Image:Chart descend.gif]]
| [[Image:Chart fork right.gif]]
|style="background-color:#CCCCFF; background-image: repeating-linear-gradient(-45deg, transparent, transparent 10px, rgba(255,255,255,.5) 10px, rgba(255,255,255,.5) 20px);"| PLEA
|
|
|-
| [[Image:Chart descend.gif]]
| [[Image:Chart fork right.gif]]
|style="background-color:#CCCCFF; background-image: repeating-linear-gradient(-45deg, transparent, transparent 10px, rgba(255,255,255,.5) 10px, rgba(255,255,255,.5) 20px);"| TXCA
|
|
|-
| [[Image:Chart descend.gif]]
| [[Image:Chart fork right.gif]]
|style="background-color:#CCCCFF; background-image: repeating-linear-gradient(-45deg, transparent, transparent 10px, rgba(255,255,255,.5) 10px, rgba(255,255,255,.5) 20px);"| AGQG
|
|
|-
| [[Image:Chart descend.gif]]
| [[Image:Chart fork right.gif]]
|style="background-color:#CCCCFF; background-image: repeating-linear-gradient(-45deg, transparent, transparent 10px, rgba(255,255,255,.5) 10px, rgba(255,255,255,.5) 20px);"| AGQR
|
|
|-
| [[Image:Chart descend.gif]]
| [[Image:Chart fork right.gif]]
|style="background-color:#CCCCFF; background-image: repeating-linear-gradient(-45deg, transparent, transparent 10px, rgba(255,255,255,.5) 10px, rgba(255,255,255,.5) 20px);"| AGQC
|
|
|-
| [[Image:Chart descend.gif]]
| [[Image:Chart fork right.gif]]
|style="background-color:#CCCCFF; background-image: repeating-linear-gradient(-45deg, transparent, transparent 10px, rgba(255,255,255,.5) 10px, rgba(255,255,255,.5) 20px);"| AGQC
|
|
|-
| [[Image:Chart descend.gif]]
| [[Image:Chart fork right.gif]]
|style="background-color:#CCCCFF; background-image: repeating-linear-gradient(-45deg, transparent, transparent 10px, rgba(255,255,255,.5) 10px, rgba(255,255,255,.5) 20px);"| AGDB
|
|
|-
| [[Image:Chart descend.gif]]
| [[Image:Chart fork right.gif]]
|style="background-color:#CCCCFF; background-image: repeating-linear-gradient(-45deg, transparent, transparent 10px, rgba(255,255,255,.5) 10px, rgba(255,255,255,.5) 20px);"| TXMA
|
|
|-
| [[Image:Chart descend.gif]]
| [[Image:Chart descend.gif]]
| [[Image:Chart turn right.gif]]
| TXMP
|
|-
| [[Image:Chart descend.gif]]
| [[Image:Chart fork right.gif]]
|style="background-color:#CCCCFF; background-image: repeating-linear-gradient(-45deg, transparent, transparent 10px, rgba(255,255,255,.5) 10px, rgba(255,255,255,.5) 20px);"| AKVA
|
|
|-
| [[Image:Chart descend.gif]]
| [[Image:Chart fork right.gif]]
|style="background-color:#CCCCFF; background-image: repeating-linear-gradient(-45deg, transparent, transparent 10px, rgba(255,255,255,.5) 10px, rgba(255,255,255,.5) 20px);"| AKBA
|
|
|-
| [[Image:Chart descend.gif]]
| [[Image:Chart fork right.gif]]
|style="background-color:#CCCCFF; background-image: repeating-linear-gradient(-45deg, transparent, transparent 10px, rgba(255,255,255,.5) 10px, rgba(255,255,255,.5) 20px);"| IDXA
|
|
|-
| [[Image:Chart descend.gif]]
| [[Image:Chart fork right.gif]]
|style="background-color:#CCCCFF; background-image: repeating-linear-gradient(-45deg, transparent, transparent 10px, rgba(255,255,255,.5) 10px, rgba(255,255,255,.5) 20px);"| AKBP
|
|
|-
| [[Image:Chart descend.gif]]
| [[Image:Chart fork right.gif]]
|style="background-color:#CCCCFF; background-image: repeating-linear-gradient(-45deg, transparent, transparent 10px, rgba(255,255,255,.5) 10px, rgba(255,255,255,.5) 20px);"| ABNA
|
|
|-
| [[Image:Chart descend.gif]]
| [[Image:Chart fork right.gif]]
|style="background-color:#CCCCFF; background-image: repeating-linear-gradient(-45deg, transparent, transparent 10px, rgba(255,255,255,.5) 10px, rgba(255,255,255,.5) 20px);"| AKOT
|
|
|-
| [[Image:Chart descend.gif]]
| [[Image:Chart descend.gif]]
| [[Image:Chart fork right.gif]]
|style="background-color:#CCCCFF; background-image: repeating-linear-gradient(-45deg, transparent, transparent 10px, rgba(255,255,255,.5) 10px, rgba(255,255,255,.5) 20px);"| OTIT
|
|-
| [[Image:Chart descend.gif]]
| [[Image:Chart descend.gif]]
| [[Image:Chart fork right.gif]]
|style="background-color:#CCCCFF; background-image: repeating-linear-gradient(-45deg, transparent, transparent 10px, rgba(255,255,255,.5) 10px, rgba(255,255,255,.5) 20px);"|OTLF
|
|-
| [[Image:Chart descend.gif]]
| [[Image:Chart descend.gif]]
| [[Image:Chart fork right.gif]]
|style="background-color:#CCCCFF; background-image: repeating-linear-gradient(-45deg, transparent, transparent 10px, rgba(255,255,255,.5) 10px, rgba(255,255,255,.5) 20px);"| QTNA
|
|-
| [[Image:Chart descend.gif]]
| [[Image:Chart descend.gif]]
| [[Image:Chart turn right.gif]]
|style="background-color:#CCCCFF; background-image: repeating-linear-gradient(-45deg, transparent, transparent 10px, rgba(255,255,255,.5) 10px, rgba(255,255,255,.5) 20px);"| IDXA
|
|-
| [[Image:Chart descend.gif]]
| [[Image:Chart fork right.gif]]
|style="background-color:#CCCCFF; background-image: repeating-linear-gradient(-45deg, transparent, transparent 10px, rgba(255,255,255,.5) 10px, rgba(255,255,255,.5) 20px);"| AKAA
|
|
|-
| [[Image:Chart descend.gif]]
| [[Image:Chart turn right.gif]]
|style="background-color:#CCCCFF; background-image: repeating-linear-gradient(-45deg, transparent, transparent 10px, rgba(255,255,255,.5) 10px, rgba(255,255,255,.5) 20px);"| AKDA
|
|
|-
| [[Image:Chart fork right.gif]]
|style="background-color:#DDDDDD; background-image: repeating-linear-gradient(-45deg, transparent, transparent 10px, rgba(255,255,255,.5) 10px, rgba(255,255,255,.5) 20px);"| OBOA
|
|
|
|-
| [[Image:Chart descend.gif]]
| [[Image:Chart fork right.gif]]
|style="background-color:#DDDDDD; background-image: repeating-linear-gradient(-45deg, transparent, transparent 10px, rgba(255,255,255,.5) 10px, rgba(255,255,255,.5) 20px);"| M3GA
|
|
|-
| [[Image:Chart descend.gif]]
| [[Image:Chart descend.gif]]
| [[Image:Chart turn right.gif]]
|style="background-color:#FFCCCC;"| M3GM
|
|-
| [[Image:Chart descend.gif]]
| [[Image:Chart descend.gif]]
|
| [[Image:Chart fork right.gif]]
|style="background-color:#FFCCCC; background-image: repeating-linear-gradient(-45deg, transparent, transparent 10px, rgba(255,255,255,.5) 10px, rgba(255,255,255,.5) 20px);"| PNTA
|-
| [[Image:Chart descend.gif]]
| [[Image:Chart descend.gif]]
|
| [[Image:Chart fork right.gif]]
|style="background-color:#FFCCCC; background-image: repeating-linear-gradient(-45deg, transparent, transparent 10px, rgba(255,255,255,.5) 10px, rgba(255,255,255,.5) 20px);"| VCRA
|-
| [[Image:Chart descend.gif]]
| [[Image:Chart descend.gif]]
|
| [[Image:Chart fork right.gif]]
|style="background-color:#FFCCCC; background-image: repeating-linear-gradient(-45deg, transparent, transparent 10px, rgba(255,255,255,.5) 10px, rgba(255,255,255,.5) 20px);"| TXCA
|-
| [[Image:Chart descend.gif]]
| [[Image:Chart descend.gif]]
|
| [[Image:Chart fork right.gif]]
|style="background-color:#FFCCCC; background-image: repeating-linear-gradient(-45deg, transparent, transparent 10px, rgba(255,255,255,.5) 10px, rgba(255,255,255,.5) 20px);"| IDXA
|-
| [[Image:Chart descend.gif]]
| [[Image:Chart descend.gif]]
|
| [[Image:Chart turn right.gif]]
| TXMP
|-
| [[Image:Chart descend.gif]]
| [[Image:Chart fork right.gif]]
| OBAN
|
|
|-
| [[Image:Chart descend.gif]]
| [[Image:Chart turn right.gif]]
|style="background-color:#DDDDDD; background-image: repeating-linear-gradient(-45deg, transparent, transparent 10px, rgba(255,255,255,.5) 10px, rgba(255,255,255,.5) 20px);"| ENVP
|
|
|-
| [[Image:Chart fork right.gif]]
|style="background-color:#DDDDDD; background-image: repeating-linear-gradient(-45deg, transparent, transparent 10px, rgba(255,255,255,.5) 10px, rgba(255,255,255,.5) 20px);"| ONMA
|
|
|
|-
| [[Image:Chart fork right.gif]]
|style="background-color:#DDDDDD; background-image: repeating-linear-gradient(-45deg, transparent, transparent 10px, rgba(255,255,255,.5) 10px, rgba(255,255,255,.5) 20px);"| ONFA
|
|
|
|-
| [[Image:Chart fork right.gif]]
|style="background-color:#DDDDDD; background-image: repeating-linear-gradient(-45deg, transparent, transparent 10px, rgba(255,255,255,.5) 10px, rgba(255,255,255,.5) 20px);"| ONTA
|
|
|
|-
| [[Image:Chart turn right.gif]]
| ONSK
|
|
|
|
|-
|-
| <Physics>
| [[Image:Chart descend.gif]]
| -
| [[Image:Chart fork right.gif]]
| TXMP
|
|
|-
| [[Image:Chart fork right.gif]]
| AISA
|
|
|
|-
| [[Image:Chart descend.gif]]
| [[Image:Chart fork right.gif]]
| ONCC
|
|
|-
| [[Image:Chart descend.gif]]
| [[Image:Chart turn right.gif]]
| ONWC
|
|
|-
| [[Image:Chart fork right.gif]]
| AITR
|
|
|
|-
| [[Image:Chart fork right.gif]]
| ONSA
|
|
|
|
|-
|-
| <Object Name="...">
| [[Image:Chart fork right.gif]]
| string
| OBDC
| Use an unique name for each object.
|
|
|
|-
|-
|valign="top"| <ScriptId>
| [[Image:Chart descend.gif]]
|valign="top"| integer
| [[Image:Chart turn right.gif]]
| Tested with BSL command ...
|style="background-color:#FFFFAA;"| M3GM
:obj_create Id [Id]
|
:obj_kill Id [Id]
|
:env_anim Id [Id]
:env_setanim Id [Id]
|-
|-
|valign="top"| <Flags>
| [[Image:Chart descend.gif]]
|valign="top"| flag
|
| [[Image:Chart fork right.gif]]
|style="background-color:#FFFFAA; background-image: repeating-linear-gradient(-45deg, transparent, transparent 10px, rgba(255,255,255,.5) 10px, rgba(255,255,255,.5) 20px);"| PNTA
|
|
;Object setup flags
:None
:InUse
:NoCollision
:NoGravity
:FaceCollision
|-
|-
|valign="top"| <Physics>
| [[Image:Chart descend.gif]]
|valign="top"| flag
|
| Optional tag of Object.
| [[Image:Chart fork right.gif]]
:None
|style="background-color:#FFFFAA; background-image: repeating-linear-gradient(-45deg, transparent, transparent 10px, rgba(255,255,255,.5) 10px, rgba(255,255,255,.5) 20px);"| VCRA
:Static
|
:Linear
:Animated
:Newton (used with <Flags> FaceCollision to [http://www.youtube.com/watch?v=YICB7qugrtc make object pushable])
|-
|-
| <Position>
| [[Image:Chart descend.gif]]
| float x3
|
| Optional tag of Object. Only used for non-animated objects. X Y Z position.
| [[Image:Chart fork right.gif]]
|style="background-color:#FFFFAA; background-image: repeating-linear-gradient(-45deg, transparent, transparent 10px, rgba(255,255,255,.5) 10px, rgba(255,255,255,.5) 20px);"| TXCA
|
|-
|-
| <Rotation>
| [[Image:Chart descend.gif]]
| float x3
|
| Optional tag of Object. Only used for non-animated objects. X Y Z rotation.
| [[Image:Chart fork right.gif]]
|style="background-color:#FFFFAA; background-image: repeating-linear-gradient(-45deg, transparent, transparent 10px, rgba(255,255,255,.5) 10px, rgba(255,255,255,.5) 20px);"| IDXA
|
|-
|-
| <Scale>
| [[Image:Chart descend.gif]]
| float
|
| Optional tag of Object. Only used for non-animated objects.
| [[Image:Chart turn right.gif]]
| TXMP
|
|-
|-
| [[Image:Chart fork right.gif]]
|style="background-color:#DDDDDD; background-image: repeating-linear-gradient(-45deg, transparent, transparent 10px, rgba(255,255,255,.5) 10px, rgba(255,255,255,.5) 20px);"| ONOA
|
|
|
|
<Import Path="...">
<Import Url="...">
|valign="top"| link
|valign="top"| This tag comes in two variants. It doesn't matter what variant you use.
|-
|-
| <Animation Name="...">
| [[Image:Chart descend.gif]]
| link
| [[Image:Chart turn right.gif]]
| File path to *.dae file.
|style="background-color:#DDDDDD; background-image: repeating-linear-gradient(-45deg, transparent, transparent 10px, rgba(255,255,255,.5) 10px, rgba(255,255,255,.5) 20px);"| IDXA
|
|
|-
|-
|valign="top"| <Flags>
| [[Image:Chart fork right.gif]]
|valign="top"| flag
|style="background-color:#DDDDDD; background-image: repeating-linear-gradient(-45deg, transparent, transparent 10px, rgba(255,255,255,.5) 10px, rgba(255,255,255,.5) 20px);"| ENVP
| Optional tag of Animation. For more information on those flags look [[XML:OBAN|OBAN]] page.
|
 
|
;Object animation flags
|
:None
:Loop
:PingPong
:RandomStart
:AutoStart
:Local
|-
|-
| <End>
| [[Image:Chart turn right.gif]]
| integer
|style="background-color:#DDDDDD; background-image: repeating-linear-gradient(-45deg, transparent, transparent 10px, rgba(255,255,255,.5) 10px, rgba(255,255,255,.5) 20px);"| CRSA
| Optional tag of Animation. Frame number. Used to define the end of an OBAN from an *.dae file.
|
|
|
|-
|-
| <Start>
|
| integer
| [[Image:Chart turn right.gif]]
| Optional tag of Animation. Frame number. Used to define the start of an OBAN from an *.dae file.
| ONCC
|}
|
 
|
 
;Example
 
For documentation purpose the file here has been trimmed down.
<?xml version="1.0" encoding="utf-8"?>
<Oni>
    <Physics>
 
        <Object Name="motorcycle">
            <ScriptId>8</ScriptId>
            <Flags>FaceCollision</Flags>
            <Import Url="motorcycle/export.dae">
                <Animation Name="motorcycle02">
                    <Flags>AutoStart</Flags>
                    <End>880</End>
                </Animation>
                <Animation Name="motorcycle02_stop">
                    <Start>881</Start>
                </Animation>
            </Import>
        </Object>
 
    </Physics>
</Oni>
 
In this example OniSplit takes the "export.dae" file, looks what parts it contains and creates geometry files from it.
* M3GMhubs_rear.oni
* M3GMhubs.oni
* M3GMmotocycle.oni
It's a nice feature that hierarchies are supported here.
 
The motorcycle is made of 3 parts so 3 object animations ([[XML:OBAN|OBAN]]) will be created up to frame 880. Then OniSplit creates 3 more OBANs starting from frame 881.
 
The reason for the interruption at frame 880 is probably to give barabas a few more frames of glory in the cutscene.
* OBANmotorcycle0200.oni
* OBANmotorcycle0201.oni
* OBANmotorcycle0202.oni
* OBANmotorcycle02_stop00.oni
* OBANmotorcycle02_stop01.oni
* OBANmotorcycle02_stop02.oni
 
 
 
;Notes about BSL usage:
 
The bio lab script file use the motorcycle objects and animations like this:
env_show 9 0 # hide solid motorcycle parts (because they get visible at level start)
# in the original game the motorcycle is separated in object 8, 9 and 10
# also the OBAN files have a bit different names
# static and animated objects are totally independent from each other
# so their script ids might not be the same
obj_create 8 10 # create animation-ready motorcycle parts
env_anim 8 10 # animate those parts (not necessary if OBAN flag is "AutoStart")
# the first animations would loop because of "AutoStart"
# so get the right timing to apply the other animations
# "motorcycle02_stop00" and the others will not loop because they don't have "AutoStart"
env_setanim 8 motorcycle02_stop00 # motorcycle
env_setanim 9 motorcycle02_stop01 # hubs
env_setanim 10 motorcycle02_stop02 # hubs_rear
obj_kill 8 10 # delete animated parts
env_show 9 1 # show solid motorcycle parts
 
 
 
==Exported Oni Level (ONLV*.xml)==
{| border=0 cellspacing=20 cellpadding=0 style="float:right"
| skybox file ONSKafternoon<br>[http://i305.photobucket.com/albums/nn207/unknownfuture/Oni_Galore_Images/3D_modding/ONSKafternoon.png http://i305.photobucket.com/albums/nn207/unknownfuture/Oni_Galore_Images/3D_modding/ONSKafternoon_tn.png]
|}
|}


File structure
{{XML}}
 
* ONLV instance
: <Name> - this is your BSL folder (save game slot and level number are defined inside [[OBD_talk:ONLD|ONLD]])
: <Environment> - link to AKEV file (solid level geometry)
: <Objects> - link to OBOA instance (animated level geometry, sometimes particles)
: <SkyBox> - link to ONSK file, originally there are 4 files in level 0: crapsky, night, sunset, afternoon
: <Characters> - link to AISA file (pendant of [[OBD_talk:BINA/OBJC/CHAR#XML|BINACJBOCharacter file]]), holds character spawn collection
: <ObjectQuadMap> - link to ONOA instance (maybe spawnable / function holding objects ?)
: <Particles> - link to ENVP instance (pendant of [[OBD_talk:BINA/OBJC/PART|BINACJBOParticle]]), holds particle spawn collection, door lock lights are typically stored inside ENVP
: <Corpses> - link to CRSA instance (corpses consist of 19 body parts)
* OBOA instance
: ...
* ONOA instance
: ...
* ENVP instance
: ...
* CRSA instance
: ...
* M3GA
: ...
* IDXA
: ...
 
 
 
'''Flags in the <OBOAObject> section'''
 
These are also used for the physics.xml file
: '''<Flags>'''
:: <!-- None -->
:: InUse
:: NoCollision
:: NoGravity
:: FaceCollision
: '''<PhysicsType>'''
:: None
:: Static
:: Linear
:: Animated
:: Newton
 
 
 
Sample code from a trimmed warehouse level.
 
<font color="#FF0000">'''''[...]'''''</font> mean another Corpse code block. There are usually 20 in total. They are somehow needed to prevent bugs.
 
<?xml version="1.0" encoding="utf-8"?>
<Oni>
    <ONLV id="0">
        <Name>EnvWarehouse</Name>
        <Environment>AKEVEnvWarehouse</Environment>
        <Objects>#1</Objects>
        <SkyBox>ONSKafternoon</SkyBox>
        <Characters>AISAlevel1_scripts</Characters>
        <ObjectQuadMap>#2</ObjectQuadMap>
        <Particles>#3</Particles>
        <Corpses>#4</Corpses>
    </ONLV>
    <OBOA id="1">
        <Objects />
    </OBOA>
    <ONOA id="2">
        <Elements />
    </ONOA>
    <ENVP id="3">
        <Particles />
    </ENVP>
    <CRSA id="4">
        <FixedCount>0</FixedCount>
        <UsedCount>0</UsedCount>
        <Corpses>
            <CRSACorpse>
                <CharacterClass></CharacterClass>
                <Transforms>
                    <Matrix4x3>0 0 0 0 0 0 0 0 0 0 0 0</Matrix4x3>
                    <Matrix4x3>0 0 0 0 0 0 0 0 0 0 0 0</Matrix4x3>
                    <Matrix4x3>0 0 0 0 0 0 0 0 0 0 0 0</Matrix4x3>
                    <Matrix4x3>0 0 0 0 0 0 0 0 0 0 0 0</Matrix4x3>
                    <Matrix4x3>0 0 0 0 0 0 0 0 0 0 0 0</Matrix4x3>
                    <Matrix4x3>0 0 0 0 0 0 0 0 0 0 0 0</Matrix4x3>
                    <Matrix4x3>0 0 0 0 0 0 0 0 0 0 0 0</Matrix4x3>
                    <Matrix4x3>0 0 0 0 0 0 0 0 0 0 0 0</Matrix4x3>
                    <Matrix4x3>0 0 0 0 0 0 0 0 0 0 0 0</Matrix4x3>
                    <Matrix4x3>0 0 0 0 0 0 0 0 0 0 0 0</Matrix4x3>
                    <Matrix4x3>0 0 0 0 0 0 0 0 0 0 0 0</Matrix4x3>
                    <Matrix4x3>0 0 0 0 0 0 0 0 0 0 0 0</Matrix4x3>
                    <Matrix4x3>0 0 0 0 0 0 0 0 0 0 0 0</Matrix4x3>
                    <Matrix4x3>0 0 0 0 0 0 0 0 0 0 0 0</Matrix4x3>
                    <Matrix4x3>0 0 0 0 0 0 0 0 0 0 0 0</Matrix4x3>
                    <Matrix4x3>0 0 0 0 0 0 0 0 0 0 0 0</Matrix4x3>
                    <Matrix4x3>0 0 0 0 0 0 0 0 0 0 0 0</Matrix4x3>
                    <Matrix4x3>0 0 0 0 0 0 0 0 0 0 0 0</Matrix4x3>
                    <Matrix4x3>0 0 0 0 0 0 0 0 0 0 0 0</Matrix4x3>
                </Transforms>
                <BoundingBox>
                    <Min>0 0 0</Min>
                    <Max>0 0 0</Max>
                </BoundingBox>
            </CRSACorpse>
          <font color="#FF0000">'''''[...]'''''</font>
        </Corpses>
    </CRSA>
</Oni>
 
'''not empty OBOA - example from level 19'''
 
(exported ONLV files seem to contain 32 empty <OBOAObject> sections)
 
If I remember correctly this one is only an object for the cutscene. Maybe the real floor(s) (those with collision) can be tracked down with the id used by bsl.
 
 
 
            <OBOAObject>
                <Geometry>#347</Geometry>
                <Animation>OBANDishFloor01</Animation>
                <Particle></Particle>
                <Flags>InUse</Flags>
                <DoorGunkId>0</DoorGunkId>
                <DoorId>0</DoorId>
                <PhysicsType>Animated</PhysicsType>
                <ScriptId>204</ScriptId>
                <Position>-183 99.59154 -2501.25</Position>
                <Rotation>0.7071067 -1.545431E-08 1.545431E-08 0.7071068</Rotation>
                <Scale>1</Scale>
                <Transform>1 -4.371139E-08 -5.21253064E-16 0 1.19248806E-08 -1 4.371139E-08 1 1.19248806E-08 -183 99.5815353 -2501.25</Transform>
                <Name>object_DishFloor01</Name>
            </OBOAObject>
 
 
'''not empty ENVP - example from level 19'''
            <ENVPParticle>
                <Class>locklight</Class>
                <Tag>mainchamber_locklight01</Tag>
                <Transform>1 -4.559326E-08 1.35404189E-05 -1.354042E-05 -2.03512554E-05 1 -4.53176945E-08 -1 -2.03512554E-05 -391.790527 58.0480423 -1364.412</Transform>
                <DecalScale>1 1</DecalScale>
                <Flags></Flags>
            </ENVPParticle>
 
<Transform> - the last 3 values are the position (x, y, z)
 
<Flags>
: <!-- None -->
: NotInitiallyCreated
 
 
==Exported Akira Environment (AKEV*.xml)==
Somehow I would like to have the AKEV and ONLV information on one page (like the sound stuff on SNDD). Let's see how this turns out.
 
 
'''AGQG flags'''
<!-- : None -->
: DoorFrame (invisible quad that uses the TXMP_DOOR_FRAME texture), appears to have no relevance
: Ghost (pathfinding volume separator, see [[OBD:AKVA|AKVA]] etc)
: StairsUp
: StairsDown
: Stairs
: Triangle
: Transparent
: TwoSided (make polygons visible from both sides)
: NoCollision (no character collision, no particle collision)
: Invisible (makes polygons visible; tip: use two-faced wall for no transition, use one-faced wall for one-way transition)
: NoObjectCollision (no particle collision)
: NoCharacterCollision (characters can go through polygons)
: NoOcclusion
: Danger (automatic creation via _marker_danger texture)
: Horizontal (slope > 70°, automatic creation)
: Vertical (slope < 70°, automatic creation)
: GridIgnore (onisplit will ignore the object when it calculate the pathfinding grids, so the grids will be white)
: NoDecals (decals can't be applied to object, doors use this)
: Furniture (Cntl + Shift + s: makes furniture textures red)
: ProjectionBit0 (automatic creation)
: ProjectionBit1 (automatic creation)
: SoundTransparent
: Impassable
 
 
'''(Copied from hex page. Is this still up to date ?)'''
 
;Triangles
:Many quads are in fact triangles: the last two vertices have the same [[OBD:PNTA|PNTA]] and [[OBD:TXCA|TXCA]] entries, and the ARGB color is (255, 205, 205, 205) (80% gray, 100% opaque). There is also a flag specifying that.
 
;Ghost, StairsUp, StairsDown
:These flags are used for BNV adjacencies, see [[AKAA]]. Stairs up/down are used instead of Ghost when the quad is placed at the bottom/top of the stairs. These quads are not visibile. The script variable env_show_ghostgqs is intended to control the visibility of such quads but it requires "debug" level files.
 
:There are a couple of ghost quads that aren't referenced from [[AKAA]]. It's likely that those quads are useless.
 
;DoorFrame
:This appears to be another type of "ghost" quad (its visibility is controlled by the same env_show_ghostgqs variable). Sometimes it is used together with the Ghost flag but not always. Only the door frames that also have the Ghost flag are used as adjacencies so it's unclear if the rest of the door frames serve any purpose. In fact it appears that this flag has no effect other than making the quad invisible.
 
;Stairs
:This is applied to the invisible ramp quad that covers the stairs. In general this flag is also applied to the visible stairs geometry but there are some exceptions (errors? see level 19 stairs).
 
;NoOcclusion
:This flag tells the octtree raycaster to ignore the quad when doing ray/quad intersections. This is tipically used for small quads that are unlikely to affect the overall environment visibility.
 
;ProjectionBit
:These 2 flags can be 00, 01, 10 and 11. That means the values 0,1,2 and 3 which have the following meanings:
:*0 - No projection plane specified. One can be computed if needed. Never used in files, may slow down the game if used.
:*1 - Project quad on XY plane.
:*2 - Project quad on XZ plane.
:*3 - Project quad on YZ plane.
:The projection plane is used to determine if a point is in a quad (this point is usually the result of an intersection between a ray and the quad plane).
 
;GridIgnore
:Appears to be unused. Its likely purpose is to mark quads that don't count as obstacles in the pathfinding grid.
 
;Danger
:Appears to be unused. Its likely purpose is to create danger areas in the pathfinding grids. Usually there's a trigger volume nearby that hurts/kills the character. This quads are always invisible.
 
;Invisible
:Invisible quads have a couple of different uses:
:* block player access to some parts of the environment
:* stairs ramp
:* collision geometry (used by some "complex" furniture)
:* danger quads (see above)
:* some other apparently useless quads
 
;Furniture
:Set for all quads that belong to a furniture object. It doesn't appear to be used. It is also redundant since all the furniture quads have an object id.
 
;NoDecals
:Prevents the creation of decals on the quad. Set for door quads because the decals would disappear when the door opens. That's why shooting a door doesn't leave a mark.
 
;Impassable
:Probably used by forcefields and end of level boundaries (like in state archive level).
 
 
----
vertex color shading at:
 
    <AGQG id="4">
        <Quads>
            <AGQGQuad>
                <Colors>RGB[A]
 
 
==Ideas to test out==
None ATM.
 
 
==Ideas that has been tested==
===Sky dome - it's a fail===
{| border=0 cellspacing=20 cellpadding=0 align=right
| sky box<br>[http://i305.photobucket.com/albums/nn207/unknownfuture/Oni_Galore_Images/XML_modding/ugly_skybox_lines.jpg http://i305.photobucket.com/albums/nn207/unknownfuture/Oni_Galore_Images/XML_modding/ugly_skybox_lines_tn.jpg]
| sky dome<br>[http://i305.photobucket.com/albums/nn207/unknownfuture/Oni_Galore_Images/3D_modding/sky_dome_512x512.jpg http://i305.photobucket.com/albums/nn207/unknownfuture/Oni_Galore_Images/3D_modding/sky_dome_512x512_tn.jpg]
|}
 
Maybe it's possible to create a very big sphere or dome that covers the entire level (and let Oni's skybox unused). If it's doable it could avoid ugly lines of the skybox coming from OpenGL rendering.
 
 
'''Update:''' 12 June 2012
 
New issues appeared that need to take care about:
 
* brightness:
: The brightness can be somewhat influenced by BSL commands like with gl_fog_..., gs_farclipplane and must be set adequately.
 
* texture size:
: The dome seen in the screenshot has a texture size of 512x512 and hence looks quite ''pixelated''.
: The problem might be solved by splitting the dome into sectors and giving each sector its own texture.
 
 
{| border=0 cellspacing=20 cellpadding=0 align=right
| gl_fog_start=.99999<br>[http://i305.photobucket.com/albums/nn207/unknownfuture/OCF_Images/sky4sectors_b.jpg http://i305.photobucket.com/albums/nn207/unknownfuture/OCF_Images/sky4sectors_b_tn.jpg]
| test level over [http://mods.oni2.net/node/202 HERE]<br>[http://i305.photobucket.com/albums/nn207/unknownfuture/OCF_Images/sky4sectors_a.jpg http://i305.photobucket.com/albums/nn207/unknownfuture/OCF_Images/sky4sectors_a_tn.jpg]
|}
 
'''Update:''' 14 June 2012
 
* texture boarder and distortions:
: Texture boarders have darker pixels so the UV must not reach them. Also after splitting the textures inside the editor there will be little distortions but they are still noticeable enough to make the sky look odd. Fine-tuning the UVs didn't really help.
 
* The gs_farclipplane max value makes the size of the dome quite limited: I think that the max radius here is somewhere between 2500 and 5000 world units.
 
I consider this as a ''fail''. Oni would need bigger view range and a texture support of 2096x2096.
 
 
==Ideas for onisplit==
Neo might update OniSplit so that it is searching specific strings in object names of a dae level file.
 
 
'''Cutscene cams'''
* string "cutscene''N''" (e.g. cutscene231) -> OBAN
 
 
'''Doors'''
* string "door*" (e.g. doorBlastDoorMX2000) -> DOOR + BINACJBODoor + OBAN
** but if the string is "door*clone''N''" then the DOOR and OBAN creation gets skipped (e.g. doorBlastDoorMX2000clone3), only class name, rotation and position get written into BINACJBODoor
 
 
'''Animated objects'''
* string "*_BeforeAnim": that's first static object with collision data (e.g. BlueCar1_BeforeAnim)
* string "*_InAnim": that's the animated cutscene object (e.g. BlueCar1_InAnim)
* string "*_AfterAnim": that's the second static object with collision data (e.g BlueCar1_AfterAnim)
 
 
'''Fake-destructible objects'''
* string "*_BeforeAnim": that's first static object with collision data (e.g. ConcreteWall2_BeforeAnim)
* string "*_Fragment''N''": that's the group of animated cutscene objects (fragments of the static object) (e.g. ConcreteWall2_Frag5)
* string "*_ColFrag''N''": that's the group of static objects with collision data (e.g. ConcreteWall2_ColFrag5)
* string "*_NoColFrag''N''": that's the group of static objects without character collision (e.g. ConcreteWall2_NoColFrag5)<br>NoColFrag would be useful if the fragments are quite numerous and small and hence would pose a problem to the pathfinding

Latest revision as of 18:07, 9 December 2023

ONLV : Oni Game Level
XML modding tips
  • See HERE to start learning about XML modding.
  • See HERE if you are searching for information on how to handle object coordinates.
  • See HERE for some typical modding errors and their causes.
XML.png
XML

ONLD << Other file types >> ONSK

switch to OBD page


ONLV and AKEV should not be extracted as XML unless it is for the purpose of trouble shooting or research. The extracted XMLs cannot be used for level creation.

If you want to create a new level check out the corresponding tutorial.

ONLV

XML tag Content type Description
<ONLV id="..."> integer ONLV's instance number. Should be 0.
<Name> char[64] Name of BSL folder.
Save game slot and level number are defined inside ONLD.
<Environment> link Link to AKEV via file name (AKEVname, don't use file suffix .oni)
Level geometry.
<Objects> link Link to OBOA via instance number (#N).
The OBOA instance holds doors, animated objects (usually for cutscenes) and pushable objects (which are not used the original game due to unfinished physics code).
<SkyBox> link Link to ONSK via file name (ONSKname, don't use file suffix .oni)
This is the skybox.
<Characters> link Link to AISA via file name (AISAname, don't use file suffix .oni)
This "AI Setup Array" is an alternative character list. BINACHAR is more powerful.
<ObjectQuadMap> link Link to ONOA via instance number (#N).
This "Object Array" holds functional objects – doors, furniture, turrets, triggers and consoles. In addition, it appears that the engine only searches for door-type objects.
<Particles> link Link to ENVP via instance number (#N).
These "Environment Particle" are traditionally only used for door lock lights and particles used by OFGAs.
<Corpses> link Link to CRSA via instance number (#N).
This is a "Corpse Array". It's used to spawn dead characters such as Chung in Chapter 1.

OBOA

Used for movable/moving objects.

XML tag Content type Description
<OBOA id="..."> integer Instance ID. Should be 1.
<Objects> - Array of <OBOAObject> tags.
<OBOAObject> - There are always 32 empty objects plus those that are actually used
<Geometry> "#" + integer Link to M3GA instance. Doors have two separate models: an animated and a static one. If this <Geometry> links to a door, it will be the animated model.
<Animation> link OBANname.
<Particle> # + integer Link to ENVP instance. There can be multiple ENVP instances – one for a lock light and others for additional particles.
<Flags> flags
None
InUse
NoCollision (any effect? no collision is default behavior)
NoGravity
FaceCollision (for doors)
<DoorGunkId> int32 The index of the door frame GQ (only used for door objects)
<DoorId> int32 Only used for doors; in the case of double doors, both doors have the same ID and they are flagged as "InUse FaceCollision"
<PhysicsType> flags
None
Static
Linear (pushable object)
Animated (animated via OBAN)
Newton (same as Linear)
<ScriptId> int32 Scripting ID; used by BSL function obj_create; "65535" means not used.
<Position> vector Float x3. Not used for animated objects.
<Rotation> quaternion Float x4. Not used for animated objects.
<Scale> float Not used for animated objects.
<Transform> matrix Float 3*3 + 3 more floats for the X Y Z position of the object. For more information on the matrix, see OBD:CRSA. Used for animated objects.
<Name> char[64] Name of the object; informational only.

ONOA

Used by static objects (imported by object list).

XML tag Content type Description
<ONOA id="..."> integer Instance ID.
<Elements> - This is an int32 array for the <ONOAElement> tags.
<ONOAElement> -
<ObjectId> integer Object ID and type to which this quad belongs (see AKEV's AGQG for details).
Actual object IDs can also be found in BINA/OBJC/####.
<QuadList> "#" + integer Link to IDXA instance. Each object has its own IDXA instance.

Where do the links go to again?

ONOA <ObjectId> -> AKEV AGQG -> BINA/OBJC/#### by type and ID
ONOA <QuadList> -> ONOA IDXA -> AKEV AGQG by order

ENVP

XML tag Content type Description
<ENVP id="..."> integer Instance ID.
<Particles> - This is an int16 array for the <ENVPParticle> tags. If there's not going to be any contents, you put <Particles /> here.
<ENVPParticle> -
<Class> char[64] BINA3RAPfile.oni (don't use file prefix/suffix).
<Tag> char[48] Particle's scripting name for BSL commands; see OFGA for more information on name composition.
<Transform> matrix Float 3*3 + 3 more floats for the X Y Z position of the particle. For more information on the matrix, see OBD:CRSA.
<DecalScale> int32, int32 X Y
<Flags> flag
None
NotInitiallyCreated

CRSA

XML tag Content type Description
<CRSA id="..."> integer Instance ID.
<FixedCount> integer The array capacity of <Corpses> is larger than the number of "fixed"/"used" corpses in order to allow the engine to store new corpses at runtime. "Fixed" means that those corpses are never overwritten/deleted at runtime – all new corpses are stored after the "fixed" ones. This means that "fixed" <= "used" <= "capacity".
<UsedCount> integer
<Corpses> - This is an int32 array for the <CRSACorpse> tags. By default, Oni wants 20 slots for corpses. Unused corpses have their matrix and bounding box filled with zeroes.
<CRSACorpse> - New corpses can be made with the BSL command make_corpse filename and some hex-editing. The pose of the corpse is taken from the player character. The contents of the files thus created can then be inserted as elements in a level's CRSA.
<CharacterClass> link ONCCname
<Transforms> - There are 19 <Matrix4x3> for each <Transforms> (which represents a body part).
<Matrix4x3> matrix Float 3x3 + float x3 for the last 3 values (X Y Z position). For more information about the matrix, see OBD:CRSA.
<BoundingBox> - Bounding box of the whole corpse.
<Min> float x3
<Max> float x3

M3GA

There can be one M3GA instance per animated object. Animated meshes of doors are embedded in ONLV. All other animated meshes are stored outside it as M3GM files.

XML tag Content type Description
<M3GA id="..."> integer Instance ID.
<Geometries> - This is an int32 array for the <Link> tags.
<Link> link
#N (instance number) (for non-door)
M3GMname (for door)

It can happen that you see here references to DAE files. This happens when the ONLV was created with some older OniSplit version (like 0.9.86.0) and if the ONLV was converted to xml in absence of the resources used by M3GA.

M3GM

Read about them here HERE. Note that M3GMs have their own component instances: PNTA, VCRA (x2), TXCA, IDXA (x2). Doors store their animated model in ONLV, while the static model comes from BINACJBODOOR.oni, which also links to M3GM files.

IDXA

XML tag Content type Description
<IDXA id="..."> integer Instance ID.
<Indices> - This is an Int32 array for the <Int32> tags.
<Int32> int32
From ONOA to AGQG elements
Link to <AGQGQuad>s in AGQG by order. (The array in AGQG starts with 0, so for example <Int32>6</Int32> would link to the 7th <AGQGQuad>.)
From M3GM to PNTA elements
Read more HERE.
From M3GM to VCRA elements
Read more HERE.

Level files hierarchy

(un)colored cell = file striped cell = embedded instance
ONLV
Chart fork right.gif AKEV
Chart descend.gif Chart fork right.gif PNTA
Chart descend.gif Chart fork right.gif PLEA
Chart descend.gif Chart fork right.gif TXCA
Chart descend.gif Chart fork right.gif AGQG
Chart descend.gif Chart fork right.gif AGQR
Chart descend.gif Chart fork right.gif AGQC
Chart descend.gif Chart fork right.gif AGQC
Chart descend.gif Chart fork right.gif AGDB
Chart descend.gif Chart fork right.gif TXMA
Chart descend.gif Chart descend.gif Chart turn right.gif TXMP
Chart descend.gif Chart fork right.gif AKVA
Chart descend.gif Chart fork right.gif AKBA
Chart descend.gif Chart fork right.gif IDXA
Chart descend.gif Chart fork right.gif AKBP
Chart descend.gif Chart fork right.gif ABNA
Chart descend.gif Chart fork right.gif AKOT
Chart descend.gif Chart descend.gif Chart fork right.gif OTIT
Chart descend.gif Chart descend.gif Chart fork right.gif OTLF
Chart descend.gif Chart descend.gif Chart fork right.gif QTNA
Chart descend.gif Chart descend.gif Chart turn right.gif IDXA
Chart descend.gif Chart fork right.gif AKAA
Chart descend.gif Chart turn right.gif AKDA
Chart fork right.gif OBOA
Chart descend.gif Chart fork right.gif M3GA
Chart descend.gif Chart descend.gif Chart turn right.gif M3GM
Chart descend.gif Chart descend.gif Chart fork right.gif PNTA
Chart descend.gif Chart descend.gif Chart fork right.gif VCRA
Chart descend.gif Chart descend.gif Chart fork right.gif TXCA
Chart descend.gif Chart descend.gif Chart fork right.gif IDXA
Chart descend.gif Chart descend.gif Chart turn right.gif TXMP
Chart descend.gif Chart fork right.gif OBAN
Chart descend.gif Chart turn right.gif ENVP
Chart fork right.gif ONMA
Chart fork right.gif ONFA
Chart fork right.gif ONTA
Chart turn right.gif ONSK
Chart descend.gif Chart fork right.gif TXMP
Chart fork right.gif AISA
Chart descend.gif Chart fork right.gif ONCC
Chart descend.gif Chart turn right.gif ONWC
Chart fork right.gif AITR
Chart fork right.gif ONSA
Chart fork right.gif OBDC
Chart descend.gif Chart turn right.gif M3GM
Chart descend.gif Chart fork right.gif PNTA
Chart descend.gif Chart fork right.gif VCRA
Chart descend.gif Chart fork right.gif TXCA
Chart descend.gif Chart fork right.gif IDXA
Chart descend.gif Chart turn right.gif TXMP
Chart fork right.gif ONOA
Chart descend.gif Chart turn right.gif IDXA
Chart fork right.gif ENVP
Chart turn right.gif CRSA
Chart turn right.gif ONCC