Andrew Wegener's blog

Hong Kong thoughts

C++ Programming FINAL

Posted by Andrew Wegener on November 15th, 2012

It’s finals week! I sound excited because I actually just finished my last exam!  Let me tell you about me C++ Programming final.  Our professor wanted us to modify an existing game.  This project is simply experiential and pretty open.  When I hear the word “mod”, I instantly think of Minecraft.  It seems like there are mods for Minecraft coming out all of the time.  So, I figured, it must be fairly simple.

I started off with research as usual.  I came upon a thing call Minecraft Coder Pack (MCP for short).  This was my key to modding this game.  Once I got it running, I realized it was all in Java…. issue.  However, I’m not a quitter.  I was almost willing to learn the Java language so that I could complete this mod, but once studying the source code, I realized it was not necessary.  Java and C++ are both object-oriented languages so they work pretty much the same.  The languages were similar enough so I could read the code and have a fair understanding of what it was doing.  A major issue is that there is over 8.5 billion lines of code in Minecraft, and finding the single line of code that changes what I want was pretty difficult.  Through forums and a whole lot of googling, these were some changes I was able to make:

Flipping the world upside down (found by accident!)

Huge creeper explosions! (or teeny tiny!)

Miltank the Pokemon!

Sunset (before)…

Sunset (after). Awesome!

Tepig the Pokemon!

I also changed the perspective, running speed, and jumping height so it was like a crazy acid trip or something.  A really great experience over all, perhaps over the break I can make a new mod on my brand new computer I bought!!!!! (pics hopefully to come later!) Have a great holiday season everyone!

Posted in C++ Game, C++ Programming | No Comments »

Cognitive Art of Game Design FINAL

Posted by Andrew Wegener on November 15th, 2012

Time for finals!  This project is all about the client.  Professor Jose has been connecting us with professionals all quarter and it all comes down to this.  The client I was set with is Michael Trzecieski from Reality Robotics.  My classmate and good friend, Mariel Thompson, was able to be my partner for this assignment.  We didn’t think our professor would allow it, but once we had Michael on our side, he couldn’t say no!  We worked great together!  She was the “art director” and I was the “lead programmer” essentially.   We get along great and made a fantastic team so I hope I can do future projects together with her.

Check out Michael’s robot toy, BERO (short for “Be the Robot”), at:  http://www.youtube.com/watch?v=XdfP_u3m7as

and/or:  http://www.youtube.com/watch?v=5UQjlHgEtJQ

It is a really cool toy robot, and I’m not just saying that.  Anyways, Michael asked us to make a game demo for him in a couple of weeks – so we did.  We used Gamesalad, a new program to us, so that we could publish it when finished.  Although it is not published yet, we plan to complete it enough so we can publish it to the Android/Apple app stores.  We got started right away.

We spent about a week solidifying our concept.  The most challenging part of this was narrowing our scope to something feasible to complete in a couple weeks, especially with our other final projects happening.  We practically nailed it.  We had just enough time to complete what we wanted.  There are still more things to add, but most of it is eye candy and nonessential to completing a game.  Once we finished conceptualizing, it was time for programming.

Learning a new program can be rough.  This is at least the fourth program I have learned this quarter (I’ve learned many things, it depends on what you consider a “program”).  I believe this will be one of the most important programs however because it allows me to publish games to app stores.  So I started off small.  YouTube videos of the basic interface and simple commands were helpful.  Also, Gamesalad provides basic templates that you can use for free!  We used the cross-platform controller template with a built-in touch-controlled joystick along with an A and B button.  The template didn’t want to support flipping the image of Bero (with my limited knowledge of Gamesalad at least) when it would change direction.  After that main issue, most of the issues were fairly small other than just time and running into a million little issues.

I’ll try not to get into too much detail, but it’s a game about the BERO robot trying to find his purpose.  He hears a sound and subconsciously dances for the first time.  He loves the feeling so he follows the sound so he can always dance and be a happy little robot.  Check out this short game play video and leave comments to let me know what you think!  It should be published this holiday season!

 

Posted in Cognitive Art of Game Design, Gamesalad | No Comments »

Assignment 6 – Windows Application in Visual Studio – TicTacToe

