Archive

Archive for the ‘Hitchhiker’s Guide to Games’ Category

Reflections on Hour of Code 2013

December 20, 2013 Leave a comment

This year I was fortunate enough to an audience of enthusiastic technologists to share Computer Science Education Week with. We dutifully completed our our hour of code exercise. In general the event was a huge success that left many students smiling and excited about computer Science. However, with any endeavor there are things that can be done better in the future.

My article today will focus on challenges our class faced, key observations and specific ideas for improvement. My observations today are based on our hands on class room experience, my own efforts evaluating teaching vehicles as well as my experience teaching my four year old and six year old the concepts I shared in the class room.

Part I: Challenges

Devices

In my particular scenario a dedicated computer lab was not available when we held our hour of code exercises. The offline exercises were conceptually appealing but presented their own logistical challenges. Our class opted to bring in as many phones and tablets as possible. This resulted in about half the class having a device. This was anticipated, and I arranged to have several extra devices on hand. When we setup our devices for the exercises, we were met with our first dose of reality.

Reality #1 All devices are not treated equal. Several devices could not load the low end exercises. Every parent is not going to have the interest or means to buy the newest technology for their child.

In our experience the older kindles experienced the most problems. This problem was amplified by not having any native kindle apps to go along with hour of code. I know why my family purchased a Kindle: Cost. I am sure other families have done the same. Our education efforts need to cater to a broader base of technology.

Bandwidth

The school where we had our Hour of Code had a student wi-fi network. Even having a student accessible wi-fi network was a great blessing. However, we also found that we quickly consumed all of this precious resource.

Reality #2 School networks can be unreliable and slow. Any material that is streamed can not be relied on in a classroom setting

In our situation we made some accommodations by having a few of the phones switch from the wi-fi to cellular networks. Results were mixed for the students that remained on wi-fi. Some students got what they needed while others became the victims of network metering and never setup their device.

Part II: Key Observations

Students that Tackled Smaller Steps Did Better

Breaking a problem into smaller steps is a fundamental concept for problem solving. This simple principle has brought me great success in school and in the work place. Certain students broke the problems down naturally while others tried to do too much. In my own family my older child broke down the problem while my younger child struggled with this idea. Without fail the students that solved smaller problems moved through the material faster. This observation leads to the following paradox:

We must think small to think big

It is through partitioning the problem space that we can swiftly solve larger problems. As learners this means we must resist the urge to appear proficient out of the gate. We live in a world where perfection is paraded  as normal. Music is auto-tuned, models are photo shopped and athletes dope to perform beyond their natural ability.  Contrary to popular belief, perfection is not easily obtained.

A learner will simply not be proficient when they are first exposed to a new concept. And, the key secret is to not only accept, but to embrace this fact. Everyone must start with the smallest idea they can grasp and build out from there. My neighbor may be ahead of me, or at least appear ahead of me, but that does not matter because it is up to me to master the fundamentals at my own pace. Think of how many times it took your hand to learn writing. Think of how long it takes to learn an instrument.

Learning is a process

As educators we may need to slow down students that are unsuccessfully taking on multiple steps. We must encourage students to solve the problems they can solve. Included in this is we must resist the urge to say “Well, Billy figured it out, you just need to work harder”.  Confused learners that are trying don’t need to be told to work harder, they need to be told how to break the problem down into smaller pieces. At no point should the words “it’s obvious” be uttered from our mouths. “It’s obvious” is an intellectual cop out that actually says “I can’t explain this better”.

Students that Verbalized Their Efforts Fixed Problems Faster

This observation supports the classic “Rubber Duck” theory where the act of telling another person out loud what is happening, or an inanimate object like a rubber duck when no one can listen, helps the speaker to quickly, almost magically, resolve their problem. I have a variety of personal experiences that speak to this idea. In our classroom experience the same patterns emerged. Specific students would naturally say aloud what they were doing. Meanwhile students that quietly toiled stayed stuck longer. Often it was when they were asked to explain out loud what they did that the problems just “jumped out”

Explain the problem to someone if you can’t solve it

As learners, the important thing to take away from this experience is to involve others when we face problems. They can’t just be there, we must put the problem to words. If no one is available we must still vocalize the problem. Speech invokes important parts of the brain, and when you are faced with a difficult problem you need all of the help you can get.

As educators this means we need to encourage more discussion. This can be difficult to do in a classroom environment if everyone were to talk at once. Maybe it has to happen outside of class, but the dialog needs to happen. The Hour of Code instructional aids had great advice when it came to providing help

Ask three then me

This approach naturally promotes an environment where problems are vocalized. Some teachers also allow students to correct their work to redeem some points on homework and exam questions. The general line of thinking is that by doing it right a second time a student will learn what is needed. However the “Rubber Duck” theory seems to highlight that if we want true understanding in our students, they need to explain out loud how they tried and failed to solve the problem. Talking takes more time and effort, but conveying true understanding has a life long impact. I know you are busy as an educator. I also know that deep down you want to make a difference in the world. Do the right thing regardless of the cost.

