Malus Containment - 10/10/2015 - Not-so-brutal workarounds

View previous topic View next topic Go down

Malus Containment - 10/10/2015 - Not-so-brutal workarounds

Post by Landy on Sat Oct 10, 2015 5:15 pm

If you don't already know, Malus has been on hold thanks to a pretty nasty bug in Unity. For a simple explanation, whenever a GameObject is scaled negatively, it's rotations completely break.

What's a GameObject used for? Well, in older versions of Witness Protection, an empty GameObject was used to dictate where bullets come from when fired from your weapon. In Malus, that system is exactly what we use.

This worked in Witness Protection because it was a 3D game, and all we had to do to re-position models was to do a bit of rotation.
Malus, on the other hand, is a 2D game, which means that things aren't as likely to change direction via rotation. To flip Clyde around, we relied on scaling his model negatively. This makes it so he's literally "flipped" the other way.

Sadly, thanks to that Unity bug, stuff breaks when we scale it negatively.
I've placed a cube object at the front of Clyde's pistol for an example.


Works fine here, unflipped...


...but when Clyde is scaled negatively, the cube's collider doesn't rotate properly.

One day, my girlfriend (Cannibun on the forums) gave me an idea: I could make a seperate model and seperate animations for whenever Clyde would be flipped. I initially thought this wouldn't work, as the only method I knew to mirror models could only mirror geometry and not the skeleton or animations. This meant I would have to precisely and painstakingly re-create every animation for use on the flipped model. As such, we decided to take it the easy way and just waited for Unity to fix the bug.

Obviously, the bug wasn't (and still hasn't been) fixed. I grew impatient, so I decided to try and revisit Cannibun's idea.
The modelling software I use is called Milkshape3D. I got it a long time ago. It's more fit for Quake 3 or Half-Life, but most somewhat-modern formats aren't an issue with it.

At first, I tried flipping the geometry, then rotating the skeleton, which broke the animations pretty badly...


A bit later, I noticed an option in the "Tools" menu of Milkshape3D:


I then tried using the tool, thinking "No, there's no way it's this easy..."


And to my surprise, it worked!!


But I had a feeling it wouldn't work as well with mirroring anima-

...it really DOES work wonders!

So, in a nutshell, Malus should be back on track as soon as Stryke puts aside whatever mad science experiment DEAD PROJECT he's currently working on.

We'd also like to raise awareness to the bug, as it apparently hasn't seen a fix in 2 years, maybe even longer.

-Landy
avatar
Landy
Developer

Posts : 46
Points : 1093
Join date : 2015-04-21
Location : Probably behind you

View user profile

Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum