Pages

  • Twitter
  • Facebook
  • RSS Feed
Showing posts with label video games programming. Show all posts
Showing posts with label video games programming. Show all posts

Monday, April 7, 2014

Hi everyone!!!!

Today is concept art day!! yehaaaa!! And I bring you the first level sub-boss first concepts. They have been done by M!ke and I have to say they are fu**ing amazing!! 

The first idea was a sub-boss for the first level of the game. Something bad-ass, something every shoot'em up game should have (in my opinion). A mecha. I love mechas, I love robotech, evangelion and so on. So I gave M!ke the specs and references for these task.

The first thing I asked for was the head. I wanted to see how the head of the boss was going to be so the entire mecha looked like the head. In a previous post is the awesome result, click here to see it.

The references are clear, the anime and manga style is all over the concept art. I love the protectors on the jaws and the little fangs of the mouth.

The next step was the body. I gave M!ke some references and tips. Big feet and forearms, square and sharp edges for the hole mecha, devil-like style and so on. The result? A first sketch with two kinds of leg design and a very promising overall look. :-)


Oh my god! I love it! The two versions of the legs are awesome, but very different so I was "forced" to pick one up. What do you think I chose?

After choosing the leg style and giving some corrections to them the next step was the rest of the body, the details, the shoulders etc.

New specs, more changes, a lot of talking and sketching and some colors. The concept keeps going and here is the new one :-)


Nice!! the coloring is great, the forearms...LOVE IT!, the little wings need some work, but we0ll get to that. The sword? Awesome!! What do you think about the progress of the sub-boss concepts? 

With some more tips, specs, instructions and hours of work the shoulders are modified and the right arm is done.


Ok! I think it's awesome but there is still a lot of work and it will get better and better. Let's give it a brake. Let's think and talk about it. In the next part, the full body concepts...WITH GUNS!! AND SWORDS!!!

Thank you very much for reading us.

Keep updated in our twitter and indiedb accounts.

Warp Space


Bye!!!

Wednesday, March 12, 2014

Hi everyone!!!

One of the most difficult thing for a programmer to understand in the early stages of your 3D video game programming career is all the "rotation" world. I mean,  2D? Piece of cake. Just use Euler angles, no Gimbal lock and everything works fine. But, when you enter the 3D world...oh my friend, the rotation of 3D objects can make your head spin at first.

Unity has many good options to rotate the gameobjects for easy stuff when you are learning Unity3D and testing: transform.LookAt will rotate the forward vector or your gameobject so it points to the target you want. Perfect for easy things like make enemies follow you in a really easy and little game.

Other good example is the Quaternion.Slerp function. It will rotate from one rotation to another one with a factor of X. Wait, are you thinking "what? quaterninon? what the hell is that?". Ok, we all do to ourselves these same question the first time. Long story short: a Quaternion is a way of storing the orientation of an object in 3D space. Actually the most used way in videagames. Why? It needs less math operations to use the Quaternions, and that's important in video games. If you want to know more about Quaternions...be my guest http://en.wikipedia.org/wiki/Quaternion

If you don't know what a Slerp is, may be this post is too much for you. Naaaaaaaaaaaa, it's a joke. Slerp is just a mathematical way of going from point A to Point B (rotation A and B in this case) in X time using Quaternoins. This is the quick explanation. Just think "rotate from this Quaternion to that Quaternion in X seconds".

So, we want to rotate our battleship "realistically" when the user goes upwards or downwards and return to neutral position when the user is not moving in the vertical axis. How can we achieve this? I'm not a superUnityProAAA programmer, but I managed to do this with Euler angles. Big, horrible, very horrible code. This should be inside our character's Update function.



Ouch, pretty awful...

I was trying to mix the Euler angles with the Quaternions and this "beast" code was the result. I realized one thing: you can't try to make use of Quaternions as with Euler angles. You have to abstract of the Euler angles and think "ok, I wanna rotate from here to there with Quaternions". You can't create a Quaternion that is a rotation of 90 degrees on X axis. At least not by numbers. We have to use the Unity3D great engine. So, we need to go from rotation of 0,0,0. The regular ship standing position to 45, 0, 0.

Ok, let's think in Quaternions: We wanna go from rotation A (0,0,0) to rotation B (45,0,0) in X seconds. So if we abstract from the Quaternion, we could think like this: we want to perform a Slerp from "thing" A to "thing" B. But, how do we make the "thing A"?  Very easy with Unity.

Quaternion thing1 = Quaternion.Euler(0,0,0);   //From rotation A
Quaternion thing2 = Quaternion.Euler(45,0,0); //To rotation B

transform.rotation = Quaternion.Slerp(thing1, thing2, 2.0f);

In three lines we have perform a perfect rotation with Spherical interpolation. Think of the Quaternion as an interpreter. Just something the SLERP needs.
So if we want our character to do this when we move in vertical axis, the code should be something like this (inside update function)

Quaternion fromRot = transform.rotation;
Quaternion toRot = Quaternion.identity;

if (Input.GetAxis("Vertical") > 0.0f)       {toRot = Quaternion.Euler( 45,0,0); }
else if((Input.GetAxis("Vertical") < 0.0f){toRot = Quaternion.Euler(-45,0,0); }
else                                                      {toRot = Quaternion.Euler(0,0,0)      }  //neutral rotation

transform.rotation = Quaternion.Slerp(fromRot, toRot, 2.0f);

And there you go!! with these few lines we have a very nice rotation.

Thank you and leave some comments!!!!!


 
© 2012. Design by Main-Blogger - Blogger Template and Blogging Stuff