Lara Croft Re-Boot

New and Old Lara Croft

This new (young) Lara Croft game is really something I am looking forward to.  The new, less curvy Lara croft as many seem to call it.

To be able to play as the less experienced Lara, thats not a daredevil independent woman as her future self.  In fact the developers are saying that, “when people play Lara, they don’t really  themselves into the character… They’re more like ‘I want to protect her.’ There’s this sort of dynamic of ‘I’m going to this adventure with her and trying to protect her.”

I thought that was an interesting way of looking at the game.  Its like playing as Nathan Drake as a child or a teenage Kratos.  You would see a whole different side of this character and how the became the legend.  Sometimes we see the video game Avatar as a representation of ourself.  Here they are saying you and the character are separate entities only bound together by the controller.

This isn’t really something revolutionary, I don’t think I am Solid Snake or Mario when I play those games.  Where this really hit’s home is how human she looks.  The tattered clothing and realistic look of the new Lara is much more powerful then the older sexualized version with insane proportions.  It’s almost as if the industry is moving away from the titillation of women and now making strong female protagonists that can use something other then plain avatar graphics to enhance their character.

By making a video game character feel real, move realistically, it makes the action and fighting hit closer to home.  If I am playing as Snake in MGS 3, I really don’t give a damn if he dies.  I just get pissed of that I have to reload my save.  Here you are playing as a cornered animal in an island surrounded by threats.  To be able to go from an everyday person to a hero is fairly existential.

From the demo’s I saw at E3, this and Watchdogs are the two games I really want to play.

End of June Update



It seems like I am spending more time with organic lifeforms then the cybernetic ones lately.  I haven’t found a good chance to sit down and play around with Unity/Maya.  I find myself getting distracted and meeting with friends and time eludes me.


However I have made it back at some random hours in the night and instead of passing out I write a random blog post about something I found interesting.


In terms of what I accomplished this month… I got a good amount of gaming done.  I beat Mass Effect 2 again to prepare for ME3 playthrough and I recently re-acquired Resident Evil 5 and I’ve been having loads of fun re-living the fun late night co-op missions me and my old high school friends made.  I ended up skipping on the gym today so I would find time to write this blog, and its already almost 9pm :O.  Time flies when you are having fun :D.


The plan for tonight is to polish up two blog posts, set up Unity and go back to some Javascript tutorials.  Lets see how July works.  Hopefully I’ll get more time to do Game Dev and less time for People Dev.


Also ESPAINA~~~~~~!!!!!!!!!!!!!!!!!  Suck it Italy.

Unity Adventures 101: Untitled Unity Game



I won’t lie, the last month and weeks went by so quickly.  I had hoped to have some heavy leeway into Javascript and have begun some Unity tutorials by now.  I blame Skyrim and my friends.

The plan is by the weekend of June 22, I will have done enough of Unity and Javascript to have some base work for this game.  The next step is Maya modelling stuff.  Then if this project takes too long and drags on to August, I will place it on hold.  Since I need to become familiar with Ogre 3D.

Also I “downloaded” Rosetta Stone and I am learning French properly.  When I see some Frenchmen in MIGS I will be able to network with them in the suave French language.

The reason why this process is taking longer is because I don’t want to half-ass this project since it’s personal, and I want to learn EVERYTHING.  Learning takes time, mistakes and alcohol.

The Game

THE GAME, many of you will know that I am horrible at making names for things.  My first year character’s name was Hunter Hendricks/Hendrixs/Hendriks.  My inspiration for making this game came from a couple of places.  I want to make a game that revolves around meaningful user input.  Apart from Skyrim, I managed to finally beat Dead Island (DI).  When you slice or shoot zombies in DI, you pick where you attack with serious thought because of the stamina bar.  Also, its pretty awesome to see a slow-mo zombie arm slice off.  I liked the body decaling they had on each zombie.  If I sliced a foot, flesh tore of that area.  The other area of inspiration I had was from the Metal Gear Solid: Rising trailer, where Raiden was cutting that watermelon.  I decided to make a game where you could have the awesome combat of Dead Island, with the out of combat and interactive slicing of that MGS:R trailer.

The setting and other game elements haven’t been completely finalized, because I haven’t decided on a good enough theme and setting that I would like to place this game in.  Even if the mechanics and dynamics are fun, the aesthetics is really what completes a game.  Angry birds is essentially projectile motion, but because of their theme, it’s become an incredible success.  Among other things.

The current base idea for this game is to play in the first person wielding a sharp weapon.  For now it will be a PC only title, but the end goal is to put it on the iOS and Android.  The player uses one button to slice and the other to block.