Posted by Andrew Wegener on October 31st, 2012

Microsoft Visual was a new program for me at this point.  I did not enjoy this assignment.  However, now that I am over my frustration, I realize Professor Rueda’s intention.  He wants us to be frustrated!  No, seriously.  Through our frustration, we actually learn how to solve the problems we run into.  I don’t necessarily agree with his methods, but they might be effective… maybe.

Anyways, I tried.  I tried at least 9 times.  I spent literally all weekend from the first bus to school until the 8 or 10pm bus trying to find a game that would run.  However, it wasn’t until Sunday that I was able to get one to work – and it was the example shown in class…  I believe I still met the requirements, but it for sure wasn’t impressive.  I attempted to edit it, but it wasn’t in any form I was familiar with (it didn’t have the form window that shows the what the window will look like when it runs).  I was able to edit the colors slightly. Here are the differences in the code and the results they produced:

The above images show the original code and color scheme

The above images show the new code and color scheme

Unfortunately, this was all I was able to figure out how to change.  Like Thomas Edison said, I didn’t only get one solution for making a game (or light bulb in his case), but I discovered 1000 ways not to make one…. or something like that!  Stay positive!  Hopefully, I’ll be able to take away a little more from the next assignment!

Posted in TicTacToe, Visual Studio | No Comments »

Assignment 5B – Strategic Luck

Posted by Andrew Wegener on October 31st, 2012

 

Yay! More C++ coding!  Well, judging from the pseudocode, this should be relatively easy, right? Wrong!  Just kidding.  Overall, it was pretty easy.  Let me explain:

The first part of the game is the generating of each players’ pieces.  This could be fairly simple.  However, the first set of rules I declared stated that:

1) Each player would receive ten pieces with randomly generated powers from 1-10.

2) The greater of the numbers will defeat the lesser.  The only exception is that 1 can defeat a 10.

These rules are flawed.  In theory, a player could receive ten 10s and be guaranteed to win (if the other player doesn’t have any 1s).  What I’m saying is that in some cases, it could be impossible for one player to win.  Lately, in my ITGM 351 Cognitive Art of Game Design class, Professor Rueda has been making us read about balance in games.  As it is, this game is not balanced.  It is important that games create the illusion of fairness to its players.  My solution to the imbalance was this code that determines the players’ powers:

I decided to set three randomly chosen pieces to certain powers.  This code ensures that each player will definitely have at least two 1s and one 10.  This virtually eliminates any predetermined victories or losses to either player, obviously extreme, outrageous cases can still occur but the chances are slim to none.  Also, the three random pieces are named Slot A, Slot B, and Slot C.  I added the “do… while” loops to make sure the same piece was not chosen for two slots.

The actual loop of the main game is less than 100 lines (including a fair amount of white space).  The majority of the code, in terms of lines, is from the function that displays the game board.  This function is a whopping 800+ lines.  All that remains are the random number generator function, the clear screen function, the directions, the title, and SPOILER ALERT!!!!!!….

(Highlight between the dashes to reveal the spoiler)

A GIANT PIKACHU!!!

One last thing I would like to mention… This was the first program I’ve written that I did a new (to me, at least) debugging technique.  All of the blue text are “comments” – the compiler just skips that line after the //.  Something weird was happening with the Slots and their values, so I inserted multiple cout statements telling the compiler to display the values of the slot variables.  So, if you want to play this game on “easy” mode, you could just delete the //s then the pieces values will be revealed to you.  Fun stuff!

The debugging technique and a better understanding of functions were the biggest experiences I took away from this assignment.  I have had many of my friends play this game and it’s hilarious seeing their excitement/frustration/satisfaction while playing.  For example, the game ONLY displays the enemy pieces, and ONLY when they are defeated (including in a draw).  I enjoyed this project and it went smoothly for me for the most part.

I am not allowed to post the .exe file, unfortunately.  Find my contact information and contact me. Maybe you’ll be lucky enough for me to send it to you!

Posted in C++ Game, C++ Programming | No Comments »

Assignment 7 – Compile an RPG in VS – WitchHunt

Posted by Andrew Wegener on October 31st, 2012

