Post by olganix on Dec 8, 2017 21:48:16 GMT
Hi.
Lazybone and I have done lot of work to have XmlConverter and "what values is for" on file for effects :
-bsa: configuration file (look like .bac), witch could use eepk, define a projectile, its hitbox, the display on impact on ground, wall, enemies.
-eepk: configuration file for effect, witch could use emp, etr, ecf, emo, ema, emm, and texturesEmbPack.
-emp: for particules generation.
-etr: for making 'traces', sort of extrude things.
-ecf: for colorise the character (like 'poison' effect).
-emo, obj.ema and mat.ema : allready done with conversion into .emd, .esk, .ean, and mat.ema.xml.
Please see, Lazybone's XV2_Xml_Serializer and Olganix's XenoXmlConverter to have more information about it, and link on tutorial for each.
In this post, we will focus on Etr.
For Etr, the tool to convert is Olganix's XenoXmlConverter.
Don't forget to keep originals files to reverse a strange behaviour, or for make comparaison !!!
For people witch don't know yet, Etr are in xxxxx.tbind.emb file, so you have to unPack with the last version of EmbPack2 (link).
So, you have to repack the extracted folder each time you change the etr file.
As it's a little bored to do conversion and repack each time, I give you a example of batch to do the job each time you execute it : XXX.cmd (link). Don't forget to adapt paths in file before use it !!!
Notice: if nothing change, there 2 questions:
-did you don't forget to use the batch ?
-did the Xml don't have a error of synthax (tags not well close by sample).
check the date of file, or use the batch in cmd.exe to see errors, to solve this kind of problems.
Notice: we use in game the offline->training to test more easely the files. when you make a change and repack, select "Get back to characters selection" (not sure it's the exact name because my game is not in English) to have will the reload of the emb if you use the Eternity's patcher.
Notice: The only thing to know about eepk here is :
For Etr, it's make a link between :
-the tbind.emb witch have the etr,
-the trc.emm witch have materials,
-and trc.emb with have the texture.
And define a effect to play.
(To know more about playing a Effect, you have to look eepk tutorial, and look after .bac and .bsa files).
Notice:
-all times are in frames.
-all angles are in degrees in the Xml.
-all distances could be considered as meters.
-all Uv are based on one repetition for [0.0, 1.0].
--------------------------------
For this example, we will use only the skill\SPA\000_GOK_KMH (Goku's Kamehameha) Effect_ID 3 (witch is the kmh with no charge) and the kmh_Beam.etr by simplify 000_GOK_KMH.eepk (link).
The other Effect (id 0, 1, 4, 5, 10) are removed to not have interferences, like "charged kmh".
The only effects witch is visibled, but it's not relative to etr, are :
-the ray-shadow
-the dust clouds/smokes.
-effects at the impact like projected rock, hit aura, ...
The kmh_Beam.etr (link) is composed of 3 part:
-a plane witch is extruded
-a cylinder witch is extruded
-a small cylinder, with less resolution, witch is extruded.
For this tutorial, we will focus on the first part.
------------- Fast Xml review :
Etr is a shape witch is extruded on the axis of the effect.
This create a animated geometry witch use a material from emm, some textures, and some animations.
The Xml is composed of 2 parts :
-Etr parts, witch have all parameters, animations and refer to some TextureUnits to use.
-TextureUnit definition, witch is define how to use a texture, and add some scroll animations.
------------- TextureUnit :
On this simplified case, it's use the textureUnit index 0 witch use this texture :
If we take a look on it:
<TextureUnit EmbTextureId="0">
<TypeRepetition U="Wrap" V="Wrap" />
<Filtering Min="Linear" Max="Linear" />
<unk_0 u8="0x0" />
<unk_2 u32="0x0" />
<unk_3 u16="0x0" />
<ScrollAnimation UseSpeedInsteadKeyFrames="True">
<ScrollSpeed U="0.000000" V="-0.050000" />
<unk_2_0 u32="0x0" />
<unk_2_1 u32="0x0" />
<unk_2_2 u16="0x0" />
<Keyframes />
</ScrollAnimation>
</TextureUnit>
Saddely, there still have some unknow values. I keep informations in Xml about it if people want to try to find "what is for".
The EmbtextureId, is the index of the texture to use in .trc.emb file.
(Notice: the last embPack.exe add the index of each in comments to fastly find it)
In TypeRepetition and Filtering there is strange "2" in certain case, is because I didn't found the difference of behaviour.
Be sure the version with no "2" is the most used on all files.
For ScrollAnimation, there is two case: using ScrollSpeed parameters, or using keyframes, depend of UseSpeedInsteadKeyFrames.
-Speed is in case of you just need to scroll a full texture in time.
-Keyframe is in case of you have few images in the texture, witch could make a animation in time by display them each time. Like a explosion with sprite.
For ScrollSpeed, the speed is UV coordinates by frame (Uv coordinates is based on [0.0, 1.0] for one repetition).
For KeyFrames,
<Keyframes>
<Keyframe timeIndex="0" scroll_u="0.0" scroll_v="0.0" scale_u="1.0" scale_v="1.0" />
<Keyframe timeIndex="18" scroll_u="0.0" scroll_v="-0.05" scale_u="1.0" scale_v="1.0" />
</Keyframes>
you could have only one keyframe for just setup.
A sample, if you have 2x2 images in the texture, you should use scale_u = scale_v = 1/4 = 0.25,
And use in time, 0.25 or 0.0 on scroll_u and scroll_v to change of image to display.
------------- Etr Part :
The 2 main things to know about Etr are :
1) There is 2 states in the effect :
-creation of the extrude witch the player can't move because of the character animation. I call this state "Extrude" to make the difference in parameters.
-a "Hold" state, witch the player could move.
it's a little bit simplify because I think it's depend of the duration of character animation, but it's to better understand.
2) for performance reasons, the extrude is like as a part of 3d tails, is done by 2 parts:
(No jokes on my draw ! i'm not a graphist at all . if someone want to make a new one ... or a gif !!! ... please, do it)
-there is a extended part witch make the effect smoother. I will call it "End" of Etr.
-there is a fixed part witch have some fixed point. We add new points after End part make one step, so it's take many frames before new points. I will call it "Middle" of Etr.
The time between adds of a new serie of points (because of duplication of shape's points), I call it "step".
The performance consideration is to not moving all the points each frame.
Notice, in general 3d's tails, there is the second extend part (a third part), witch make the disparition of the tails smooth. It's the same way, it's just the middle points are removed sometime.
On all Middle part, one step is one Uv repetition in V (without consider the scrollAnimation).
The End of Etr should also be one Uv repetition in V.
Let's see some parameters :
-TimeStartExtrude : the time for beginning the extrude
-DurationExtrude : how much time the extrude continue.
-UVPauseOnExtrude : if true, ScrollAnimation will not work in Extrude state.
-NumberFrameForNextSegment : time between each step. the maximum seam to be 127 frames (because of the number of bits in etr file for this parameters, and the fact you could have -1).
-DoublePointOfMiddleSection : if true, it's seam to add some middle between each step (difficult to confirm).
after the "Extrude" state, we pass to the "Hold" state :
-DurationHold : with this, you could keep a kmh and make some others, so have many kmh.
Notice: In eepk, AllowCancel should be at 0 to see "Hold" more longer. And you should stop animation witch make Color_Factor.A at 0.0.
(I use Red for Color0 to better see)
-UVPauseOnHold : if true, ScrollAnimation will not work in Hold state.
Notice: there is some flags into Eepk file witch could change a lot the behaviours in Extrude and Hold states, about orientation, position, and live kmh direction.
I try to keep a simple/understandable example. Take a look in Eepk tutorial to check if there is some information about it.
after, we have some usual transformations, from bone attachement or not.
-AttachedBone Name="TRS": The effects could be attached to a bone of character or of a Emo.
-PositionOffset X Y Z
-Rotation Pitch Yaw Roll
-PositionExtrude_Z : it's a position (after the positionOffset direction) of the start of khm on the kmh axis. Positives values go front.
-ScaleShape
-AutoOrientation : active or not AutoOrientation.
About autoOrientation, we have to say few things about the shape :
<LineShape>
<Point X="-0.000000" Y="1.000000" />
<Point X="-0.500000" Y="0.866025" />
<Point X="-0.866025" Y="0.500000" />
<Point X="-1.000000" Y="-0.000000" />
<Point X="-0.866025" Y="-0.500000" />
<Point X="-0.500000" Y="-0.866025" />
<Point X="0.000000" Y="-1.000000" />
<Point X="0.500000" Y="-0.866025" />
<Point X="0.866025" Y="-0.500000" />
<Point X="1.000000" Y="0.000000" />
<Point X="0.866025" Y="0.500000" />
<Point X="0.500000" Y="0.866026" />
<Point X="-0.000000" Y="1.000000" />
</LineShape>
Here, if AutoOrientation is on, the X-axis will be target the camera by a rotation from kmh axis.
Else, X-Axis is left of Character/AttachedBone (for positive values), and Y-Axis is bottom.
Notice: Uv coordinate, more precisely the U, is build by putting 0.0 on the first point of LineShape, 1.0 on the last, and adapt other points by subdivisions.
For Path and EndPoint, it's very complex. you better don't touch it. but, if you are curious:
<Path>
<Point WorldScaleFactor="1.000000" WorldScaleAdd="0.000000" WorldOffsetFactor="0.000000" WorldOffsetFactorb="0.000000" />
</Path>
<EndPoint WorldScaleFactor="1.000000" WorldScaleAdd="0.000000" WorldOffsetFactor="0.000000" WorldOffsetFactorb="0.000000" />
It's about some scale and offset on values witch depend of the position of the start and end of kmh from center of the scene.
Path add intermediaires Point.
I think it's to make like thunder strike effect. but I can't have to relevant way to do a thing clean.
After, we could pass on visual parameters:
-EmmMaterial Id="4" : index of the material in emm (last XenoXmlConverter add index in comment).
-Color0 R="1.000000" G="1.000000" B="1.000000" A="1.000000"
-Color1 R="1.000000" G="1.000000" B="1.000000" A="1.000000"
-NoDegrade value="True" : if false, you should have degrade between the 2 Color. Color0 at U=0.0, Color1 at U=1.0.
-DisplayMiddleSection value="True" : you could hide the Middle part of Etr, and just see the End of etr.
-TextureUnit Index="0" : refer to the second part of the file with TextureUnits.
Now, the Animations :
There is 2 kind of animationsList, AnimationAList and AnimationBList.
AnimationB is a group of AnimationA, with one unknow parameters. So we don't know a lot on it.
For animationA, it's about only one Parameter (as I see in values on all files) "Color_Factor" and it's R,G, B, or A components.
"Color_Factor" it's about animate a value witch will be mutiply on the Color0 channel (may be also on Color1 when it's used). (So, you must have a value != 0.0 on the channel of Color0 to see the animation).
<AnimationAList>
<Animation Parameter="Color_Factor" Component="A">
<StartAnimation At="EndWithNoInterpolation" />
<unk_0b u8="0x0" />
<unk_1b u4="0x1" />
<unk_1 u8="0x9" />
<unk_2 u16="0x0" />
<Keyframes>
<Keyframe TimeIndex="0" Value="1.0" />
<Keyframe TimeIndex="14" Value="1.0" />
<Keyframe TimeIndex="18" Value="0.0" />
</Keyframes>
</Animation>
</AnimationAList>
<AnimationBList />
There is still many Unkwon values.
Hope the knowed values will be enougth to do some good mod, or someone would be motivate to continue and find the last.
Have a good day and happy modding !!!