Phil Hassey - game dev blog
Phil Hassey as Syndrome
"Look, stores don't sell
costumes like this to just anyone."

Archive for the 'crazy' Category

Thanksgiving Centerpiece – made of cheese doodles

Monday, November 8th, 2010

I think we all have a duty to produce a unique centerpiece for Thanksgiving (or your equivalent national eating turkey holiday.)

centerpiece

This was my Thanksgiving centerpiece from last year. Part of it was performance art – the construction of the piece as the turkey was being cooked. It was made from Cheetos cheese doodles and toothpicks.

This year, I’m considering some other options. Possibly even options that might be semi-relevant to this blog. I’d say more, but I don’t want to ruin the surprise.

-Phil

Galcon for Sixense

Thursday, August 12th, 2010

I spent the first few days this week integrating Galcon with the Sixense motion controllers! It was a nice break from the work on the Android as I waited for a G1 to get shipped to me (I’m not sure if Galcon will work on the low-end phones yet, but I’m going to find out soon!)

galconsixense

Working with the Sixense was very different, the controllers are great, and it really provides a completely unique Galcon experience. I modified the game to allow all modes to be played Co-Op with multiple users (mouse + up to 4 Sixense controllers). And I also added a special Sixense Multi-player mode where you are divided into two teams and can play against each-other.

Like with any interface design I always try and fit Galcon to the device. In this case, I had to modify a few subtle things in the user interface to make it work just right with the Sixense. I also set one of the controller’s buttons to be a “Select-all” and a “Deselect-all” button, which makes it easy to do those common actions. So I think I’ve done a pretty good job matching the Sixense controller interface with the Galcon interface. You can also see in the screenshot that each controller gets a different color for their planet selection / action choices, and the crosshairs contains the Ships % information. The mouse player still goes off the standard Ships % that’s show in the bottom right corner.

All-in-all, I think this variant of Galcon is going to be a ton of fun! I have no idea when it will be available for people to play, but I’m sure it’ll be good times when it is!

-Phil

I have all these cellphones, but I don’t know how to use them!

Saturday, August 7th, 2010

So, turns out I’ve got a lot of cellphones now. But, in fact, I have service for none of them! I just use the Wi-Fi to test my games.

But, I found at GDC earlier this year when I first got the free Droid from Google (with free service for some amount of time) that having a cellphone with 3G in a city is super convenient! I was able to navigate the city and use busses and do all kinds of neat city people stuff. Wow! I even saved myself $50 by taking a bus to the airport instead of taking a taxi! Neat!

Unfortunately, eventually the free service period ended. The trouble is, when I check the Verizon website (which seems to be the carrier for Droid and Palm Pre, etc) they want me to buy a phone for $500 to get cell service. And maybe get a contract, or something. It was all very confusing and sounded pretty expensive.

But I just want to pay for a single month of 3G+voice+text service for one of the phones I already have. Or maybe I’d want to pay for some really basic voice service year-round and upgrade to 3G fancy stuff during the couple of conferences I go to. Or maybe pop on some service for like a weekend once in a while when I go to a city or something. Either way, I’m entirely unsure how to navigate the wide-world of cellphone plans.

Help me!!!
-Phil

P.S. I have a Nexus One, a Droid, a Palm Pre, and soon: a Palm Pixi and a G1. I’m entirely unsure what I can do with all these phones, but I want to be able to make calls and use 3G from time-to-time!

Galcon iPad Sale and cool tournament with art prize!

Wednesday, June 16th, 2010

Hey,

I’m going to make a piece of custom artwork as a prize for a Galcon tournament! It’ll look something like this, but not exactly, because I already gave this one away to someone else:
phil-artwork

That image was actually colored pencil + markers + water color on paper. Then I scanned it in, inverted it, and added a bit of glow. The winner will be getting a new piece of artwork – I’ll send them the original in the mail as well as display a slightly enhanced version on the website for everyone to envy 🙂

Anyway check it all out here.

-Phil

xkcd “Self-Description” solved with python+pygame

Wednesday, January 13th, 2010

Well, something about this xkcd comic drew me in …

