Sunday, September 30, 2012

INFR 3110 - Twoloccing Some Homework

So last week I managed to get Twoloc running, so this week was naturally the week where I started working on my homework questions. I worked on a few questions, and got some of them done. So here are my thoughts with working with Twoloc and Ogre.

The first thing I did was Easy 1. I blogged about it briefly in my last post, but I didn't really go in depth of how I did it. Well, it was pretty easy. Even when using my own framework, that question would be pretty straightforward, just make a bunch of lights using OpenGL and shaders, load in a model using an obj loader, and then make them rotate using math.

Here's the same picture from last week.

Well with Twoloc, you still need to make your lights and load in your objects, but Ogre wraps everything up for you. So like, three lines of code will make you a light. Another three lines gets you an object. And bam, you have everything. All you need to do now is make it rotate, which honestly is not hard at all. That's like basic trig.

So my first thoughts of that was that using an actual engine saves you a lot of time. I didn't have to worry about writing my own code or whatever, it was just already wrapped up and good to go. Pretty good. I also worked on the solar system question, but I found out that apparently it counts for a medium or an easy, not both.

The sun is black on purpose. Promise.

Obviously I'm going for the medium portion, but I haven't really started that yet. Above is essentially the requirements for the easy question, but I want the points for medium. Getting to this point didn't really take that much time either, just had to figure out how to texture, which is honestly just like one line of code and some linking. Again, not that hard to do.

Afterwards I worked on two other questions, one with dynamic textures and one with billboards and imposters. The dynamic texture one I'm not 100% sure if I did correctly, so I'm not going to talk about that one right now, but the billboard and imposter one is pretty cool.

It's also definite proof that I'm an amazing artist.

So that question requires us to make two trees. The first one is a billboard, and the second one is just a tree made from textured planes. I've done some stuff with imposters before in SHFTed so I know what they're all about, so that wasn't too bad. I was more worried about the billboards before I actually started this question, but again, apparently Ogre makes things easy and like three lines later I had a billboard.

The actual imposter took me more time since I was too lazy to figure out how to get rid of backface culling, so I ended up using four planes to make a two plane billboard. The other two planes I had to figure out how to rotate them and place them in the right position so that it would cover the back of the other two planes.

We also had to have other trees that were toggleable.

That actually took some time, but overall it was fairly straightforward to do. I honestly feel that the easy questions were designed more to acclimate us to using Twoloc and Ogre rather than to actually challenge us.

Overall though, I think that the engine itself was pretty ok to use. I'm still not 100% confident and comfortable using it, but my initial impressions were that it is a lot easier to use once you know how to use it. I'm excited to continue working on it, but I have a lot of other work to do unfortunately. 

Tuesday, September 25, 2012

INFR 3330 - Game Design in Real Life

So apparently Game Design II is split up into two half lectures in a week instead of one regular lecture. That's kinda different. I think for Game Design in particular it works out well, since it opens up the ability to easily do say, two different activities, one in each class, instead of cramming them in one long lecture and having game devs switch their attention.

Game Design has always been one of the more interesting lectures, regardless of the lecture content, just because there's a lot more classroom interaction and activities than any other class. This week was no different. The first class was spent designing a game with a basket and a ball.

But not basketball.

The class was split up into two groups and each group was tasked with creating a game. Our group decided to make a game where there are two teams. Both teams stand on the desks and the attacking team tries to get the ball into the basket, and the defending team tries to stop them. The only catch is that the player with the ball can only take three steps before having to throw the ball.

So essentially we made a really corrupted version of basketball. The entire time I was like "hey guys, we're totally just remaking basketball.". It wasn't exactly like basketball, but there's so many similarities it's like a bad rip off of it that's claiming it's not basketball just because desks.

Chaos Bounce is a pretty sick name though.

What I found interesting was that given the task of make getting a ball into a basket a game, it seemed like people in generally normally just go back to what they're familiar with. Like we pretty much got a weird version of basketball, and the other group got a weird version of volleyball injected with chaos.

I guess it's hard to be super super creative and think of something radically new given just a spontaneous task with a reasonably short time limit. That was also pretty apparent during the second lecture, where we had to modify some chip game.

That little crevice on each desk really screws with the game.

