18,700
edits
m (copy-edit part 1) |
m (copy-edit part 2) |
||
Line 197: | Line 197: | ||
OniSplit.exe -create:txmp out env/markers/*.tga | OniSplit.exe -create:txmp out env/markers/*.tga | ||
===The master | ===The master XML file=== | ||
The master XML file's name determines the BSL folder name and the AKEV and ONLV file names in the output folder. File paths in the XML can be either absolute or relative. | |||
The | |||
'''Mandatory files''' for level import: | '''Mandatory files''' for level import: | ||
Line 208: | Line 205: | ||
* ''level_textures.tga/jpg/png'' | * ''level_textures.tga/jpg/png'' | ||
* Character.xml or AISA with player | * Character.xml or AISA with player | ||
* ONSK name in <Sky> ( | * ONSK name in <Sky> (in Windows, this can be a fake name; does the Mac need actual ONSK files?) | ||
* ONLD file | * ONLD file for the new level; read [[Making_a_mod_package#Mod_Info.cfg|HERE]] about making sure your level is unlocked (accessible on the Load Game screen) | ||
{| class="wikitable" width="100%" | {| class="wikitable" width="100%" | ||
!width=150px| XML tag | !width=150px| XML tag | ||
!width=120px| | !width=120px| Content type | ||
! | ! Description | ||
|- | |- | ||
| <?xml version="1.0" encoding="utf-8"?> | | <?xml version="1.0" encoding="utf-8"?> | ||
Line 227: | Line 224: | ||
|valign="top"| <Level SharedPath="..."> | |valign="top"| <Level SharedPath="..."> | ||
|valign="top"| link | |valign="top"| link | ||
| The master | | The master XML file can link to other XML files. Most of them will be [[OBD:BINA/OBJC#OBJC_types|BINACJBO]] files. The file type is 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". | ||
Some resources used by those | 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 integrated into the AKEV. Unused resources in the shared folder will be ignored. That way the final level archive or AE package contains only the necessary files, saving disk space for the end user. | ||
In the demo are various subfolders in shared folder: consoles, doors, furniture, triggers and turrets. | In the demo are various subfolders in the '''shared''' folder: consoles, doors, furniture, triggers and turrets. These file types do not need their file prefixes: CONS, DOOR, TRIG and OFGA. OniSplit will recognize them nonetheless. | ||
'''Common mistake:''' | '''Common mistake:''' | ||
CJBO files '''need relative paths to the resource instead of names'''. Taking consoles for example: | 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". | ||
|- | |- | ||
| <Environment> | | <Environment> | ||
Line 252: | Line 248: | ||
| <Node Id="..."> | | <Node Id="..."> | ||
| string | | string | ||
| | | informational (space for notes) | ||
|- | |- | ||
|valign="top"| <ScriptId> | |valign="top"| <ScriptId> | ||
|valign="top"| integer | |valign="top"| integer | ||
| Tested with BSL command ... | | Tested with BSL command ... | ||
: [[#<Model>|env_show | : [[#<Model>|env_show ID 1]] (use 0 to hide) | ||
: [[#Breakable glass with BSL recognition|env_broken | : [[#Breakable glass with BSL recognition|env_broken ID1 [ID2]]] (if a second ID is supplied then objects in the range ID1..ID2 get counted; "3001 3018" would cover 18 objects) | ||
: [[#Texture exchange|env_texswap | : [[#Texture exchange|env_texswap ID texture]] (no file prefix/suffix allowed) | ||
: [[#env_shade|env_shade | : [[#env_shade|env_shade ID ID R G B]] | ||
Static objects store their | Static objects store their ID in [[XML:AKEV#IDXA_.28quad_group_id.29|one of AKEV's IDXA instances]]. | ||
|- | |- | ||
|valign="top"| <GunkFlags> | |valign="top"| <GunkFlags> | ||
Line 280: | Line 276: | ||
| For detailed information see [[#<Rooms>|HERE]]. | | For detailed information see [[#<Rooms>|HERE]]. | ||
For Google | For a Google SketchUp BNV tutorial see [http://oni.bungie.org/forum/viewtopic.php?pid=36760#p36760 HERE]. | ||
|- | |- | ||
| <Import Path="..."/> | | <Import Path="..."/> | ||
Line 292: | Line 288: | ||
: <Textures Format="BGR" AlphaFormat="RGBA" MaxSize="512"> | : <Textures Format="BGR" AlphaFormat="RGBA" MaxSize="512"> | ||
Textures that aren't power of two (2 | Textures that aren't power of two (2<sup>x</sup>) or bigger than 512 will be resized. For example, 2003x2000 will become 512x512. | ||
|- | |- | ||
| <Texture Name="..."> | | <Texture Name="..."> | ||
Line 360: | Line 356: | ||
'''NOT''' currently supported (you need to import as regular .oni file): | '''NOT''' currently supported (you need to import as regular .oni file): | ||
: [[XML:BINA/OBJC/MELE|Melee.xml]] (overrides global MELE; not used in | : [[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 | : [[XML:BINA/OBJC/CMBT|Combat.xml]] (overrides global CMBT? not used in vanilla levels) | ||
|- | |- | ||
| <Films> | | <Films> | ||
Line 385: | Line 381: | ||
This is a | This is a trimmed-down 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" ?> | <?xml version="1.0" encoding="utf-8" ?> | ||
Line 451: | Line 447: | ||
'''env_show''' | '''env_show''' | ||
The motorcycle has here | The motorcycle has here scripting ID 9. You can show and hide the object with the BSL command '''env_show''', where the second parameter means true or false. '''Never use 0 as an ID''' because it won't work. | ||
env_show 9 1 | env_show 9 1 | ||
env_show 9 0 | env_show 9 0 | ||
EdT demonstrates [https://youtu.be/Em6wa5JTQNM here] | EdT demonstrates env_show [https://youtu.be/Em6wa5JTQNM here]. Note how the objects have collision. | ||
The last vanilla 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: | ;More possible applications of env_show: | ||
* ground/ceiling/objects for cutscenes that become partially destroyed | * ground/ceiling/objects for cutscenes that become partially destroyed | ||
* | * destructible walls like in Deus Ex: Human Revolution (trigger volume, replacing punch anim with punch-through-wall anim) | ||
* grids in front of ventilation shafts (a | * grids in front of ventilation shafts (a small door object could be an alternative) | ||
** at the moment this can't be done because characters can't sneak under the top edge of the opening (the characters collision spheres are too big) | ** at the moment this can't be done because characters can't sneak under the top edge of the opening (the characters collision spheres are too big) | ||
* managing object groups with trigger volumes (save multiple objects in one | * managing object groups with trigger volumes (save multiple objects in one DAE file) | ||
<!-- atm, the effort is not worth the work | <!-- atm, the effort is not worth the work | ||
Line 473: | Line 467: | ||
: edit: replace 0 by 25 | : edit: replace 0 by 25 | ||
If the objects appear to | If the objects appear to flicker then we could replace the hide_all_object_groups() function with individual TV exit functions. | ||
func hide_all_object_groups | func hide_all_object_groups | ||
Line 523: | Line 517: | ||
} | } | ||
--> | --> | ||
=====Import of object groups===== | =====Import of object groups===== | ||
'''Mod Tool versus | '''Mod Tool versus SketchUp''' | ||
The meaning and behavior of "groups" greatly differs in these two programs. | The meaning and behavior of "groups" greatly differs in these two programs. | ||
:'''In | :'''In SketchUp''' you can group objects which enables you to easily duplicate all objects inside a group and to scale/rotate/translate them all together. | ||
:'''In Mod Tool''' grouped objects are still loose, and duplicating a group won't duplicate the objects. To achieve the same effect as in SketchUp, you have to create a hierarchy where any one object is the "parent" and all others the "children". | |||
'''Google SketchUp''' | |||
To create a group, select two or more objects, right-click on the selection and choose "make group". | |||
[[Image:ModTool_can_import_objs_in_hierarchies.jpg|right|thumb|Mod Tool can import objects in hierarchies to Oni.]] | [[Image:ModTool_can_import_objs_in_hierarchies.jpg|right|thumb|Mod Tool can import objects in hierarchies to Oni.]] | ||
'''Mod Tool''' | '''Mod Tool''' | ||
Either use the Explorer (A) or the Schematics(B) to create a hierarchy. | Either use the Explorer (A) or the Schematics (B) to create a hierarchy. | ||
:(A) In Explorer window, drag and drop one or more objects onto another one. | :(A) In the Explorer window, drag and drop one or more objects onto another one. | ||
:(B) Open the constrain tab at the right side. Select parent object, click "Parent", click the child object(s). Check the result in the Schematics window. | :(B) Open the constrain tab at the right side. Select parent object, click "Parent", click the child object(s). Check the result in the Schematics window. | ||
:'''Mod Tool: caution when saving to | :'''Mod Tool: caution when saving to DAE!''' | ||
:A normal selection won't do. You have to select the object tree to successfully save a hierarchy. This is same way you do with Oni characters. | :A normal selection won't do. You have to select the object tree to successfully save a hierarchy. This is the same way that you do it with Oni characters. | ||
<!-- | <!-- | ||
=====Import of smart object groups===== | =====Import of smart object groups===== | ||
Let's say there are two groups. If an edit is made to one mesh the clone in the other group is instantly | Let's say there are two groups. If an edit is made to one mesh, the clone in the other group is instantly changed the same way. | ||
So that's a smart group. | So that's a smart group. In SketchUp this is named "component". In Mod Tool it's named ???. | ||
:(Can be imported from SketchUp DAE file but causes a crash when re-saving. I guess a script is needed to do the job.) | |||
--> | --> | ||
=====Breakable glass with BSL recognition===== | =====Breakable glass with BSL recognition===== | ||
Broken | Broken environmental objects can be recognized by the BSL command ''env_broken (ID_1, ID_N)''. However, this requires additional code to work. | ||
An example is the training level. Let's determine how we can set up such a thing. | An example is the training level. Let's determine how we can set up such a thing. | ||
Line 621: | Line 608: | ||
func void targets_gone(string ai_name) | func void targets_gone(string ai_name) | ||
{ | { | ||
if(inside_target_function eq 0) | if (inside_target_function eq 0) | ||
{ | { | ||
enter_target_function() # catch other "targets_gone" functions to let them do nothing | enter_target_function() # catch other "targets_gone" functions to let them do nothing | ||
Line 650: | Line 637: | ||
;Explanation: | ;Explanation: | ||
Player enters the TV, | Player enters the TV, targets_gone() gets triggered. The variable "inside_target_function" should be 0 by default, so we will enter the "if" block. Next, we can assume that the player didn't destroy all glass objects, so "num_broken" will be less than 18; thus, targets_are_not_gone() gets called. | ||
The TV function targets_gone() ''would'' be triggered every frame, but targets_are_not_gone() creates a delay 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. | |||
In this case the targets_gone() function will do nothing because "inside_target_function" was set to 1 by the first call. | |||
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 | BSL command supported on Windows and Mac: | ||
: env_texswap ID texture | : 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.) | Might be useful to switch on/off static and animated textures. (News broadcast screen: running or off or smashed. Lava stream: flowing or stagnating or cooled down. Etc.) | ||
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. | ||
If we remove "_color" from the object the shadows will be gone next time we import the tower. | If we remove "_color" from the object, the shadows will be gone next time we import the tower. | ||
Mod Tool: Explorer [8] | Mod Tool: Explorer [8] | ||
Line 693: | Line 678: | ||
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 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 | |||
======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]] | ||
To get | 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 | 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: | Basically you can go with the checklist: | ||
Line 719: | Line 699: | ||
* Property > Render Map | * Property > Render Map | ||
* In render map property page, under Sampling select Vertices Only | * In render map property page, under Sampling select Vertices Only | ||
* Under Surface Color choose Enable, then in the box below select Vertex _Color | * 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 | * Under Map, select Illumination only | ||
* Finally, click on the button Regenerate Maps... | * Finally, click on the button Regenerate Maps... | ||
This must be done for all objects separately. | This must be done for all objects separately. | ||
: [http://mods.oni2.net/system/files/vertex_color_script.txt There's a script]<!--http://mods.oni2.net/node/352--> which can apply vertex color and render maps to all '''selected''' objects. Load it into the script editor | : [http://mods.oni2.net/system/files/vertex_color_script.txt There's a script here]<!--http://mods.oni2.net/node/352--> which can apply vertex color and render maps to all '''selected''' objects. Load it into the script editor with Alt + 4 and hit F5 to run it. (Be sure the script's language was set to VBScript.) | ||
: The variable "overwrite_VC" can be changed. | : 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 "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. | :: With "0" only selected objects without CAV maps will be the script's target. | ||
'''Notes on ModTool view modes''' | '''Notes on ModTool view modes''' | ||
Line 736: | Line 715: | ||
* "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. | ||
======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. | |||
# BSL command | # BSL command | ||
Line 752: | Line 729: | ||
=====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 is the high | |||
How to create shadow maps: | |||
* https://web.archive.org/web/20121105081823/http://www.game-artist.net/forums/support-tech-discussion/5622-burning-shadows-onto-texture-xsi.html | * https://web.archive.org/web/20121105081823/http://www.game-artist.net/forums/support-tech-discussion/5622-burning-shadows-onto-texture-xsi.html | ||
Line 763: | Line 736: | ||
Notes on map options: | Notes on map options: | ||
* "Surface color and illumination": outputs used texture with added shadows | * "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 | ||
=====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. | |||
Compared to the "baked lightmaps" method, this needs more polygons of course. | Compared to the "baked lightmaps" method, this needs more polygons of course. And these polygons are transparent, which is a problem with Oni's limited rendering ability for such textures. However, standalone lightmaps only need a few new textures if used wisely. | ||
Read | Read [[Lightmapping levels]] to learn more. | ||
[[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 binary data 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]]. | ||
Sample code from the master XML file: | |||
<Import Path="env/lab_bnv.dae"/> | <Import Path="env/lab_bnv.dae"/> | ||
'''Fundamentals''' | '''Fundamentals''' | ||
* ''' | * '''BNVs''' are '''volumes''' (sometimes also named '''rooms''') that have a pathfinding grid assigned to them. | ||
* For practical reasons you only need '''floors and ramps''' to build BNV. ( | * For practical reasons you only need '''floors and ramps''' to build a BNV. (As seen [http://edt.oni2.net/images/Hideout_BNV.jpg HERE.]) | ||
** A BNV polygon can consist of 3 or more points but it's recommended to use '''shapes with 4 points''' because the other shapes usually waste more grid space. At the moment you can import only '''[[ | ** A BNV polygon can consist of 3 or more points, but it's recommended to use '''shapes with 4 points''' because the other shapes usually waste more grid space. At the moment you can import only '''[[wikt:Convex|convex]]''' shapes. | ||
* Secondly there are so called '''ghosts''' (vertical quads) that connect ''' | * Secondly, there are so called '''ghosts''' (vertical quads) that connect '''neighboring BNVs'''. AI can only transit from BNV to another through ghosts. | ||
: OniSplit gives error messages for ghosts that don't have 2 | : OniSplit gives error messages for ghosts that don't have 2 neighboring BNVs, for example: | ||
BNV Builder: Ghost 'grid2' has no | BNV Builder: Ghost 'grid2' has no adjacencies at <-72,41 1,999 -166,6> and <-71 1,999 -168,21>, ignoring | ||
'''Tolerance values''' | '''Tolerance values''' | ||
* | * Horizontal distance from room to ghost: 1 | ||
* | * Vertical distance from room to ghost: 18 | ||
* ' | * Ghost's horizontal dimension must be greater than 0 | ||
* | * Under optimal circumstances, pathfinding works on a plane that is +4 world units above or -0.5 below the pathfinding grid | ||
* | * Normally characters can't pass over low vertical walls such as stairs/curbs if those don't have a ramp under them; 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 | ||
* | * Maximum angle of ramp you can go on is 70°; higher angles will make characters fall through to their death (in those cases you might want to add invisible walls/boxes to prevent them from touching the ramp) | ||
'''More notes on PF processing''' | '''More notes on PF processing''' | ||
* Actually, BNV and ghosts can have any name and don't need any texture. | * Actually, BNV and ghosts 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 | * During pathfinding calculation, OniSplit creates a new folder called "temp" and a subfolder "grids". There is a file named "''levelname''_grids.dae". That file contains rooms with textures called "bnv_grid_''N''.tga" which mark obstacles in the pathfinding grid. Ghosts will have a transparent texture "'''_marker_ghost'''.tga". You also get these 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 | * 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 your saving option. That way all the planes can be quickly saved to a *.dae file. | ||
* You can influence the pathfinding creation of dangerous zones | * You can influence the pathfinding creation of dangerous zones using danger quads. Read about those [[#Marker textures|HERE]]. | ||
* Another kind of influence is the [[#<Model>|gunk flag]] IgnoreGrid. It can be used to | * Another kind of influence is the [[#<Model>|gunk flag]] IgnoreGrid. It can be used to tell OniSplit to ignore the object during pathfinding creation. The grids in that place will be white. | ||
[[Image:Pathfinding_grid.JPG|thumb|200px|right|''ai2_showgrids = 1'' in action]] | [[Image:Pathfinding_grid.JPG|thumb|200px|right|'''ai2_showgrids = 1''' in action]] | ||
'''BSL commands''' | '''BSL commands''' | ||
* chr_show_bnv = 1 | * chr_show_bnv = 1 | ||
:: shows number of | :: shows number of BNVs the player is standing on | ||
* ai2_showgrids = 1 | * ai2_showgrids = 1 | ||
:: shows pathfinding grids | :: shows pathfinding grids | ||
* ai2_chump | * ai2_chump | ||
:: spawns a friendly | :: spawns a friendly Striker that follows the player if possible, makes also pathfinding grids visible | ||
* ai2_chump_stop = 1 | * ai2_chump_stop = 1 | ||
:: | :: Striker stops following you | ||
* ai2_chump_stop = 0 | * ai2_chump_stop = 0 | ||
:: | :: Striker follows you again | ||
=====Pathfinding on uneven ground===== | =====Pathfinding on uneven ground===== | ||
Pathfinding works on | Pathfinding works on slightly uneven ground as long as the polygons are 0.5 world units beneath or 4 world units above the BNV. | ||
For | For greater surface irregularities, we can use a trick: | ||
* The problematic polygons must be saved to | * The problematic polygons must be saved to a DAE file and then referenced in the model section as an individual object. | ||
* Then the <GunkFlags> tag needs to be '''''GridIgnore'''''. | * Then the <GunkFlags> tag needs to be '''''GridIgnore'''''. | ||
* Additionally we create a | * Additionally we create a plane (invisible if necessary) under the object so that Oni doesn't think there's a hole. | ||
* The ghosts must be taller than the highest polygon to | * The ghosts must be taller than the highest polygon to be walked on. (This has been tested up to a height of 2,000 world units.) | ||
'''Symptoms of too-small ghosts''' | |||
'''Symptoms of too small ghosts''' | |||
A) AI can't run at all. | A) AI can't run at all. | ||
B) AI loses PF if tracked enemy performs animations that are | B) AI loses PF ability if the tracked enemy performs animations that are outside of the pathfinding volume. Here's a video (<nowiki>https://youtu.be/vfKPzP5hiCo</nowiki>, dead link) showing these symptoms. | ||
'''Missing boundaries''' | '''Missing boundaries''' | ||
Let's say you have a BNV, tall ghosts, and a GridIgnore-flagged hill with trees and | Let's say you have a BNV, tall ghosts, and a GridIgnore-flagged hill with trees and bushes and stuff. | ||
Why do | Why do AIs run up against the trees? | ||
: ''' | : '''Problem:''' There are no red/orange grids that limit the AI's movement. Normally, objects will produce red pathfinding squares around them. But objects that are 20 world units above the BNV are ignored just like objects with the IgnoreGrid flag. | ||
: '''Solution:''' Add simple geometries like ''_marker_impassable fences'' or danger quads near the BNV. | : '''Solution:''' Add simple geometries like ''_marker_impassable fences'' or danger quads near the BNV. | ||
'''Disappearing AIs''' | '''Disappearing AIs''' | ||
The ground is sometimes not solid | The ground is sometimes not solid, and the player and AIs are falling through it. | ||
: '''Problem:''' On GridIgnore-flagged uneven ground, AIs can fall through it when they are out of the player's view. | |||
: '''Solution:''' Use either '''chr_lock_active ''AI_name''''' or '''chr_all_active = 1''' | |||
=====Debugging (OniSplit v0.9.93.0+)===== | =====Debugging (OniSplit v0.9.93.0+)===== | ||
[[Image:OniBrowser.jpg|thumb|200px|right|OniBrowser | [[Image:OniBrowser.jpg|thumb|200px|right|OniBrowser displaying level geometry plus PF and ghosts.]] | ||
* '''env_show_ghostgqs = 1''' makes the ghost quads visible | * '''env_show_ghostgqs = 1''' makes the ghost quads visible | ||
** | ** The original ghost quads can't be seen; per Neo, "they are not included in the octtree and bsp tree" | ||
** | ** To see them you must use the -debug option in the level creation command (available with OniSplit '''v0.9.93.0+''') | ||
OniSplit.exe -create:level ''output_folder'' '''-debug''' ''input_folder''/''master_xml_file''.xml | OniSplit.exe -create:level ''output_folder'' '''-debug''' ''input_folder''/''master_xml_file''.xml | ||
Not all debugging/testing needs to be done in Oni. There also a [http://mods.oni2.net/node/256 | Not all debugging/testing needs to be done in Oni. There is also a [http://mods.oni2.net/node/256 program] (Windows only) which can display the whole level. | ||
For example you can load an AKEV*.oni, select the level name and use hotkeys [B] and [P] to display | For example you can load an AKEV*.oni, select the level name, and use the hotkeys [B] and [P] to display BNVs and ghosts. | ||
'''Bug prevention:''' | '''Bug prevention:''' | ||
After all | After all testing is done, you should compile the level a last time without the -debug option. | ||
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:pathfing_creation__merge_polygons_to_fix_connections.jpg|thumb|200px|right|Fixed PF in compound level after underground | [[Image:pathfing_creation__merge_polygons_to_fix_connections.jpg|thumb|200px|right|Fixed PF in compound level after underground construction...]] | ||
It can help to merge | It can help to merge polygons to one object and merge their edges. These become white. (Outer edges are blue.) | ||
==== | ====<Textures>==== | ||
=====... used for exceptions===== | =====... used for exceptions===== | ||
The [[#textures_tag|textures tag]] is mandatory. | |||
AKEV textures will be imported by the master | AKEV textures will be imported by the master XML file automatically; you don't need to add them to that file. | ||
: With OniSplit v0.9.82-93.0, the textures' formats will be DXT1 and | : With OniSplit v0.9.82-93.0, the textures' formats will be DXT1 and (for transparent ones) BGRA4444. | ||
: With OniSplit v0.9.94.0+ the textures' formats will be BGR and | : With OniSplit v0.9.94.0+ the textures' formats will be BGR and (for transparent ones) RGBA. | ||
To change the default texture import format, use the Texture'''s''' tag. (Possible with OniSplit v0.9.94.0+) | To change the default texture import format, use the Texture'''s''' tag. (Possible with OniSplit v0.9.94.0+.) | ||
To change the format/flag/ | To change the format/flag/gunk flag of a specific texture, use the Texture tag. | ||
An example: | An example: | ||
Line 906: | Line 868: | ||
</Textures> | </Textures> | ||
* Use | * Use the gunk flag "TwoSided" to make surfaces visible from both sides. | ||
* If the texture comes with | * If the texture comes with the gunk flag "NoCollision" then all objects with that texture will have no collision. Characters would fall through it. | ||
Transparency and no collision | Transparency and no collision together would make sense for a water-like substance. The Vago Biotech level uses this approach for the area with green toxic waste. | ||
[[Image:making_a_surface_transparent_and_twosided.png|thumb|200px|right|'''Figure 1''']] | [[Image:making_a_surface_transparent_and_twosided.png|thumb|200px|right|'''Figure 1''']] | ||
[[Image:AKEV_single_object_multiple_textures.png|thumb|200px|right|'''Figure 2'''<br>one object with multiple textures, one per polygon cluster]] | [[Image:AKEV_single_object_multiple_textures.png|thumb|200px|right|'''Figure 2'''<br>one object with multiple textures, one per polygon cluster]] | ||
[[Image:AKEV_single_object_multiple_textures_ingame.png|thumb|200px|right|'''Figure 3'''<br>blue: | [[Image:AKEV_single_object_multiple_textures_ingame.png|thumb|200px|right|'''Figure 3'''<br>blue: two-sided<br>glass: two-sided and transparent<br>random metal: no flag (one-sided)]] | ||
'''TwoSided and transparent objects''' | '''TwoSided and transparent objects''' | ||
It's also possible to set this in Mod Tool. For TwoSided-ness use one image source for diffuse and transparency. (It won't work with two image sources even if both sources use the same image.) | It's also possible to set this in Mod Tool. For TwoSided-ness, use one image source for diffuse and transparency. (It won't work with two image sources even if both sources use the same image.) | ||
For transparency additionally use the three checkboxes: | For transparency you must additionally use the three checkboxes: | ||
* Transparency: Enable | * Transparency: Enable | ||
* Transparency: Use Alpha | * Transparency: Use Alpha | ||
Line 932: | Line 894: | ||
''' | '''One texture per object''' | ||
Furniture and Physics objects are allowed to have only 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. | ||
AKEV core geometry can have one texture or multiple textures | |||
Line 943: | Line 903: | ||
'''Question:''' How do we apply multiple textures to an AKEV core object? | '''Question:''' How do we apply multiple textures to an AKEV core object? | ||
'''Answer:''' Assuming you are using Mod Tool the procedure will be | '''Answer:''' Assuming you are using Mod Tool the procedure will be as follows. Repeat this for each cluster you create (except for projection). See also '''Figure 2 and 3'''. | ||
* | * Select some polygons | ||
* | * Go to 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 | ||
* | * In the Texture Projection section, click on "New" and choose a suitable projection | ||
** | ** Do this only if there isn't a projection in the "Texture_Coordinates_AUTO" cluster yet | ||
** OniSplit processes only one texture projection, see '''Figure 4''' | ** OniSplit processes only one texture projection, see '''Figure 4''' | ||
* | * Choose the texture and UV, then fine-tune the UV via Alt + 7 | ||
[[Image:AKEV_multiple_textures_one_projection.png|thumb|200px|right|'''Figure 4'''<br>use only one texture projection per object]] | [[Image:AKEV_multiple_textures_one_projection.png|thumb|200px|right|'''Figure 4'''<br>use only one texture projection per object]] | ||
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 | |||
=====Marker textures===== | =====Marker textures===== | ||
Marker textures are used to import certain objects with special flags. Import those | Marker textures are used to import certain objects with special flags. Import those objects alongside [[#<Model>|AKEV core]] geometry. | ||
Marker textures aren't imported automatically. Add those textures to the final package | Marker textures aren't imported automatically. Add those textures to the final package or plugin yourself, e.g. with some sort of script. | ||
OniSplit.exe -create:txmp out env/markers/*.tga | OniSplit.exe -create:txmp out env/markers/*.tga | ||
The flags Transparent, TwoSided and NoOcclusion are only set if the same texture source is used for diffuse and transparency and if transparency setting are enabled. See the subsection under "[[#... used for exceptions|... used for exceptions]]" called "TwoSided and transparent objects". | |||
'''Danger quads''' | |||
Pathfinding grids have different colored squares with different meanings. | |||
* white/gray - clear space | * white/gray - clear space | ||
* green light - | * green light - near wall | ||
* green - | * green - semi-passable | ||
* green dark - stairs | * green dark - stairs | ||
* blue very light - border 1 | * blue very light - border 1 | ||
Line 987: | Line 942: | ||
* red - impassable | * red - impassable | ||
For detailed information on colors see [[OBD_talk:AKVA/0x24#EFFECTS_of_various_pathfinding_grid_tile_types|HERE]]. | 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 | Normally, OniSplit decide how to color the grids. But it's possible to add your own danger quads to fine-tune zones of higher danger. Those orange areas will be generated with the 4 different blue borders around it. | ||
Danger quads must have "'''_marker_danger'''" as texture name. | Danger quads must have "'''_marker_danger'''" as texture name. | ||
Line 997: | Line 952: | ||
'''_marker_barrier''' | '''_marker_barrier''' | ||
<!-- Originally this is only used for | <!-- Originally this is only used for level-bounding invisible walls? --> | ||
Results in flags: Transparent TwoSided(double-check) Invisible NoObjectCollision NoOcclusion | Results in flags: Transparent TwoSided(double-check) Invisible NoObjectCollision NoOcclusion | ||
Line 1,004: | Line 959: | ||
'''COLLISION (boxes)''' | '''COLLISION (boxes)''' | ||
AIs can get stuck in detailed geometry. This can be prevented with collision boxes. | AIs can get stuck in detailed geometry. This can be prevented with collision boxes. In-game the box will be invisible, but has collision so characters can't get through. The pathfinding grid will be red where it comes in contact with the box; the red is followed by a light green and then regular green. | ||
Typically it | [[XML:OFGA|OFGAs]] use the COLLISION texture. Onisplit doesn't automatically apply gunk flags to it. You need to use XML tags for that. Typically it would be <GunkFlags>Invisible NoObjectCollision</GunkFlags> | ||
''' | '''Stairs''' | ||
Texture: '''_marker_stairs''' | |||
Normally, characters can't move on stairs | Normally, characters can't move on stairs because they contain vertical rises. In this case you can use a sloping quad that is above or inside the staircases. It's possible to set the desired flags in the <Model> section, but doing so and exporting these self-made stair ramps is wasted time. Simply apply _marker_stairs to that quad and characters will be able to move on that surface. | ||
Resulting flags: Stairs Transparent TwoSided Invisible NoObjectCollision NoOcclusion | |||
This has no effect on pathfinding creation. Regularly-textured stair geometry (which intersects the marker quad) will be flagged as NoCharacterCollision. | |||
''' | '''Impassable''' | ||
texture: '''_marker_impassable''' | texture: '''_marker_impassable''' | ||
Resulting flags: Transparent TwoSided (<-double-check this) Invisible NoOcclusion | |||
Impassable walls are very similar to collision boxes except that | Impassable walls are very similar to collision boxes except that particles can also collide with them. The pathfinding grids will be also red, light green, and green. | ||
''' | '''Blackness a.k.a. jello fix''' | ||
Texture: '''_marker_blackness''' | |||
Resulting flags: TwoSided NoCollision | |||
Simply black walls. No effect | Simply black walls. No effect on pathfinding creation. The purpose of these walls in Oni is to block out areas outside of a level's outermost wall so that the Jello-cam cannot show the player other parts of the level when it escapes a wall. See [[Jello-cam]] for details. | ||
''' | '''Doors''' | ||
Texture: '''_marker_door''' | |||
Resulting flags: DoorFrame Transparent TwoSided NoCollision NoOcclusion | |||
Don't use this. | Don't use this. | ||
====<Objects>==== | ====<Objects>==== |