The 3rd panel reminded me of a study I did in college on iterated function system fractals.  These fractals are known for creating ferns, trees, and the Sierpinski triangle.  There are a number of ways of creating these fractals, but one of them is called (something like) the reducing photo copier method.  Where you can start with ANY starting image on your photo copier, and just shrink the images, make a few copies, position them on the copier, and repeat.  Eventually your image converges towards the fern / triangle / whatever if you are precise.  (This can be done with a ‘Real Life’ photo copier for simple IFS like the Sierpinski triangle.)

So as a way to avoid work that I’m supposed to be doing this evening, I figured I’d see how “accurate” this comic was.  Here’s my pygame code that checks it out.  If you run main.py it will start with an image (the xkcd logo) and each time you press a key it will do an iteration of re-creating the comic.  You can see it flashing between the current iteration and the original strip.  After about 4-5 iterations the images converge (pretty closely.)

The most interesting bit was trying different starting images and seeing how long it took to converge.  Starting with all black  it takes 6 iterations.  Starting with all white takes 5 iterations.  And starting with the xkcd logo takes 4 iterations.  The logo probably goes the quickest because it has some black and white in it (like this image) so it converges faster.  (You can edit main.py towards the bottom page to try these different starting points.)

So .. there ya go!  Enjoy!

-Phil

Elephants! First python + pygame game submitted to App Store :)

Saturday, December 19th, 2009

So, I managed to submit a “python” app to the App Store — “Elephants!” Here’s a few crazy things I had to work out to get things going:

  • I found that ObjC doesn’t care much for C++ objects that do their own reference counting.  To have a “Game” object at all, I had to use a pointer to my object instead of using my reference counting object.  It seems that during some of the “magic” of ObjC it copies objects without calling any of the C++ copying methods, so reference counting gets killed.
  • I ported a basic subset of pygame to tinypyC++ and made it work under openGL.  I don’t have this available in my tinypyC++ repository because it takes a good deal of prep-work to use (isn’t out-of-the-box) so it wouldn’t be generally useful to anyone yet.
  • I was able to get pause on call / resume working by saving the game state to a text file.  Since tab-separated files are so easy to create and parse in python this seemed to be the easiest route to getting the project done.
  • I learned a ton about C++ templates.  I still haven’t even touched the tip of the iceberg, and I’m not sure I want to, but at least I’m getting the basics down and that seems to be enough for me to stumble through this project with.

You can check out my current progress at svn://www.imitationpickles.org/tinypy/branches/tinypy2 (in the tinypy/example folder you can check out a julia fractal demo.  It also includes a mini pygame module that depends on SDL not OpenGL, so it actually works out-of-the-box.)