There were some rules we had to follow, and the game was played by essentially hitting each chip and depending on how it went, something may or may not happened. There were also these goal cards that we had to try to complete in order to win. After playing it a few times, we had to modify the game.

We couldn't really think of ways to modify it though, so we ended up just changing the rules around a bit so they made a bit more sense (to us), and then made our own goals. We noticed that if all the "secret" goals were always constant, it was pretty easy to figure out what they were, so we had to make new ones.

I had to "buy" that green chip for our modified version.

Again, we had some issues being creative with the goal cards. We ended up just thinking of random things like getting red white red in that order (Canadian flag), or like getting a chip on another chip, or getting all the chips. We called that one Gangnam style because we could.

We also have an assignment due this week. This assignment I thought was pretty cool, since we were required to use the Portal 2 level editor to create a level. I never used the editor before, but I played around with it over the weekend and it was actually pretty easy to use.

Honestly I probably wouldn't have even re-downloaded Steam if it wasn't for this assignment.

It's been a while since I played Portal, and I definately never created a level before so at first I wasn't sure what to do. Then I just started building, and building, and building, and next thing I know I had a level. I'm not sure if it's a very good level though, since I'm under the impression that the first time you make something it won't be very good.

However I'm pretty happy with it. I need a lot of tweaks and testing though, I'm afraid certain parts of it won't be intuitive enough for the user. In fact it might not even be fun. I'm not even sure.

I also reached the item limit pretty quickly.

I'm actually very excited to test it out with some friends. Really wonder how others play it out. I'll blog more about it next week, after I make all the changes I need to make.

Sunday, September 23, 2012

INFR 3110 - Compiling Two Lines of Code

So this was my first week back, but the second week of school. As a result I had a bunch of stuff I needed to catch up on this week. For Game Engines, that would be getting TwoLoc to compile. TwoLoc is pretty important since now only is it going to be used for the homework questions, but for GDW as well.

So it all started when I first cloned it from the repository and spent all the time in the world downloading and installing all the components. It made me sad at first since I was so looking forward to using Visual Studio 2010 again, but apparently TwoLoc was designed for 2008. I really miss 2010.

Although 2012 is out so I may need to move on with my life. (Wikipedia)

So it couldn't compile.

No one knew why, but it couldn't compile. The engine couldn't compile and no one knew why it couldn't, so people just told me to reclone all the things and then try again. So I did, and then the dependencies stopped working. Uninstalled recloned everything and it still didn't work. At that point I was feeling kinda sad since the homework questions were out, and as everyone knows the homework questions are my life. Until I'm done them.

More forgiving rules this time around; still strict though.

So I pretty much gave up. I went to Buckstein on Weds to try to get him to fix my issue. He proposed a few ideas, but I didn't have too much time and he couldn't fix it before I had to go. So that made me a bit sad.

Regardless though, I tried a few more things and stuff and it didn't work. So I went back to Buckstein the day after and was like. "Buckstein, it still doesn't work. Here, let me show you." and hit F7. It magically compiled. I was like what. Why did that happen. Why is programming magic.

HOW.

Regardless, I'm not complaining too much.

So the first thing I did was try to get some of the questions done. Worked on one of them two days ago in class and I'm pretty sure I got it done. Easy 1. All it needed was a mesh model loaded in and then two lights rotating around, with keyboard speed control.

It looks better in person, trust me.

Pretty sure it's done. So my goal is to work on more today and get at least one more done.

And once again, the rush to get to 60 begins.

Tuesday, September 18, 2012

INFR 3330 - The Drop in Dream Drop Distance

So earlier this year I bought a 3DS. I did so primarily for two reasons: Kingdom Hearts 3DS and future Pokemon games. Well, Kingdom Hearts 3DS came out and I got it a few days after it came out. It's a pretty ok game, but I haven't had time to finish it yet, but I'm for sure going to get around to doing that hopefully reasonably soon.

For this blog post, I would like to talk about one of the game mechanics in place for the game. So, (possibly) no spoilers. Essentially, you play as two characters in the game, Sora and Riku. You play as one character at a time, but after a certain amount of time, regardless of what you're doing, you Drop and the gameplay switches to the other character.

