Sunday, December 4, 2011

Programming, Programming, Programming, and more...

Programming.

It's what makes the game, and as much as I wish that games simply required you to make a bunch of pretty pictures, breathe life into them using your morning breath, and then things suddenly start moving in 3D, sadly it is not the case...

So for the last few days all I could work on was programming. Here's what I did:

High school vector math, seriously... to get a beam (green line at the moment) to shoot from the player character (the ball here) to where you click.


The math used was the simple solve the intersection of a line and a plane:

//the xy plane which the level constrains to
Vector3f planeV1 = Vector3f(0.f,0.f,0.f);
Vector3f planeNormal = Vector3f(0,0,-1.f);

//find the uparam
float uParam = planeNormal.Dot(planeV1-kPos)/planeNormal.Dot(kDir);
Vector3f pointOfIntersection = kPos + uParam*(kDir); //multiply the uparam found to get the point of intersection
pkVBuffer->Position3(1) = Vector3f(pointOfIntersection); //draw the line to this point
pkVBuffer->Color3(0,0) = ColorRGB(255,255,255);
pkVBuffer->Color3(0,1) = ColorRGB(255,0,255);

bool bClosed = false;
bool bContiguous = true;
m_spkPolyline = WM4_NEW Wm4::Polyline(pkVBuffer,bClosed,bContiguous);
m_spkPolyline->AttachEffect(WM4_NEW VertexColor3Effect);
m_stateNodePtr->AttachChild(m_spkPolyline);


The kDir, and kPos, values come from the GetPickRay function from the camera, and fills in the camera position, and a normalized vector towards the point clicked on the viewport. Sadly if you click too many times, the lines really start to add up. Another thing I worked on is the constraint plane, which was evidently scrapped and replaced with one line of code, to constrain the player to the Z axis:


//constrain player to z axis
m_playerRigidBody->getRigidBody()->setPosition(hkVector4(m_playerRigidBody->getRigidBody()->getPosition().getComponent(0), m_playerRigidBody->getRigidBody()->getPosition().getComponent(1),0,0));

You may have noticed the black and white dots in the picture above. It's the particle system that's pretty much a clone of the Particle System example in WildMagic 4. I found it really difficult to make the particles move, since the UpdatePointMotion function was being called in some other function deeply in-bedded in WildMagic4. For some odd reason the moment the game window popped up (not the command console) the UpdatePointMotion would stop being called, so I had to call it manually in the OnIdle function in mainGame.

There's still lots more to do, and the game is due... in less than 24 hours T-T

Tuesday, November 29, 2011

Better late than never... I hope

Seems to be the motto for my life...

I had just finished modelling and UV mapping Ice Queen, which is seriously overdue. I had been a bit obsessive in making her look good, and would spend hours just tweaking her vertices. Derek telling me that I only had to combine the dress and crown into the model for both UVs and rigging to work for it was god sent, because then I would of had to extrude the dress and crown out of her hips and head respectively. I extruded the hair out of the head, so when it fans out the UV coordinates get spread out more, not sure if I'll lose marks for this, but her hair is a big puff of white.

Nice that Maya .png's have a transparent background =D



I still have to add the skeleton, paint weights, rig the character, and add textures, which will along with programming for game engine design homework, and programming for the game, suck up any possible time I have awake. Though my little brother still insists I play Pokemon Friends with him whenever I arrive home, technically he has made more games than me. 

Sunday, November 27, 2011

Cat Mullets in Roms and Braid Advice

Well I've been assigned to do the spline camera control and key frame animation. So I finished the functionality of the spline controls, but the only problem is that I hard coded it into the game. I didn't start this way, I did the whole UML run down and started on my way making three classes: Keyframe; which holds the translation and rotation information of a Spatial node, MotionPath; which has a vector of keyframes and either LERPs and SLERPs, or uses catmull-rom and spline rotation to traverse the points, and finally a Cutscene class; which has a vector of MotionPaths so the motion paths can be played all at once.

I found this to be slow to code, and Tyler suggested, along with Colin that I just hard code it to see if it works. The creator of Braid according to Colin said that you should get the functionality working and then create a class around it. So the catmull-rom spline works, show below (you may have to refresh your page to see the animation):



But this is only splining between two points, none the less it's quite smooth. Now I've got to extend the functionality back to classes. Extending this to spline through more than 2 points makes me hit a lot of vector out of bound errors... which I know all too well, seen too many, and frankly still have no idea how to make my code robust enough so they don't appear. It also doesn't help that catmull-rom splines like to ask for points before and after the two points you are splining through...

I feel most inadequate ;_;

Oh I don't know why the scene is pink and blue, and the player character is falling off the constraint plane because that piece of code is commented out.

Wednesday, November 16, 2011

The game... it's alive?

