Thursday, January 31, 2013

Sometimes code is so secure that I can't even access my own code...

Being trapped with security issues in the .Net framework got me stuck with no simple solution for quite many days, while trying to test the animation framework on XBOX 360 I got quite many warnings and many show stoppers, one that I couldn't figure out for almost 3 days was the confusing security implemented for classes in .Net, I know for some tools security is a must, but for a game I don't think a high level of security is needed, anyway, the content deserializer was able to properly decode all the animation and play it flawlessly in Windows but it didn't run on XBOX since I couldn't setup the same security level directly in the assembly code, so it was just telling me that the security methods that I was trying to setup didn't exists in XBOX so I couldn't set it at all, after many days of frustration found that by simple adding into each dll the following:

using System.Security;              // <-- this adds security
[assembly: SecurityTransparent]  

will clear up the dll requirements needed to be able to use reflection and call List<List<T>>
This is not rocket science nor something close to anything revolutionary, but I needed this to keep the framework simple and run it fast, finally, I was able to compile with the directives and the framework finally started to work in XBOX which really excited me. Saddly I am stuck now in another issue with the shader code which I hope to solve soon and be able to test the whole solution together. If this fits as expected I will post a video with the very smooth animations achieved with the Mystic Framework, it is not a revolutionary 3d framework since there are many, maybe hundreds or more made by tens or hundreds of people, so there is no way for a single person to compete against that, probably most people think that 3d is the future and that's where everyone is going, but I feel that there is a lot to gain also in the 2d arena using 3d technology, so I hope to make a niche new market with this solution. Rayman Origins by Ubisoft did a great step towards this direction, so I hope to achieve the same level at the Indie level, if not, well at least I tried.

Monday, January 21, 2013

The color palette of the 21st century...

Not so many years ago, previous hardware used color paletter to display colors and it was relatively easy to swap colors and create animations like rainbows, well with technology evolution it came as a thing of the past and today it is quite cumbersome and complicated to replicate the same effect, even color replacements can be quite difficult to achieve as in old generation hardware. I spent a week thinking how to achieve the same and searched everywhere for a good implementation that will have the less impact as possible, well as a matter of fact I couldn't find any code but just a bunch of ideas. Even something as simple as creating blending effects became a nightmare in a matter of days, like linear burn A+B-1 blending, can be quite complicated to achieve in modern hardware and I am still unable to perform this in a way that memory, bandwidth and speed are not compromised, since the framework has to be very fast I came up with some solutions in my mind and will post some videos soon. Sometimes I think I just only need one command to do whatever I want, but that command doesn't exists in the pipeline, or is available in the next generation hardware.

So far color replacement is working, but I haven't tested it yet in XBOX in game, for only one color, adding more colors shouldn't be that difficult but there are quite many restrictions with the technology available in XNA and pixel shaders v2 with XBOX, like the number of parameters that can be passed through the shader, so using an image to remap color palette seems to be better solutions but doing it in RGB color space seems to be pretty bad if you are using different shades of the same color, so HSV comes to the rescue, but the number of operations performed to convert each pixel to HSV can be quite taxing to the GPU of the XBOX, so hopefully I can squeeze as much juice as possible from the GPU and implement a color palette, stay tunned.

Monday, January 7, 2013

Sometimes going back to traditional animation gives better and juicy results

Finally, last weekend I found myself with lot of things to animate, now that the framework is almost ready and mostly working except for the audio module that is only half implemented. I decided to re-take again the juicy part, which is to make the eye candy and character movement so I can test if the framework works as expected.

A week ago, when talking about juicy things that make your game looks better I found Juice it or lose it video, and how to make simple things look better by adding small animations, or small things that give more feedback to the player and make the game experience a experience of the 21st century based on 20th century technology. So I decided to animate the Cat's character tail that was a static 2d sprite with springs simulation to wave it but it didn't look nice enough for me, so I tried different 3d and 2d techniques without much success, I couldn't make it look good enough given the time I wanted to spend on it, so doing it in 3d requires a lot of work modeling and animating all the vertices the way I wanted, and 2d polygons do not deform very well with a shape like a tail, so after a few tries I decided to go back to the traditional frame by frame animation, and make about a dozen frames like the picture below.

You can check the progress in this video from a very rought sketch to a clean final animation.

I am still wondering if I can make a 2d patch deformed polygon that can show 2d textures with appropiate deformation and corrected perspective in 2d, but so far I haven't been able to find a good way to do it without having to invest a lot of time and effort, given that, 2d traditional animation seems to be the right path in this case.