I was thinking about having base quick slice attacks, where the player unleashes a short flurry of blows to the enemy that damages them.  If the player holds down and drags the mouse in a slicing pattern, then they unleash a more powerful attack that can cut of body parts.  The last attack will be a slow motion slice combo where the player draws a slicing pattern on the screen and the character will slice in that pattern.  All these skills can be upgraded for a better outcome.

The slo mo slice can only perform 1 slice during the first level, but at max it breaks down the pattern into many more small lines.  For example, if I draw a triangle pattern at level 1, the algorithm will only sample 2 points in that  pattern and create 1 slice.  At level 3, it would break it down into 3 line segments and use those for slicing apart the enemy.

So that’s the base idea I have so far.  I will be adding more game design stuff while I continue to learn Javascript and Unity.  ITERATIVE GAME DESIGN!

Making a Game With TV Elements



It seems like it has been a while since my last real post.  I pretty much took last week of to play video games and this week I started work.  However when I am not doing boring stuff at work I spend my time thinking about this game I am currently working on making.  The development has been slow because of other stuff going on, but its about to pick up this month.  I just need to get a solid background in Unity and Javascript so I am not a total noob when it comes to making the game.

I came across an idea a while back about why TV is so popular and what makes games popular.  How to create some sort of synergistic approach to this that would make people want to play games more, for reasons they love TV.

I realise that this new Microsoft “SmartScreen” idea about having a tablet while gaming/watching TV shoes is a pretty interesting idea that tries to combine the two in a decent way, but its putting to much emphasis on the TV side.  Here are some of my Notes.



  • Using TV characteristics while making a game
    • TV is Scheduled, broadcast and passive
    • Games are dynamic user defined experiences
  • Combine the scheduled broadcast of TV with the dynamic real-time elements of a game?
  • Turn on the TV and colours blast in your face with the dynamic real-time elements of a game?
  • The game is running when you are not playing, when you are playing your are advancing the story, like an MMO?
  • Different things happen in the game when you play at different times
    • Prime time: Big bosses come out
    • Midnight: rare and weird stuff happens

Advantages of TV

  • Advantages of TV: Passive
    • People can watch the program and it requires no use input from the player.
  • Advantages of TV: Scheduled
    • You know when something will happen, but you don’t know what will happen.
  • Advantages of TV: Broadcast
    • This information is not only shown to you, its not personal.  It is a public broadcast.

Advantages of Games

  • Advantages of Games: Dynamic
    • The game state is always changing depending on your input.  It varies from person to person.
  • Advantages of Games: Personal
    • Your user experience is different from some other person, what you do is entirely up to you during the game.

Combining Both Elements to Create a Game

The best part about TV is having some realization of what will happen.  You know on some channels what will happen, but you can also flip through channels and find something random that you like.  The other advantage is the sheer number of people TV has access to and the variety of content.  The broadcast might be similar to an MMO, but initializing a broadcast is as simple as turning on the TV but initializing an MMO requires turning on the game, downloading an update and so on.  People of the 2012’th generation are to damn impatient to wait.  At least the common consumer is.  We want information and our entertainment fast, the more manual set-up required the likelihood of them using that product goes down.

The best part about games is their dynamic and personal experiences.  Games would be boring if they were so linear that every player had the same experience while playing, then it would fail to entertain you in the way a game should.  On a side note, it is impossible to generalize about all the games in the industry because of the sheer number of games out there and there are thousands of different types that make an exception for each rule.  An assumption going fourth is that games are a system of play where the outcome is decided by the player, the system may have rules.  The aesthetic would be end desired emotional response from the Mechanics and Dynamics of the game.  The mechanics are the base components of the game that are needed to make the game played (game algorithms, game engine, game bits and parts, rules).  Dynamics are the mechanics in motion, the result of the player interacting with the mechanics.

While I love TV shows, this medium can never fully entertain me.  Sure I love Game Of Thrones, Battle Star Gallactica, Firefly, Mad Men and laughing with the cast of Community.  What if during the commercial break I could play as a warrior in a Game Of Thrones battle episode? Or if I could fly a viper ship in a Cylon attack during an episode of Battlestar Gallactica.  What if you could download an official application on your phone that gets updated at the beginning of every episode that will allow you to play mini-games that relate to that episode?


I saw an interesting statistic the other day, “111 million people watched the Superbowl, we share gaming experiences but the scale on which we do is infinitesimally small compared to TV.”  Granted that I doubt 111million are going to be playing a video game at the same time, and getting around 2-3 million (Average view count for viewers on major TV shows) players on a game would be the next step for this industry.  Lets just hope its not another COD clone.

