Showing posts with label Framework. Show all posts
Showing posts with label Framework. Show all posts

Monday, April 1, 2013

Animation loops the hard way or is there a better way?

One thing that sometimes seems to be tedious is to make an animation to loop seamlessly without jumps, and all animation packages I saw till today do not provide a way to to do this, the reason can be obvious if you are just making straight animations, but when making games an essential component is to loop for example an idle animation and have each channel behave as expected regardless of the starting frame without having to worry about the start or end of the animation loop, anyway it can start at any frame if you are in a loop and it should look as expected.

Since I couldn't find any reasonable tool for that, I ended up doing it to simplify simple looping tasks, like moving legs, arms, etc... in loops , Check a quick test here. Nothing really revolutionary to see here, but it just broke down a tedious task to the minimum, by only having a keyframe at the beginning and one in the middle the framework takes care of compensating and returning back to the loop properly without having to do it myself manually, and one of the key issues I had for many months when trying to animate simple loops was that all loops had to start at frame 0, and put my keys after, with this solution I just end up putting keyframes at any time and the framework will close the loop without me having to adjust it to look proper. This simple logic actually made me save quite a lot of time at the end, each animation has multiple parts moving and I am not showing up at this stage what the vertex animation holds, so trying to loop seamlessly all the keys and look proper was a tedious task, for example, for one of the characters it took me about 10 hours to make it look right, only because the looping started always at frame 0, ended at the end of the animation length and have so many moving parts that it was really hard to make it look convincing. Now it can easily take me half of that just by using a free mode where loops are calculated by the framework and not by my eyes. I am still wondering why there aren't any tools like that in animation packages, probably because the target audience is not games and just movies, or perhaps I haven't search enough.


Wednesday, February 13, 2013

Updated development video - shader and palettes editor


Finally I was able to make some time and published a brief short video showing up the shader editor I made during the last weekend to help me fix more shader coding bugs that I had for a few months and was taking a lot of time to debug. Also the color palette manipulation in the framework, color palettes is something that is not available with modern hardware but necessary for 2d games, so this is just an example of a color palette manipulation and how to take advantage of it to reduce the memory footprint by reusing textures and by changing a few paremeters you can change how your character looks in-game. The shading layer can also be manipulated while in game to adjust the shade strenght and I am thinking if I should enable shading coloring at this stage.

Now with the shading layer working and most of the framework working, it is time to redo all the animations of the game using this new platform!

Monday, February 11, 2013

Shaders! let's break the cycle

Shaders do make things come to life in the 3d and 2d, but it is quite challenging to have a Jack of all trades do it all platform that can help write good shaders since shaders are usually tied to game engines. I tried Nvidea and AMD solutions plus a few others without much luck.
So the cycle continues, I've been trying to improve and fix my shader for the past month, and still I haven't been able to properly finish it, it works but the quality I am looking for is still not there, it takes quite a lot of time to write a good pixel shader, especially when it takes some time to think and write code without knowing fully the syntax, try to compile it and get some syntax/coding errors, fix them and then again compile the shader, then compile the game editor or game viewer to test the result, if it doesn't works I have to go back and modify the shader, every single test takes from 3 to 5 minutes with a few more minutes of waiting for the compiler to finish plus review the outputs so it takes around 10 minutes for each test. I think I wasted too much time waiting, so what do you do when you can't find something that you need? well... I usually do something for myselft when something like that happens, and I wrote one for myself, and spent this weekend doing it, just a day and a half and I just made a realtime shader editor/compiler so no more wait! no more trying to find a tool that can handle my needs of mixing textures and many other things that I was looking for, now the sky is the limit! and here I go!.

I will post some videos of the real time shader editor with the new code for palette color handling soon! I am quite excited by the results of this week and looking forward to fix the last ones at the shader level.

Saturday, February 2, 2013

Speed! Speed! I need to be faster...

This was a very difficult week, I was able to finally integrate and run the Mystic framework in XBOX360, finally!, and I was expecting to spend most of this week trying to improve performance of the framework, but after so many tries, it seems that XBOX doesn't have enough horse power to deliver all real time calculations I have in the framework as fast as I was expecting, sometimes I had constant framerates and sometimes from no where dropped quite a lot even in Windows.

