Phil Hassey - game dev blog
Phil Hassey as Rambo
".. I've been there,
I know what it's like,
and I'll do it again if I have to."

Restricted tinypy to C++ compiler

December 1st, 2009

elephant1I’ve spent the last week working on a tinypy to C++ converter.  It works!  See the screenshot to the right – I’ve managed to port a pygame game over to C++.

Here’s how (and some of the catches):

  • I require type annotation of all the functions and methods.  “def test(x:str)->str: return x”
  • I do two passes on each file, the first pass to catch all the function types and class members, and the second pass to generate the code.
  • I generate C++ code that has automagic reference counting.  So you have to code your script so it won’t have any cyclic references if you want garbage collected for you.

How is this different from shedskin (really cool project!)?

  • Built-in reference counting, instead of using libgc.
  • I require the user to type annotate everything.
  • It only supports a subset of the tinypy subset of python.  Shedskin supports a much larger subset of python.

So what’s the point?

  • Well, I learned a lot about STL and C++.
  • I know it will produce iPhone friendly code, I’m pretty sure libgc isn’t iPhone friendly?  (At least, I haven’t found anything via a few searches…)
  • Way less magic.  Since everything is annotated, there are no surprises.
  • Implementing C++ modules is pretty easy – the code can be inlined within the python code and it just works.
  • This will make it easier for me to develop C++ games.

Anyway, if you’re super brave, you can check out svn://www.imitationpickles.org/tinypy/branches/tinypy2 .. I don’t have the elephants example in there, but the pygame.py that I include gives you a pretty good example of a complex module.

I’m going to chat with the tinypy folks to see if we’ll merge this into the tinypy trunk or have it as a separate project.  I’m not quite sure what makes sense to everyone else 🙂  The nice bit about merging this in is that I could unify the test suites nicely.  And tinypy would still function as normal, just better tested, and with function annotation parsing supported.  All that said, I should make a tinypy module for tinypyC++ so that I can do some code evals!

Galcon pricing experiment

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

Galcon Labs super awesome Galcon sequel on App Store!!

October 2nd, 2009

Finally it’s here!  Buy it now!

Really, with 4 totally new single and multi-player missions, it’s a pretty kickin’ time :)  I’ll be playing a good deal the next few days, so I hope to see you on the games!

For more screenshots and other goodies, go here.

-Phil

Galcon Labs on the App Store!

October 2nd, 2009

Hey,

So Galcon Labs is now available on the App Store! Check it out 🙂

Anyway, I just got back from 360iDev where I gave a talk about Galcon Multiplayer.  The two main points made in the talk were about managing community, and test driven development.  With so many devs talking about App rejections and other problems, I wanted to make sure the app was approved first time through the system.  And it was, in an excellent 7 day turn-around 🙂  So a real big thanks to all the folks out there who pressed me into reading the Kent Beck book on the subject!

-Phil

Galcon Labs – Preview!

September 24th, 2009

labs-asn-1-p-txtHey,

After a few days of itunesconnect being down, I was able to submit Galcon Labs to the App Store.  Check it out!  (See Phil’s first ever video!)

On a dev note, this game was REALLY fun to make.  I got to do things that completely change the gameplay of Galcon so that Galcon Labs is really four totally different feeling games.  My favorites are the Billiards mode (where the planets move around) which is just a lot of fun, and the Assassin mode where instead of trying to conquer everyone, you are assigned a single player that you have to destroy first.  The interesting thing about that, is if you destroy another player, or the player who is trying to annihilate you gets destroyed – YOU LOSE!  It really changes up how you have to play!

As usual, testing (TDD) was a big deal.  Having a network game makes it so that everything has to be tested to make sure it really works.  I’m going to be doing a talk at 360iDev on Wednesday, so if you want to hear me compare UDP networking to herds of rabid animals, be sure to attend.