After the previous assignment, I was about ready to give up on Visual Studio – AKA murder it.  I was so frustrated, I just wanted to make a very simple RPG and not worry about downloading anything.  So, I started make Zelda! It was such a trivial attempt that I didn’t even bother saving the project before Professor Rueda stopped me and told me to download an RPG game and compile it.  Tentatively, I gave in and began searching.

Here are some problems with this assignment: 1) Visual Studio GAMES are not easy to find. 2) RPG games are even harder to find. 3) RPG games tend to have many many many external libraries.  It took me at least 6 tries before getting one to work.  Thankfully, my classmate, Mariel, used to Linex (a fairly new term to me) so she is familiar with linking libraries and compiling programs.  She was able to download and compile a game by the next class which was about a week before it was due.  So, she was nice enough to help me out with downloaded and compiling my game.  After a couple failed (or too complex) attempts, we came across a Pokemon game.  If you’ve played Pokemon, you know there’s a lot of Pokemon, a lot of attacks, a lot of abilities, a lot of items, etc.  The Pokemon game I downloaded had hundreds of libraries full of much of this information.  Mariel walked me through how to link libraries and set up project files properly.  After I had to link all the libraries by hand (as opposed to clicking on a single folder), we realized that it was necessary to download a new compiler and access their libraries to get the game to work.  A brief attempt at finding these was unsuccessful, so I went back to searching.

I found a game called Hale.  I had everything copied into my project folder and was about to compile when I opened the last folder and realized it was in Java.  However, the linked files and everything still works fine, it’s just not the right language.  I’ve played the game for hours already – I think it’s really fun!  But sadly, it’s worth nothing if I do not find a C++ game.

It wasn’t long until I found another game.  This one is called Witch Hunt.  It’s an ASCII game written in C++ and works in Visual Studio.  This compilation was surprisingly smooth.  After Mariel’s help previously, I had a decent understanding on the basic requirements of compiling a game properly.

I am not sure if I’m doing something wrong, but early on in the game, it is necessary that you walk outside where monsters can attack you.  When this happens, I try escaping – then the game crashes.  Although this is frustrating, I DID get it compiled on my own!

This assignment, admittedly, taught me a lot.  Mariel was a huge help and now I’m curious as to what games I will be able to compile myself since I get so much enjoyment from playing Hale.  Hope the next Visual Studio project will be this successful!

Posted in C++ Game, C++ Programming, Visual Studio | No Comments »

Assignment 5A – Pseudocode – Strategic Luck

Posted by Andrew Wegener on October 30th, 2012

StrategicLuckPseudocode

Here is pseudocode for my game which I call “Strategic Luck.”  While the first half is just notes and brief directions for my game, the bottom is pseudocode.  I learned that pseudocode is, simply put, a human-worded version of the code.  Basically, a sketch of what you predict the code will look like – or an outline.

I thought this was dumb.  I always imagine the code in my mind beforehand to make sure it’s feasible, this was only writing it down.  Turns out, even for how short and simple my pseudocode is, this was quite helpful.  It’s outlines the main loop of the game.  Aside from a few functions, syntax, and technicalities, the pseudocode is a simplified version of the code for my game.

Posted in C++ Programming | No Comments »

Assignment 4B – C++ – Lucky 7

Posted by Andrew Wegener on October 10th, 2012

This is my first experience touching the C++ language.  Overwhelming while reading the chapters, but slightly more comprehensive once it became hands-on.  For this assignment, I wanted to create a short minigame from Mario Party 3.  Since my arrival in Hong Kong, my group of friends and I play Mario Party a couple times a week, so I thought this fit in well.  The game is simple – here is a screenshot of the instructions.

Basically, roll the dice, once or twice (rhyme!), and finish equal to or higher than the computer without falling off the staircase.

First, I needed a random number generator.  Here’s how to do that.

This says “I can pick a random number!” (above)

