A bit more polish

Published May 31, 2006
Advertisement
Added a few more bits here and there to make the games a little more consistent. They all have the same button-push sounds now. Most of 'em have their own little "victory theme" that plays when your game is over.

A couple of days ago, Penn Jillette posted an enhanced version of his "Monkey Tuesday" theme to his website. He stated that the theme was free and he was interested in seeing what could be done with it. Since I can't resist free, one verse from the Monkey Tuesday theme is now the "game over" theme for Voracity.

Yesterday Ravuya posted a terrific idea as a comment. Shelly thought it'd be a good idea to send out a daily email with the high scores and links to the games, thus making it easier to make a daily ritual of the games. I was pretty lukewarm on this idea. People seem to cotton to the idea of seeing how well they did at a game, but I've never had a good experience with daily emails. I inevitably become annoyed with 'em.

Ravuya suggested that instead I make an RSS feed out of the high scores. That way I could put together a daily entry of the scores along with a link to the current game. It'd serve the same purpose as a reminder, but it'd be much less obtrusive because it'd be showing up in your RSS reader of choice rather than your inbox.

Unfortunately, this brings up a problem. The way my games work is that high score tables are only generated when they're about to be viewed, not when the next day actually begins (12 AM CST in this case), thus freeing me from having some kind of server daemon.

That means if you go to http://www.thecodezone.com/games/poppies.php to play a game, the first thing it does is quietly check the date on the file http://www.thecodezone.com/games/tables/hitable_poppies.php. If the date on the file is different from the server's date, it quietly regenerates that file, showing it in a little floating frame. The upshot is that you see games from several hours ago, even though the table was generated just three seconds earlier (if you're the first person of the day to play the game).

Looking at all of the games for today, for example, the tables were all generated between 1:01 AM and 3:58 AM (CST). Those times correspond to the first time somebody played the game today.

Making an RSS feed would require me to rethink things a bit, otherwise I wouldn't really be able to guarantee a timely RSS delivery. It'd be sort of a dining philosopher's deadlock on a macro-scale. The games are waiting on someone to load the pages so it can update the tables, but meanwhile nobody's loading the games because they're not being reminded to play. The deadlock is only broken by someone playing the games without a reminder, this causing the games to write a new RSS and remind everyone to go and play.

Of course, that's a mite contrived, but it does underline my need for a different way to generate my tables. What it's all leading to is that I need to have. . .

1. A single piece of PHP somewheres that automatically generates all of the tables at once along with a public XML file that people can load into their RSS readers.

2. Something that'll cause that PHP code to run early in the morning.

Now then, It'd be pretty easy to make a little scheduler right here that loads up "regen-tables.php" at 1:00 every morning (CST), but that'd be a mite kludgy. For one, it adds another point of failure to the process. If I go on vacation or something happens that could limit my access to the machine, all of the high scores stop updating.

No, it needs to be something that lives on the server somewheres and automatically runs "regen-tables.php" at 1:00 every morning. I'll probably need to pester the crazywebhosting server-monkeys to see if such a thing is easy to set up.



Now then, next question. Do I need one RSS feed or seven? Easiest would be to have one RSS feed called hiscores.xml. It'd look something like this. . .

DAILY PUZZLE HIGH SCORES FOR 5/31/2006

ChessCards (link to ChessCards):

1. Fredrick Fribble, Moves: 207, Time 3:57
2. Zippy, Moves: 250, Time 4:50
etc.

ConFusebox (link to ConFusebox):

1. Zippy, Moves: 40, Time 2:30
2. Skippy, Moves: 30, Time 3:05
etc.


That'd be pretty straightforward, but it'd also be pretty long. Especially if the games start to get a larger following. If you only care about ConFusebox, you might not wanna sift through all the other scores every morning to see how you did. You might prefer a hiscores_confusebox.xml file that contains only those scores.

In that case, I'd still have a hiscores_all.xml that contains all of the scores (as above) for people (like me) who play all of the games.

Any thoughts? There's certainly no downside to having six individual feeds along with one uber-feed containing all of the scores, but is that just overengineering things? Will I end up with seven feeds, six of which everyone will ignore?


So your homework is the following:

1. How will I best handle doing one early-morning update of the high score tables?

2. One big RSS feed for all of the scores or seven RSS feeds, one for each game and one for all of the games together?
Previous Entry Stuff seems to be working
Next Entry More RSS musing
0 likes 3 comments

Comments

TANSTAAFL
As for scheduling the update of the feeds, I propose the following:

Write a Yahoo! Widget(or the moral equivalent) that loads a webpage once per day, and have this widget running on your computer. This web page, naturally, regenerates your various tables and the rss feed(s). Basically, for the widget, you just need a timer object that uses a URL object and calls fetch() on it.

RE: RSS feed(s):

A problem with both the "single feed only" as well as the "feed for each game" is scalability. In a single feed only situation, as you add games, the feed gets uglier and uglier, but in a feed for each game situation, you wind up with a lot of feeds as you add more games, and that is just as cumbersome.
May 31, 2006 11:53 AM
caffeineaddict
I'd rather have individual feeds. I rarely if ever play anything except ConfuseBox, so anything else would be largely ignored on my part. I do like the idea of being reminded though. I play it every now and then but rarely make it back the next day to check out how I did and consequently don't generally play again for some time.
May 31, 2006 12:01 PM
Ravuya
John, PHP can output XML just as well as it can output HTML -- you can keep doing whatever it is you are doing now with your high-scores PHP script, but have it output RSS XML.

I saw something around here that might help you, unless I've misread your problem.

You'd simply add the URL to the PHP file (http://hattansawesomegames.net/lolrss.php) as your RSS file in your reader and it'd work like magic. At least that's the approach I took with my pure-PHP RSS feed -- no cron job required.
May 31, 2006 03:16 PM
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Advertisement