Hence the "Drop" in Dream Drop Distance. (Kingdom Hearts Wikia)

For people that played the Chain of Memories game originally released for the GBA, the concept of playing as Sora in one section of the game and Riku in another section is pretty familiar. However in CoM, you played entirely as Sora for the first half, finish his story, and then played as Riku as he goes about his adventure.

However in 3DS, the character's adventures are played out essentially simultaneously. You could be playing through Sora's story in Traverse Town for like half an hour, and then you Drop and you have to pick up from where you left off and play Riku's story. Once you Drop you go back to Sora's story, and rinse and repeat for the rest of the game.

The game doesn't really explain how it makes sense for the characters to pass out randomly during the story. (Wikipedia)

It sounds kind of confusing. And honestly, it's kind of confusing to play. You could literally be in the middle of a battle and then the timer could run out and you are forced to stop playing as one character and play as the other.

Playing through it, I found it to be kind of disorienting sometimes. When you're playing a game, you're supposed to get immersed in the story. And I find that I do get immersed into the story and gameplay when playing the game, but then a Drop happens and I feel like all of a sudden the immersion just gets destroyed. It's like watching an awesome movie but every twenty minutes the channel changes to another awesome movie.

And it wasn't even during a commercial. (Wikipedia)

It's an interesting mechanic. Yet at the same time I feel like it's not a very good mechanic. I would've much preferred it if the game played out similar to CoM where you play through one character's story first, and then the other afterwards. At least that way it doesn't feel like you are being interrupted during your game.

There were a few moments where I would be playing through an awesome part of the game when half way through it would Drop. Then I would have to go and play through some mediocre portion of the game just to get back to the awesome part. Sure, I could manually force a Drop, but I was already interrupted, the gameplay experience was already affected.

I tried.

Or even if they made it so that after a specific key event in the game, then you Drop and play as the second character. That way at the very least it retains the whole concept of switching between characters during gameplay, but it doesn't interrupt the user during key moments.

Honestly I just think it's just bad game design. It just wasn't executed that well. It's honestly so annoying to have to completely adjust to the new objectives and possibly different skills/spirits that you have to play with. And once you do so, you Drop again. The rest of the game so far seems ok, but I found that the forced change gets kinda frustrating.

Monday, September 17, 2012

INFR 3110 - The SHFTed Engine

So another school year has started. Apparently this semester I also have to do weekly blogs for two of my classes, Game Engine and Game Design II.

I missed the first lecture of both of those classes because I was still in Hong Kong doing my internship, but here I am, writing a blog for Game Engine. To start things off, I plan on (briefly) writing about the game engine of the most complex game I've had the pleasure of creating so far, SHFTed.

Yeaaaa.

So SHFTed, for people that don't know, is the GDW game that my group made in second semester of second year. It's a third person action adventure game where you play as the character Jack as he explores Fantasyland defeating enemies and collecting things.

One of the things that always stands out to me when it comes with developing a GDW game is how the game is not really a game until like the month before it's actually due. For the first three months in the semester, people not only take developing the game a bit less seriously, but they also end up working on the engine since we have to create the game from scratch.

This was our "game" two months into the semester.

Like look at that. That's a weirdly textured guy, a platform, a tree and some random square particles. That's not even a game. The most you could do at that point was walk around (without animations) and just like jump on the platform and tree. But then the collision detection wasn't even that good back then (even though it's not even that good in the final version..) so it wasn't even really anything at that point.

But that's what we had two months into the semester. So two months of work gave us that. Yet by the end of the semester, we had something that looked like this.

Only about a million times better.

So two more months resulted in that. Which is honestly a lot bigger jump as far as a game goes. It went from nothing to a moving character in the first two months, and from a moving character to a fully working level in another two months.

So how did all that happen so quickly? Well. It all boils down to the game engine. For the first two or three months of the semester, everyone just works on the engine. The back end tech that no one really sees, but only experiences. We had no game two months into the semester, but we had the beginnings of the tech that made the game.

This is CPU Mesh Skinning in progress. Lewl.

Once the engine is setup and polished, making the actual features of the game becomes relatively trivial. Nothing we really did in terms of gameplay was that complex. The entire game is built upon simple X, Y, Z movement with collision detection and some variables be adjusted.

