Jump to content

Krane is sort of broken


MF99K

Recommended Posts

so the anim decompiler has been having some glitches. Sometimes the spriter files are completely fine, sometimes they're, well, like this2016-03-15.png.953a58bc35605d2b139fe8a54

 

Using Krane has kind of been a bit of a toss up, so I'm wondering how many people have had similar issues, and if anyone has any idea how to fix this

Link to comment
Share on other sites

Yes, I know this issue (especially with sleep animations). Most symbols are just mirrored, so changing their rotation by 180° (pi radian for all ye scientists) should work fine.

EDIT: I derped, place a minus in front of the scale.

Link to comment
Share on other sites

10 minutes ago, Mobbstar said:

Yes, I know this issue (especially with sleep animations). Most symbols are just mirrored, so changing their rotation by 180° (pi radian for all ye scientists) should work fine.

If you knew there was a consistency to the issues, you could've just told me :P.

Could you give me one example where this definitely happens? I'll try to look into it when I can.

(by the way, reflection by an axis isn't the same as a 180° turn; picture a triangle where each vertex has a different color, any rotation will preserve the counterclockwise listing of colors, except for a change of starting point, but a reflection inverts it)

Link to comment
Share on other sites

4 minutes ago, simplex said:

 

Could you give me one example where this definitely happens? I'll try to look into it when I can.

 

the tigershark as pictured, and pretty much everything I've tried decompiling with the exception of beefalos and butterflies.

Link to comment
Share on other sites

8 minutes ago, simplex said:

Could you give me one example where this definitely happens? I'll try to look into it when I can.

(by the way, reflection by an axis isn't

The rabbit also does this.

And: Woopsie! I corrected the previous post.

Link to comment
Share on other sites

9 hours ago, mf99k said:

this is one of the attack animations. the idle animations are often the only ones that aren't broken

Then please provide which of the tigershark builds is the one in question and the name of at least one faulty animation.

Link to comment
Share on other sites

Just now, simplex said:

Then please provide which of the tigershark builds is the one in question and the name of at least one faulty animation.

tigershark_ground_build

most of the animations but especially:

  • eat_loop
  • eat_pre
  • hit_side (pictured)
  • sleep_pst
Link to comment
Share on other sites

@mf99k and @Mobbstar

Does that look better?

LJYYuJp.png

I found the problem, thank you both for your help. If you're interested in the mathy underpinnings of the issue, I included an explanation in the spoiler below.

Spoiler

When applying a geometrical transformation built by a rotation and scaling, the usual convention is to first apply scaling and then rotation. I assumed Spriter followed this convention, and my experimentation with Spriter seemed to suggest that was indeed the case. I was wrong, Spriter does it the other way (rotation first, then scaling). Since matrix multiplication is usually not commutative, this meant decompilation often would provide incorrect results; in fact, the decompilation results would only be exact when both the "x" and "y" scalings were equal (which is why "idle" animations were usually fine). The error was particularly large when the scalings had opposite signs, which is why the animations were particularly wrong when reflections were involved.

I just pushed a new version of the ktools (version 4.3.0) to GitHub. I'll publish this new version to the forums as soon as I compile the Windows executable, which will likely be today (but since I have to redownload and reinstall Visual Studio it's possible I'll only get it done by tomorrow).

Link to comment
Share on other sites

Just now, simplex said:

@mf99k and @Mobbstar

Does that look better?

LJYYuJp.png

I found the problem, thanks you both for your help. If you're interested in the mathy underpinnings of the issue, I included an explanation in the spoiler below.

  Hide contents

When applying a geometrical transformation built by a rotation and scaling, the usual convention is to first apply scaling and then rotation. I assumed Spriter followed this convention, and my experimentation with Spriter seemed to suggest that was indeed the case. I was wrong, Spriter does it the other way (rotation first, then scaling). Since matrix multiplication is usually not commutative, this meant decompilation often would provide incorrect results; in fact, the decompilation results would only be exact when both the "x" and "y" scalings were equal (which is why "idle" animations were usually fine). The error was particularly large when the scalings had opposite signs, which is why the animations were particularly wrong when reflections were involved.

I just pushed a new version of the ktools (version 4.3.0) to GitHub. I'll publish this new version to the forums as soon as I compile the Windows executable, which will likely be today (but since I have to redownload and reinstall Visual Studio it's possible I'll only get it done by tomorrow).

would I need to uninstall ktools first and then install the new version or will it work as an update?

Link to comment
Share on other sites

Just now, mf99k said:

would I need to uninstall ktools first and then install the new version or will it work as an update?

You'd need to reinstall it. If you're on Windows, you can just use the new executables I'll upload. If you're on Linux or Mac, you'll have to recompile them (though the steps in installing the dependencies, such as ImageMagick, can be skipped).

Link to comment
Share on other sites

@mf99k

Maybe I should clarify: you don't need to uninstall the previous version (by "install", I presume you meant running "sudo make install" under Linux or Mac, since otherwise there's no proper installation and you just have a folder of portable executables). Installing the new version will replace the previous one, no previous steps are necessary. If this is what you meant by update, sorry for causing any confusion.

Link to comment
Share on other sites

42 minutes ago, simplex said:

@mf99k

Maybe I should clarify: you don't need to uninstall the previous version (by "install", I presume you meant running "sudo make install" under Linux or Mac, since otherwise there's no proper installation and you just have a folder of portable executables). Installing the new version will replace the previous one, no previous steps are necessary. If this is what you meant by update, sorry for causing any confusion.