Good Enough Software

As a professional programmer I have had moments of near manic OCD on projects. I have also had moments where I had to just be satisfied when things were “good enough” As I observed the Hour of Code I considered whether “good enough” really is good enough. I will present the case for subscribing to this principle and rejecting it and allow the reader to form an opinion.

The case for “Good Enough”

Several levels of the Light Bot Hour of Code really stumped the new programmers. Nearly everyone was diligent and eventually found solutions. Some of the solutions were longer than they needed to be and less than elegant. The validation engineer in me immediately saw the imperfections, but I held my tongue and  no one was was asked to repeat any level where the goal was achieved. The point of the lesson was not to become a master Light-Bot technician, the point was to get a feel for a variety of procedural approaches.

You need a clear goal to know what is “Good Enough”

Reality #3 The world runs on “Good Enough”

The fact of the matter is that the real business world is based on “Good Enough” The goals end up being things like “Make money with the software” or “Be on the shelf before Christmas”. These are times where things that may seem important to programmers, such as white space usage, actually have no bearing on the business goals. In the same vein it is easy for educators to place emphasis on items that don’t support real life goals. Stepping back and asking “What am I trying to achieve in my students lives?” can have profound impact on the details you scrutinize and choose to overlook.

The case against “Good Enough”

“Good Enough” can also be considered a slippery slope that encourages mediocrity. Where ever you set the bar is where people will rise or fall to. The academic world simply does not have room for sub-par work. Only students that master the fundamentals have earned the right to use artistic license to be selective in what principles they apply.

Train hard, fight easy

Reality #4 Excellence is a rare combination of skill, talent and dedication

These principles are near and dear to my heart. These were words repeated by my wrestling coach and my track coach. These were men I had great respect for, men that were champions, men that built champions. They were relentless in their pursuit of perfection. I can remember specific teachers in college that pushed harder than others for excellence. If you can achieve this presence as an educator, your influence will forever be etched in the minds of those you teach. The key point to be this force is that you must achieve personal greatness. My wrestling coach was a four time state champion. My track coach set records that people are still trying to beat today. The professors who pushed for excellence had worked on important projects in the industry. They forced excellence because they intimately understood what it took. Asking the question “Am I qualified to expect excellence?” can set the stage for teaching beyond “Good Enough”

As a learner we must seek to understand what the instructor is trying to get from us. Do they have a goal in mind? What is expected of you? Do they seem to be forcing excellence and not settling for “Good Enough”?  Have they proven mastery in their own life?

Part III: Improvements

  • Coding exercises need to work on old devices
  • Dedicated coding exercises are needed on Kindle
  • All downloaded content must be prepared outside of class
  • Show struggling students how to decompose the problem into small, manageable steps
  • Encourage discussion to have students solve problems on their own
  • Use exercises that note when a solution is good enough or optimum. This was seen some in Light Bot Hour Code, but was more apparent in the game version with the star system.
Advertisements

Lab[3] = Make Some Noise

November 19, 2013 9 comments

Note: If you tried this lab on or before 8/29/2013, there was an error in the original code. Please download the code again.

Objective

  • Run the Jaalaga starting code on a device
  • Pick different sounds
  • Update the credits screen if you use different sounds

What You Will Need

Lab Version

  • Version 0.3

Prerequisite

In Lab[0] we setup a development environment. Our development environment at this point includes several software tools, the AndEngine source code and our Android or Kindle Device. Among the code was a project with a wide variety of AndEngine examples. You should have reached a point where you ran these examples on your device. If you did not reach this point you should get Lab[0] working before tackling this lab because it requires a working AndEngine setup.

Introduction

In this lab we take what we accomplished in lab[2] and add some excitement with some sounds. Audio is an important element to a game because it can is another way to convey to the player what is going on in the game world. Tense music and sound effects can add an extra level of challenge to any game. In the interest of keeping these labs shorts, we will focus our audio efforts on replacing existing sounds.

Steps

Run the Starting Code for Lab 3

First you will need to get the starting code from Git Hub at the link described above. Add this project to your working setup from Lab[0]. Note, if you changed the graphics in the previous labs, you can update just the “src” folder and the “assets/sounds” folder.  Compile and run the code. You should now hear sounds when a missile is fired or when a missile collides with an enemy. If you are happy with the sounds, you are done!

Update the Sounds

The source code for this lab and future labs will be marked with comments that have TODO at the beginning. This lab has x such comments

Original Sounds

The player missile fire sound is a creative commons attribution sound. Therefore the sound shows up in the credits. Here is the original sound: http://www.freesound.org/people/bubaproducer/sounds/151022/ This file is saved as playerFire.mp3 and is stored in /assets/sound/

