Archive for May, 2010
Google Pac Man
As many of you probably already know, yesterday Google changed their logo to a playable Pac Man game in honor of the 30th anniversary of the game. A few members of StackOverflow put together the code and assets to allow others (like me) to host it on their own site or even locally. Here is the game:
And here are the assets if you want to host it locally:
Unity
Currently, my job is to create a game to teach astronomy to middle school students. Luckily for me, there is an abundance of options for game engines to help me ranging from the simple and free (Scratch and Alice) to the expensive and complex (Unreal, etc). For our project we wanted an engine deep enough to cover multiple game types in one game that was reasonably priced. After debating over the 2D vs. 3D issue, I decided 3D might be too complex for the style of game we wanted to create. However, after prototyping a few game ideas in several different engines, we settled on Unity for its flexibility and affordability (free for the indie version $1200 for the pro version). Even though it is primarily a 3D engine, 2D games can be made without much trouble.
In order to get familiar with the Unity engine, I followed two tutorials I found in the Unity forums. The first was a basic shmup.
The second tutorial was a redux (in C#) of the first plus an extension that included models for the ship and asteroid. While I followed along with this tutorial, I decided to keep everything in JavaScript. This helped me to clarify some of the elements of the Unity engine independent of language.
After completing the tutorials, I decided to extend the game a bit to include bombs, more asteroids and large asteroids. As of this writing, I haven’t made final decisions for how to complete the game (whether it will be a score the player must or a set time limit), but the current version can be found here:
http://programmingmylife.com/spaceShooter/spaceShooter.html
Unity makes the process of uploading any game you build in the engine to a website incredibly easy. When making a build of a game you simply have to use the following settings:
File > Build settings > web player (make sure to include all scenes)
When you build the game it will create a *.unity and a *.html file (the * represents the name of the game that you set). Assuming your web host knows what to do with the .unity file, you can simply upload the two files and the game will run at that web location. If, like me, your web host doesn’t support the .unity file format likely this will cause your browser to fail to download the content. I received an error on Chrome stating ‘Failed to download data file’ with details ‘Download failed, try again’, but on Firefox, the download status simply stayed at zero. To fix this, you will simply need to include in the directory with the .unity and .html file the following in a file called web.config:
<?xml version="1.0" encoding="utf-8" ?><configuration> <system.webServer> <staticContent> <mimeMap fileExtension=".unity3d" mimeType="application/vnd.unity" /> </staticContent> </system.webServer> </configuration>
I was able to find these instructions from this query at Unity Answers. Unity Answers is a great service that runs in addition to the Unity forums. These two complementary services along with the users give Unity a strong community that should allow users from novice to advanced to find answers to any problems they might have.
How to Set up androidVNC with TightVNC and a Linksys WRT54G Router (Windows)
Have you ever gotten to work and realized you forgot to start the download for that movie that just released today? Or maybe Steam is having a sale and you want the game downloaded before you get home so you don’t have to wait to play. VNC clients allow you to do just that, and now you can do it from anywhere with an Android device and a data plan (or on Wifi).
In the past week since I bought my Droid Incredible, I have been scouring the internet and asking friends to suggest their favorite apps. Nearly all of the apps have been easy to install and use, save for one. AndroidVNC requires a small amount of setup by the user (especially if your home network is not configured for outside VNC access). I wanted to create this post because while this isn’t a complicated process, I wasn’t able to find a set of instructions with all the steps in one place.
I intend to make ‘How to’ posts for any software or hardware project I do that requires me to use multiple sources to finish. This will hopefully serve to help others that use similar configurations in the future and to remain as a record of what I’ve done for my own reference.
NB: If you are trying to do this with a different router, you should determine how to forward the ports (5900, 5800, 5500) on your router, then skip to step 2.
Step 1:
To begin, we need to setup port forwarding on our WRT54G router. First, you will need to enter the setup page for your router. The default address for this page is 192.168.1.1 which you can simply enter into your browser address bar. If this doesn’t work, you likely either have a dynamic IP (here is how to set up a static IP), or your router’s IP address has been set to a different address and you will need to go there instead. Upon entering the settings page, you should be asked for a username and password. The defaults here are to leave username blank and enter the password ‘admin’ without the single quotes. I do suggest changing these to include a real username and a non-dictionary word password for better home netowrk security.
Now that you are logged in to your router settings page, you need to click the security tab and uncheck the ‘Block Anonymous Internet Requests’ box seen here:
After you have done that, be sure to click the ‘Save Settings’ button at the bottom of the page.
Before we can forward our ports, we need to know what the local address of the PC is. You will need to open the ‘Run’ box of your operating system. In Windows 7 and Vista, just type run into the search box in the start menu. For XP, click the run button in the start menu. Type ‘cmd’ (again, without single quotes) into the box and hit enter. In the window, type ‘ipconfig’ (no quotes), hit enter, and look for the value next to IPv4 Address. It should be of the form ’192.168.1.XXX’. Write this down.
Finally, we are ready to forward the ports! Back in the WRT54G setup window, click the ‘Applications and Gaming’ tab. Type the ports to forward as seen below, check the enable boxes (on the three lines you are changing), enter the last part of the IP address you found above in the IP address boxes, and hit the Save settings button again. If done correctly, the settings should be on the page when it reloads. If you do not enter an IP address into the box(es), the ports will not save and you will need to re-enter the information.
Step 2: Finding your IP Address
This one is simple. Simply click the following link:
Look for the number after ‘Your IP Address is:’. Write this down.
Step 3: Setting up TightVNC
Go to the TightVNC website, and download the software. Be sure to get the latest beta version if you are using Windows 7 or Windows Vista. Now, install the software using the default settings. During the installation, TightVNC should ask you for an administration and primary password. Be sure to set these up now and write them down. Now that TightVNC is set up, go to the start menu and run TightVNC Server. Run application mode if you want the service to end on log out (if you have multiple users on your system or if you have safety concerns). Otherwise, either application mode or running as a service should be fine.
Step 4: Setting up AndroidVNC on the Device
First, download the AndroidVNC program from the Android Marketplace, or scan the following QR code:
Open the program, leave the ‘Nickname’ field blank, enter the primary password that you created for TightVNC (not the administrative password, if you made them different), and enter your IP Address from step 2. Click connect and you should be able to control your PC from your Android device!
Incredible
Last week, I decided to jump on board the Android bus and bought the HTC Droid Incredible. I haven’t had it long enough to give a full review, but I’d like to give a review of my first experiences with my own smart phone (I have played with other smart phones, but having one all the time for a few days is a different experience than playing with one even for an extended period).
Technically, my first smart phone was the LG Vu. I returned it within the 30 day return period because 1. I couldn’t justify the extra expense of the data plan 2. The internet and phone in general were sluggish and 3. The apps that currently make smart phones much more enticing were nearly nonexistent. The Vu was mostly just a touchscreen version of the LG Shine (which is the phone I ended up going with).
The Incredible’s 1 GHz Snapdragon processor along with the relative maturity of the Android App Marketplace take care of the latter two concerns. I have not yet felt as though the phone was slow to do anything. Snapping through the home screens and getting into apps are a breeze thanks to the processor. So far, most of the apps seem interesting, but I haven’t had reasons to use them naturally. I’ve opened them up and looked around, but I haven’t wanted movie times because I was going to a movie or looked for a specific youtube video using the app for example. I’ll get around to discussing those things when I’ve had a better chance to interact with those apps organically.
What I have had much more interaction with thus far are the widgets. These alone have nearly justified my purchase. The home screen widget from HTC gives me a large display of the time and the weather, which I would hardly ever check before I had this phone. I also have a habit of not checking my Google Calendar nearly as much as I’d like to remember important dates and events. I have been checking it more often now that it is more easily accessible, and I think I will be using my it more often now that I don’t have to go out of my way to see it.
The Scoreboard widget has also helped me out already. Friday night I had a bit of time to kill before leaving to meet some friends, and the widget reminded me that a hockey game was on that I wanted to see. Without that, I would have likely forgot and done something else. It is a quick and convenient place to check when my favorite teams are playing next. It also send notifications for score updates for my favorite teams.
Also, during dinner Friday night I was able to use the internet to come up with some trivia my friends and I were debating (did you know John Milius directed Conan?).
The Facebook widget hasn’t really done much to change how I view Facebook. It scrolls through some of the most recent status updates, but if I really want to check Facebook, I will always open the full app to scroll faster. The same goes for Twitter.
Another big upside to having a smart phone with a data plan is being able to take advantage of Google Voice. One way to justify the extra expense of the data plan is using Google Voice to manage text messages. While you can’t send to multiple recipients or send MMS messages, all regular texts are free and get sent to the Google Voice app. The only difference between checking a regular text and one through Google Voice is which button you click to open the message. Depending how much you pay for texts each month, this alone could justify the price of the data plan. Additionally, I can’t stand that carriers see fit to charge for texts with a data plan. There is nothing special about the data in a text. It is simply a packet of data of predefined size that your wireless carrier charges you a special rate for because they can. There are other advantages to Google Voice, but sticking it to the man is the one that matters most to me.
So while I am still getting used to having a phone capable of all this (as well as getting used to a touchscreen keyboard), I can’t see myself going back to a ‘dumbphone’. I’ll get into any problems I run into with the phone in a post in the near future, but for now, I can’t come up with anything negative about this phone: it’s just too incredible.
Blog Chronology
I was recently approached about programming a small app for Android. I have been following Android’s development for a while and decided this was a great opportunity to dive in and start seeing what I could do without an Android device. I haven’t done much in the way of programming for Android yet, but I’ll be sure to update when I do. In my search for information about how to get started with development for Android, I came across the Replica Island blog*.
While some blogs may have outdated early postings (who will care what I thought about Windows 7 when Windows 10 is out?), a blog devoted to one project, such as the Replica Island blog, is better read chronologically. I appreciate the default layout of placing the newest posts first for most blogs; it makes sense for the vast majority of visitors to a site. However, I haven’t seen any blogging site or software that gives the reader an option to reverse the posts and place them in chronological order easily on the main page.
In the case of a specific project blog, this is really the only order that makes sense. When I came across the Replica Island blog, I wasn’t concerned with the newest post because I wanted to read about the entire project from the beginning.
In addition to blogs devoted to a single project, I have had to emulate this feature for other blogs I enjoy reading. Before starting this blog, I decided to see how some of the bloggers I enjoy reading started off (Joel Spolsky, Jeff Atwood, Scott Hanselman). As with this blog, each of those have a front page featuring all of the posts in reverse chronological order. Instead of clicking a link that puts the posts in chronological order, I had to find the first post and work from there.
*For those interested in more about Replica Island, also see this video.