There used to be a great game 1vs100 on Xbox live, which was a brodcast fun game that allowed you to play with tonnes of people for free.  I’d like to see more games like that pop up on the next gen consoles.

The one thing I wanted to take away from this “brainstorm” was the idea of making a game run 24/7 regardless of user input, however when the user decided to enter the “game” they would be engrossed in an ever moving and changing world.  Sounds a lot like an MMO, but I am trying to look at more ways to make them seem more different.

Thanks for reading
– Moose OUT

End of May Update





I did almost no Game Dev work this month.  Just some Javascript and Game Design blogs that I haven’t posted yet.  To be honest I have just been making the most of this good weather and my friends that I rarely see.  Also Gym.  I have been going 5 times a week, and I am trying to get a lot more fit.  Changed diet and everything.

Work 8am – 5pm, Gym 5-6pm.  By the time I get home and eat and shower and stuff its like 10 pm.  Then I watch Battlestar Galactica… which is realllllllllllllly good.  Also I have been catching up on Game of Thrones.  Also awesome.

I planned on having a working demo of the game I am designing by early June, but it seems a bit unlikely.  I would like to spend July/August working on Ogre.  So I have to find some time to work on Unity/Javascript/Maya this coming month.


By the end of this weekend I should have some posts that I have been writing in my free time at work up so, that should be interesting.


Pew pew…

Level Up: Aftermath


I am writing this after commuting home from the Level Up convention/award ceremony/event.

It was truly a great and interesting event for a number of reasons.  I did not plan on going until I saw that our Game Design class was cancelled at night.  At this point the only thing stopping me from going was my own laziness.  I tried to grab my other group members to join me, but I only managed to get Kevin.  Probably the best one to bring anyway.

While we never had any intention of showing of our game, or worked on it exclusively for Level Up, as soon as we got there we began debugging.

At this point out game had no sounds, no HUD and an imbalanced game system.  We did not have our blacksmith master menu system that would allow the player to level up their items and complete side quests.  We just had several battles linked by using a little rotating exclamation mark.

We had left with Gary’s group and managed to get to the convention by 3pm, from then till 5pm Kevin and I were debugging.  I was fixing the shader lighting and Kevin was balancing the game to showcase.

We essentially prepared for a huge Q/A session to gather a whole bunch of data.  I wish we had put more effort into getting a HUD into the game. Regardless of the HUD I learned a lot of stuff about the game that I would not have been able to find out through normal testing.

What needed to be fixed

Aside from the obvious points of making the game look prettier by adding higher resolution textures, HUD/GUI and the rest of the shaders.  We noticed that the collision system was a bit wonky and people were having issues with depth perception.  There needed to be a greater collision response for the player since most of the time people were asking “am I even killing this monster?”  Also the AI were updating way to fast and were very difficult.  People were getting cornered and died fairly quickly.  We need to allow the players to exit the battle and upgrade their equipment rather then re-spawning them in the same level.

The great thing was that there were a lot of artsy girls and male programmers along with some gamers who tested our game.  I noticed that some guys were very aggressive and tried to parry and dodge while moving back an attacking.  Many inexperienced gamers just stood there, got surrounded and managed to die.  Granted when Dr. Nacke and Dr. Hogue tested our game they both had issues with the HUD and the obvious problems.

I also noticed that some people were having issues with the camera movement.  We need to slow down the intensity of the camera movement since some people ended up staring down into the ground because the camera acceleration was to fast for people with slower reflexes.  It would be good to have the player adjust the camera acceleration to their preference in the final version.

When people were in the forest area, they would walk around aimlessly and end up having a horde of enemies chase them while they ran backwards and attacked.  The forest area should have regions where only some beasts spawn and they patrol that area.  Many times people spawned and were surprised that a wolf began chasing them.  We need to have better and smoother transitions between levels that give players a safe zone that they can chill back in.  Players need to make the decision to enter a dangerous area and provoke an enemy attack.  Rather then having the AI walk towards you in a line, they should recognise that they are colliding with each other and push away to corner the player.  The AI need more behaviour that will allow for a more robust battle system then just the player running backwards and attacking.

Overall, we need to give the player more and better feedback during gameplay.  We need to place our HUD into the game to tell the player how much stamina and health they have left.  We need sounds to show the location of the enemy, and tell if they are hitting an enemy.  We need to add more AI behaviour instead of endless seeking.

Lessons Learned

We went there with a 2 man team from a group of 6 people.  We went in unprepared with little expectations.  By this time next year, we should have our game completed and use this event to test our game out with a different crowd and have several different versions to test different things.  There were different types of people that played our game and it was evident in the way they played it.

