OBD talk:TRBS: Difference between revisions

From OniGalore
Jump to navigation Jump to search
m (lol that was wrong)
mNo edit summary
Line 43: Line 43:
When extracting a TRBS with onisplit v0.9.41.0 the TRIA instance gets exposed. Then it can be modified by hand to change the hierarchy of body parts.
When extracting a TRBS with onisplit v0.9.41.0 the TRIA instance gets exposed. Then it can be modified by hand to change the hierarchy of body parts.


In the table are two hexhound hierarchies. One modified and one original onisplit-generated.
In the table below you can see examples of TRIA instances: one from Konoko and one from a more or less hypothetical hex-hound.


The extracted xml code of those two is a bit different. They have same hierarchy but the order of body parts is different. As result the head animation was applied to different parts.
: Onisplit v0.9.58.0 and lower needs a dae file where the body part names are strictly correct but the order doesn't matter. The result will be always a standard TRIA.
: Onisplit v0.9.68.0 and higher(?) tolerates unusual body part names but it takes the order ''serious'' to build the hierarchy.
: In other words, when building a custom hierarchy with new onisplit versions you don't need any longer to edit the TRIA instance in xml.
 
Note that the head could be at a different location in the order. As result the head animation would be applied to a different body part.


Normally such overlay animation have "Head" as "<UsedBones>", if your new model's head isn't the 11th part you need to change it.
Normally such overlay animation have "Head" as "<UsedBones>", if your new model's head isn't the 11th part you need to change it.
Line 51: Line 55:
A character with non-standard TRIA needs a complete set of new animations, those animations must be created based on that new TRIA.
A character with non-standard TRIA needs a complete set of new animations, those animations must be created based on that new TRIA.


The order how the body parts get incorporated into the TRBS depends on their position in the dae file.
 
'''Changing the body part order'''


Inside Mod Tool, the objects have an order which can be seen in the Schematics. The user can influence that order by using the Reorder Nodes Tool [I].
Inside Mod Tool, the objects have an order which can be seen in the Schematics. The user can influence that order by using the Reorder Nodes Tool [I].
Line 69: Line 74:
|}
|}


objs = 0
  if selection.count > 0 then
  if selection.count > 0 then
  ' any part could be seleced, let's find the root body part
  ' any part could be selected, let's find the root body part
  SelectNeighborObj selection(0), 4
  SelectNeighborObj selection(0), 4
  ' get children
  ' get all members including the pelvis
  set bodyparts = '''selection(0).FindChildren( , , siMeshFamily)'''
  set bodyparts = '''selection(0).FindChildren( , , siMeshFamily)'''
  for each member in bodyparts
  for each member in bodyparts
Line 84: Line 88:
  logmessage "Y: " & member.Material.CurrentImageClip.source.Parameters("YRes").Value
  logmessage "Y: " & member.Material.CurrentImageClip.source.Parameters("YRes").Value
  end if
  end if
objs = objs + 1
  logmessage "----------------------------------------------------------"
  logmessage "----------------------------------------------------------"
  next
  next
  logmessage "counted body parts: " & objs
  logmessage "counted body parts: " & bodyparts.count
  end if
  end if
   
   
Line 191: Line 194:
| '''standard TRIA'''
| '''standard TRIA'''
| '''hexhound TRIA'''
| '''hexhound TRIA'''
| '''hexhound TRIA'''
|-
| original
| modified
| original (made v0.9.68.0)
|-
|-
|
|
Line 287: Line 285:
             <TRIAElement>
             <TRIAElement>
                 <Parent>16</Parent>
                 <Parent>16</Parent>
                <Child>18</Child>
                <Sibling>0</Sibling>
            </TRIAElement>
            <TRIAElement>
                <Parent>17</Parent>
                <Child>0</Child>
                <Sibling>0</Sibling>
            </TRIAElement>
        </Elements>
    </Instance>
