Jump to content

Creating a level: Difference between revisions

m
no edit summary
mNo edit summary
mNo edit summary
Line 149: Line 149:
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 167:
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 183:
  OniSplit.exe -create:txmp out env/markers/*.tga
  OniSplit.exe -create:txmp out env/markers/*.tga


===The master XML file===
==The master XML file==
''The project file for level creation.''  
''The project file for level creation.''  


Line 409: Line 410:




====<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 497:
-->
-->


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


Line 530: Line 531:
-->
-->


=====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 624:
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 632:
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====
[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 658:
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 694: Line 695:
* "Textured" let you see the textured object with illumination and vertex coloring.
* "Textured" let you see the textured object with illumination and vertex coloring.


======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 707:
  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 719:
** 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 728:
[[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 771:
:: 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 801:
: '''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 820:
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 870:
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 899:
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 981:
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 996:
: [[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,075: Line 1,076:
  </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,224: Line 1,225:
  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.


8,013

edits