Also, check out pygame 1.8.  It is really awesome 🙂  While working on Galcon Labs I felt I needed to put more effort into differentiating the game from previous Galcon games visually.  As it’s still triangle ships and planets, this took some effort.  And during the last hour, I decided I needed a whole shiny new look for the planets.  In the game I use a texture with 64 planet designs on it.  So creating all those by hand would have been too hard.  I used pygame to generate new landscapes and found the new pygame 1.8 features really helpful.  I was able to use the new blending modes to trim the landscapes into circles and rotate and scale them down so I got a nice antialiased look for all the planets.  In previous versions of pygame, this would not have been nearly as easy!  So, not just for games, but for generating and doing automated image manipulation, pygame is really starting to shine 🙂

Cheers!
-Phil

Galcon T-Shirt Competition!!

September 1st, 2009

(I should have posted this earlier, sorry blog-reading folks!)

Rev up your design skills and make a Galcon T-Shirt!  Top entries win a FREE T-Shirt and the admiration of the world!!

http://www.galcon.com/misc/compo.php?cid=2

Here’s some graphics, logos, fonts, and other goodies from the new iPhone Galcon that you can use on your T-Shirt:

http://www.galcon.com/stuff/tshirt2.zip

Contest Starts: August 25th
Contest Ends: September 8th
Voting Ends: September 14th

Fine print: T-Shirts must be family friendly.  Unfriendly t-shirts will be DQ’d and will incur the wrath of Nanno.  Upload a hi-res (300dpi) image, if trouble ensues, use the Contact form and bug Phil.  T-shirt designs become property of Galcon.com.

Preview entries here: http://www.galcon.com/misc/compo.php?action=ipreview&cid=2

Have fun!
-Phil

Oddball python import issue?

July 16th, 2009

It seems when I have the import within my function I get some strange behavior.  For lack of cooperative blog formatting, here’s a link to the code and the results.  I tested this with python 2.5.2 and 2.6.2.

Now that I’ve pinpointed the issue I can easily work around it.  But .. I’m still curious if anyone can tell me what is going on?  Is this a feature?  Or is there a bug at work here?

Galcon at 360iDev

July 13th, 2009

“I just got accepted to speak at the 360iDev Conference!  The show will be going down September 27 to 30, 2009.  It’s looking like it’s gonna be a great show, especially with yours truly speaking. The first one was a hit among the attendees and this one is looking even better than the last. Tickets are cheaper on a first come, first serve basis! So buy your tickets asap at http://www.360idev.com/ to get the best possible price. See you there and you better go to my session!”

So, yeah, .. It should be awesome.  I managed to secure an 80 minute talk spot – which will include me talking about dev, Nan talking about the community, and Tim talking about the audio.  So it’s really going to be a great opportunity to meet the whole Galcon team.

Cheers!

-Phil

Galcon Flash is here

June 23rd, 2009

There’s not a whole lot to say, since all you have to do is click on it to play it NOW!  Really, Galcon is an amazing Realtime multi-player game .. IN FLASH!  With 100’s of servers, we’re ready to expand to 1000’s of simultaneous users playing the game!  The game allows for anonymous non-paying users to play the game, so it should be great for n00b stomping.  (All n00bs get the name “n00b-23432″ or something like that.)

Anyway, have a blast playing it!  Also, buying Galcon and Flash Galcon is the same thing .. I dropped the price to 7.95 for the launch of this, since Galcon has been out for almost 3 years now.  Hopefully this will also kick some more life into the Classic Galcon community again!

-Phil

Galcon Flash has arrived ..

June 23rd, 2009

So .. Yeah.  Check it out.  Realtime multi-player game .. in flash!

So on a more technical note .. The game involves quite a number of technologies!

  • AS3 – of course – for the Flash client itself
  • C++ – for the server
  • PHP – for the web API and rankings system
  • python – for the bots

If I did the project over, I’d probably do the server in python as well.  But all in all the project went pretty well.  After things were done, it only took me a morning to write up the python client.  There’s a very good chance I’ll release that code in a few weeks and let people try making bots for the game.

Anyway – have fun checking it out.  I’m a bit wiped out from wrapping all this up, so I’ll try and post some more interesting details later!

-Phil