Py2Exe – Packaging my Python Game

I’m building Eccoes in Python. One of the problems with Python is that not everyone has it. That makes distributing my game all the more difficult. I added some GUI elements to my game yesterday to build a menu using PGU. I also moved all the classes my game uses into some sub folders to better organize it. After these two changes my game would no longer build using py2exe. I tried to point py2exe at the eccoes.py file inside the eccoes package and it could not resolve the dependencies. It also couldn’t grab the graphics files I needed to use PGU. I finally figured it out, but it was a mess. I ended up moving my launching code to the root folder, and through trial and error figured out how to include the assets for PGU.

Resources that I found helpful:

After installing PGU I copied the graphics from C:\python26\share\pgu\themes\default into the same folder as my executable.

I’m planning on distributing my tech demo of the game soon. I need to figure out what license I’m required to distribute it under. I think most of my libraries are L-GPL, so…I’m actually okay there. My graphics, placeholders for now, are licensed under a version of the Creative Commons. I’m thinking I’ll want to do GPL, but I don’t know if anyone is interested in this yet.

Posted in Eccoes, Neat Tricks | Leave a comment

Eccoes – Replays and Testing

I’ve got rudimentary networking working in my game. Two clients can talk to each other directly, exchange messages, and show the movements of the other player. Sort of. The last time I demoed the game, one of the clients dropped a message or something, and was no longer synchronized with the other player. This kind of thing is tricky to test for and tricky to recreate. My current strategy is to open two instances of the game on one computer and manually control them both.

The answer I read about is that I need to build a system that can log player actions and then replay them. That way I can create a set of specific user inputs and replay them in a deterministic way. This is the next feature that I’m working on.

My plan is to create a class that logs all user input in a similar way that player characters log their own actions. This class will use the same clock and history mechanism that the player characters use.

Posted in Eccoes | Leave a comment

NPR Morning Edition Bookmarklet

I like to listen to NPR’s Morning Edition. I’d like a podcast, but there isn’t one available. You can listen to it online, but I find it annoying to have to navigate through the home page to get it. I found myself accessing the player by URL and changing the date. I decided to automate it. The bookmarklet code is here:

javascript:d= new Date();location.href=”http://www.npr.org/player/v2/mediaPlayer.html?action=1&t=3&islist=true&id=3&d=”+(d.getMonth()+1)+”-“+d.getDate()+”-“+d.getFullYear();

Drag the above link to your bookmark bar and then click it to take you today’s Morning Edition.

Posted in Neat Tricks | Tagged | Leave a comment

Skeleton CSS

I really like the minimalist features of Skeleton. There aren’t a lot of styles and it seems to effortless provide what I want. It still took me a bit of extra time to struggle through the styles because there really wasn’t good documentation. The skeleton.css file is almost self-documenting, but not quite.

The main div for your page has the class of ‘container’. Or rather, the main div that you want to have columns inside of it.

You can put columns inside of columns, but you need to add the class of alpha to the left column and omega to the farthest right column. Those remove the padding and make it possible to fit columns inside of other columns.

A row class is useful for outer divs to make sure that the columns end at the same place, but I ended up using the clearfix class for my rows instead. The only difference is that a row adds space between it and the next set of columns, when I really wanted there to be no space.

I really like how the columns stack for a mobile view, but you still need to think about how to present things on mobile. On the page I’m working on I centered my columns and changed the way the menu is displayed.

Posted in Projects | Tagged | Leave a comment