Here are some things I’ve been adding this week in preparation for my next project:

  • I’ve added “weak pointers” .. Since reference counting has the problem of cyclic references never getting collected, I had to do this for some use-cases.  In tinypyC++ weak pointers are just normal pointers, and if the object is collected, the pointer will be invalid, so be careful.  They are created by doing stuff like “x = ptr(GameData())”
  • I’ve added more C style types.  I’ve got uint16, cstr, Array, etc.  This all makes it possible for me to have a different kind of object – a struct in tinypyC++.  The struct is meant to be a C oriented type that can be saved directly to disk.  In Elephants I serialized via saving CSV data.  In the future, if I keep all the game state in C struct type data, I can just use a single simple line like “open(‘data.txt’,’wb’).write(struct_dump(game_data)”
  • I found that STL extensions include a “hash_map” which turns out to be about 2x as fast as the normal “map”.  I’m using that now.

I’m not entirely sure how useful this project is going to be for anyone else, or even for me for that matter.  But I think after my next game project I’ll have a much better feel for what the situation is.  TinypyC++ has some real tradeoffs in terms of being a bit of a hybrid of C++ and of python.  It doesn’t offer the full power of either language.  But I’m doing my best to capture a middle ground between them that will make my life easier.

Galcon pricing experiment

Monday, November 23rd, 2009

Two weeks ago, the price of Galcon @ $3, Labs @ $2, and Lite @ $0.  This past week, I changed them to Galcon @ $5, Labs @ $3, and Lite at $1.  I wanted to see how this would impact revenue.

And the big surprise is …

It didn’t!  Much.  Best I can calculate, revenue was down 10%.  The most dramatic change was Lite, which went from $0 revenue to a few bucks a day, and from a few hundred downloads to almost none.  So this week I’m changing the prices back to Galcon @ $3, Labs at $1, and Lite at $0.  What have we learned?  It seems that people who want a free game want a free game, and people who are willing to buy would rather spend less.  Since I’m not going to run this sale for a month I can’t say for sure what the long term effects will be, but I’d guess word-of-mouth would be reduced as the pool of Lite players shrunk.  Who knows 😉

Cheers!
-Phil

I can has flash?!

Thursday, March 12th, 2009

So .. who thinks flash + Galcon = win?  I don’t know yet, but I’m giving it a try.  I’m not actually developing the flash version.  An awesome friend of mine has been doing the time on this one.  Though I’ll probably be doing the LAMP end of the deal.  At present the game is non-networked, but we’re been considering the possibilities.  A TCP/IP edition of the game could be made, but I wonder if that would end in tears.  TCP/IP isn’t ideal for gamedev IMO.  Flash doesn’t support UDP as-of-yet.

This isn’t the first time Galcon has reared it’s head from within the browser window.  (See my earlier blog posts …)

I haven’t decided exactly what I’m going to do with this once it’s completed.  Probably a few things.  Throwing it on facebook is an obvious one.  Throwing it on galcon.com is another one.  Maybe mixing it with something like The Maze of Madness is another one.  Or maybe something else!

One idea that I have that would be really cool would be if the tinypy vm were ported to ActionScript using Alchemy* .. and then somehow people would be able to script Galcon on the web and share it with their friends..

*I don’t know if you caught that .. but I think my weekend just got booked 🙂

From python to C++

Saturday, February 14th, 2009

I think I wrote an article a few months ago comparing C and python.  I’m doing some new iPhone games now, and this time I’m using C++.  I found not having classes was getting to be too painful for me, so I’m trying out C++.  Here are a few things I’ve observed:

(As a side note – I’m writing my games /almost/ the same way I’d write them in python.  So if you’ve seen my game code, I’m doing almost the same stuff, except in C++.)

  • As usual, not having memory management is a bit of bother.  Fortunately, I’ve found there are only a few places where I actually need it.  The main thing I had to do was write some basic reference counting code for my state engine class.
  • I’m using structs instead of classes, since I have no use for private variables or methods.
  • Having separate .h and .cpp files is a drag.  But them’s the breaks .. It sure would be swell if C++ was a wee bit smarter about that.
  • For my in-game objects, I just define a single struct that has all the possible variables I need.  This is pretty much how I did things in python anyways.  I’ve never been a big fan of using much inheritance.
  • For writing my GUI classes, in python I was able to get lots of magic into them.  In C++ it isn’t so easy to get magic, so I’m doing without most of it.  It seems that most of the magic was gold-plating anyways.
  • Having written all this code in python before, getting clean C++ code seems pretty natural.  I know what I WANT my code to look like, so I try to get my C++ to be as close as possible to that. 
I think the bottom line of this post, is that my code is coming out pretty pythonic.  Maybe?

Running OpenGL Apps on a Linux guest in VMWare Fusion

Monday, January 26th, 2009

Here’s my “tip of the day” for running OpenGL Apps on a Linux / Ubuntu guest in VMWare Fusion.  The problem is that while running VMWare Fusion on OSX, your guest Ubuntu system doesn’t have 3D acceleration.  Bummer!  I really like doing my game-dev under linux .. so after a bit of searching I found this neat trick:

1. Open a Terminal in OSX (host OS)

2. ssh -Y ip.address.of.guest.OS
(You can find out the IP address of your guest OS via ifconfig.)

3. run the game you are working on 

4. OSX pops up a window with your game running at full speed!

Via that SSH session I can run my games under linux, but the OpenGL stuff is forwarded to my OSX host, which renders it at full speed.  This is called X11 forwarding, which I had heard of before, but I didn’t know it included OpenGL 🙂

I’d love it if Fusion included 3D acceleration of linux-based Guest OSs, but in the meantime, this will get me by.  One thing to note, this isn’t perfect.  I tried running tux racer, and although it seemed to run at full speed, the view wasn’t centered and so I only saw the top left 25% of the game.

-Phil