Urban Dead HUD; added Inventory Sorting

I’ve updated the Urban Dead HUD Greasemonkey userscript; it now offers inventory sorting, inspired by Ikko’s userscript (albeit a little different in implementation). Here’s a screenshot:

Right now, UD is reasonably interesting — our team of plucky survivors have been helping out with the defence of Caiger Mall, a major mall towards the north-west of the city. We’ve repulsed the Church of the Resurrection’s attempts to wipe us out, but that seems to have made us quite a juicy target; there are now no less than three separate Zombie groups ganging up on us. For now, we’re still holding out.

Tags: , , , , ,

Comments (4)

Urban Dead HUD

I’ve been playing a bit of Urban Dead recently. Urban Dead is a very low-key, web-based MMORPG — you play a 3-minute turn once every 24 hours. It needs some rebalancing and some new features, especially given the organised nature of some of the bigger marauding zombie hordes, but I’m still finding it fun.

To scratch a couple of itches, I’ve written a Greasemonkey user script for UD called the Urban Dead HUD. It adds several nifty features to the user interface:

  • keyboard accelerator access keys for the action buttons, and your inventory — very handy when you’re attacking an enemy repeatedly;
  • an on-page long-distance map of the surrounding squares;
  • a distance tracker, which tracks the distances to “important” locations for you

There’s screenshots on the download page, so you can see what I’m talking about.

Greasemonkey is a fantastic tool, as is Mark Pilgrim’s Dive Into Greasemonkey, which has repeatedly turned out to be an excellent, well-written reference while hacking this. Thanks guys!

Tags: , , , , , ,

Comments (14)

PRNGs and Groove Theory

Urban Dead is a new browser-based MMORPG that’s become popular recently. I’m not planning to talk about the game itself, at least not until I’ve played it a bit!, but there’s something worth noting here — a cheat called Groove Theory:

Groove Theory was a cheat for Urban Dead that claimed to exploit an apparent lack [sic] of a random number generator in the game, [so] that performing an action exactly eight seconds after a successful action would also be successful.

Kevan, the Urban Dead developer, confirmed that Groove Theory did indeed work, and made this comment after fixing the bug:

There is some pattern to the random numbers, playing around with them; “srand(time())” actually brings back some pretty terrible patterns, and an eight-second wait will catch some of these.

So — here’s my guess as to how this happened.

It appears that Urban Dead is implemented as a CGI script. I’ll speculate that somewhere near the top of the script, there’s a line of code along the lines of srand(time()), as Kevan mentioned. With a sufficiently fast network connection, and a sufficiently unloaded server, you can be reasonably sure that hitting “Refresh” will cause that srand call to be executed on the server within a fraction of a second of your button-press. In other words, through careful timing, the remote user can force the pseudo-random-number generator used to implement rand() into a desired set of states!

As this perl script demonstrates, the output from perl’s rand() is perfectly periodic in its low bits on a modern Linux machine, if constantly reseeded using srand()the demo script’s output decrements from 3 to 0 by 1 every 2 seconds, then repeats the cycle, indefinitely.

I don’t know if Urban Dead is a perl script, PHP, or whatever; but whatever language it’s written in, I’d guess that language uses the same PRNG implementation as perl is using on my Linux box.

As it turns out, this PRNG failing is pretty well-documented in the manual page for rand(3):

on older rand() implementations, and on current implementations on different systems, the lower-order bits are much less random than the higher-order bits. Do not use this function in applications intended to be portable when good randomness is needed.

That manual page also quotes Numerical Recipes in C: The Art of Scientific Computing (William H. Press, Brian P. Flannery, Saul A. Teukolsky, William T. Vetterling; New York: Cambridge University Press, 1992 (2nd ed., p. 277)) as noting:

“If you want to generate a random integer between 1 and 10, you should always do it by using high-order bits, as in

j=1+(int) (10.0*rand()/(RAND_MAX+1.0));

and never by anything resembling

j=1+(rand() % 10);

(which uses lower-order bits).”

I think Groove Theory demonstrates this nicely!

Update: I need to be clearer here.

Most of the Groove Theory issue is caused by the repeated use of srand(). If the script could be seeded once, instead of at every request, or if the seed data came from a secure, non-predictable source like /dev/random, things would be a lot safer.

However, the behaviour of rand() is still an issue though, due to how it’s implemented. The classic UNIX rand() uses the srand() seed directly, to entirely replace the linear congruential PRNG’s state; on top of that, the arithmentic used means that the low-order bits have an extremely obvious, repeating, simple pattern, mapping directly to that seed’s value. This is what gives Groove Theory its practicability by a human, without computer aid; with a more complex algorithm, it’d still be guessable with the aid of a computer, but with the simple PRNG, it’s guessable, unaided.

Update 2: as noted in a comment, Linux glibc’s rand(3) is apparently quite good at producing decent numbers. However, perl’s rand() function doesn’t use that; it uses drand48(), which in glibc is still a linear congruential PRNG and displays the ‘low randomness in low-order bits’ behaviour.

Tags: , , , , , , , ,

Comments (8)

JFK Reloaded

Games: OK, JFK Reloaded is very, very wierd.

Read the insanely detailed FAQ and boggle at the author’s obsessive research and fetishistic recreation of the events at Dealey Plaza, November 22nd 1963.

Quite worrying, to be honest!

Tags: , , , , , , , , , ,

Comments

Playing US games on a European PlayStation 2

Games: when I moved from Ireland to the US, I brought along my PS2; I hadn’t had it that long, and I wasn’t going to leave it behind (despite many offers to give it a good home ;).