For example:

  • Experienced gamers adapted very easily to the WASD controls and managed to survive for a while
  • In-experienced gamers got completely destroyed and would have preferred a controller layout with simpler buttons
  • Players had to bend down or kneel on the floor and were in a very uncomfortable position playing the game, giving a negative feel to the game already

Next time we should prepare a variety of versions of our game with different control layouts and a proper chair and screen for them to play it on.  Also polish.  Our game needs to be very polished.  By this time everything should be implemented, and we are just performing balance and fun testing.

Is this level to hard? Do we need to increase our collision response? Should you be sprinting faster? Do you need more stamina?  We should be finding the answers to these questions in preparation for the final GameCon.

Final Notes

Overall it was a good event and I did learn a lot.  I got to bond with some fellow classmates from all years of the program.  We debugged and found errors in our game and code.

Some of the attendees offered awesome advice and seeing them play the game and enjoy it regardless of the state it was in really made me happy.  Considering this was an unfinished game, I just wondered how much better it could have been and I deeply regret not preparing a better version for this day.

People were really impressed with just the fact that we built out game from the ground up not using anything.  Some people even had a hard time believing us that we were not outsourcing anything by using external programs like Havok for physics.  This probably made me the most proud to be apart of UOIT Game Development.  That and the fact that one group that was using Unity Toon shading had several members who had no idea how to do edge detection and did not know what the Sobel Operator was.

I am looking forward to going to more of these events in the future and creating better polished games in the near future.  Time to get some sleep. GOOD NIGHT!

Thank your for reading,
– Moose

Game Opinion: DLC


Kevin recently told me that he wrote a blog relating to on-disk DLC and why that is a bad thing.  I on the other hand think that it is a good thing in many cases.

But first lets go over how the game production works.

DLC Production

Publishers are not releasing DLC on the disk for genuine bad reasons to take the consumers money and run away with it.  Instead they have data that proves that after every passing week, players are less interesting in buying DLC for the game title.

On Disk DLC

So while they have a huge team working on the core game they normally have a team on the side working to create DLC so that it is ready for launch.

In fact having a team working on DLC while the core game is being made can only make the quality of the DLC better.  Since many people don’t understand how games are developed, they don’t understand completely what “On-disk DLC” means.  If I were to create a character as a DLC item, I would have to redo all the character and squad selection menus and user interfaces for that character to be available in the main game.  So the core team developing  the game must prepare for these changes.

Also there are tonnes of games out there to be played.  Once we complete our games we normally move onto the next game.  We rarely ever hear about DLC, stop playing our current game and go play that DLC.  Instead we say, “oh, that looks interesting, once I am done with this game I might check that DLC out.”

Aside from that, the shelf life for software titles is very short.  It is better to have the option of DLC if you are an early adopter so you can buy that item while the disk is still in your console.  If you are the type of person who buys a game early on, beats it and then trades it in to get the most of your money back then early DLC is geared toward you.  EA is notorious for locking out online content for people who buy used copies of their games, forcing them to buy an online pass.

Games also go through a period of certification where once content is released for a console it must be verified.  During this period the development team has little to nothing to do.  Also if games are focused on a certain release date to maximise profit then their development team would have completed the game early and would also have nothing else to do.  During this idle period they are normally commissioned to build DLC while their core title is awaiting certification from the console manufacturer.

Despicable Money Grab

Aside from great content being built that is worth your money to purchase and deliberate publisher tricks for you to but other useless items to get a cheap in-game item.

This is like buying a happy meal to get a gun in Mass Effect.  Or buying a new mousepad to unlock a character.

When Assassins Creed Brotherhood came out they had a great Facebook game that you could play before the release of the core game to unlock items in the real game.  This was a free social game that had a lot of in game lore and content that was a nice lead into the full game.

When publishers start putting in game items with useless other counterparts is when DLC becomes a useless money grab.


Overall at its core this is discussion is if we either have the DLC on day 1 to play it, or we wait 3-6 months later and end up not playing it at all.  In any case, the price of video games have been $60 for several years now.  The quality of the games released has significantly increased over the years yet the price has remained the same.  If many consumers can afford paying $60 for a AAA title, then $15 extra for some worthwhile content is not a huge deal.

Fallout and Oblivion had amazing DLC that really extended the game and Shivering Isles was more of an expansion then DLC.

I personally don’t have a problem downloading content for a game I really like.  With Mass Effect 2, there were several pieces of DLC that released once I finished playing the game that I never got around to playing.

Game Opinion: Game Stories