|
    <Instance id="4" type="TRIA">
        <Elements>
            <TRIAElement>
                <Parent>0</Parent>
                <Child>1</Child>
                <Sibling>0</Sibling>
            </TRIAElement>
            <TRIAElement>
                <Parent>0</Parent>
                <Child>2</Child>
                <Sibling>3</Sibling>
            </TRIAElement>
            <TRIAElement>
                <Parent>1</Parent>
                <Child>0</Child>
                <Sibling>0</Sibling>
            </TRIAElement>
            <TRIAElement>
                <Parent>0</Parent>
                <Child>4</Child>
                <Sibling>5</Sibling>
            </TRIAElement>
            <TRIAElement>
                <Parent>3</Parent>
                <Child>0</Child>
                <Sibling>0</Sibling>
            </TRIAElement>
            <TRIAElement>
                <Parent>0</Parent>
                <Child>6</Child>
                <Sibling>7</Sibling>
            </TRIAElement>
            <TRIAElement>
                <Parent>5</Parent>
                <Child>0</Child>
                <Sibling>0</Sibling>
            </TRIAElement>
            <TRIAElement>
                <Parent>0</Parent>
                <Child>8</Child>
                <Sibling>9</Sibling>
            </TRIAElement>
            <TRIAElement>
                <Parent>7</Parent>
                <Child>0</Child>
                <Sibling>0</Sibling>
            </TRIAElement>
            <TRIAElement>
                <Parent>0</Parent>
                <Child>10</Child>
                <Sibling>0</Sibling>
            </TRIAElement>
            <TRIAElement>
                <Parent>9</Parent>
                <Child>11</Child>
                <Sibling>0</Sibling>
            </TRIAElement>
            <TRIAElement>
                <Parent>10</Parent>
                <Child>12</Child>
                <Sibling>14</Sibling>
            </TRIAElement>
            <TRIAElement>
                <Parent>11</Parent>
                <Child>13</Child>
                <Sibling>0</Sibling>
            </TRIAElement>
            <TRIAElement>
                <Parent>12</Parent>
                <Child>0</Child>
                <Sibling>0</Sibling>
            </TRIAElement>
            <TRIAElement>
                <Parent>10</Parent>
                <Child>15</Child>
                <Sibling>17</Sibling>
            </TRIAElement>
            <TRIAElement>
                <Parent>14</Parent>
                <Child>16</Child>
                <Sibling>0</Sibling>
            </TRIAElement>
            <TRIAElement>
                <Parent>15</Parent>
                <Child>0</Child>
                <Sibling>0</Sibling>
            </TRIAElement>
            <TRIAElement>
                <Parent>10</Parent>
                 <Child>18</Child>
                 <Child>18</Child>
                 <Sibling>0</Sibling>
                 <Sibling>0</Sibling>

Revision as of 11:53, 22 October 2012

XML section

Template:XMLModdingHints

general information

  • TRBS files are stored globally (in edition/GameDataFolder/level0_Final)
  • these files are used by ONCC
  • they contain 5 models differing in ("LOD") level of detail (triangle number)


extraction

onisplit -extract:xml output_folder input_folder/TRBSname.oni


creation

onisplit -create output_folder input_folder/TRBSname.xml


example

TRBSkonoko_body_high.xml (extracted with onisplit v0.9.68.0)

<?xml version="1.0" encoding="utf-8"?>
<Oni>
   <TRBS id="0">
       <Elements>
           <Link>TRBSkonoko_body_high_TRCM1.dae</Link> <!-- 300 triangles -->
           <Link>TRBSkonoko_body_high_TRCM2.dae</Link> <!-- 842 triangles -->
           <Link>TRBSkonoko_body_high_TRCM3.dae</Link> <!-- 1250 triangles -->
           <Link>TRBSkonoko_body_high_TRCM4.dae</Link> <!-- 2038 triangles -->
           <Link>TRBSkonoko_body_high_TRCM5.dae</Link> <!-- 3294 triangles -->
       </Elements>
   </TRBS>
</Oni>


custom TRIA

Onisplit creates the TRIA instance on its own.

When extracting a TRBS with onisplit v0.9.41.0 the TRIA instance gets exposed. Then it can be modified by hand to change the hierarchy of body parts.

In the table below you can see examples of TRIA instances: one from Konoko and one from a more or less hypothetical hex-hound.

Onisplit v0.9.58.0 and lower needs a dae file where the body part names are strictly correct but the order doesn't matter. The result will be always a standard TRIA.
Onisplit v0.9.68.0 and higher(?) tolerates unusual body part names but it takes the order serious to build the hierarchy.
In other words, when building a custom hierarchy with new onisplit versions you don't need any longer to edit the TRIA instance in xml.

Note that the head could be at a different location in the order. As result the head animation would be applied to a different body part.

Normally such overlay animation have "Head" as "<UsedBones>", if your new model's head isn't the 11th part you need to change it.

A character with non-standard TRIA needs a complete set of new animations, those animations must be created based on that new TRIA.