Of course, Sony include plenty of trade-restrictive features in the PS2; European games won’t play on a US PS2, and vice versa. So until now, I’ve been playing the few games I brought along from Europe, with the help of a YPbPr VGA converter, allowing the PS2 to display on a VGA monitor, and a transformer to transform 110V US current to 220V.

But that was before the superb japanese craziness of Katamari Damacy came along, and with GTA: San Andreas due out next month, something had to be done.

So — after a little shopping, I found the solution — rather than get into serious stuff like soldering, I got this – the Slide Card. It’s a 1.5-inch long piece of plastic, with a carefully placed notch. It requires one piece of PS2 modification — you first of all have to remove the front of the CD panel. This just requires popping out one screw and a couple of clips, painless. You can then leave it off — it’s purely cosmetic — or stick it back on if you really want to, at a future date.

Then, when you want to play an import game, the protocol goes like this:

  • put in the Slide Card boot DVD, power on the PS2
  • wait for the Swap Magic splash screen
  • insert the little plastic Slide Card, and slowly drag it left-to-right until it hits a piece of plastic internally
  • use it to pull out the CD tray, place the import DVD into the tray, and push it back in
  • use the Slide Card again, grabbing a little internal peg part with the notch in the card, and dragging the card right-to-left to load the CD into place.
  • hit ‘X’ on the PS2 controller, and the game boots!

So, this is a nifty solution; it basically works around the disc-replacement logic in the PS2, without any soldering or hackery required. And I’ve successfully used it after a night at the bar on several occasions, so that’s the true test of how twiddly it is ;)

Unfortunately, by now I’ve probably spent nearly as much on hardware to play US PS2 games with a European PS2, as I would have if I’d just bought a US PS2. But hey…

Tags: , , , , , , , ,

Comments (3)

Katamari Damacy

Games: Katamari Damacy (roughly translated as ‘Clumpsoul’) is a game where you roll around various landscapes, making a giant ball of ’stuff’.
Here’s a review. It looks like sheer genius; here’s hoping it gets a US/Euro release!

Tags: , , , , , , , , , ,

Comments

The True Story of Monopoly(R)?

Games: Anti-Monopoly: ‘A professor and a freelance writer are determined to set history straight on the origin and theft of a favorite American pastime’.

Details how Monopoly(R) is very similar — and allegedly based on – The Landlord’s Game, a socialist educational game from 1904, which was introduced as follows: ‘the object of this game is not only to afford amusement to players, but to illustrate to them how, under the present or prevailing system to land tenure, the landlord has an advantage over other enterprisers, and also how the single tax would discourage speculation’.

Apparently, once Monopoly(R) was set to succeed, this original was bought out and buried for $500. Here’s some more links that seem to back that up…

MonopolyCollector.com says ‘the Landlord’s Game was very similar to Monopoly(R), with the purchase of properties, utilities, a public park square, and a ‘Go to jail’ square. Many feel Darrow just added items to this game and improved some features.’

This article and its second part provide lots more detail.

Here’s a description of ‘The Landlord’s Game’, and another.

Tags: , , , , , , , , , ,

Comments

Degenatron!

Games: The DEGENATRON Archive and Gaming Page — amazing. The Degenatron is the games console advertised, and occasionally featuring in radio phone-ins as to the violent behaviour of ‘kids these days’ and the like, on the in-game radio stations in GTA:VC. This faked ‘homage’ page is perfect; right down to the animated rainbow horizontal-rule divider.

Be sure to check out the playable emulators! Smash the green dots inside the mysterious red square!

Tags: , , , , , , , , , ,

Comments

Freedroid

Games: Commodore 64 old-timers may remember Andrew Braybrook’s classic Paradroid, easily one of the best games for that platform, and a classic by any standards. Here’s a copy of the Zzap! 64 review from 1986. Many thumbs up, and the bottom line was that Paradroid ranked as ‘THE classic shoot-em-up’.

Paradroid trivia: in the days before .plan files, Zzap! 64 published a development diary by AB! Here’s the birth of one of the game’s key mechanisms, the ‘transfer game’:

Tuesday May 21: An average morning’s contemplation until …ZAP WHIZ POW ! An idea for a game within the main one, fighting for control of a new robot. Instead of just a graphical sequence showing the takeover of a new robot, why not have to play for it, you against the robot’s brain? Base it on logic circuits and use some existing routines. A whole new game segment in a small space!

Cool.

The authors’ company, Graftgold, has a website, detailing its history. Sadly, it maps the decline of the 80’s-style small games company, and ends on this note: ‘I would recommend the games industry to anyone wanting an exciting career buts its certainly not an easy ride. Most publishers we worked with either went bust, sold out or simply did not publish the game to our expections despite tight contracts. The trouble is the developer does their bit first then the publisher can choose the level to do their bit. Unless you can get real commitment by way of big advances you cannot rely on a publisher.’

Shame. Anyway. I’m not the only Paradroid fan out there — it seems a bunch of fellow enthusiasts have come up with FreeDroid, a homage to Paradroid which seems to be evolving into an RPG! It’s quite impressive – the gameplay is virtually identical to the original. Fedora Linux users can install it using apt-get install freedroid.

BTW, related: here’s two attempts at a canon for computer gamers, at costik.com and the Ludologist (of which I’ve played 121). What I find interesting about them is how clearly one is American and Apple-II-based and the other European and Commodore-64/Amiga-based. Stay tuned for the third, Spectrum-based canon. ;)

Tags: , , , , , , , , , ,

Comments