Everything in SHFTed that made it a half decent game demo came from the tech. The GPU mesh skinning, the various full screen shader effects that gave it that cartoon feel, and all the other shaders, functions and classes that actually made the game run. Everything boiled down to getting that engine done first before we could get the game made.

Why, I even had to do some math.

Making the actual system that runs the game takes the vast majority of the time when working on a GDW project. This was proven when I made Portal Puffs. Proven again when I worked on Reaper. Proven once again when I made SHFT. And obviously again when working on SHFTed.

So what was SHFTed's engine like? Well, it mostly used my code base for one. SHFTed was ultimately created by a bunch of classes I made and a bunch of Gordon's classes thrown together. I eventually just wrapped up my stuff into an engine called NGenesis, and he called his EXCode or something. 

NGenesis is such a better name.

But at the end of the day, all they really are are just a bunch of random classes thrown together that individually just do things like do math, read files, displays an object or whatever. But when put together, they run a game.

So for SHFTed, the engine itself was relatively straight forward. The part that makes it stand out the most from most of the other GDW games would be how its shaders were run and used. We used a bunch of shader effects ranging from simple to complex that made SHFTed the way it was.

Exactly.

The most apparent ones would obviously be the Gooch shader and the Sobel filter to give it the cartoony look, as well as the GPU mesh skinning which gives us awesome animations, and the shadow mapping that gives us that shadow we have that is kinda off when you look at it from a certain direction.

But we also used shaders for a lot of other things like transformations, texturing, and so on. All that was done within shader code, but then wrapped up and handled by our shader class in our engine. The game would essentially run and at specific points calmly call the appropriate shader calls to make our game look and function the way it does.

This was SHFTed with like half as many shaders.

So all I'm really saying is, the engine is really important. Once it's set up (and if its set up right), it's a lot easier to add stuff to your code and to make changes. If it's modular you can reuse a lot of code and it makes developing a lot faster and efficient. Not to mention having the right engine rendering your game also makes it look a lot nicer.

At the end of the day, it doesn't matter if you have the most awesomest game, if you don't have an engine that can run it, it's not a game. So get the engine done, and the rest will come smoothly and quickly.

Sunday, September 16, 2012

Global Edge - The Final

Soundtrack Song (Man this song is so depressing once you look at the lyrics. Maybe not appropriate.)

Warning, this is gonna be a longish blog post. Slightly different format too.

Work

The final week was ok. With the amount of hours we put into the project in the weeks leading to it, you would imagine that the final week would be even more super crunchy and required a lot more work. However apparently we did enough that we honestly finished like every major piece and just had minor pieces and bug fixes left.

As a result, it was actually a pretty relaxing week in terms of work. Mostly just finishing up the final bits and making sure most bugs are gone or hidden.

MaXit; mostly bug free.

Highlights of the week include the moving and packing of the BeaconWall at Science Park and moving MaXit into the BU lab. The lease at the Science Park ended on the 14th, so throughout the week Patrick was moving stuff out of the office to his new place at Diamond Hill.

Me and Michael Chow got pulled in on the 11th to help him pack stuff up and to set up other things. For me, I had to set up MaXit on one of the BeaconWall computers for the product launch they have coming up. Afterwards we just kinda helped pack things up and move.

End of an era.

On the same day, we went back to BU to help move our stuff to the new lab they have. I don't exactly remember what their lab was called, but it was essentially like a technology appreciation lab. Think of J101 but with cool things like the Game Dev Lab.

We moved MaXit to it's new home in that lab, and then just kinda set things up. Afterwards we kinda just looked around at the cool stuff they had in the lab and went home. It's actually a pretty sick lab. They have full surround sound audio for their projector screen with a bunch of cool things like Kinects and a touch screen TV which we played Fruit Ninja on.

It doesn't look as exciting from this angle though.

The following day was just pretty much spent doing random things. I personally just went and took a bunch of screenshots for the system and did some light debugging. As it was my last day at work, I went over my components with Enrico who is staying behind for an extra few more weeks before heading into the mainland.

But that pretty much sums up what I did this summer for MaXit.

Seen here in it's new home.

Return