I got stuck for about 2 days just optimizing the code as fast as I could and still enjoying the real-time calculations, but finally found a road block and couldn't find a way to improve it more, so now step 2 is to start caching values and make sure that the animations run perfectly. Luckily, I came up with many last minute optimizations and a few more are still in my mind, but I am getting now solid 60 FPS in-game even in XBOX, and this is without using multi-threading in the animation modules, when I added the multi-threading support I started getting even lower framerates from time to time, due to the local variables created per thread, so sometimes caching and re-using the same variables can really help improve the speed of the calculations but makes it impossible for some threaded blocks of code, specially for vertex calculations since I am not using the GPU at this moment for that due to the physics calculations per vertex. I will publish a video of the framework running in-game pretty soon, and it is working very nicely.



Just a quick screnshot, the character in the middle is being rendered using the Mystic Framework, the others using the old skeleton model, I will post a video of the small details achieved with the Mystic Framework animation tool.

Still need to investigate why in XBOX the color replacement technique is not working in the same way as in Windows, but in this case the color of the character in the middle was dynamically changed to green/blue for testing.

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.

Friday, December 14, 2012

Time to get warmer this winter...isn't it?

It was a very busy week, with many small ideas that finally paid off,  it was a long journey since I started working on the fabric simulator but finally I was able to make it work perfectly, next is  wind and gravity modifiers but hope this will take very little time to implement. Check the latest video showing the fabric simulator in real time at my channel. Don't forget to like it! if you want to get more updates on the next things I have in mind. Almost one video a week this December, a lot of things are getting done every week.

So few lines of code were needed this week to solve the worse physics issues I couldn't fix until something come up to my mind while traveling in the train. The only sad thing is that I won't be able to release Elem3ntz! game before year-end as I was hoping for, but instead I added so many new things into the animation framework but I think it will pay offs in the long term.

Sunday, December 9, 2012

Finally enabled texture atlas animation

After so many months, finally I made time to add texture atlas animation clips in the framework, took a few days to complete the user interface and cloning options but now I can easily add texture atlas sprite animation. Check the latest update in my channel

Sunday, December 2, 2012

Animation clips references

I am quite happy today, and very busy, the last few days I've been trying to figure out how to include clips from other animations that I have made to re-use them as building blocks with minor overhead. Finally I can show some of the latest changes in the framework. This weekend I was able to solve this problem, I couldn't figure out an easy way for many months until this weekend and finally an Eureka! moment came, and found a way to run multiple animation clips inside other clips as references, making a lot easier to animate, each included clip can run in infinite loops at different rates or triggered by in-game events. This seems to be a trivial issue if you program the solution for each specific animation but when running multiple ones and trying to batch everything in one mesh it becomes quite complicated to build.

Check the video in my channel

There is still one issue related to cloths and springs, whenever the frameworks runs slowly or is delayed the vertex location can go nuts and jump all the way around, it doesn't happens as long as the game runs smoothly, so I need to implement some special logic to avoid over moving those vertices, not an easy task, but have many more things that I want to finish implementing before releasing the Elem3ntz! game.

Monday, October 8, 2012

Mystic Framework

It has been a very busy week but things are getting better with the Mystic Framwork animation system that will power my games. This is the logo for the framework for the XBOX360 and Windows.


the test play will start soon to verify that all modules are working correctly so I can focus later on puzzles and animations for Elem3ntz! game.

Monday, October 1, 2012

Inverse Kinematics...

It has been a very exciting month, decided to take a little break and see what the world has to offer, and end up playing a few games in rush mode so I can continue development quicker, I got attached to FTL (Faster Than Light) and think it is a nice game beat it with most ships but got tired after 6 days of playing it, then moved to TorchLight2 and I wanted to see what's the difference between Diablo3 and Torchlight2, I just rushed through it, and finishing it during the weekend, and it is worth every penny, but I feel I lost a lot of its content by just playing alone and just rushing to the next dungeon or area without reading much, just kill and go to the next star, didn't spent a lot of time trying to find what skill to use or what gear to use , I just kept upgrading as long as the stats were higher. I only played Diablo3 during the Beta and I didn't feel things were right, compare to Torchlight I think things are a little bit better but I do not recall much of it, not many memorable battles, maybe I should have played slowly trying to digest the content... maybe I spent too much time with Diablo2 in the past and T2 just went through a flashback, anyway, finally spent a few days doing XBLIG playtesting of many great Indie games, looking at other's master pieces inspire me to do better.