Today we are going to look at 3 types of stories and three games that show case these types of stories very well in my opinion. (Beware of Spoilers)

  1. Skyrim – fragmented player centric story
  2. Mass Effect – player choice driven
  3. Assassins Creed – linear story


While I personally have not beaten this game, I have spent several hundred hours combined playing Morrowind, Oblivion, Fallout 3 and Fallout: New Vegas.  Those games have similar types of story mechanics.

The fantasy games like Morrowind, Oblivion and Skyrim give little to no information about the player to leave it ambiguous enough for the player to fill it with their imagination.  Ambiguousness is key in these types of stories because the player can be anything from a warrior to a mage and a lizard man to a furry cat like race.

Fallout on the other hand does provide some history as to who the person was.  Fallout 3 you play as the hero from birth up until maturity.  Once you reach maturity to leave the safety of your underground vault to explore the Washington wasteland.  This game is more about taking a character given to you and moulding it the way you want to.  This is similar to Fable’s story progression.  You are a hero and you can either be bad or good.  Fallout uses a karma system to do this.  However the karma system didn’t have a huge impact on gameplay.  In Fable your entire persona would be modified depending on your choices.

The story in these games are fragmented and sporadically placed.  You always have a main quest objective, but whenever the player is exploring they have a chance of starting a new quest line.  That is the greatest thing about this style of telling a story.  Its more immersive because the player is in charge of completing tasks.  In other RPG’s there are little quest statements that pop up and you must read and accept that quest.

Bethesda has made their quest system very dynamic and open.  Sometimes you hear about a quest just by listening to an NPC conversation.  If someone asks you to go pick up some useless item for them and you don’t want to, you can literally kill that NPC and end that quest line.  There is a lot of freedom given to the player in this type of story telling.

Mass Effect

Mass effect is known for its speech choice interactions.  The player is in a social interaction with an NPC and they choose what to say.  The game categorises the players choice in a karma system but they have Paragon and Renegade in place of positive and negative.  Paragon would be the good intentions that are fairly selfless and morally correct.  Renegade are more selfish and immoral choices.

The game does offer some grey areas that are not paragon or renegade choices.  Later versions of the game have special scenes where the player is in a quick time event where they must quickly decide to do a paragon or renegade action.

The quick time events are a good way of advancing the story since they have the players first initial response that is most genuine.  If someone is really annoying you, and you are trying to a nice person and do paragon actions yet you flick the right trigger to slap them in the face, it brings out your true emotions.

Mass Effect doesn’t give the player a huge role in determining the story, but the player does get to pick what path to take to reach the end of the game.  Over the trilogy the choices the player makes have greater consequences.  Some choices only effected the way some NPC’s viewed your character later choices affect the lives of hundreds of people and the extinction of some races.  Even some of your crew members lives are at risk if the player picks a wrong choice.

This type of story telling is good when the game has a good story and world that the game designer wants to immerse the player in without using a completely open world.  Many players who play open world games spend more time playing around in the sandbox then caring about the story.

Assassins Creed

This game offers a really interesting storyline in the first game that looses its meaning after the 3 sequels.  They integrate their story in real world events questioning the way we look at the things around us.  The plot becomes somewhat controversial not using the standard good vs evil approach.  Instead they use the Assassins vs Templars approach.  The Assassins fight for free will and oppose a ridged system of development for humankind.  Templars believe that order is the only way for our species to realise its ultimate potential.  The series is all about two shadow organisations fighting over centuries.

Assassins Creed is really good at setting up a epic story that has a lot of depth and creates several questions in the players head as to what is going on.

Granted that the first game had very linear and unchanging gameplay but they had a story with great depth and was epic enough to build an entire franchise out of it.

Thank you for reading
– Moose

Shaders 103 – Lighting


By now you should know what shaders are, and how they work.  You should also know how to integrate them into your code.  Since I have spent a lot of time putting lighting and what not into our game, I have become a bit of an expert with it.  So today I am going to go over how to do some fragment based lighting.

Changes from OpenGL and Movement Matrices

While I didn’t do the lighting in our game last semester, you can’t take old OpenGL code with lighting and a whole bunch of glTranslate and glRotate calls and expect it to work.

The first thing we are going to have to do is build a whole bunch of matrix functions that build a perspective, look at, rotation, translation, multiplication, invert and transform matrices.  When you download the CG API some of the sample code does have these functions build in, but they expect you to know what they do and how they work.

Here is how we will now be rendering objects instead of using the ‘gl’ draw calls.

/*** Render brass solid sphere ***/