This is a nifty little formula to imitate rolling a die.  Melissa helped our class understand this.  So, someNumber = the random number (anything between + or – a “gazillion” (quoting Professor Rueda)).  diceRoll will equal the [huge random number "modulus" 6] + 1 . Modulus was a new term for me.  Simply put, it the remainder of the division of the following number.  For example, if the huge random number is 34821, mod (short for modulus) by 6.  To start, divide 34821 by 6.  The answer is 5803.5 . OR 5803 with a remainder of 3.  Therefore, 34821 % 6 = 3.  Some smart people figured out that dividing any integer by 6 will always have a remainder of 0-5, so, if you add 1 (like the formula does) you will always get a number 1-6 aka a dice roll.  Like Pikachu on toast.  Swag.

So let’s get started, first, I needed a game board to show the progress of the player and computer.  Rather than figuring the roughly 72 possibilities of where each player could be located, I can call on a function!  Check it out (below – click to enlarge this one)

It’s simply a series of If statements saying “if computer is here, and player is (or isn’t) here, show the player piece on this step”.  All it had to do is use the inputs of the computer’s height and the player’s height which are stored in global variables.

Now that rolling works, I wanted the computer to “cheat”.  Okay, yes it cheats – no quotation marks.  But not to the point that it always wins.  Here’s what I mean (below).

This says ” if it’s the computer’s (I call it Nemesis for no reason) second turn only, add it’s current height to the dice roll.  If it’s more than 7 (if it would fall off the staircase), say “I pass this turn.” and pretend it never rolled.” This  just means that the computer will never fall off the stairs but will always make use of it’s highest possible score.  So if the total is less than 7, it will state the roll and still move.

That basically sums it up.  Unfortunately, I’m not allowed to post my game for security reasons.  Lame.  This is not Pikachu on toast.  Oh well!  Play Mario Party 3 and play the Game Guy game Lucky 7!

Yay! I win!

 

Posted in C++ Game, C++ Programming | 1 Comment »

Assignment 2 – Extensible Gameplay – Tap Dance

Posted by Andrew Wegener on October 9th, 2012

TapDance

^^^^^^^ click this link to download my game design document for “Tap Dance”!

A brief back story: I have a group of friends that frequently comes over to my apartment for game nights.  Typically, we chat, eat, and scream while playing Mario Party 1, 2, or 3 on the Wii64 (N64 emulator on the Wii).  A few nights ago, as we were reading the instructions for a minigame, Bri (the friend I mentioned in my post of my journey here, my first friend!) misread the directions as saying “tap A to dance.”  For some reason, it hit me.  “Tap A to dance!” I stated. “Tap A to dance!!!” I exclaimed.  I stood up and started dancing around while singing “Tap A to dance, tap A to dance!”  As I humiliated myself, my friends literally ROFLed (and I never use that term) at me.  Everything hit me at once.  A mobile game where you tap the screen to dance.  I explained to my friends the concept of the game.  They wanted me to call it “Tap to Dance.”  But similarly to Justin Timberlake saying in movie “The Social Network” about dropping the “the” from “the Facebook”, I decided to drop the “to” (or as I was quickly singing it, the “tuh”).  Thus, “Tap Dance” was born.

I researched some existing dance games, and while doing so, I stumbled upon some research saying that dance games can improve concentration skills and academic performance.  I liked this idea a lot because more often than not, people assume gamers are lazy, stupid bums.  I consider myself a gamer, but I definitely don’t consider myself stupid.  In fact, games have expanded my vocabulary, taught me invaluable problem solving skills, and helped me develop a social life and not be (too) socially awkward.

I want Tap Dance to be a game that improves concentration skills without the player knowing the benefits of this seemingly “just for fun” game.

I hope to develop this idea further and publish a version of the game.  Hopefully see you all on the app store soon!

Posted in Cognitive Art of Game Design | No Comments »

Assignment 1 – “Games are Truly Art” – Just Another Day

Posted by Andrew Wegener on October 9th, 2012

JustAnotherDay

^^^ click this link to download my game design document for “Just Another Day”

Professor Rueda asked the class to conceptualize games that would make the players’ reactions be one of the following:

“Games are truly art!”

“The best art game ever!”

or

“Wow the art is awesome!”

I wanted my players’ reactions to be “Games are truly art.”  To summarize, “just Another Day” is a game about an average day not being so average.  It helps the player realize the importance of everyday decisions and how even what appears to be an insignificant choice, may lead to a life changing affect.  With the use of color and plot changes, “Just Another Day” visually demonstrates how a simple decision can change one’s life drastically.