Ok so normally this is the part where I talked about random things I feel like talking about, like what I did or stuff I ate or whatever. But I have an actual epic tale to talk about this time. This is the story of how Gary returned to Toronto from Hong Kong.

So it all started in Hong Kong obviously. I woke up at 6 AM to finish packing and eat breakfast. My flight was scheduled to leave at 10:30 so I had to leave at like 7:45 and get there by like 8:30 to be two hours early. Garf and Joanna came with me to the airport to see me off.

Oh God that vein in my arm.

After checking in and saying goodbye and whatnot, I went through security and got to my gate. Now, when I first came to HK, I got a return ticket from Cathay that flew directly from Hong Kong to Toronto. However since I was needed to stay longer and couldn't change my flight, I had to buy a new ticket.

Patrick told me to get the cheapest one. So I did. So I had to go from Hong Kong to Tokyo. And then to Chicago before I could get back to Toronto. So two layovers.

I was so excited to get Facebook Timeline just to get the map feature.

So when I was at the Hong Kong airport, I was just kinda sitting there in the midst of a bunch of Japanese people waiting to go back to Japan. I felt kinda out of place with so much Japanese being spoken around me.

On the plane itself I had a window seat and awesomely enough I didn't have a person sitting next to me, so I was able to relax a bit more and have a bit more space to put my things.

Hey thats Japan.

I've been to Japan before for an actual vacation, but it was still pretty amusing to be at Narita for a layover. Well it was at first until I got bored. But anyways I got off the plane and found out my flight to Chicago was delayed by 45 minutes. As a result I wouldn't have time to make my connection in Chicago, so I had to switch my flight to a later one.

After that I just found some Internet to notify the people I needed to notify that my flight was changed, and then I went and walked around the terminal I pretty much only went to the snack/souvenir stores, and I wanted to honestly buy all the snacks but obviously I couldn't.

But I did get this box of blueberry cheesecake flavor Kit Kats.

Japan honestly has the best snacks. Anyways, so I got on the plane to Chicago three hours after I landed, and then attempted to sleep. I was somewhat successful and managed to maybe sleep for like 5 - 8 hours of the flight or so. So not too bad.

After I got off the plane, I had to go grab my luggage and go through customs and then back in through security because North American airports. It was pretty standard up until the point I went through security, when one of my bags was stopped inside the scanner thing.

This bag.

At that point I instantly knew it was going to be searched. I almost laughed though since I knew why. I had so many Kamen Rider toys and stuff in there I could see the "what the hell is this?" going through the scanner operator guy's head. 

So he did eventually call his buddy to investigate, so he did. He took out the Decadriver and the K-Touch and then did a casual visual inspection of it and then scanned it with his wandy thing. After that he was like ok this is good and gave my stuff back to me.

O'Hare airport wasn't that exciting otherwise.

After that I found a place to sit down and recharge all my electronics and essentially played my 3DS for like two hours until I got hungry, where I went and bought the saddest order of rice I've had in the last four months.

Freaking Manchu Wok. Ughh.

Ugh.

Then I just pretty much waited and got on the smallest plane I've ever ridden in my life. Like it was really tiny. Four seats per row. Don't think I've ever ridden on a plane that size before so it really amused me how it was operated by like four people for what couldn't be more than a hundred.

That flight was short, like an hour long. Getting off was interesting though, since normally planes have a little bridgey thing that gets attached to the door and you can walk off, but since this plane was so small I literally had to get off the plane. Like walk down the stairs onto the ground and into the airport.

I felt like such a noob taking this picture. But I had to.

Overall it was an incredibly long day. I managed to make it back to Toronto at midnight, so it literally was like a 30 hour day for me. 26 to get from Hong Kong to Toronto alone.

Normally a direct flight is like 14.5, so Michael Chow actually got on a plane after me, but landed much earlier than I did due to his direct flight. But whatever, I was in Japan for three hours and Chicago for four. I know you're jealous.

Wrap Up

So my Hong Kong internship/exchange came to an end last night. Have to say, I miss Hong Kong already. I've lived there so long that I kinda developed a new kind of life style there, so I already miss it. Regardless, it has been an amazing experience.