/* modelView = rotateMatrix * translateMatrix */
makeRotateMatrix(70, 1, 1, 1, rotateMatrix);
makeTranslateMatrix(2, 0, 0, translateMatrix);
multMatrix(modelMatrix, translateMatrix, rotateMatrix);

/* invModelMatrix = inverse(modelMatrix) */
invertMatrix(invModelMatrix, modelMatrix);

/* Transform world-space eye and light positions to sphere's object-space. */
transform(objSpaceEyePosition, invModelMatrix, eyePosition);
cgSetParameter3fv(myCgFragmentParam_eyePosition, objSpaceEyePosition);
transform(objSpaceLightPosition, invModelMatrix, lightPosition);
cgSetParameter3fv(myCgFragmentParam_lightPosition, objSpaceLightPosition);

/* modelViewMatrix = viewMatrix * modelMatrix */
multMatrix(modelViewMatrix, viewMatrix, modelMatrix);

/* modelViewProj = projectionMatrix * modelViewMatrix */
multMatrix(modelViewProjMatrix, myProjectionMatrix, modelViewMatrix);

/* Set matrix parameter with row-major matrix. */
cgSetMatrixParameterfr(myCgVertexParam_modelViewProj, modelViewProjMatrix);
glutSolidSphere(2.0, 40, 40);

Now this may seem like a lot, but it is necessary for working with shaders.

The beginning where we call the setBrassMaterial() function is where we set the objects parameters.   We will get to that a bit later.  For now think of it as your glColor call.

The first part where we create the matrix using a simple rotation and translation matrix is fairly simple.  You would just pass on those parameters as if you were doing a normal glRotate or glTranslate call.  You can replace these with variables so you can move these.  For now this object is stationary so we do not need it to move

However the next part is where you  multiply them to get your modelMatrix and invert it to get your final matrix.  This is so we can calculate lighting with respect to the sphere object.  We then update our eye and light Cg parameters that we will see later.

The last bit of code creates the modelView matrix and actually draws the sphere.

Using Materials

The book uses this method of creating functions that set the emissive, ambient, diffuse, specular and shininess values.  Like this:

static void setBrassMaterial(void)

const float brassEmissive[3] = {0.0, 0.0, 0.0},
brassAmbient[3] = {0.33, 0.22, 0.03},
brassDiffuse[3] = {0.78, 0.57, 0.11},
brassSpecular[3] = {0.99, 0.91, 0.81},
brassShininess = 27.8;

cgSetParameter3fv(myCgFragmentParam_Ke, brassEmissive);
checkForCgError("setting Ke parameter");
cgSetParameter3fv(myCgFragmentParam_Ka, brassAmbient);
checkForCgError("setting Ka parameter");
cgSetParameter3fv(myCgFragmentParam_Kd, brassDiffuse);
checkForCgError("setting Kd parameter");
cgSetParameter3fv(myCgFragmentParam_Ks, brassSpecular);
checkForCgError("setting Ks parameter");
cgSetParameter1f(myCgFragmentParam_shininess, brassShininess);
checkForCgError("setting shininess parameter");


So this function just sets the colour of each of the light parameters that we want.  Using this we can make several material functions for different objects and control them independently in whatever way we want.  You can make a character, enemy and level material.  Right before you load your character, you can make their lighting bright so that they stand out.  For enemies, you can give them a bit of a red highlight to show the player that they pose a threat.

What to Initialise

Now we are in our initCg() function let us break it down into a vertex and fragment area.

Vertex Initialisation

myCgVertexProfile = cgGLGetLatestProfile(CG_GL_VERTEX);
checkForCgError("selecting vertex profile");

myCgVertexProgram =
myCgContext,              /* Cg runtime context */
CG_SOURCE,                /* Program in human-readable form */
myVertexProgramFileName,  /* Name of file containing program */
myCgVertexProfile,        /* Profile: OpenGL ARB vertex program */
myVertexProgramName,      /* Entry function name */
NULL);                    /* No extra compiler options */
checkForCgError("creating vertex program from file");
checkForCgError("loading vertex program");