Changing the body part order

Inside Mod Tool, the objects have an order which can be seen in the Schematics. The user can influence that order by using the Reorder Nodes Tool [I].

Taking this into account it should be possible to let Mod Tool generate a TRMA file fitting to TRBS.


VBS code piece for TRMA creation

  • The objects get listed one after another (TRMA-ready).
  • The textures are listed for TRMA and TXMP creation.
  • There's a texture size check to see if "-large" argument is necessary.
hexhound hierarchy

hexhound_hierarchy_tn_zpsd82230ce.png

if selection.count > 0 then
	' any part could be selected, let's find the root body part
	SelectNeighborObj selection(0), 4
	' get all members including the pelvis
	set bodyparts = selection(0).FindChildren( , , siMeshFamily)
	for each member in bodyparts
		logmessage "object name: " & member.name
		if not typename(member.Material.CurrentImageClip) = "Nothing" then
			logmessage "texture: " & member.Material.CurrentImageClip.source.filename.value
			'logmessage "material: " & member.Material.name
			'logmessage "shader: " & member.Material.shaders(0).name
			logmessage "X: " & member.Material.CurrentImageClip.source.Parameters("XRes").Value
			logmessage "Y: " & member.Material.CurrentImageClip.source.Parameters("YRes").Value
		end if
		logmessage "----------------------------------------------------------"
	next
	logmessage "counted body parts: " & bodyparts.count
end if

' INFO  : object name: A
' INFO  : texture: C:\Users\RRM\Desktop\A.tga
' INFO  : X: 512
' INFO  : Y: 512
' INFO  : ----------------------------------------------------------
' INFO  : object name: R
' INFO  : texture: C:\Users\RRM\Desktop\R.tga
' INFO  : X: 512
' INFO  : Y: 512
' INFO  : ----------------------------------------------------------
' INFO  : object name: S
' INFO  : texture: C:\Users\RRM\Desktop\S.tga
' INFO  : X: 512
' INFO  : Y: 512
' INFO  : ----------------------------------------------------------
' INFO  : object name: P
' INFO  : texture: C:\Users\RRM\Desktop\P.tga
' INFO  : X: 512
' INFO  : Y: 512
' INFO  : ----------------------------------------------------------
' INFO  : object name: Q
' INFO  : texture: C:\Users\RRM\Desktop\Q.tga
' INFO  : X: 512
' INFO  : Y: 512
' INFO  : ----------------------------------------------------------
' INFO  : object name: N
' INFO  : texture: C:\Users\RRM\Desktop\N.tga
' INFO  : X: 512
' INFO  : Y: 512
' INFO  : ----------------------------------------------------------
' INFO  : object name: O
' INFO  : texture: C:\Users\RRM\Desktop\O.tga
' INFO  : X: 512
' INFO  : Y: 512
' INFO  : ----------------------------------------------------------
' INFO  : object name: L
' INFO  : texture: C:\Users\RRM\Desktop\L.tga
' INFO  : X: 512
' INFO  : Y: 512
' INFO  : ----------------------------------------------------------
' INFO  : object name: M
' INFO  : texture: C:\Users\RRM\Desktop\M.tga
' INFO  : X: 512
' INFO  : Y: 512
' INFO  : ----------------------------------------------------------
' INFO  : object name: B
' INFO  : texture: C:\Users\RRM\Desktop\B.tga
' INFO  : X: 512
' INFO  : Y: 512
' INFO  : ----------------------------------------------------------
' INFO  : object name: C
' INFO  : texture: C:\Users\RRM\Desktop\C.tga
' INFO  : X: 512
' INFO  : Y: 512
' INFO  : ----------------------------------------------------------
' INFO  : object name: D
' INFO  : texture: C:\Users\RRM\Desktop\D.tga
' INFO  : X: 512
' INFO  : Y: 512
' INFO  : ----------------------------------------------------------
' INFO  : object name: E
' INFO  : texture: C:\Users\RRM\Desktop\E.tga
' INFO  : X: 512
' INFO  : Y: 512
' INFO  : ----------------------------------------------------------
' INFO  : object name: F
' INFO  : texture: C:\Users\RRM\Desktop\F.tga
' INFO  : X: 512
' INFO  : Y: 512
' INFO  : ----------------------------------------------------------
' INFO  : object name: G
' INFO  : texture: C:\Users\RRM\Desktop\G.tga
' INFO  : X: 512
' INFO  : Y: 512
' INFO  : ----------------------------------------------------------
' INFO  : object name: H
' INFO  : texture: C:\Users\RRM\Desktop\H.tga
' INFO  : X: 512
' INFO  : Y: 512
' INFO  : ----------------------------------------------------------
' INFO  : object name: I
' INFO  : texture: C:\Users\RRM\Desktop\I.tga
' INFO  : X: 512
' INFO  : Y: 512
' INFO  : ----------------------------------------------------------
' INFO  : object name: J
' INFO  : texture: C:\Users\RRM\Desktop\J.tga
' INFO  : X: 512
' INFO  : Y: 512
' INFO  : ----------------------------------------------------------
' INFO  : object name: K
' INFO  : texture: C:\Users\RRM\Desktop\K.tga
' INFO  : X: 512
' INFO  : Y: 512
' INFO  : ----------------------------------------------------------
' INFO  : counted body parts: 19


