WorldMaker.netBlog2008February › 28

Twittering it Old School

6 months, 1 week ago

So, I'm still not entirely convinced about Twitter, but I'm tired of people talking about it as some sort of newly sliced bread so I've ventured into the world of Twitter. Now, you can read and follow my twitters from the website, but I figured that wasn't cool enough for retro street cred. I wrote a simple script that will now allow you to follow my twitter from the old school UNIX finger command: finger me@worldmaker.net.

For those curious, here's the simple and stupid Python script to generate a twitterified plan file: (I used Django utils because they were handy; you'll also need python-twitter and simplejson. Django utils need a settings module for translation apparently.)

#!/usr/bin/python
import os
os.environ['DJANGO_SETTINGS_MODULE'] = 'some.django.settings'
from django.utils.dateformat import format
from django.utils.text import wrap
import twitter
import datetime

"""
Simple script to populate a .plan from twitter updates.

Public Domain from Max Battcher.  No rights reserved.
http://www.worldmaker.net/
"""

PLAN_FILE = ".plan"
TWITTER_USER = "YourUsername"

f = open(PLAN_FILE, "w")
api = twitter.Api()
sts = api.GetUserTimeline(TWITTER_USER)
for st in sts:
    txt = """
%s: %s
-- """ % (format(datetime.datetime.fromtimestamp(st.GetCreatedAtInSeconds()),
        "F j, Y @H:i"),
        st.text)
    txt = wrap(txt, 75)
    print >>f, txt
f.close()

Design Decision: The Perils of PNRP

6 months, 1 week ago

Most of my biggest design issues on working on my game have come from the wonderful world of networking. It's not that networking is hard, but it's more that there are way too many choices and currently no decent panaceas.

Currently drawing my ire: PNRP, the Peer Name Resolution Protocol. Ultimately PNRP is a very simple tool: it's a distributed hash table mapping keys to IP addresses. When it works, it's easy and scalable. Want to connect to a new "room"? Find some IPs from PNRP and connect to them and you're done. But it seems to a certain extent that it doesn't really work, at least, not reliably, and when it doesn't work it can be hard to diagnose and harder to fix. Not to mention the fact that on XP it's not installed by default and the install is irritating and quite prone to failure in my experience. It's not exactly PNRP's fault, and I still respect it as a technology, but it just seems that it's still too early to rely on PNRP in an actual application that you plan to distribute outside of a tightly controlled network.

I figured I would eventually have to replace PNRP, but was hoping to at least use it as a cost saving device early on during testing... But all of my difficulties in setting up test environments and working with testers have come from installing Windows Peer-To-Peer and getting PNRP set up and talking to the correct clouds and wondering about why things don't appear to work... So it looks like I'm going to have to replace it as a dependency sooner rather than later.

On a semi-related note: When can I get access to the Steamworks ...

Colophon Copyright © 1999-2008 Max Battcher / WorldMaker. Some Rights Reserved.