#define GET_VERTEX_PARAM(name) \
myCgVertexParam_##name = \
cgGetNamedParameter(myCgVertexProgram, #name); \
checkForCgError("could not get " #name " parameter");


This is a fairly simple vertex initialisation.  The main point is to see that we are passing the modelViewProj matrix.  If you go back up to our draw code you can see where we update myCgVertexParam_modelViewProj parameter.

Vertex Shader Code

void v_fragmentLighting(
float4 position : POSITION,
float3 normal   : NORMAL,

out float4 oPosition : POSITION,
out float3 objectPos : TEXCOORD0,
out float3 oNormal   : TEXCOORD1,

uniform float4x4 modelViewProj)
oPosition = mul(modelViewProj, position);
objectPos =;
oNormal = normal;

You can still see that this vertex shader is still simple.  We take our model view matrix and multiply that by our position and output both our position and our object position.

Fragment Initialisation

#define GET_FRAGMENT_PARAM(name) \
myCgFragmentParam_##name = \
cgGetNamedParameter(myCgFragmentProgram, #name); \
checkForCgError("could not get " #name " parameter");


/* Set light source color parameters once. */
cgSetParameter3fv(myCgFragmentParam_globalAmbient, myGlobalAmbient);
cgSetParameter3fv(myCgFragmentParam_lightColor, myLightColor);

This not the full code for the initialisation.  This smidgen of code contains the new parameters that we will be passing into our fragment shader to compute our lighting.

Fragment Shader Code

void basicLight(
float4 position : TEXCOORD0,
float3 normal   : TEXCOORD1,

out float4 color : COLOR,

uniform float3 globalAmbient,
uniform float3 lightColor,
uniform float3 lightPosition,
uniform float3 eyePosition,
uniform float3 Ke,
uniform float3 Ka,
uniform float3 Kd,
uniform float3 Ks,
uniform float shininess)
float3 P =;
float3 N = normalize(normal);

// Compute emissive term
float3 emissive = Ke;

// Compute ambient term
float3 ambient = Ka * globalAmbient;

// Compute the diffuse term
float3 L = normalize(lightPosition - P);
float diffuseLight = max(dot(L, N), 0);
float3 diffuse = Kd * lightColor * diffuseLight;

// Compute the specular term
float3 V = normalize(eyePosition - P);
float3 H = normalize(L + V);
float specularLight = pow(max(dot(H, N), 0), shininess);
if (diffuseLight <= 0) specularLight = 0;
float3 specular = Ks * lightColor * specularLight; = emissive + ambient + diffuse + specular;
color.w = 1;

This code takes in our parameters that we pass in our C++ code to compute emissive, ambient, diffuse and specular lighting.  Emissive and ambient are fairly easy to compute, however diffuse and specular require some more work.

Emissive Light

Emissive is the light that is emitted or given off by a surface.  This can be used to stimulate glowing
Equation: emissive = Ke
Ke is the materials emissive color

Ambient Light

Ambient or ambience is light that has bounced around from different objects.  This can be used to make your environments better.  You can have a grey ambient for smoggy cities or a nice bright yellow ambient for forests and nature environments.
Equation: ambient = Ka * globalAmbient
Ka is the material’s ambient reflectance
globalAmbient is the color of the incoming ambient light

Diffuse Light 1

Diffuse light is reflected off a surface equally in all directions.  Even if an object has small nooks and crannies, the light will bounce of its rough texture
Equation: diffuse = Kd * lightColor * max(N dot L, 0)
Kd is the material’s diffuse color
lightColor is the color of the incoming diffuse light
N is the normalised surface normal
L is the normalised vector toward the light source
P is the point being shaded

Diffuse Lighting 2
Specular Light 1

Specular lighting is light scattered from a surface around the mirror direction.  It is only seen on very shiny and metallic materials.  Unlike the above types of light, Specular depends on where the viewer is looking at for it to work.  It also takes into account how shiny a surface is.
Equation:  specular = Ks * lightColor * facing * (max(N dot H, 0))^shininess
Kd is the materials specular color
lightColor is the color of the incoming specular light
N is the normalized surface normal
V is the normalized vector toward the viewpoint
L is the normalized vector  toward the light source
H is the normalized vector that is halfway between V and L
P is the point being shaded
facing is 1 is N dot L is greater then 0 and 0 otherwise

Specular Light 2

Then you add all the lights together and that is lighting in a nutshell.

Fragment Lighting

Thank your for reading,
– Moose

Common to Extraordinary


Before we begin, I am going to try to build this game using a few of the 14 forms of fun as a bit of a template.

  • Beauty
  • Immersion
  • Intellectual Problem Solving
  • Competition
  • Social Interaction
  • Comedy
  • Thrill of Danger
  • Physical Activity
  • Love
  • Creation
  • Power
  • Discovery
  • Advancement and Completion
  • Application of an Ability

Among these the ones we will be focusing on

  • Immersion
  • Intellectual Problem Solving
  • Social Interaction
  • Thrill of Danger
  • Advancement and Completion

Pick a Profession

You play as a class.  A class of high school students.

Inciting Moment

While in the middle of a weekly school assembly word breaks out that a couple armed gunmen have entered the school.  Immediately everyone goes into shock and enters their school lock down procedure.

Each class is assigned to a teacher and they must stick with that teacher ad follow their orders.

The gunmen have set up patrols around the school and booby traps.  They also have set up short range EMP’s.  Your task is to try and find a way out to call for help.  The first one who makes it to an exit wins.

The Game

The game begins when you pick a teacher to follow.  Each teacher has their own strengths and weaknesses along with a special ability.

Once you pick a teacher you traverse through a board game in the shape of a floorplan of your school.

Board Example 1
Board Example 2

Players will start in the gymnasium and will try to traverse through the school on a per turn basis using cards like Munchkin.

The board will be broken up into segments and players will be able to pick and travel in any direction they want.  There will be different exits placed in equal intervals across the board.


Each teacher will have an attack, cunning and Intelligence skill level.  Attack determines how strong they are at taking out the gunmen, cunning their skill to deceive the gunmen and intelligence determines their ability to outsmart the gunmen.  Each skill is on a scale from 1 to 5.

Some teachers will be able to physically overpower the gunmen, others will try to sneak and entrap them and the intelligent ones will create items to take out the gunmen.

Some of the teachers the player can pick are:

  • The Cute Substitute Teacher
  • The Physics Teacher
  • The Chemistry Teacher
  • The English Teacher
  • The Home Economics Teacher
  • The Principal
  • The Gym Teacher
  • The Comp Sci Teacher
  • The Dance Teacher

Teacher Stats – A/C/I

Cute Substitute Teacher - 1/5/2

The substitute teacher’s special ability is to use her sex appeal once every 3 turns to get out of a battle.

The Physics Teacher - 2/2/4

The physics teacher’s special ability is to loose all his intelligence to gain maximum attack once every 3 turns.

The Chemistry Teacher - 1/2/5

The chemistry teacher can create special bombs to disorientate and distract enemies once every 3 turns.

4874142-teacher-behind-the-desk--vector-illustration.jpg (400×362)
The English Teacher - 1/3/3

The English teacher can confuse the enemy with words once every three turns

The Home Economics Teacher - 3/2/2

The Home Ec teacher has the ability to increase her attack to maximum by equipping her cutlery once every 3 turns.

The Principal - 4/3/2

The Principal has the ability to re-allocate his stats once every three turns.

The Gym Teacher - 5/2/1

The gym teacher has the power to move two places once every 3 turns

The Computer Science Teacher - 2/2/5

The computer science teacher can hack into the security system to set off the fire alarm to disorientate an attacker once every 3 turns.

The Dance Teacher - 3/4/1

The dance teacher can re-allocate her stats once every 3 turns.

Deck of Cards

There will be three decks of cards.

One is a loot deck with upgrades and items for the teachers to equip to increase their stats and buff themselves.  The player can only draw from this card when he lands on a space that indicates there is loot, a chance card lets him pick up from the deck or if they defeat a gunmen.

The other is a chance deck.  Every time a player moves into a spot on the board they must draw from this deck.  This deck contains everything from de-buffs, gunmen, movement cards and more.

The last deck is an exit deck.  Once the player reaches an exit on the board, they must fulfil a final challenge as stated on the card.  This can be anything from defeating a boss gunmen to completing a challenge.

Loot Deck

Some of the items in the loot deck will be: (all items temporarily increase a stat)

  • Reading glasses: Increase your Intelligence by 1
  • Fresh Apple: Increase your Attack by 1
  • Body Spray: Increase your Cunning by 1
  • Gym Socks: Throw these at a gunman to evade him and move on
  • Coordinated Assault: Work with your class to take down a level 3 and under gunmen

Chance Deck

Some of the chance deck items will be:

  • Gunman Level 1
  • Gunman Level 2
  • Gunman Level 3
  • Gunman Level 4
  • Routine Check: A group of gunmen arrive, you and your class run to the nearest class and wait 2 turns for them to leave
  • Scout Alert: You must send half your class to check ahead to move two spaces next turn.  Your stats are halved next turn.

Exit Deck

Some of the final challenges are:

  • Gunman Level 5
  • Booby Trap:  There is a bomb at this exit, it went off when you tried to open the door.  You loose one of each stat and must find a new exit.
  • Freedom: You lucked out, this exit is free.  Go call the cops!


When you draw any of the gunmen cards, the combat turns will go as follows

  1. Depending on their level you would need to have one skill high enough to beat that gunman
  2. If you cannot beat that gunman you must use an item
  3. If you have no items you may use an ability
  4. If your ability is on a cool down the gunman escorts you and your class to a classroom where you are grounded for 2 turns.  All your cards are confiscated.