Well the very basic prototype of the game is running:



Now to point out some of the things we have:

  1. The main character R3mote as a rigid body which can move through setting its velocity.
  2. The main character R3mote can jump by applying a force to it.
  3. When left mouse is clicked a sphere is generated at R3mote's position, (A place holder for firing the laser).
  4. The platform highlighted in red is a phantom, and when the player collides with it they are pushed up. (A test for collision events and triggers)
  5. The player is constrained to a 2D plane in the XY axis of the scene.
Of the list I worked on the constraint plane, which is a constraint class in Havok and I only needed to do some perusing in the demo files to find out how to constrain the player. It just constrains the pivot of the player, which is at their feet, to a 2D plane that is shown by the flat plane facing the camera. Something that needs to be done is that the player shouldn't spin around when they jump, and any collisions with other rigid bodies causes the player to spin onto their head. This can be remedied by using a character controller class in Havok, which sets the player's inertial tensor to infinity... making it not spin.

I also worked on the movement, but those were just four lines of code. Though since the velocity of the player is set to move left and right, the player can just float across the screen. This is just place holder , and will be changed. 

Also checking out the Character Control documentation it shows how to create rigid bodies that would stop colliding when the player state is set to jumping. This would be a great way to make platforms that the player can jump through, but land on. Havok really seems to be on our side.

Tuesday, November 1, 2011

Completed Logo

Here's the coloured and completed RGBA game logo, from the inked version I posted before:


I find that most of my time spent in Photoshop when I'm "graphic designing" is scrolling through the layer effects, and staring at the picture to see if it looks nice...

Hopefully the game does this logo justice, and vice versa.

Sunday, October 23, 2011

Maya Modelling

I very much enjoy the Intermediate Modelling class, and Derek really knows his stuff. I fell a bit behind on the modelling, since I spent a bit too much time adjusting the way the limbs and body look, to make it feel more realistic. I need to finish the face and hair, and UV them by Wednesday.

UVed Ice Queen, but she's bald...

Wire-frame of the same model, I kept all of the faces as quads!
We already started to learn how to create diffuse, specular, and normal maps in Mudbox. I should make a real quick normal map of this model to load into a normal map shader that I am working on. Things are really starting to pile on!

Tuesday, October 11, 2011

A Game Logo

Well I did a quick sketch for a game logo and inked it in Photoshop. Colin loved it, and Tyler liked it overall, minus the star on top of the b. So I slapped it on our wiki, and hopefully I can get more feedback from the other group members.

Here's the base inked:

Robot Guardian Beyond Awesome

I also attempted to build WildMagicPP in release mode, manually, by trying to eliminate all the errors on the error window. I ended up creating 1632 linker errors... so I may need to start again.

Tuesday, September 27, 2011

Ice Queen My Way

As part of Assignment 1 for Intermediate Modelling we had to draw a bi-pedal character in three different poses: top view, front view, and side view. Having recently watched Adventure Time, and instantly becoming a fan-boy, I decided I wanted the Ice Queen from the gender-blender episode to be the boss of the Adventure Time level. Here's the three views:



Ice Queen originally is quite a bit more simpler in the show, but I decided to draw it in an anime style because I am influenced by anime. The team also decided that one level would be created by each member, that way the art style would be unified in each level, but different between levels like you would see on TV when changing channels. Next I will be setting up these pictures in Maya and begin to model it in 3D.

Thursday, September 22, 2011

Like J.K Rowling

The so called one was sitting on a train, I did not have the luck of being on such a train (the train from rags to riches). But like J.K. Rowling the idea popped into my head while I was just sitting on the bus, and it pretty much went like this:


A quick picture I sketched in Colin's sketchbook when I announced to him during class that I had a game idea.

The basic idea was that the main character was some robot stuck inside of the TV, and had to traverse the channels to escape. Using the electron beam in the centre of the screen (like in CTR TVs), the player would fire beams of four different colours (white, red, green, blue) to vaporize enemies and traverse the level. I wanted the four beams to have different properties (being influenced by RPGs) such as red doing fire damage, the blue beam freezing the terrain and enemies, and the green beam allowed the player to "blink" (become invincible for a split second). Also whenever the player changed beam colours the screen would also be flooded with the colour, and different platforms or paths would be revealed. I also wanted the beam to bounce around platforms, and also amplify depending on how many times it bounced. Another idea I had was that there would be absorption platforms that would absorb beam colours, and one that could absorb all 3 would cause the player to go into "seizure mode" when they charged and landed on the platform.

After explaining this to my group members they all agreed on liking the idea. They started to put in their own input, and after voting my idea over Colin's (sorry Colin...) we put up a wiki and threw all our ideas together.

The wiki link is here: http://tvgameproject.wikispaces.com/