The collision sound is another creative commons attribution sound. It is also listed on the credits scene. The original sound can be found here: http://www.freesound.org/people/Robinhood76/sounds/187647/  This file is saved as enemyExplosion.mp3 and is stored in /assets/sound/

Replace Sounds

If you want to use different sounds, replace the mp3 files mentioned above to a file with a different sound. Make sure they are fairly short because the audio pool is a small, finite size. If you load a sound that is too big to fit into memory, AndEngine will simply not play the sound.

Update the Credits

See the new file JaalagaCredits.java for code that displays the credits screen. When using sound from FreeSound.org, or any source, you should comply with the license terms. Attribute means give the author credit. Non-commercial means you can’t use the sound if you intend to publish an app for profit. Honoring license terms is the right thing to do as a content creator. If you can’t or don’t want to comply with the license terms, simply don’t use the work.

Lab[2] = Make it Collide

November 12, 2013 Leave a comment

Objective

  • Run the Jaalaga starting code on a device
  • Detect collisions between missiles and enemies
  • Establish good values for the ship’s speed and missile speed with the expanded game loop
  • Pick better sprites for the enemy ships

What You Will Need

Lab Version

  • Version 0.5

Prerequisite

In Lab[0] we setup a development environment. Our development environment at this point includes several software tools, the AndEngine source code and our Android or Kindle Device. Among the code was a project with a wide variety of AndEngine examples. You should have reached a point where you ran these examples on your device. If you did not reach this point you should get Lab[0] working before tackling this lab because it requires a working AndEngine setup.

Introduction

In this lab we move beyond what we learned in Lab[1]. A new red button has been added that causes ‘missiles’ to fire from the player’s ship to the newly added enemies. Some basic collision detection has already been added to the code restricting the ships movement to the camera bounds. What is missing right now is the collision detection between the player’s missiles and the enemy ships.

The image below displays the type of thing you should see when first running the code for this lab.

Screenshot_2013-11-11-00-00-08

Steps

Run the Starting Code for Lab 2

First you will need to get the starting code from Git Hub at the link described above. Add this project to your working setup from Lab[0]. Note, if you changed the ship sprite by finishing the last lab, you can update just the “src” folder and the “AndroidManifest.xml” file.  Compile and run the code and you should see something like the screen above.

Examine TODO Items

The source code for this lab and future labs will be marked with comments that have TODO at the beginning. This lab has six such comments

lab_2_todo

Collision Detection for Missiles and Enemy Ships

First, as be sure that you have tried to shoot a ship. What happens? A less than interesting  event happens as the graphic for the missile travels right over the enemy sprite. For this part of the lab will actually try to write some code. Step by step instructions will be given, so don’t panic.

The general algorithm, or approach to solving a problem, we will implement is as follows:

For each missile, iterate over every enemy ship and determine if a collision has occurred. When a collision has occurred, remove both the missile and enemy from the screen.

The procedure above is represented in the flow chart below. Note that this flow also includes hiding rockets that have left the screen. The code you need to add to accomplish this flow is provided below.

lab_2_procedure

lab_2_code

You should add the code above to your project and run the game to see that missile impacts now cause the enemy ships to disappear. Some notes on the code above:

  • A “for loop” is a way to do things in a repeated fashion. It is of the form “for( initial value; condition; end of loop action)”. The normal practice is for loops to count upwards, but this loop is a specific scenario where we may need to remove items and we don’t want to lose our place.
    1. We set the variable j to the last item in the enemies list
    2. We check to see if j is greater than or equal to zero. In other words we check to see that if we have more enemies.
    3. If we still have an enemy, we we execute all instructions in the loop, else we exit
    4. At the end of the loop we reduce the value of j so we can access the next enemy
    5. Return to step 2
  • The recycle call in theory should return the object used for the missile to the pool to be reused. This is because making too many objects can slow down your program as “garbage” builds up and must be cleaned up. That is the theory, but in reality there is a bug in the RocketPool right now that means that the recycling/reuse is not happening. Expect this to be fixed in the next lab.
  • You effectively “remove” something from the screen by hiding it and turning off updates.

Change Ship and Missile Speed

At this point, you may be saying, “I already did that in lab 1!” The need to repeat the exercise is three fold.

  1. The code changed in a fairly dramatic fashion. We could have had a lesson on using a difference tool, but I figured you did not have the time or interest.
  2. The game loop has now grown and the old values may no longer work well.
  3. Repetition strengthens neural pathways

Change Sprites