I've gained so much from this experience I cant even begin to put it into words. But by far this has been not only my best trip to Hong Kong, but definitely the best summer of my life. It was both fun and educational. Learned a lot and had lots of fun.

Just so happens that my having fun face looks pretty neutral in pictures.

In terms of programming and software development, I learned so much. Normally at school, we only deal with graphics programming and human computer interaction. However at BeaconWall we had a focus on web/network programming and computer to computer interaction.

It's still programming at the end of the day, but it was a different type of programming in the things we did, and the data we had to handle. It definitely expanded my expertise in a different direction that I feel gives some pretty positive value going forward with my studies.

As an aside whenever you Google images "Michael Chow UOIT", a ton of images from my blog show up just because I say Michael Chow a lot.

I dealt with many more languages during my time at BeaconWall than I had at school. I only ever really did C++ at UOIT with some Cg and a splash of GLSL, but at BeaconWall I not only had to do C++, but also HTML, JavaScript, PHP, SQL and Linux Shell Scripts.

As far as non-work stuff goes, I definitely will miss all the people I've met in Hong Kong. I've made a bunch of new friends over there, and I will miss them a lot.

TE;DR

我返左加拿大喇。我要二十六個鏡先可以返多倫多。因爲我要去東京同芝加哥 layover;幾場等到死呀。我已經要 d 掛住香港。我好想再返呀。

Friday, September 7, 2012

Global Edge - Birthday in Hong Kong

Work

So I know I've been saying that the project we've been working on has been due for like so long. And honestly it feels like it really has. We've pretty much been in crunch mode the last month or so, and working overtime all the time.

However, the end is near.

The end, not Diend. (Wikipedia)

I'm leaving next week. So this means it really is the end. After taking my birthday off (more on that later) on Monday, I worked like 11 - 12 hours on both Tuesday and Wednesday, getting last minute features in and making sure the system is stable for the when we launch the project.

Major things I worked on the last few days include writing a php script that allows users to import data into the database via a text file. I also worked on another php file that deletes all the pictures that were generated from the report whenever a new comment has been saved so that the report will update.

Apparently I'm a web programmer now. (Wikipedia)

Also on Wednesday we went back to the Science Park where we were interviewed by some guy from the Hong Kong Economic Times. Apparently having international university students internning in Hong Kong is a thing, so some guy wanted to interview me, Michael Chow and Enrico about working here as well as talking to Patrick about BeaconWall.

That was pretty ok. It wasn't as exciting as I thought it would be. Yesterday though we did another demo to Baptist University. This time it was a legit demo to the same guy we demo'd to before, his boss and some TA who would be using the system.

MaXit recorded me doing the demo and I took this screenshot from the report. Technology.

Overall the demo went alright. They plan on rolling out some actual trials and testing next week, so from now until then it's all about making sure the system is stable and everything is good to go.

Misc

So on Sunday I went to the Ten Thousand Buddhas Monastery. There were many buddhas and much walking was involved.

Many Buddhas.

But I don't really want to talk about that now.

So it was my birthday yay! I am now officially two decades old. So I'm no longer a teenager apparently. Not sure how I feel about it yet. It really doesn't feel much different, but it's weird cause I'm no longer 1X, now I'm 2X. But for my birthday I took the day off work and went to Ocean Park.

Yay Ocean Park.

For those of you that don't know, Ocean Park is essentially an amusement park that has rides and stuff, but also has animal components as well. They pretty much have animal exhibits like a zoo scattered throughout a park kinda like Wonderland. It's much smaller though, but more fun imo.

Anyways, so Ocean Park is free when it's your birthday, which is why I wanted to go on my birthday, so I went with my friend Joanna.

Free Ocean Park is best Ocean Park.

There are many things to see there:

Fish.

More fish.

Monkeys.

Pandas.

Alligators.

Red pandas.

Penguins.

And more!

Afterwards we went on rides and stuff too. Overall it was a really fun day. Really hot and sunny though, but really fun. Definitely one of my better birthdays.

Thanks Joanna :)

TE;DR

我二十嵗喇!我九月三號生日gah,今次係我第一次唔係加拿大過生日。但係我都好開心。我去左海洋公園。我生日個日好熱呀。我下個禮拜五會返加拿大gah lah。又要返學喇。。