Posted in Cognitive Art of Game Design | No Comments »

Assignment 4A – PS1 Game – Banjo Kazooie

Posted by Andrew Wegener on October 9th, 2012

Two weeks before I left for Hong Kong, I had major reconstructive surgery on my knee.  While I was glued to the couch, I needed something to keep me busy.  What other than video games to save the day, right? :D This idea led to me hacking my Wii.  It was surprisingly easy!  I downloaded a GBA emulator with Pokemon Red along with an N64 emulator with an assortment of games including, but not limited to, Mario Party, Donkey Kong 64, Pokemon Snap, Yoshi’s Story, and of course, Banjo Kazooie (and the sequel, Banjo Tooie).  Although some of these games don’t work (example: Pokemon Snap you cannot turn the camera, the Pokemon sensor red light thing doesn’t light up, and every picture is black when you talk to Professor Oak after each run), Banjo Kazooie runs pretty well.  The opening cinematic doesn’t line up with the music properly, and there are a couple of color issues – the usually black shadows are orange for some reason – but overall the experience is virtually the same – fantastic.  Since I’ve been in Hong Kong, I’ve been playing during the little free time I’ve had.  Fortunately, my childhood memories of the game have served me well and I have completely finished the first 7 levels (100 note score, all moves learned, all jiggies, both empty honeycomb pieces, and even the cheato books!).  Rusty Bucket Bay is next, but before that, I had to make a Scratch version of Banjo Kazooie.  Quick tangent: I’m listening to music as I’m writing this, and a Banjo Kazooie sound effect just played (I downloaded about 300 sound effects from the game). Awesome timing!

Fortunately, I already had a side scrolling script AND gravity from Lunchbox’s experiments.  This saved me a bunch of time and helped me get started right away with the “fun” stuff and got me excited to work on this project.  This was assigned on a Wednesday, and that Friday we happened to have a make up class, and I practically was finished with about a C-grade project.  Anyway, I started with the sprites.  These are not my own sprites, however, I did edit each and every one of the 200+ (rough estimate) sprites I used.

Banjo!

Before I did any movement, I wanted a simple idle animation for Banjo.  The logic was quite simple for this.  The feeling of getting the script right on my first try felt nice :)

This is about as easy as it gets. Depending on the direction of Banjo, that direction of costumes would cycle through.  Oh, I also discovered the nifty little comments tool which is just like in C++ (I recently learned) how you initiate a comment with a simple “//” followed by the comment.  Cool stuff… for a nerd like me.

While Banjo is going through his Idle animation, Scratch checks to see if a button is being pressed every .1 seconds (defined by the Action variable).

This short but wide brick of script determines the value of Action.  This nested group of logic is too wide to fit on my Macbook screen, but it basically says Action = 0 when nothing is pressed.  If something is pressed, set Action to 1.  This variable’s only purpose is to trigger the Idle animation of Banjo.

From here, everything was pretty much redundant.  “(button) triggers (action x), but only while Banjo is doing (action w) but only if he isn’t doing (action y) or (action z).”

Here is an example: Banjo’s rolling script.  When ‘m’ (attack) is pressed while walking left (‘a’) and Banjo is NOT crouching or  jumping, then Banjo can roll until he is interrupted by crouching or jumping.  Banjo is allowed to jump from the middle of a roll attack in the N64 version.  (more Banjo Kazooie sound effects just played from my iTunes!)

This logic is pretty simple, but it’s my first enemy script (besides the football players in Football Frogger).  All it really says is until it’s defeated by Banjo’s attack, hurt Banjo if touched.  And when it’s defeated, it says “GRRR!” When gruntlingDeath is broadcasted, the honeycomb appears and shoots up and my fancy pants gravity script pull it back to the ground (and it bounces!).

I’m going to try to record some gameplay, so as Mumbo Jumbo says in Banjo Tooie….

Banjo Kazooie is finished! Collect the Jiggy to win!

IMG_1212

^^^^^^^^ click that link to see the gameplay and listen to the super catchy music!

Posted in C++ Programming, Scratch Games | No Comments »