Scene setup. Hierarchy. LODs. Mesh properties.

Ubisoft Disrupt™-driven games modding

Moderator: Oleg

Post Reply
User avatar
Oleg
Site Admin
Posts: 14665
Joined: Fri Feb 06, 2004 3:54 am
Contact:

Scene setup. Hierarchy. LODs. Mesh properties.

Post by Oleg »

Watch Dogs scene setup.

The filter does not export an entire scene, it requires some base (root) node to start from. The root node is determined by the name of the file you are exporting to. When exporting a vehicle to a file named muscle_03.xbg, the filter will search your scene for a dummy node named muscle_03.xbg and if found, this node and it's children will get exported. Thus, you can have multiple assemblies loaded into ZModeler at the moment of export. For example, you can have an original model loaded and kept in a renamed hierarchy branch, while you assemble an export model in another (properly named) hierarchy branch. Also, only used materials will get exported, so you can have a lot of different materials loaded in Materials browser.

Additional ZModeler-specific name suffixes can appear in root object name. These suffixes will turn on/off different export scenarios in a filter, depending on purpose of the exported geometry file.

Rigid skinning
This is the commonly used method for the game vehicles. The entire vehicle is single geometry volume (split into material groups), but each vertex can be bounded to some controlling bone, or consider it as "belong to one specific part". Thus, the game can control individual parts of single geometry just like these are completely separated objects. When you load the vehicle into ZModeler, you will see a hierarchy of parts, but this was actually a single volume of geometry that ZModeler has split into parts for simplicity. When ZModeler does this, it appends .rigid suffix to the root node (for example, muscle_03.rigid). On export this suffix will mean that all parts of hierarchy should be merged together into single mesh volume and the game will control parts with rigid skinning techniques.

This might be a bit messy to understand, and you generally don't need to bother with these technical details, just keep in mind that vehicle requires a .rigid suffix in root name to be exported properly.

Blend skinning
Softskin or blend skinning technique allows multiple bones to affect vertices with different influence weights, so transformation to bones would spread softly across the mesh volume. This technique allows to bend a shape by transforming a series of bones and simulate bending of joints in a leg or foot, or bending of a coat on a character. As you might guessed, this technique is used for character models.
Soft skinning requires an assembly of bones arranged into a Skeleton. This skeleton is then assigned as "influencing" to some mesh while mesh vertices have a pre-defined bone weights assignment on them. ZModeler support upto 8 affecting bones on each vertex, WatchDogs uses upto 6 affecting bones.
When soft-skin model is loaded into ZModeler, two items are created: the one with suffix .skel and this is a skeleton base with hierarchy of bones, and the one with suffix .mesh - this is the mesh that respective skeleton is affecting. Thus, when loading "char01.xbg" model, you will get a "char01.skel" and "char01.mesh" root nodes.
Availability of these two entries on export will turn on the blend skinning export scenario.
Since blend skinning includes an unknown fragments in a geometry model, creating of blend skinning models is currently limited to constrain of reusing original "unknown" fragments. ZModeler will create "_unknown_A.dat", "_unknown_B.dat" and "_unknown_C.dat" files nearby the imported file: in order to make an export, the export folder should contain copies of these files. Otherwise, the model will loos an in-game interactive physics. Once again: copies of unknown data fragments "A", "B", "C" should be copied into export folder prior to exporting, otherwise the exported model will not behave interactively with in-game physics (movements, wind, etc.)

When no suffixes is found, the hierarchy is exported as a regular set of objects. This can particularly be used for exporting weapons or scenery objects.


Hierarchy
The hierarchy of objects is important for rigid skinning, as it allows to define parent-child relation. For example, you arrange door glass and door mirror to be the child of the door itself, so when Aiden opens vehicle door, the glass and mirror will rotate too. Hierarchy includes mesh objects and dummy nodes. Most of dummy nodes are helper locators for in-game effects, so the game engine will know the location and direction of exhaust smoke effect, or location and direction of taillight glow effect. Additional dummy nodes are marked in square braces and specify location of pre-defined hinge points for in-game animations. For example, the front right door object DoorFront_R will contain a [DoorFront_R_Hinge] dummy node and this dummy node will allow the game animation to adapt to your changes. The door opening animation is coded in game and placing the Hidge dummy point properly will let you adjust the base or pivot of the animation.

Note, if your model utilizes dummy nodes in square braces, you should toggle on Create .skeleton option on export, since these points are not saved in .xbg geometry file. By creating a .skeleton file, you export full hierarchy including these additional dummy nodes. When you move the door away but see in game the door-open animation played around the wrong pivoting point, this would generally mean a missing (or improperly named) door hinge dummy node, or a failure to enable "Create .skeleton" option on export. Vehicle models require this option; weapons, scenery and characters are not.


LODs
It is very important to create multiple LODs for your mesh models, so the game performance will not suffer on bad frame rates. By default, exporter will try to locate all six possible LODs on your model (UH, VH, H, M, L and VL), but if certain are missing (e.g. no meshes providing high-detailed "H" lod), the filter will skip associated LOD. Thus, your vehicle could use two, three LODs only.