standard TRIA hexhound TRIA
   <Instance id="8" type="TRIA">
       <Elements>
           <TRIAElement>
               <Parent>0</Parent>
               <Child>1</Child>
               <Sibling>0</Sibling>
           </TRIAElement>
           <TRIAElement>
               <Parent>0</Parent>
               <Child>2</Child>
               <Sibling>4</Sibling>
           </TRIAElement>
           <TRIAElement>
               <Parent>1</Parent>
               <Child>3</Child>
               <Sibling>0</Sibling>
           </TRIAElement>
           <TRIAElement>
               <Parent>2</Parent>
               <Child>0</Child>
               <Sibling>0</Sibling>
           </TRIAElement>
           <TRIAElement>
               <Parent>0</Parent>
               <Child>5</Child>
               <Sibling>7</Sibling>
           </TRIAElement>
           <TRIAElement>
               <Parent>4</Parent>
               <Child>6</Child>
               <Sibling>0</Sibling>
           </TRIAElement>
           <TRIAElement>
               <Parent>5</Parent>
               <Child>0</Child>
               <Sibling>0</Sibling>
           </TRIAElement>
           <TRIAElement>
               <Parent>0</Parent>
               <Child>8</Child>
               <Sibling>0</Sibling>
           </TRIAElement>
           <TRIAElement>
               <Parent>7</Parent>
               <Child>9</Child>
               <Sibling>0</Sibling>
           </TRIAElement>
           <TRIAElement>
               <Parent>8</Parent>
               <Child>10</Child>
               <Sibling>0</Sibling>
           </TRIAElement>
           <TRIAElement>
               <Parent>9</Parent>
               <Child>0</Child>
               <Sibling>11</Sibling>
           </TRIAElement>
           <TRIAElement>
               <Parent>9</Parent>
               <Child>12</Child>
               <Sibling>15</Sibling>
           </TRIAElement>
           <TRIAElement>
               <Parent>11</Parent>
               <Child>13</Child>
               <Sibling>0</Sibling>
           </TRIAElement>
           <TRIAElement>
               <Parent>12</Parent>
               <Child>14</Child>
               <Sibling>0</Sibling>
           </TRIAElement>
           <TRIAElement>
               <Parent>13</Parent>
               <Child>0</Child>
               <Sibling>0</Sibling>
           </TRIAElement>
           <TRIAElement>
               <Parent>9</Parent>
               <Child>16</Child>
               <Sibling>0</Sibling>
           </TRIAElement>
           <TRIAElement>
               <Parent>15</Parent>
               <Child>17</Child>
               <Sibling>0</Sibling>
           </TRIAElement>
           <TRIAElement>
               <Parent>16</Parent>
               <Child>18</Child>
               <Sibling>0</Sibling>
           </TRIAElement>
           <TRIAElement>
               <Parent>17</Parent>
               <Child>0</Child>
               <Sibling>0</Sibling>
           </TRIAElement>
       </Elements>
   </Instance>
   <Instance id="4" type="TRIA">
       <Elements>
           <TRIAElement>
               <Parent>0</Parent>
               <Child>1</Child>
               <Sibling>0</Sibling>
           </TRIAElement>
           <TRIAElement>
               <Parent>0</Parent>
               <Child>2</Child>
               <Sibling>3</Sibling>
           </TRIAElement>
           <TRIAElement>
               <Parent>1</Parent>
               <Child>0</Child>
               <Sibling>0</Sibling>
           </TRIAElement>
           <TRIAElement>
               <Parent>0</Parent>
               <Child>4</Child>
               <Sibling>5</Sibling>
           </TRIAElement>
           <TRIAElement>
               <Parent>3</Parent>
               <Child>0</Child>
               <Sibling>0</Sibling>
           </TRIAElement>
           <TRIAElement>
               <Parent>0</Parent>
               <Child>6</Child>
               <Sibling>7</Sibling>
           </TRIAElement>
           <TRIAElement>
               <Parent>5</Parent>
               <Child>0</Child>
               <Sibling>0</Sibling>
           </TRIAElement>
           <TRIAElement>
               <Parent>0</Parent>
               <Child>8</Child>
               <Sibling>9</Sibling>
           </TRIAElement>
           <TRIAElement>
               <Parent>7</Parent>
               <Child>0</Child>
               <Sibling>0</Sibling>
           </TRIAElement>
           <TRIAElement>
               <Parent>0</Parent>
               <Child>10</Child>
               <Sibling>0</Sibling>
           </TRIAElement>
           <TRIAElement>
               <Parent>9</Parent>
               <Child>11</Child>
               <Sibling>0</Sibling>
           </TRIAElement>
           <TRIAElement>
               <Parent>10</Parent>
               <Child>12</Child>
               <Sibling>13</Sibling>
           </TRIAElement>
           <TRIAElement>
               <Parent>11</Parent>
               <Child>0</Child>
               <Sibling>0</Sibling>
           </TRIAElement>
           <TRIAElement>
               <Parent>10</Parent>
               <Child>14</Child>
               <Sibling>16</Sibling>
           </TRIAElement>
           <TRIAElement>
               <Parent>13</Parent>
               <Child>15</Child>
               <Sibling>0</Sibling>
           </TRIAElement>
           <TRIAElement>
               <Parent>14</Parent>
               <Child>0</Child>
               <Sibling>0</Sibling>
           </TRIAElement>
           <TRIAElement>
               <Parent>10</Parent>
               <Child>17</Child>
               <Sibling>0</Sibling>
           </TRIAElement>
           <TRIAElement>
               <Parent>16</Parent>
               <Child>18</Child>
               <Sibling>0</Sibling>
           </TRIAElement>
           <TRIAElement>
               <Parent>17</Parent>
               <Child>0</Child>
               <Sibling>0</Sibling>
           </TRIAElement>
       </Elements>
   </Instance>


