Recent Posts

This week I started working in a new company, my previous working place wasn’t so development focused, while now, at a consulting company, the abundancy of developers around me is no surprise at all.

Academically and professionally my development focus was always .NET, majorly web development, so there was not much space to dig around other technologies due to my personal project’s fields belonging in game development.

This first week was all about training. Training in NodeJS. Training in AngularJS. Training in Knockout.  Training.

Recently I wrote a post introducing the Elastic Search engine and how to install it. Now it’s time to move on and start doing some funny things with this powerfull tool.

If you follow the Part 1 of Elastify your Search post you are able to:

  • Start ES engine by typing elasticsearch on the terminal
  • Get a JSON response with basic ES information when accessing localhost:9200 on the browser
  • Access Head plugin by typing localhost:9200/_plugin/head

Now let jump into create and search for data in Elastic Search

Tags

The Bug Effect

All of us have had, on an occasion or another, a co-worker (or even ourselves) changing a piece of code and reintroducing a bug in the project.
The bug then gets to the production environment and it’s reported.

Team reaction: “Damn! I’ve already corrected that”. “Oh, I just missed an if statement”.
Client reaction: “This shit does not work”. “It gets worse with each update”.

Quest editor in Unity3D

For my first Unity3D custom editor I chose to make a quest editor, most simplified as possible for my needs but as much customizable as possible to make quest creation and editing simple for non programming developers.

This is the required example of quest code for this post:

quest

As our lives move on, it has been hard to keep up with updates on our side projects so we hope we can explain you what has been happening.

As you may recall, one of our projects we mentioned here was Checklist, a simple checklist for developers of any platform whose main goal was to develop a platform in our behalf, while we would learn new tools and try others.

As time passed, we found other platforms that did the same (or sometimes even more) and the fact that some of us weren’t able to respect the deadlines, it was decided to stop its development.

But as people say ”when one door closes, another opens” and so we started a project called TourGo.

It has been a while since my last blog post about Xamarin and I feel this is the time to write something more about it. Although I haven’t been working with Xamarin for some months, I will write here some questions people often asked me when I was full-time working with it:

Have you used any java library directly? How easy is it to use them?
First of all, let me say that Xamarin itself created a github account with many samples some of which have Android API wrappers for C# of popular java libraries (ex: ActionBarSherlock) which is worth checking out.

One of the requirements I had concerning the project was its feature of uploading files from the device to the server and I knew it wouldn’t be easy especially due to the Documents API introduced in Android 4.4.

In this post I will show how I organize my node.js applications. I’ll start explaning the nodejs principles, with examples.

NodeJs Principles

NodeJs follows the next principles:

Unix philosophy

  • “Small is beautiful”
  • “Make each program do one thing well”

Keep It Simple, Stupid (KISS) principle.

“Simplicity is the ultimate sophistication.” – Leonardo da Vinci

I think I already gave the idea of the way to structuring a node application. Creating microservices to do specific work, separating the complexity and decoupling the responsibilities.

One of the biggest problems that people have with Nodejs is the maintainability of the application. That’s the reason why is better to have 3 different micro applications than a big one.

Two months ago during one of my normal days at the office I was told that there was a private school looking for android developers that were available to teach. That school needed someone for 3 times a week (for a 66 hour course) and my boss asked me if I wanted to take the opportunity. The course consisted in a 24h Java introduction, 24h for Android and 18h for a project.

In this post I’m gonna talk about Cordova and its integration with Visual Studio. For this I created a simple bootstrap project using Cordova, Ionic and Typescript for people that are starting this adventure like me.

What is Apache Cordova?

Cordova it’s a open source platform to develop mobile applications with Web Technologies (Javascript, Html5, CSS). It’s possible to install plugins to access the device native api. For example, if we want to access the camera, we just need to install the camera plugin.

Tags , , , , ,

Animation tool, part I

Once a wise man said a very wise sentence:

You will eventually regret any use of Euler angles.

His name is John Carmack, and today I can say that I couldn’t agree more with him, why? Let me tell you why.

The next step of my game development project is to develop an animation tool, since I’m not that good with art I always though that it would be better to create each separate part of my characters and animate them separately, instead of creating the different sprites for each animation frame they had, all was going well until I stomped on a huge rock, which was that? Transformations without matrices!

My initial idea was to develop simple tool for a simple game with certain components for the development tool, one of those components is a skeletal animation tool, which on my project is called Puppeteer. I wanted to do this in a way that I could avoid the use of matrices, instead using vector and float data for translation, scale and rotation, this was going well until the problem of the skeletal animation showed up, it’s much more difficult, if not impossible, to achieve a good skeletal animation avoiding matrices, and once the mathematical principles behind this are understood they proved to not be so difficult as they seemed, instead of carrying the values of translation, scale and rotation on 3 different properties and trying to reinvent the wheel combining them with dodgy equations it’s much better to have them stored in matrices and using the standard approaches that people who know much more than I do developed.

Let me give you a brief explanation on how the matrix transformations work in a simple skeletal animation

You see those pointy objects with a short orange side and a long blue one? Those represent the bones of the character.

Each one of those bones can contain one parent and can contain multiple children, the bottom bone for example is the root bone, since it contains no parent, and is the parent element of two other bones, that will be the parent of other bones and so on.

Each bone contains a matrix to represent it’s transformation in the world, and the reason for the relationship between them is that the parent transformation influences the children transformation, every time the parent rotates, scales or moves that will be reflected on the children.

Here’s an example of what happens when a bone is translated and rotated

bones2

As you can see al the children were moved, but still have their origin in the previous bone end.

To have this effect we require a simple matrix multiplication, so let’s assume we want to calculate the matrix transformation applied to a second bone on the hierarchy, the calculation would be:

TransformationMatrix = ChildBoneLocalTransformation * RootBoneTransformation

The “ChildBoneLocalTransformation” would be a simple matrix formed using translation, scale and rotation, while the “RootBoneTransformation” would be the same matrix, with the roots data, and an extra value added to the translation component of the matrix, given by the bone length, without this detail all the bones would overlap each others.

On my next post I plan to show a video of the animation tool in motion and the steps to attach images to the bones showing how a character animation can be created. Unfortunately I didn’t get the time to prepare a more presentable demo of the editor, and it’s better to divide these posts into smaller parts.