Currently, default LODs setup is available when you turn on the "Watch Dogs Compatibility" in ZModeler's settings window (Options\Settings\General\Compatibility), but this might be changed later, since this compatibility could be taken as the native ZModeler compatibility and be toggled by default.

LODs are taken from scene states by their names, so if you don't have yet LODs in your scene, you can "create new" scene states that would "affect geometry", just be sure to give proper name to them: UH, VH, H, M, L, VL (for ultra-high, very-high, high, medium, low and very-low respectively).

Additionally, you can assign LOD ranges to let the game know the maximum distance for respective LODs. These ranges are assigned as a user-defined property LODs on a root dummy node of your model and contains comma-separated distance values for LODs starting from the ultra-high. For example, the muscle_03.rigid has a LODs property with value 10, 20, 30, 45, 90, 250 meaning the game will render very-high lod when camera is closer than 20 meters to the vehicle but further than 10 meters, and will render ultra-high LOD when it moves closer than 10 meters. The rest of values are used for lower LODs respectively. When dealing with blend skinning model, you should assign lod ranges on .mesh model as "LOD" user-defined property on each LOD level (see next paragraph)

Compound objects as LOD containers
ZModeler allows an object to contain different mesh geometry inside for different states. These objects are called Compound and listed in hierarchy view as bold names. Each compound object could contain different objects internally and give you (show in viewports) only one at a time. This feature is used to hold mesh geometry for different LODs on a single object. An object is made to be "Compound" and one geometry is assigned for UH (ultra-high quality) state, another mesh is assigned for VH (very-high quality) and so on, while in hierarchy view you see only one object.

You can toggle on/off different LODs on Structure panel to make compound nodes to show up meshes for the chosen LOD. This is generally what you start with after importing: Press the UH button on Structure panel. LODs state buttons are configured the mutually-exclusive way, so toggling one LOD state button will toggle off another LOD state button.

Arranging multiple LOD meshes into a single LOD container
Here's a quick guide on how to arrange multiple objects into a compound object. Assume you have three meshes for the door: the one is very high detail, another is high detail, and the third is a low detail version. If you wish to respect all 6 LODs in your exported model, you should create copies of these meshes, so you have one object for each LOD (e.g. copy very high detailed model to be used for the ultra-high detailed LOD). Rename parts so you don't get lost in them (e.g. door_1, door_2, door_3 etc.)
1. Pick the highest detail model in hierarchy view. Press the "UH" state button to enable the LOD this mesh will reflect in your container object.
2. Press "Convert to Compound" button on Structure panel: The object name will turn to bold, the list above hierarchy view will show "UH" item there meaning "this compound object has something for UH state".
3. Press the lock icon button (the icon, not the "Lock" button itself) next to object name on Structure panel: you will lock structure panel on a currently selected node, so you can pick different node in hierarchy.
4. Toggle VH state LOD on structure panel;
5. Drag & Drop a geometry for currently selected LOD onto an empty area of the list on structure panel: thus, you assign a given object on compound node for the currently selected state (LOD). Note, if you drop onto any item listed in this list, you will assign a given mesh for respective state (LOD), but will not create a new one;
6. Repeat 4-5 for other LODs.
The image below illustrates steps 3-4-5 for the very last LOD assignment:
wd_compound_arrange_01.jpg
Note, a compound object has it's own user-defined properties on each state involved, so if you have a mesh for ultra-high state detail (UH) and for very-high (VH) state, you should assign "LOD" user-defined property on each lod/state for the mesh object: toggle first state, assign property; toggle second state, assign property again, and so on.
huckleberrypie
Posts: 18
Joined: Wed Dec 18, 2019 3:30 pm

Re: Scene setup. Hierarchy. LODs. Mesh properties.

Post by huckleberrypie »

Additionally, you can assign LOD ranges to let the game know the maximum distance for respective LODs. These ranges are assigned as a user-defined property LODs on a root dummy node of your model and contains comma-separated distance values for LODs starting from the ultra-high. For example, the muscle_03.rigid has a LODs property with value 10, 20, 30, 45, 90, 250 meaning the game will render very-high lod when camera is closer than 20 meters to the vehicle but further than 10 meters, and will render ultra-high LOD when it moves closer than 10 meters. The rest of values are used for lower LODs respectively.
Can you point me as to where can I find that setting? I clicked on the root node (char01.skel) but didn't get the LOD properties you mentioned.
User avatar
Oleg
Site Admin
Posts: 14665
Joined: Fri Feb 06, 2004 3:54 am
Contact:

Re: Scene setup. Hierarchy. LODs. Mesh properties.

Post by Oleg »

This is probably in user-defined options found on "Properties" page for selected element (alt-click on visibility icon to select an element in hierarchy view), then switch to Properties page and double-click on "user-defined" options. Add "LODs" property (in the bottom of options window) and edit its value. press OK to close and Apply to save changes on a node.
Post Reply