Oni Central Forum

A forum for the Oni community

You are not logged in.

#1 02/03/19 13:02

s10k
Member
Registered: 01/14/07
Website

TRAM Speed up animation XmlTools patch

So I wrote a XmlTools patch file that allows anyone to speedup any existing TRAM animation by deleting frames.

Iritscen helped me a lot with this, so I really thank him. Also thanks to Delano for the input how the TRAM works.

You can download the patch file here:
http://mods.oni2.net/node/354

TRAM Speed Up Animation v1.0 written by s10k

===========================================================================
What is this?
===========================================================================

This is a XmlTools2 patch file that allow you to easily speed up any
existing animation (TRAM) in Oni.

===========================================================================
How do I use it?
===========================================================================

The easiest way to execute it is to add XmlTools to your PATH
variable and put the TRAM.xml files the same directory of the patch
file.

Then inside the directory with the xml files and patch file do
(in a console):
XmlTools -p TRAM_speed_up_animation.patch

The files should be patched and you should get animations that are
~25% faster than the original (by default).

You can adjust the speedup of the animation editing the patch file (line 13):
var FRAME_JUMP = 4;

This variable controls the frequency with each frame is erased
(the default value, 4, deletes a frame every 4 frames), if you set it to
2 you should get a ~50% faster animation and so on.

Be aware that setting the erasing window too small like 2 can cause
interpolation issues in the animations.

===========================================================================
How it works?
===========================================================================

It deletes a frame every [FRAME_JUMP]. This makes any animation faster.

The child elements that get deleted in the XML file are:
<Heights>
<Velocities>
<Positions>

The following ones get updated:
<Attacks>
<Particles>
<Rotations> (the more complex, explanation inside of the patch file)

You can check how the patch works appling it to the included sample xml
file, the do a diff with the original file and the patched one.

===========================================================================
It worked but the animation, trembles a little. Is it possible to fix?
===========================================================================

Sometimes it is possible to fix. You need to adjust the <Interpolation>
<End> element to something like 5 or 6.

Like this:
<Interpolation>
<End>6</End>
<Max>65535</Max>
</Interpolation>

===========================================================================
Does it adjust everything automatically?
===========================================================================

No, not all the elements are adjusted automatically have a look at the
"How it works?" section to know which are adjusted.

While something like <Attack><Start/><End/><Attack> is handled, something
like <Invulnerable><Start/><End/></Invulnerable> is not, though this should
be very easy to add in the included patch file, if you need to.

s10k, 03/02/2019

Last edited by s10k (02/03/19 13:02)

Offline

#2 05/12/19 14:05

s10k
Member
Registered: 01/14/07
Website

Re: TRAM Speed up animation XmlTools patch

Update:

===========================================================================
Changelog
===========================================================================
1.1, 12-05-2019
- Added <Footsteps> element support
- Now we do not delete the last frame (OniSplit gave error while
importing when we did so)
- Fix script crash when <Attacks> element is not found
(some TRAMs do not have it)

Thanks Iritscen for uploading.

Last edited by s10k (05/12/19 14:05)

Offline

Board footer

Powered by FluxBB