Something as simple as MS Paint can be used to change graphics. You can also use more advanced image editing software like GIMP (http://www.gimp.org/)

  • /assets/gfx/button01.png (Width: 512 px, Height: 64 px)
    • Normal and pressed graphic
  • /assets/gfx/menu/logo.png (Width: 240 px, Height: 240 px)
  • /assets/gfx/game/ship.png (Width: 64 px, Height 64 px)
  • /assets/gfx/game/enemy1.png (Width: 32px, Height: 32px)
  • /assets/gfx/game/enemy2.png (Width: 32px, Height: 32px)
  • /assets/gfx/game/enemy3.png (Width: 32px, Height: 32px)
  • /assets/gfx/game/playerRocket.png (Width: 5px, Height: 15px)

HGTTG[6] = Chapters 31 – 35

November 12, 2013 Leave a comment

Comprehension Questions

  • Chapter 31

    • What are the names of the mice?
    • What is the structure of the question encoded in?
    • What was outside the door?
  • Chapter 32

    • What question did the mice come up with in place of the real question?
    • Who is after Zaphod?
    • What is the Kill-O-Zap gun?
  • Chapter 33

    • What happened to the police that were shooting at Ford and company?
  • Chapter 34

    • How fast is R17?
    • ho was outside of the police ship?
    • What happened to the police ship?
  • Chapter 35

    • Where is everyone heading?

Discussion

  • Survival, Inquiry, Sophistication. Does the human experience follow this pattern?

HGTTG[5] = Chapters 26 – 30

November 12, 2013 Leave a comment

Comprehension Questions

  • Chapter 26

    • What do you think the Sens-O-Tape record?
  • Chapter 27

    • What is the answer to life, the universe and everything?
  • Chapter 28
    • What will the replacement computer be?
  • Chapter 29

    • What did Ford, Trillian and Zaphod wake up on?
    • What happened when Ford and Zaphod were kids??
    • Who will see the three when the catalog ended?
  • Chapter 30

    • Who is Arthur sent to see?

Discussion

  • How is the recording Artur watched like augmented reality?
  • “Once you know what the question actually is, you’ll know what the answer means”. How does understanding the problem help you?
  • Th planet catalog immersed people into the world being advertised. What is the state of virtual reality technology?

HGTTG[4] = Chapters 21 – 25

November 11, 2013 Leave a comment

Comprehension Questions

  • Chapter 21

    • How many suns does Magrathea have?
    • How does Marvin feel about Earth’s beauty?
    • Who did Arthur meet?
  • Chapter 22

    • Is everyone on Magrathea dead?
    • What does Magrathea make?
    • What happens to Marvin?
    • Who is Slartibartfast?
  • Chapter 23

    • What happened to the dolphins?
    • What message did the doplins have for man?
  • Chapter 24

    • How fast was the air car moving?
    • What new personality did the ship take on?
    • What is the hyper space gateway like?
    • Where did Arthur and Slartibartfast travel to?
    • What special planet were the Magratheans making?
    • Who was furious at the Earth’s destruction?
    • Who has been experimenting on the people of earth?
    • How are mice explained?
  • Chapter 25

    • What was the computer like that was built to determine the meaning of the universe?
    • What answer are the programmers asking the computer to determine?
    • Who were the philosophers?
    • What concerns did the philosophers have?
    • What was Deep Thought’s response to their concerns?

Discussion

  • How is the Hitchhikers Guide to the Galaxy device like Wikipedia?
  • What is the “air car” like?
  • What type of voice interaction do we have with computers today?
  • What is the best (fastest, lowest power, etc.) computer we have today? What about 10 years ago? 20 years ago?
  • A competing super computer was called “Googleplex Star Thinker”, did Google exist when the book was written?

HGTTG[3] = Chapters 16 – 20

November 11, 2013 Leave a comment

Comprehension Questions

  • Chapter 16

    • What planet is the ship orbiting?
    • What did Magratheans manufacture in the past?
    • How is the planet defended?
  • Chapter 17
    • What is the Nutri-Matic
    • What is the recorded message telling the the visitors to do?
    • What were the controls like to manually control the ship?
    • What did Arthur do in response to the pending missile attack?
  • Chapter 18
    • What type of crazy things happened when the improbability drive was turned on again?
    • What happened to the missiles?
  • Chapter 19
    • What escaped from Trillian’s cabin?
    • What new personality did the ship take on?
  • Chapter 20

    • How did the passengers of the Heart of Gold gain access to the inside of the planet?
    • What type of things are in the ship’s medical bay?
    • What happened to Zaphod’s brain?
    • What initials were left for Zaphod to see?
    • What happened when the shutter closed?

Discussion

  • “The fact may safely be made the subject of suspense since it is of no significance whatsoever” As humans do we sometimes over dramatize things that don’t really matter?
  • Does anything like the Nutri-Matic exist today? What would it take to invest a device as elaborate as described in the book?
  • In the comical fall of the missile turned, whale it is mentioned that the whale was busy naming things. What type of terms have been invented during the 21st century?
  • What role does our subconscious mind play in problem solving? What role do dreams play in the human experience?