So, now back to Elem3ntz! and the animation editor, about a month I got stuck trying to find a nice way to implement Inverse Kinematics since I got a lot of trouble trying to animate characters while standing in one place, it is easier if everything is in motion but not so much when you want to pin both legs and balance the body while juggling with hands, finally I figure out how to integrate the IK system developed before the gaming sessions into the animation framework, a video will be uploaded for you to see once I finish updating the UI to enable interactive IK on screen.  I am still wondering what should be the best approach for games under XBOX, I haven't tested yet if the IK solution will run on XBOX360 without using lots of resource, probably I will find out that soon, but at least there is a backup plan for that, the IK solution can be baked easily into keyframes so in both cases the IK solution will still work with good performance.

Monday, August 20, 2012

Summer is blazing hot this year and to make the heat even higher some updated pics

Just a few snaps of the editor, the Mystic Framework will power Elem3ntz! game animations, and so far it is working extremelly well, with bones, vertex animation, cloth simulator and other small tricks under the hood.
Mystic Editor



A snap of the work in progress 2D editor, not just simple bones can be added but way more things that I will show up later in a video once I finish the saving/loading code, which will take a few more days to finish. And after that, add the fluid livelike 2d animations into Elem3ntz! game.

This is the wireframe view, basically it works like a 3D tool but designed with specific tools for 2D and each parameter can be independently animated, something I couldn't find in any free solution which is a must for very complex animations. Also includes a 2d scene animator editor for very much complex animation clips.

Thursday, July 19, 2012

Animation Composer development

I am quite exited now, made a lot of progress in the past few weeks and seems that the skeleton of the framework is somehow working now, still many things to add but I can show small peek.


Somehow it is becoming easier and easier now to understand where is it going, at least I can do some minor facial animation now with complete control of the textures and deformations, still working in a better time line display since I couldn't find anything that could fit the editor. Will post a video later when I have a complete animation rigged and animated, still is quite difficult at this moment since the preview is not running in real time due to the WPF udates that makes it run slower than 60 FPS, but without it it runs smoothly.

Sunday, July 1, 2012

Animation editor

I've been busy trying to improve the character's animations in Elem3ntz! game and became a not so easy task, maybe many of you have seen the UBI Art Framework in action with Rayman's Origins and UBI mentioned that will be open source, so far I waited around 2 years and still no news and no updates from their side, so I gave up waiting for them and I don't have the luxury of time to keep waiting forever, so I decided to make one myself.

So where am I am now? check this picture below


Still far from being a complete solution, and I couldn't see much in UBI framework video, so I make some assumptions and try to find the best way to do animations for games. So basically it will manage patches with UV texturing, probably same as UBI's, and bones. Something I haven't seen before is vertex animation so this framwork supports that, multiple textures per patch, and thinking to add soft body dynamic per vertex, this sounds strange since most of the softbody dynamic solutions do work on the whole solid, but again, this is mainly used to animate 2d patches to add small details, this is not a physics engine , but this can help animate deformations withouth actually having to move tons of bones or vertices to get the desired result, don't look yet at the section in soft body dynamics since is a WIP still.

Now thinking what is best to resolve a trival question, do a patch have bones or do the bones should have patches?,  this is a very hard question to answer by myself yet, 3d packages define meshes and you attach bones to those meshes, in 2d animation it makes sense to have those meshes defined as patches and attach bones to deform the patch, on the other side, you can also have a bone that can deform multiple patches since in 2d as you can imagine it is very likely to have multiple patches not just a single mesh, and get all of them deformed by just a single bone. So probably I will enable a bi-directional relationship between bones and patch's vertices so it can work both ways. Still need to test this solution, wondering how UBI solved this, or maybe I am over-complicating things :) , any way, things are moving slowly lately but making great progress. Elemen3ntz! game is almost completed but I want to deliver better animations for the final product, I don't want it to look like cheap flash animations.

I will post a video of the editor once I complete the bones part, which will take around 2 weeks.