it was, thanks for clarifying ^^

Link to comment
Share on other sites

1 hour ago, simplex said:
  Hide contents

When applying a geometrical transformation built by a rotation and scaling, the usual convention is to first apply scaling and then rotation. I assumed Spriter followed this convention, and my experimentation with Spriter seemed to suggest that was indeed the case. I was wrong, Spriter does it the other way (rotation first, then scaling). Since matrix multiplication is usually not commutative, this meant decompilation often would provide incorrect results; in fact, the decompilation results would only be exact when both the "x" and "y" scalings were equal (which is why "idle" animations were usually fine). The error was particularly large when the scalings had opposite signs, which is why the animations were particularly wrong when reflections were involved.

 

 

The fact that I understand this without google makes me feel like a mathematician.

Out of curiousity, can you name an example of the "usual convention" being applied?

Link to comment
Share on other sites

49 minutes ago, Mobbstar said:

Out of curiousity, can you name an example of the "usual convention" being applied?

You can see it being referred to here* and here, for example. Though perhaps calling it usual was an overstatement, when looking for examples to give you I found a fair share of both conventions. When you're dealing with matrices directly the convention you pick doesn't matter much as long as you know what it means, it's when you're decomposing a matrix that you have to be careful with the convention to be picked (not that I'm a great example in doing that :P).

* Here matrices are being multiplied in the opposite order (with matrices on the left representing operations applied first); note scaling is on the left, but the explanation refers to scaling being applied first. This follows from representing vectors as row vectors (applied to the left of matrices) instead of column vectors (applied to the right of matrices). This is yet another example of a convention that may be followed.

Link to comment
Share on other sites

10 minutes ago, mf99k said:

@simplex In the meantime I wanted to work on some reskins and I was wondering if I would have to redo the images or primarily just the spriter file for the decompiled projects

 

Only the spriter file, i.e. replacing the scml is all you'll need. Just don't pick as an output directory the one with your reworked images, of course, because then they'd be overwritten; use any dummy output directory and copy the scml from there.

Link to comment
Share on other sites

I'd just like to give a minor update on the forum upload of version 4.3.0.

I'm having some issues with the packaging, with the path to the ImageMagick modules given by environment variables not being respected. After checking the latest ImageMagick's source code to confirm they should still be respected, I believe this is caused by a mismatch in the visual studio version used to compile ImageMagick and the ktools. I'm currently in the process of installing previous MSVC versions to see if this fixes the issue, and if not I'll try older ImageMagick versions, but in short this means the forum upload should be somewhat delayed.

For those who don't mind compiling from source, as I had mentioned the GitHub repo has already been updated.

Link to comment
Share on other sites

@mf99k, @Neutral_Steve and @Mobbstar

Version 4.3.0 of the ktools has been uploaded to the forums.

And yes, the packaging issues I had mentioned were solved (quicker than expected) by using the same Visual Studio version as the one used by ImageMagick's official dll releases. As mentioned in the updated description for the forum upload, the binary Windows release now requires the 2013 edition of MSVC's redistributable package (for more information, check the updated description).

Link to comment
Share on other sites

7 hours ago, simplex said:

@mf99k, @Neutral_Steve and @Mobbstar

Version 4.3.0 of the ktools has been uploaded to the forums.

And yes, the packaging issues I had mentioned were solved (quicker than expected) by using the same Visual Studio version as the one used by ImageMagick's official dll releases. As mentioned in the updated description for the forum upload, the binary Windows release now requires the 2013 edition of MSVC's redistributable package (for more information, check the updated description).

Does this fix the issue with exporting an animation with multiple animations with the same name?

Link to comment
Share on other sites

3 minutes ago, Kzisor said:

Does this fix the issue with exporting an animation with multiple animations with the same name?

It would have no effect on that, no. But care to catch me up? That's the first I've heard of it. Animation names are supposed to be unique ids within an animation bank, so how would that issue even arise? Are you trying to export several animation banks together?

EDIT: Actually, a better question would be: what does "an animation with multiple animations with the same name" mean?

Link to comment
Share on other sites

11 hours ago, simplex said:

EDIT: Actually, a better question would be: what does "an animation with multiple animations with the same name" mean?

Some animations have two "idle" animations, I will upload a zip file which contains a wall which has this issue.

This problem plagues a lot of the DST animations.

wall.zip

wall_hay.zip

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

×
  • Create New...