Old talk

New 19-bone TRIA

Basically, a 4-legged (19-bone) character would be playable if we create enough new TRAM files. A simple test can be seen here: vid + files.

An open question is how we force the head to be the 11th part when we use the auto-TRIA-creation of onisplit v0.9.52.0. I dont't know whether head view animation are hardcoded or stored inside the TRAC/TRSC.

If you test the given files you can notice that the mouse axis are wrong. This might ceome from the mistake in the dae file. Haven't checked yet. --dox

If by "head view animation" you mean aiming and looking around, then that information is in those special overlay TRAMs that are paired with a TRAS aiming screen (in that case, the keyframes of the TRAM do not correspond to a timeline, but rather to several looking/aiming directions: thus the pose for a generic direction is interpolated from several key poses). I may be out of touch, but I don't remember bone number 11 (or is it 0x0A?) as being hardcoded, i.e., there is nothing special about the head AFAIK; however, weapons are hard-coded to be attached to the right (or left) wrist, i.e., they have the same parent as bone number 0x12 or 0x0E. Hope that helps (then again, no, what I really hope for is a game-ready Iron Demon ^_^ ) --geyser 23:34, 22 May 2011 (UTC)


How about more body parts?

HERE's a quick and dirty test. (Done on PC.)

So far Oni allows 19 body parts. The vid shows a character with 20 parts. He was roughly put together (via xml) and is made of heads... (Duuno why he hasn't textures.) You can access the used files HERE.

screen_shot00080_TN.jpg screen_shot00085_TN.jpg

There are some known and unknown problems. At least he made it into the game. ^_^ As we see in the vid the 20th body part has collision data and becomes recognized by AI as a obstacle. It also reacts on incoming attacks and has self-imunity (you cannot hurt yourself by weapon and melee).

TRAM files with 20 bones are possible (via old xml method) but they refuse to become incorporated into the raw file archive. (onisplit will even stop you at the oni-file creation if you use the newer conversion method (dae and xml).

Probably this whole thing falls under the rubric "too difficult to achieve".