Creating a level: Difference between revisions

m
no edit summary
m (+cat)
mNo edit summary
 
(37 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{update|The tutorials on the now-defunct Oni Central Forum, under the section "Links to Forum Tutorials", should be merged into this article.}}
This page covers level creation from scratch. See [[Modifying an existing level]] if you want to change a vanilla level in the game.
==Level releases and resources==
==Level releases and resources==
===Fan-made levels===
===Fan-made levels===
Line 15: Line 18:
|-
|-
|2019/09/16
|2019/09/16
|[http://oni.bungie.org/forum/viewtopic.php?id=2965 Omega Tournament]
|[https://web.archive.org/web/20240527004257/http://oniforum.bungie.org/viewtopic.php?id=2965 Omega Tournament]
|31
|31
|-
|-
|2016/02/13
|2016/02/13
|[http://oni.bungie.org/forum/viewtopic.php?id=2947 AI Battle]
|[https://web.archive.org/web/20160224173743/http://oni.bungie.org/forum/viewtopic.php?id=2947 AI Battle]
|7
|7
|-
|-
|2014/01/19
|2014/01/19
|[http://oni.bungie.org/forum/viewtopic.php?id=2698 Wilderness Preserve]
|[https://web.archive.org/web/20211202225410/http://oni.bungie.org/forum/viewtopic.php?id=2698 Wilderness Preserve]
|17
|17
|-
|-
|2013/09/07
|2013/09/07
|[http://oni.bungie.org/forum/viewtopic.php?id=2656 Island]
|[https://web.archive.org/web/20201127180732/http://oni.bungie.org/forum/viewtopic.php?id=2656 Island]
|29
|29
|-
|-
|2013/07/12
|2013/07/12
|[http://oni.bungie.org/forum/viewtopic.php?id=2640 City]
|[https://web.archive.org/web/20201127175459/http://oni.bungie.org/forum/viewtopic.php?id=2640 City]
|28
|28
|-
|-
|2013/06/01
|2013/06/01
|[http://oni.bungie.org/forum/viewtopic.php?id=2619 Fight Club]
|[https://web.archive.org/web/20201029102326/http://oni.bungie.org/forum/viewtopic.php?id=2619 Fight Club]
|25
|25
|-
|-
|2012/05/12
|2012/05/12
|[http://oni.bungie.org/forum/viewtopic.php?id=2357 Old China]
|[https://web.archive.org/web/20220701102842/http://oni.bungie.org/forum/viewtopic.php?id=2357 Old China]
|24
|24
|-
|-
|2012/03/18
|2012/03/18
|[http://oni.bungie.org/forum/viewtopic.php?id=2302 Boss Battle]
|[https://web.archive.org/web/20211202220454/http://oni.bungie.org/forum/viewtopic.php?id=2302 Boss Battle]
|23
|23
|-
|-
|2012/02/12
|2012/02/12
|[http://oni.bungie.org/forum/viewtopic.php?id=2271 De Dust Deluxe]
|[https://web.archive.org/web/20201029113554/http://oni.bungie.org/forum/viewtopic.php?id=2271 De Dust Deluxe]
|22
|22
|-
|-
|2012/01/23
|2012/01/23
|[http://oni.bungie.org/forum/viewtopic.php?id=2242 Parkour Challenge 2]
|[https://web.archive.org/web/20201029114415/http://oni.bungie.org/forum/viewtopic.php?id=2242 Parkour Challenge 2]
|21
|21
|-
|-
|2012/01/16
|2012/01/16
|[http://oni.bungie.org/forum/viewtopic.php?id=2235 Parkour Challenge]
|[https://web.archive.org/web/20211205145843/http://oni.bungie.org/forum/viewtopic.php?id=2235 Parkour Challenge]
|21
|21
|-
|-
|2011/07/25
|2011/07/25
|[http://oni.bungie.org/forum/viewtopic.php?id=2001 Mini-Partenon]
|[https://web.archive.org/web/20201029103607/http://oni.bungie.org/forum/viewtopic.php?id=2001 Mini-Partenon]
|5
|5
|-
|-
|2011/10/03
|2011/10/03
|[http://oni.bungie.org/forum/viewtopic.php?id=2024 Muro's Lair - Preview]
|[https://web.archive.org/web/20201029113340/http://oni.bungie.org/forum/viewtopic.php?id=2024 Muro's Lair - Preview]
|20
|20
|-
|-
|2011/07/03
|2011/07/03
|[http://oni.bungie.org/forum/viewtopic.php?id=1957 Hexagon]
|[https://web.archive.org/web/20201029113724/http://oni.bungie.org/forum/viewtopic.php?id=1957 Hexagon]
|16
|16
|-
|-
|2011/06/23
|2011/06/23
|[http://oni.bungie.org/forum/viewtopic.php?id=1938 Junkyard]
|[https://web.archive.org/web/20201029104928/http://oni.bungie.org/forum/viewtopic.php?id=1938 Junkyard]
|15
|15
|-
|-
Line 79: Line 82:
|-
|-
|2010/11/08
|2010/11/08
|[http://oni.bungie.org/forum/viewtopic.php?id=1736 Arena of Hurt (OTA)]
|[https://web.archive.org/web/20210117150652/http://oni.bungie.org/forum/viewtopic.php?id=1736 Arena of Hurt (OTA)]
|7
|7
|-
|-
|2010/11/06
|2010/11/06
|[http://oni.bungie.org/forum/viewtopic.php?pid=50565#p50565 Martian Colony] AKA "Silly World"
|[https://web.archive.org/web/20201029105217/http://oni.bungie.org/forum/viewtopic.php?pid=50565#p50565 Martian Colony] AKA "Silly World"
|5
|5
|-
|-
|2010/02/15
|2010/02/15
|[http://oni.bungie.org/forum/viewtopic.php?id=1506 Maze]
|[https://web.archive.org/web/20201029113916/http://oni.bungie.org/forum/viewtopic.php?id=1506 Maze]
|5
|5
|-
|-
Line 93: Line 96:
|[http://mods.oni2.net/node/4 Arena of Pain]
|[http://mods.oni2.net/node/4 Arena of Pain]
|30
|30
|-
|2024/05/20
|[https://gamebanana.com/mods/514707 Kitsune: Chapter 1]
|20
|}
|}


===Forum tutorials on level creation===
===Forum tutorials on level creation===
* '''[http://oni.bungie.org/forum/viewtopic.php?id=2087 "Creating the Lair - A level tutorial"]'''
* '''[https://web.archive.org/web/20201029114347/http://oni.bungie.org/forum/viewtopic.php?id=2087 "Creating the Lair - A level tutorial"]'''
* [http://oni.bungie.org/forum/viewtopic.php?pid=53026 "Creating a Custom Oni Level (s10k video tutorials)"]
* [https://web.archive.org/web/20201127172559/http://oni.bungie.org/forum/viewtopic.php?pid=53026 "Creating a Custom Oni Level (s10k video tutorials)"]
* [http://oni.bungie.org/forum/viewtopic.php?id=1515 "Creating new levels"]
* [https://web.archive.org/web/20201127180431/http://oni.bungie.org/forum/viewtopic.php?id=1515 "Creating new levels"]
* [http://oni.bungie.org/forum/viewtopic.php?pid=33838 "Create levels with pathfinding grids"]
* [https://web.archive.org/web/20201029114358/http://oni.bungie.org/forum/viewtopic.php?pid=33838 "Create levels with pathfinding grids"]
* [http://oni.bungie.org/forum/viewtopic.php?id=2000 "More questions about levels"]
* [https://web.archive.org/web/20210117145338/http://oni.bungie.org/forum/viewtopic.php?id=2000 "More questions about levels"]
* [http://oni.bungie.org/forum/viewtopic.php?pid=37252#p37252 "Modding Existing levels - Beta" ("Moveable furniture" post)]
* [https://web.archive.org/web/20201029103906/http://oni.bungie.org/forum/viewtopic.php?pid=37252#p37252 "Modding Existing levels - Beta" ("Moveable furniture" post)]


===Wiki pages on level creation===
===Wiki pages on level creation===
* [[New levels]]<!--notes and comments by geyser that should be revisited / merged with this page-->
* [[Creating a level]] (you are here)
* [[Lightmapping levels]]
* [[Modifying an existing level]]
* [[New levels]] (a historical document)
* [[Lightmapping levels]] (an experiment)


===Free asset sources===
===Free asset sources===
* [http://vk.com/gameready Various game meshes]
* [https://3dwarehouse.sketchup.com/ 3D Warehouse] – architectural models (also see the [https://3dwarehouse.sketchup.com/collection/236901867937c4ed5fbaf4019d18db23/New-content-for-Oni curated collection] by geyser)
* [http://web.archive.org/web/20230601050258/http://tutorialsforblender3d.com/Textures/Textures_index.html Various game textures]
* [https://www.turbosquid.com/ TurboSquid] – various models, including architecture
* [https://www.textures.com Various game textures]
* [https://www.textures.com Textures.com] – wide variety of textures


==Engine limitations==
==Engine limitations==
Line 149: Line 158:
Be sure to uncheck automatic triangle creation when exporting (BNV) geometry used for pathfinding. Ghost (''doors'') must be quads.  
Be sure to uncheck automatic triangle creation when exporting (BNV) geometry used for pathfinding. Ghost (''doors'') must be quads.  


==Level import with OniSplit v0.9.82.0+==
==Setting up a workflow==
You can download OniSplit [http://mods.oni2.net/node/38 HERE] (it also comes with the [[AE]] and is found in the Tools directory of the installation).
If not noted differentely you need OniSplit v0.9.82.0 or a newer version. Onisplit can be downloaded [http://mods.oni2.net/node/38 HERE] (it also comes with the [[AE]] and is found in the Tools directory of the installation).


The level import demo files can be downloaded [http://mods.oni2.net/node/299 HERE].
The level import demo files can be downloaded [http://mods.oni2.net/node/299 HERE].
Line 167: Line 176:
Instead of "-nosep" you can now also use "-pc" for the import. Macs, however, do use "-sep".
Instead of "-nosep" you can now also use "-pc" for the import. Macs, however, do use "-sep".


==Troubleshooting==
If the game crashes while loading at ~90% progress, be sure that the texture's x and y dimensions are powers of two: 64, 128, 256, 512….
If the game crashes while loading at ~90% progress, be sure that the texture's x and y dimensions are powers of two: 64, 128, 256, 512….


Line 182: Line 192:
  OniSplit.exe -create:txmp out env/markers/*.tga
  OniSplit.exe -create:txmp out env/markers/*.tga


===The master XML file===
==Terminology==
;Polygon
:A polygon is a shape defined by points (vertices) in space. Polygons are the most fundamental building block in games. Oni uses only shapes with 3 and 4 points (triangles and quads). Other games might also use N-gons, shapes with more points.
;Face
:The '''surface of a polygon''' is also named face. The '''direction''' of a face in '''defined by its normal'''. If an object seems to have a hole, it might be that the polygon just has a '''flipped normal''' and is therefore wrongly rendered (displayed on screen).
;Normal
:Faces and even vertices themselves have directions. The normals of vertices determine how smooth or sharp edges will appear.
;Vertex (plural<nowiki>:</nowiki> vertices)
:A point within a polygon.
:Vertex colors radiate from one vertex to another vertex, whereby their different color values blend into each other so that gradients can appear.
;Edge
:A line of two points within a polygon.
;Tris (triangles)
:Polygons made of 3 points.
;Quads
:Polygons made of 4 points. Planes. Rectangles.
:Internally, all quads get converted into two triangles and will affect the maximum triangle count accordingly.
;Level
:The term "level" is often used to shorten "level map" (buildings and terrain).
;Geometry
:Level geometry can be objects made of tris and/or quads.
:Oni differentiates between basically 3 types of level geometry:
:* Static objects (sometimes also named AKEV core geometry)
:* Animated objects
:* Pushable objects (not used in the original game)
;Static geometry
:* '''Unique level geometry with no functions''' (AKEV core geometry such as buildings and streets).
:* '''Repeating objects''' are flagged as '''furniture ([[Creating_a_level#Furniture.xml|FURN]])''' although they can be outdoor objects such as boxes and containers. <!--Oni's story plays out most often inside buildings. So, there you go. -->FURN objects were used to be imported by an object collection, an CJBO. Nowadays, furniture collections can be used (again) for imports, but the individual objects are stored as [[XML:OFGA|OFGA]] files. This modularity is known in many game editors (like the Unreal Engine Editor). So, '''OFGA are nothing else than "game assets".''' The drawback of OFGA is that they '''will not import with any vertex shading'''. Only their '''geometries''', attached '''particle''' and '''gunk flags''' get copied into final (baked) level geometry.
:* '''Objects with actual functions''': [[XML:BINA/OBJC/CONS|CONS]], [[XML:BINA/OBJC/DOOR|DOOR]], [[XML:BINA/OBJC/TRIG|TRIG]], [[XML:BINA/OBJC/TURR|TURR]]
;[[XML:AKEV#AGQG|Gunk flags]]
:Properties directly associated with the polygons. Among others, these can be: Transparent, TwoSided, NoCollision, Invisible, NoObjectCollision, NoCharacterCollision, NoDecals, Furniture, Impassable.
;Baking
:When a level gets baked, all geometries get merged.
:*Unique level geometry will have vertex painting.
:*Objects derived from already compiled oni-files (shared classes) will have no vertex painting.
:*Animated and pushable objects will have no vertex shading.
;Vertex shading
:Vertex colors (vector data) can be painted onto core geometry.
:They are used as a rudimentary form of lightmapping (pixel data).
:Having vertex shading is still better than having no vertex shading at all. It makes the level appear more lifelike.
;Lightmapping
:In other games, lights and shadows are added to level geometry with lightmapping.
:There were experiments to bring lightmaps back to Oni. The technique come with a major drawback though. It doubles the triangle count and adds many textures.
;In-game
:When you are "inside" the game, running or playing it.
 
==Level construction==
'''Visible environment'''
* A '''level map''' consists of visible geometry: terrain and buildings. This is also named the '''environment''' or for short '''env'''.
** Use '''quads''' of approximately 10 up to 20 meters in size to construct env geometry.
* Anything other than floors and simple walls will be made of triangles.
** Geometry from CJBO works best with triangles. Quads might show holes in-game.
'''Invisible pathfinding'''
* '''AIs''' (or non-player characters, NPCs) need '''pathfinding''' data, usually shortened as '''bnv'''.
** Pathfinding data can be described as geometry, therefore as rooms. These '''bnv rooms''' are made of '''floors''' and are connected by '''ghost''' quads which work like doors. AIs can move from one room to another room only by passing a ghost. Therefore, ghosts have the same width as rooms in open terrain.
*** Use floor quads of approximately 10 meters in size to construct BNV floors.
*** Put ghost quads exactly on the edges of BNV floors with an angle of 90 degree.
'''Support for [[XML:BINA/ONIE|effects]]'''
* Effects such as decals that indicate damaged environment need level textures to be registered in [[XML:BINA/TMBD|TMBD]]. Make sure not to replace existing texture entries but to add your own so that the other levels remain unaffected.
'''Level logic'''
 
BSL scripts bring levels fully to life. The logic is mostly event driven whereby different checkpoints and conditions must be reached.
* Checkpoints are actually [[XML:BINA/OBJC/TRGV|trigger volumes]] that can recognize entering and exiting characters.
* The second most important source of events are [[XML:BINA/OBJC/CHAR|character (script) functions]], especially the die function of enemies.
** To support good and less good players alike, NPC characters can feature the UpgradeDifficulty flag. Also, BSL scripts can detect the current [[BSL:Game_status|difficulty level]].
* [[XML:BINA/OBJC/TRIG|Laser triggers]] are mostly used to control [[XML:BINA/OBJC/TURR|turrets]]. [[XML:BINA/OBJC/CONS|Consoles]], triggers and [[XML:DOOR|door]] unlocking are used to set up very simple "riddles”.
* The creation of cut scenes is time-consuming quality work. Due to missing tools for streamlined workflows, it is totally okay for you to skip this.
** New synchronized FILM, OBAN and TRAM files are required for cut scenes. Not to mention sound files for dialog.
 
==The master XML file==
''The project file for level creation.''  
''The project file for level creation.''  


Line 210: Line 289:
'''Common mistake:'''
'''Common mistake:'''


CJBO files '''need relative paths to the resource instead of just file names'''. Taking consoles, for example: a standard export to XML gives you "console_data". But to use the shared resources these must be paths like "'''consoles/console_data.oni'''" as they are stored in '''shared/console/'''. Note how the demoed '''shared''' folder is placed next to the [http://mods.oni2.net/node/299 project ("lab")] folder and the XML master file points to it using "../shared".
A few CJBO files '''need relative paths for resources'''. Inserting only a file name will not work. Let us take consoles for example: A relative path to a console should look like this: "'''consoles/console_data.oni'''". The resources are stored in '''shared/console/''' but since the XML master file points to the starting folder via "../shared", it will be omitted in all actual resource paths. If you need, look into the files of the [http://mods.oni2.net/node/299 demo project "lab"]. '''Doors''' and '''furniture''' also require relative paths.
 
'''lab/lab.xml'''
<?xml version="1.0" encoding="utf-8" ?>
<Oni>
    <Level SharedPath="../shared">
    ...
 
'''lab/Console.xml'''
<?xml version="1.0" encoding="utf-8"?>
<Oni>
    <Objects>
        <CONS Id="4695">
            <Header>
                <Flags>Gunk</Flags>
                <Position>944.1944 -27 29.37764</Position>
                <Rotation>3.623707E-05 270 0</Rotation>
            </Header>
            <OSD>
                <Class>consoles/console_data.oni</Class>
                ...
|-
|-
| <Environment>
| <Environment>
Line 317: Line 416:
|valign="top"| <Import>
|valign="top"| <Import>
|valign="top"| link
|valign="top"| link
| File path. Supported files:
| File path to an OBJC (collection) file. Supported collection files for <Import> are:
: [[XML:BINA/OBJC/CHAR|Character.xml]] (has to contain player character if there's no AISA file with it)
: [[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/CONS|Console.xml]]
Line 333: Line 432:
: [[XML:BINA/OBJC/WEAP|Weapon.xml]]
: [[XML:BINA/OBJC/WEAP|Weapon.xml]]


'''NOT''' supported (you need to import as regular .oni file):
The following two collection files are '''NOT''' supported. You need to copy them as regular pre-compiled *.oni files into your mod package:
: [[XML:BINA/OBJC/MELE|Melee.xml]] (overrides global MELE; not used in vanilla levels)
: [[XML:BINA/OBJC/MELE|Melee.xml]] (overrides global MELE; not used in vanilla levels)
: [[XML:BINA/OBJC/CMBT|Combat.xml]] (overrides global CMBT? not used in vanilla levels)
: [[XML:BINA/OBJC/CMBT|Combat.xml]] (overrides global CMBT?; not used in vanilla levels)
 
'''Inside''' the following three supported collection files, provide links to pre-compiled (*.oni) class files: console, door and furniture collections. Use relative paths such as:
:: <code>'''consoles/'''console_data'''.oni'''</code>
:: <code>'''doors/'''TCdouble'''.oni'''</code>
:: <code>'''furniture/'''V_tctf_bigvan'''.oni'''</code>
 
When you are unsure about the folder structure refer back to the [http://mods.oni2.net/node/299 level import demo].
|-
|-
| <Films>
| <Films>
Line 409: Line 515:




====<Model>====
===<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).
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).


Line 496: Line 602:
-->
-->


=====Import of object groups=====
====Import of object groups====
'''Mod Tool versus SketchUp'''
'''Mod Tool versus SketchUp'''


Line 530: Line 636:
-->
-->


=====Breakable glass with BSL recognition=====
====Breakable glass with BSL recognition====
Broken environmental objects can be recognized by the BSL command ''env_broken (ID_1, ID_N)''. However, this requires additional code to work.
Broken environmental objects can be recognized by the BSL command ''env_broken (ID_1, ID_N)''. However, this requires additional code to work.


Line 623: Line 729:
targets_are_gone() eventually disables the TV to prevent memory overflow; this function also contains all the things ("[...]") that you want to happen after the glass target is broken.
targets_are_gone() eventually disables the TV to prevent memory overflow; this function also contains all the things ("[...]") that you want to happen after the glass target is broken.


=====Texture exchange=====
====Texture exchange====
BSL command supported on Windows and Mac:
BSL command supported on Windows and Mac:
: env_texswap ID texture
: env_texswap ID texture
Line 631: Line 737:
A similar effect can be achieved by showing/hiding geometries with different textures as EdT has demonstrated in a private test. That way it should also be possible to have different vertex coloring for an area.
A similar effect can be achieved by showing/hiding geometries with different textures as EdT has demonstrated in a private test. That way it should also be possible to have different vertex coloring for an area.


=====Vertex coloring=====
====Vertex coloring====
Vertex colors can be edited manually in Blender by setting up following 3 things:
* Properties Panel > Data > Color Attributes<!--only tested with Face Corner, Byte Color-->
* 3D viewport (left top) > change work mode to Vertex Paint
* 3D viewport (right top) > change to Viewport Shading to Solid mode (under the dropdown menu you can choose "flat" to have full saturation)
 
{{divhide|Mod Tool}}
 
[http://web.archive.org/web/20170529111607/http://softimage.wiki.softimage.com/xsidocs/tex_vcolor_CreatingColoratVerticesCAVMaps.htm SoftImage documentation.] Observation: The sniper tower from level 19 Syndicate Mountain Compound can be isolated and re-imported as it is. It will appear quite dark.
[http://web.archive.org/web/20170529111607/http://softimage.wiki.softimage.com/xsidocs/tex_vcolor_CreatingColoratVerticesCAVMaps.htm SoftImage documentation.] Observation: The sniper tower from level 19 Syndicate Mountain Compound can be isolated and re-imported as it is. It will appear quite dark.


Line 657: Line 770:
So, how do we modify that data?
So, how do we modify that data?


======Single object shading======
'''Single object shading'''
 
If there's already a vertex color property, you can use Shift + W to activate the 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, making characters fall through the ground.
If there's already a vertex color property, you can use Shift + W to activate the 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, making characters fall through the ground.


If there's no vertex color property, the first usage of Shift + W will create that property. But you can also manually create it via Property > Color under Vertices Map.
If there's no vertex color property, the first usage of Shift + W will create that property. But you can also manually create it via Property > Color under Vertices Map.


======Level-wide shading======
'''Level-wide shading'''
 
[[Image:light_test_modtool.png|right|thumb]]
[[Image:light_test_modtool.png|right|thumb]]
[[Image:light_test_ingame.png|right|thumb]]
[[Image:light_test_ingame.png|right|thumb]]
Line 668: Line 783:
To get general shading/lighting you can set up light sources. "Infinite" lights are useful for global lighting, while "Light Box", "Point", "Neon" and "Spot" are more suitable as local light sources. They can be accessed via Primitives > Light.
To get general shading/lighting you can set up light sources. "Infinite" lights are useful for 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).
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/forum/viewtopic.php?pid=29089#p29089 on OCF here]; the quoted information is in triplicate, so don't get confused by that: at first it's detailed, then summarized, then as a checklist.
 
Basically you can go with the checklist:


The illumination of those lights can be integrated into the vertex color property:
* Property > Color At Vertices Map
* Property > Color At Vertices Map
* Property > Render Map
* Property > Render Map
Line 693: Line 805:
* "Shaded" let you see the illumination only.
* "Shaded" let you see the illumination only.
* "Textured" let you see the textured object with illumination and vertex coloring.
* "Textured" let you see the textured object with illumination and vertex coloring.
{{divhide|end}}


======env_shade======
=====env_shade=====
If you use '''env_shade''', use it with caution. It completely overwrites the vertex coloring.
If you use '''env_shade''', use it with caution. It completely overwrites the vertex coloring.


Line 706: Line 819:
  env_shade 7 10 1 1 1 # object 7, 8, 9, 10 lose all their shading
  env_shade 7 10 1 1 1 # object 7, 8, 9, 10 lose all their shading


=====Baked lightmaps=====
====Baked lightmaps====
A drawback of this method, AKA shadow maps, is the high number of [[XML:BINA/TMBD|TMBD]] changes and new textures for every wall, requiring a lot of memory. How to create shadow maps:
A drawback of this method, AKA shadow maps, is the high number of [[XML:BINA/TMBD|TMBD]] changes and new textures for every wall, requiring a lot of memory. How to create shadow maps:


Line 718: Line 831:
** Can be used on a new overlying, transparent surface
** Can be used on a new overlying, transparent surface


=====Standalone lightmaps=====
====Standalone lightmaps====
With this approach there are two meshes, whereby the shadow effects on one mesh get drawn in front of the regular level texture.
With this approach there are two meshes, whereby the shadow effects on one mesh get drawn in front of the regular level texture.


Line 727: Line 840:
[[Image:Oni_Lightmaps_double_polygon_method.jpg|center]]
[[Image:Oni_Lightmaps_double_polygon_method.jpg|center]]


====<Rooms>====
===<Rooms>===
The Rooms tag is mandatory. It contains an import path to BNV and ghosts (*.dae) which are used to create pathfinding grids. For information on the binary data behind this, see [[OBD:AKVA|HERE]].
The Rooms tag is mandatory. It contains an import path to BNV and ghosts (*.dae) which are used to create pathfinding grids. For information on the binary data behind this, see [[OBD:AKVA|HERE]].


Line 770: Line 883:
:: Striker follows you again
:: Striker follows you again


=====Pathfinding on uneven ground=====
====Pathfinding on uneven ground====
Pathfinding works on slightly uneven ground as long as the polygons are 0.5 world units beneath or 4 world units above the BNV.
Pathfinding works on slightly uneven ground as long as the polygons are 0.5 world units beneath or 4 world units above the BNV.


Line 800: Line 913:
: '''Solution:''' Use either '''chr_lock_active ''AI_name''''' or '''chr_all_active = 1'''
: '''Solution:''' Use either '''chr_lock_active ''AI_name''''' or '''chr_all_active = 1'''


=====Debugging=====
====Debugging====
'''(OniSplit v0.9.93.0+)'''
'''(OniSplit v0.9.93.0+)'''
[[Image:OniBrowser.jpg|thumb|200px|right|OniBrowser displaying level geometry plus PF and ghosts.]]
[[Image:OniBrowser.jpg|thumb|200px|right|OniBrowser displaying level geometry plus PF and ghosts.]]
Line 819: Line 932:
AIs appear to have trouble shooting through ghost quads that got registered in the octtree/BSP tree as seen here (<nowiki>https://www.youtube.com/watch?v=-ZugVBgBVKc</nowiki>, dead link).
AIs appear to have trouble shooting through ghost quads that got registered in the octtree/BSP tree as seen here (<nowiki>https://www.youtube.com/watch?v=-ZugVBgBVKc</nowiki>, dead link).


=====When OniSplit fails to connect PF quads=====
====When OniSplit fails to connect PF quads====
[[Image:Pathfinding_creation__merge_polygons_to_fix_connections.jpg|thumb|200px|right|Fixed PF in compound level after underground construction...]]
[[Image:Pathfinding_creation__merge_polygons_to_fix_connections.jpg|thumb|200px|right|Fixed PF in compound level after underground construction...]]
It can help to merge polygons to one object and merge their edges. These become white. (Outer edges are blue.)
It can help to merge polygons to one object and merge their edges. These become white. (Outer edges are blue.)


====<Textures>====
===<Textures>===
=====...used for exceptions=====
====...used for exceptions====
The [[#textures_tag|textures tag]] is mandatory.
The [[#textures_tag|textures tag]] is mandatory.


Line 869: Line 982:
See '''Figure 1'''.
See '''Figure 1'''.


=====Regular textures=====
====Regular textures====
OniSplit automatically imports textures of objects in the [[#<Model>|<Model> section]]. Those objects could be considered as AKEV core geometry.
OniSplit automatically imports textures of objects in the [[#<Model>|<Model> section]]. Those objects could be considered as AKEV core geometry.


Line 898: Line 1,011:
Caution: textures will be fixed to one set of flags. You can't use the same texture A for a one-sided cluster/object B and a two-sided cluster/object C. You would need to create a differently-named clone of that texture and apply that to cluster/object C.
Caution: textures will be fixed to one set of flags. You can't use the same texture A for a one-sided cluster/object B and a two-sided cluster/object C. You would need to create a differently-named clone of that texture and apply that to cluster/object C.


=====Marker textures=====
====Marker textures====
Marker textures are used to import certain objects with special flags. Import those objects alongside [[#<Model>|AKEV core]] geometry.
Marker textures are used to import certain objects with special flags. Import those objects alongside [[#<Model>|AKEV core]] geometry.


Line 980: Line 1,093:
Don't use this.
Don't use this.


====<Objects>====
===<Objects>===
Information on regular object lists can be looked up here:
Information on regular object lists 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/CHAR|Character.xml]] (has to contain player character if there's no AISA file with it)
Line 995: Line 1,108:
: [[XML:BINA/OBJC/WEAP|Weapon.xml]]
: [[XML:BINA/OBJC/WEAP|Weapon.xml]]


=====Furniture.xml=====
====Furniture.xml====
The AKEV core geometry is more or less the overall structure of the level while this furniture file adds standard objects (e.g. crates and desks) to it.
The AKEV core geometry is more or less the overall structure of the level while this furniture file adds standard objects (e.g. crates and desks) to it.


Line 1,038: Line 1,151:
|valign="top"| <Class>
|valign="top"| <Class>
|valign="top"| link
|valign="top"| link
| File path to an [[XML:OFGA|OFGA]] (*.oni) file. Make sure that the OFGA comes with the files it needs: M3GM and TXMP.
| File path to a '''pre-compiled [[XML:OFGA|OFGA]] (*.oni) file'''. Use it as part of a relative path. Make sure that the OFGA comes with the files it needs: M3GM and TXMP.


An OFGA can hold multiple M3GMs. That 3D content will then be integrated into the AKEV.
An OFGA can hold multiple M3GMs. That 3D content will then be integrated into the AKEV.
Line 1,046: Line 1,159:
| 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]].
| 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]].


Take care with the naming of new OFGA files. The particle name will be composed of 2 parts separated by an "_" underscore. '''Examples:'''
Take care with the naming of new OFGA files. The particle name will be composed of 2 parts separated by an "_" underscore. When one tag is empty, the final name will contain an underscore nonetheless. '''Examples:'''


: FURN <Particle>test</Particle> + OFGA <Tag>streetlight</Tag> = '''test_streetlight'''
: FURN <Particle>test</Particle> + OFGA <Tag>streetlight</Tag> = '''test_streetlight'''
Line 1,075: Line 1,188:
  </Oni>
  </Oni>


 
====Physics.xml====
=====Physics.xml=====
This file is for objects with "physics". Unlike AKEV core geometry or furniture, these objects can be animated.
This file is for objects with "physics". Unlike AKEV core geometry or furniture, these objects can be animated.


Line 1,167: Line 1,279:
|}
|}


The XML code for physics can be written in two styles.
*The '''first style''' mimics the original structure found in extracted ONLV instances. This makes it '''easier to edit old levels and reimport them''' into the game.
*The '''second style''' was created with structured data (nested objects) in mind and is '''suited for totally new levels''' where animated objects must be created in a 3D editor at first.


;Example


For documentation purposes, the file here has been trimmed down.
'''Code style 1'''
 
<?xml version="1.0" encoding="utf-8"?>
<Oni>
    <Physics>
        <Object>
            <Geometry>M3GMDishBase.oni</Geometry>
            <Animation>OBANDishBase.oni</Animation>
            <Physics>Animated</Physics>
            <ScriptId>201</ScriptId>
            <Position>-197.729141 128.46283 -2501.46387</Position>
            <Rotation>0.7071067 -1.545431E-08 1.545431E-08 0.7071068</Rotation>
            <Scale>2.109375</Scale>
            <Name>object_DishBase</Name>
        </Object>
    </Physics>
</Oni>
 
'''Code style 2'''
:For documentation purposes, the file here has been trimmed down.
 
  <?xml version="1.0" encoding="utf-8"?>
  <?xml version="1.0" encoding="utf-8"?>
  <Oni>
  <Oni>
Line 1,225: Line 1,359:
  env_show 9 1 # show static motorcycle model where Konoko parks her bike
  env_show 9 1 # show static motorcycle model where Konoko parks her bike


=====Corpses.xml=====
====Corpses.xml====
An empty Corpse element (<Corpse />) is treated as unused and placed at the end of the array. If no such empty elements are provided, OniSplit automatically adds 5. OniSplit also ensures that there are at least 20 corpses in the array.
An empty Corpse element (<Corpse />) is treated as unused and placed at the end of the array. If no such empty elements are provided, OniSplit automatically adds 5. OniSplit also ensures that there are at least 20 corpses in the array.


Line 1,265: Line 1,399:
|
|
|}
|}
'''Trimmed example'''
<?xml version="1.0" encoding="utf-8"?>
<Oni>
    <Corpses>
        <Corpse>
            <Class>generic_male_1</Class>
            <Transforms>
                <Matrix>-0.36488995 0.04620622 -0.9299034 -0.05580434 -0.9980576 -0.02769538 -0.9293768 0.04178688 0.366759717 -215.667755 1.603917 92.85312</Matrix>
                <Matrix>0.2961557 -0.185628444 0.936928 -0.368288517 -0.9272724 -0.06730227 0.8812806 -0.32512787 -0.342981815 -216.51889 1.64218426 93.189</Matrix>
                <Matrix>0.407847315 0.156575248 0.8995248 -0.238757968 -0.9326179 0.2705892 0.8812805 -0.3251278 -0.342982143 -215.239883 0.8405094 97.23532</Matrix>
                <Matrix>0.439697325 0.467113584 0.767118752 0.0248355754 -0.8601105 0.5095029 0.8978026 -0.204975232 -0.389789373 -213.6234 1.46109009 100.80056</Matrix>
                <Matrix>0.717241049 -0.179043233 0.673430443 0.4761817 -0.579636 -0.6612664 0.5087397 0.794962764 -0.3304816 -214.81662 1.56564879 92.5172348</Matrix>
                <Matrix>0.3398023 0.1672905 0.925498843 0.7910236 -0.5831365 -0.185023025 0.5087395 0.7949628 -0.330481827 -211.71907 0.792413354 95.42558</Matrix>
                <Matrix>0.1283634 0.227430075 0.965297 0.804142356 -0.59352535 0.032904774 0.5804117 0.7720126 -0.259073079 -210.372269 1.45546341 99.0937653</Matrix>
                <Matrix>-0.285799921 0.06851995 -0.955836535 -0.240357026 -0.970681965 0.00228381017 -0.927656651 0.230394751 0.2938901 -216.284851 1.5839076 91.29168</Matrix>
                <Matrix>-0.312039882 0.04875436 -0.948817253 -0.176752359 -0.9842264 0.00755515043 -0.9334825 0.1700632 0.31573534 -216.689789 1.68287766 89.9359055</Matrix>
                <Matrix>-0.356412441 -0.5390179 -0.763170958 0.0404523835 -0.82494843 0.5637587 -0.933452547 0.170058519 0.315826446 -217.422012 1.7979821 87.70907</Matrix>
                <Matrix>-0.101782769 -0.247171819 -0.9636112 0.5426916 -0.8256094 0.154451028 -0.8337422 -0.507223248 0.2181709 -217.747284 1.30605173 87.0125656</Matrix>
                <Matrix>-0.8154478 -0.150626346 0.558888733 -0.1200991 0.9885643 0.09119747 -0.566234052 0.00724477554 -0.8242127 -217.7402 2.065678 88.15346</Matrix>
                <Matrix>-0.4593738 -0.326781839 0.825947642 0.8874048 -0.1284554 0.442732215 -0.0385793857 0.9363295 0.348996729 -219.093979 1.81561315 89.08131</Matrix>
                <Matrix>-0.9545983 -0.13777709 0.26412034 0.295387268 -0.322961926 0.899134 -0.0385792255 0.9363296 0.348996431 -220.3681 0.9092429 91.37218</Matrix>
                <Matrix>-0.9715769 -0.0362956524 0.233924776 0.0276728421 -0.9988148 -0.0400396362 0.2351007 -0.0324283168 0.9714299 -222.775482 0.56178683 92.03825</Matrix>
                <Matrix>0.979860842 -0.192433611 0.0533096045 0.193336874 0.9810555 -0.0122905634 -0.0499345176 0.0223497637 0.9985025 -216.8387 1.90143847 87.84845</Matrix>
                <Matrix>0.863898 -0.399280578 0.3070101 0.171117 -0.340619326 -0.9244986 0.4737078 0.851207137 -0.225936681 -215.211975 1.58196676 87.93695</Matrix>
                <Matrix>0.4673251 -0.0255063027 0.883717656 0.746463835 -0.524209559 -0.4098731 0.4737075 0.851207256 -0.225936785 -212.815842 0.47451216 88.78848</Matrix>
                <Matrix>0.216871262 -0.007893051 0.976168454 0.3751846 0.9238389 -0.0758833 -0.9012231 0.3827002 0.203315422 -211.637314 0.410188764 91.0171051</Matrix>
            </Transforms>
            <BoundingBox>
                <Min>-219.731216 -2.258905 84.47974</Min>
                <Max>-207.518463 4.49535131 104.023239</Max>
            </BoundingBox>
        </Corpse>
    </Corpses>
</Oni>
<!--
<!--
[[Image:ONLV_CRSA_XSI_aided_import.jpg|thumb|200px]]
[[Image:ONLV_CRSA_XSI_aided_import.jpg|thumb|200px]]
8,452

edits