Sunday, 13 January 2008

Unangband Dungeon Generation - Part Seven (Game-Spaces)

(You probably want to read parts one, two, three, four, five and six before starting this).

At the conclusion to part six, I touched briefly on the importance of taking a data-centric approach to game design in Unangband, and cryptically hinted at 'merging possible game spaces' as a means of improving the overall game design. And by merging the possible game spaces, I mean minimising the number of disjoint game elements: that is, the number of different components that make up the game play. A concrete example will help immensely, before I degenerate into a series of circular definitions.

In Angband, there are two ways that a player can be affected by monster attacks. Each monster blow has an effect, which for historical reasons starts with RBE_. Examples would be RBE_HURT, RBE_POISON, RBE_CONFUSE and so on. The monster blow effects dictate what type of damage the player suffers, what items protect the player from this damage and so on.

But there's also monster spells, which have their own separate set of effects, which for historical reasons start with GF_. Examples would be GF_FIRE, GF_POISON, GF_CONFUSE and so on. The spell effects dictate what type of damage the player suffers, what items protect the player from this damage and so on.

When implementing the feature code, I wanted to add the ability to define trap damage in the terrain.txt file. I could have equally created a new set of trap effects, which for historical reasons would start with AD_. Examples would be AD_HURT, AD_POISON, AD_CONFUSE and so on.

Or I could have adopted either the monster blow code, or the monster spell code to implement my trap effects. This would have allowed me to re-use the code that already existed for these two types in many instances, but I would have had to compromise slightly for game balance sake, as the vision I had for e.g. confusion traps, may not have matched either the monster blow or the monster spell code exactly. Unfortunately, there was no clear 'winner' out of the two existing implementations.

What I instead did, was merge the RBE_ and GF_ types together, so that I only had a single choice to make, and then adopted the merged effects code for the trap implementation. This meant not only could I refactor some existing code away, but that I could have traps that caused the player to hallucinate (a monster blow effect) or be hit by gravity (a monster spell effect).

This is the concrete example of what I mean by 'merging the game space'. I took two disparate game elements (monster blows and monster spells) and combined them to take advantage of synergies of scale. I was then able to apply these to traps, other terrain, and ultimately as it turns out, to coating weapons, casting spells, implementing object effects and many other areas that did not feature in the original implementation.

The above example may seem fairly self-evident to you. But consider how you'd implement traps. I discussed this briefly in the previous part of this article. As I mentioned, several variants have implemented traps using a separate data structure, instead of as a feature (or object).

But this means that they have to extend e.g. the monster path finding code to consider separate cases for moving through a fire trap vs a fiery terrain grid. By making traps a feature, I got this functionality for free. Similarly, the monster trap disarming code uses the majority of the same code path as the monster door opening code.

In general, you should extend your existing data structures where ever possible, instead of creating additional ones. I suspect that the vast majority of games would be satisfied with five core data structures: player, enemies, playing field, pick-ups and effects. You may even be able to collapse e.g. player and enemy together.

I would argue against further reduction of data types, because you end up with an object oriented design where everything gets reduced to an 'entity'. This level of abstraction means you'll end up worrying more about the data type design than actual implementation. It seems to crop up quite frequently as a question on rec.games.roguelike.development and I've yet to see any concrete benefits in doing so.

These five data types then have a minimum of ten possible interactions between them as shown below. Actually, there's an implicit additional set of 5 interactions, because each data type could potentially interact with itself.

An interaction is not necessarily just between one instance of each type: it could equally be a 'has-a' relationship of some kind. For instance, in across the Angband variants where the enemy is a monster race, a player 'has-a' an implicit monster race consistenting of the shape the player currently is, as well as being able to ride a monster, and in Unangband, being escorted by particular monster types on battle field dungeons.

Generally in programming, you want to minimise the different total interactions, as these usually require a separate set of code paths (and test cases). But you want the interactions to be as expressive as possible, by maximising the number of permutations of these interactions.

In Unangband, there are a large number of effects, such as fire, water, acid, plasma and so on. Effects are associated with all of the above data types: players and monsters can create effects using spells, the playing field hits locations with effects and pickups (objects) create an effect by exploding, coating another item, and being used by the player.

So it's possible to use water to douse a fire, wash a bloody altar clean or create a wave. A water source could be the waves washing around a water elemental, a potion of fresh or salt water, a player casting a wall of water spell or water flooding from an adjacent grid location. This immediately creates a large number of possible interactions (the player could summon a water elemental to clean a bloody altar, or throw a potion of water at it, or cast a spell, or flood an adjacent location etc) for any particular situation, creating a large number of action choices and rewards the player for lateral thinking.

By merging the possible game-spaces, I've not had to write nearly as much code: instead of every possible permutation of water source and water effect, I've abstracted away as much as possible to the higher level 'playing field' and 'effect' interactions, and handled the majority of the work with data as opposed to code.

In part eight, I attempt some kind of summing up (Actually, it turns out I just continue, looking forward to summing up at in a later part).

Saturday, 12 January 2008

How to make the DVD drive on a Intel MacBook DVD region free

I've finally found the Achilles heal of using an Intel Apple MacBook. Note that I never noticed this with my Intel Apple MacBook Pro, but we had a region free DVD player in the house which cost approximately £20. No more however.

I've just emigrated from Europe, which is Region 2, to Australia, which is Region 4. I do a lot of DVD purchases via the States using Amazon: the States is Region 1.

Apple lets me change the region code on the DVD player 4 times. That's 4 times total. So for example, I can watch one region 1 DVD player, then one region 2, then one region 4, then another region 1. And then no more DVDs on this machine ever, except for whichever region I end up selecting last. That means approximately 2/3rds of my DVD collection will be unavailable to me.

Now, the savvy amongst you will suggest using a region free software DVD player like VLC. Unfortunately, on the Intel Macs this doesn't work. The Matshita DVD player itself compares the DVD region of the disc to the DVD region held in the firmware, and prevents any access to the disc if the regions differ. This means any access, including at a data layer - you just end up with read/write errors using any of the suggested workarounds you may have found on various Mac forums.

The only option is to download a hacked firmware downgrade that changes the DVD player from an RPC-2 player to an RPC-1 player. This of course immediately means the hardware is unsupported - and you risk the OS/X software updater overwriting the downgraded firmware, potentially cause system instability, brick the DVD drive etc.

Here's how you do it:

  1. Download the DVD info utility from MacUpdate here.
  2. Run DVD info. You'll get output of the form shown at the end of the article.
  3. Check this thread and this thread on RPC1.org to see if you've lucked out, and a hacked firmware is available for your particular make and model of DVD player.
  4. If it is, download the firmware and install it.
  5. If it isn't, you need to follow a slightly different process. This only works if you have DVDs of 4 or less regions.
  6. Take all the DVDs of your current drive firmware and rip them using Handbrake, DVD Backup or another DVD ripping software. You'll probably want to DivX or Xvid encode them to reduce disk utilisation.
  7. Locally back them up to your Buffalo TeraServer.
  8. Remotely back them up to isohunt.com using Vuze or another bittorrent client. By doing this you ensure the files are available later - effectively an offsite disaster recovery solution.
  9. Repeat steps 6-8 for the remaining three regions worth of DVDs that you have.
  10. File a suit with the World Trade Organisation against Matshita, Apple, the DVD Forum and other suitable bodies for violating the WTO agreement against region based restraint of trade. The Australian and New Zealand governments may support you, as may Antigua.
Thanks for your patience. This is a public community service announcement. Please note that I strongly support copyright and believe a 14 year copyright term should be the maximum provided for in law. Please ensure before proceeding with any actions outlined here that you are covered by the fair use conventions of your relevant jurisdiction and you are not circumventing a copyright protection mechanism.
DVD Info X v1.0.2, by xvi (xvi@rpc1.org)

WARNING --- DVD Info X will only list DVD drives that have some WRITE
capabilities, like combos, DVD-R, DVD-RW, etc...
DVD-ROM-only drives will NOT be listed.
WARNING --- You also must eject any inserted medium to list the drive.

Vendor: MATSHITA
Model: CD-RW CW-8221
Firmware: GA0J
RPC-2 (region locked)
State is SET
4 vendor resets left
4 region changes left
Region 2

Test post

One of the problems of running a blog is that your content gets scraped and redistributed illegally. I've just amended the RSS feed so hopefully I'll at least get some back links from people reading this elsewhere. Suggested by SEO blog.

Oh, and this doubles as a test post...

Friday, 11 January 2008

Eine Seite fand ich dabei besonders gut

Every so often, I look through Google Analytics to see who is referring to Ascii Dreams. The above sentence comes from Quixotic Project. Luckily I don't need a translation...

Distractions

In case you haven't known, I'm working my way through 'games I own and should have played', and figured you may appreciate my thoughts on the matter. These are a little off-topic, but allow me to procrastinate while I look at the long and well-organised Unangband bug list that Mikolaj has put together for me.

If you want numeric scores with your reviews:

Call of Duty 4/10
S.T.A.L.K.E.R. 9/10

I've really enjoyed S.T.A.L.K.E.R. - immensely so, and it has given me new appreciation for the ability of dynamic AI and monster re-population to keep a location feeling fresh. I would in many ways call this game a roguelike-like for this reason. A couple of things that didn't make the review cut.

S.T.A.L.K.E.R. reminds me of why inventory damage in Angband is such a great mechanic. S.T.A.L.K.E.R. has equipment damage for thematic reasons - it means you can't get too attached to any item, and have to constantly throw away and upgrade your equipment. This fits the Zone: the only thing being made here is the weird artifacts and everything else is temporary and disposable including the people who inhabit it. The dynamic and frequently failed quests work well for the same reason.

Those people who install equipment repair mods seem to be missing the point.

I got quite attached to one of the stalkers, Fox, who appears early on in the game, and who you help out fighting off a pack of dogs. The first time, I kept my weapon drawn too long after wards, and he went from neutral to unfriendly as stalkers do when you threaten them and shot me in the head. Reload. Then he stayed by the fire in the lonely ruined building waiting for someone. I returned much later, and was horrified to see a body there amidst another pack of dogs: relieved when it wasn't his.

I also made the classic error that Sean Bean does in Ronin of trying to position men on both sides of an ambush. Result: I shoot the bad guys, and my Duty allies, they go hostile and return fire.

Let me know if you're enjoying these.

Review: S.T.A.L.K.E.R. : Shadow of Chernobyl

A man lies on the road. He is curled up into a fetal position, head pressed to the tarmac. Fluid gurgles in his lungs. As you move closer past the ruins of a burned out bus, he sees you, and begins to curse and plead with you in a voice you can't understand. He speaks Russian, with a strong Ukrainian accent, but you only know that because of where you are - in the radiation blasted reaches of Chernobyl. You have lost your memory, but there's one thing you have learned.

You raise your gun.

This game is shades of grey on grey, but the bleakest choice of all is the one you are about to face. Forget Bioshock for presenting the moral dilemma of 2007, S.T.A.L.K.E.R. has one greater still. The choice you face is the same: whether to kill or save an innocent. But each word of that sentence is loaded with a different meaning.

In Bioshock, the dilemma is presented in a straight forward fashion, as a part of the narrative. Having killed a Big Daddy, you are given the pros and cons of two different ways of 'interacting' with a Little Sister, and the promise of either an increased immediate award, or the prospect of less gain now, and some benefit 'at some point in the future'. The killing of the Big Daddy is a forced part of the plot, and the similar harvesting or saving of the Little Sister is shown as an on-screen prompt followed by a 'fade-to-black' moment that avoids the unpalatable consequences of your decision.

In S.T.A.L.K.E.R., the choice is just one of many in that tangled world. It can occur as a consequence of your actions, but is never forced on you. When you gun down an opponent, they'll die - usually. But rarely, they'll slump to the ground and lie injured, unable to move or do more than swear at you. At this point is the crux of your decision.

If you find an injured stalker who is allied or neutral, you can talk to them, by hitting the 'F' key. The stalker will then ask for a med kit, which you can give them, and they'll stand again, and become allied, which results in their status switching to a comforting green. You do this because you're human, and leaving an injured man to die alone in the wilderness is the last resort of the wicked, and because med kits at the difficulty level you're playing at are a fungible resource, one you can recover readily unless you're particularly inept at getting shot.

But an enemy?

There are many factions in S.T.A.L.K.E.R., some of which you can ally yourselves with. Others start out hostile and seem to stay that way - but it's never made clear why they're that way inclined. Only a thin line of ambiguity separates the stalkers from bandits, mercenaries, the military in the Zone. You've spoken to the damaged men standing around the camp fires, swilling vodka and listening to the strains of a guitar. Few have much to say, most have none, but the untranslated Russain forms part of the haunting sound scape of the game, and the laughter a friendly counterpart to the howls of wild dogs and worse that infest the wilderness around you.

And this attachment to your fellow stalkers forms early in the game, possibly at the first encampment, where other loners gather on the edge of the Zone, unsure of whether they'll move inside or stay here as outsiders. The black marketeer you start out getting missions from seems less enamoured of humanity: he points out the in-game stalker rankings and suggests you can work yourself the way up the list, perhaps by shortening it a little. He gives you assassination missions - I accepted the first, and then didn't have the guts to go through with what seemed the pointless murder of one man among many.

What keeps you attached is the relentless and inhospitable nature of the zone. The mutated beasts that roam it, and the anomalies that sparkle in the twilight. Existence is fragile here. And the world is alive and continuously changing. If you confront the pack of blind dogs, they're as likely to surround and savage you - no matter how powerful the punch your automatic weapons pack. But if you leave them alone, you'll come back to find them chewing on the body of a fellow traveller. And when you find a scoped rifle, you can watch the pack sit and play in the distance, animals to the end. Guilt grows until every encounter becomes a mess of indecision.

I avoided the bandits who shot at me unprovoked and bypassed the military under the bridge while they engaged in a fire fight elsewhere - but murdered my way through a checkpoint into the second zone area. I had to progress; and there seemed no other way. Then a distress call: some of my fellow stalkers were in trouble in a junkyard. A bloody and messy close encounter in which, submachine gun ammo depleted, I had to engaged point blank with a sawn off shot gun and pistol. The grass became strewn with bodies between the wreckage of old cars. I was angry that I'd been forced to this pointless existence.

One of the bandits lay dying, groaning, cursing. I aimed down the pistol at him. Damn you for this. And shot him, unblinking.

It wasn't until later, presented with this option again, I reconsidered. Did everyone have to die? Everyone has a name here. A roll-call of stalkers, bandits, people, some suggestive of a history, a physical defect. It shows you the name when you loot the body, to remind you, under the gun sight when you aim. I looked down the barrell of my much improved rifle at the mercenary clutching at his guts.

The enemies: When you find an injured enemy, you are not given a choice. You cannot talk to him, heal him, help him in any way. If you walk away, he'll die. You can't loot the body while he's alive. It becomes a trade-off. Guilt, as the blood spatters and the body twitches and rolls. No one carries much here: vodka, some sausage, anti-radiation drugs. The price of a life. But if you walk away, his cries follow you, pleading, angry, alone.

Decisions.

Wednesday, 9 January 2008

Poll results for 'What is your favourite commercial roguelike?'; new poll

No surprises here.

Azure Dreams
4 (3%)
Chocobo's Mysterious Dungeon
0 (0%)
Chocobo's Dungeon 2
0 (0%)
Diablo
17 (16%)
Diablo II
49 (48%)
Dragon Quest: Shōnen Yangus to Fushigi no Dungeon
0 (0%)
Dungeon Hack
7 (6%)
Fatal Labyrinth
1 (0%)
FATE
9 (8%)
FastCrawl
2 (1%)
Hellgate: London
4 (3%)
Izuna: Legend of the Unemplyed Ninja
2 (1%)
JauntTrooper
1 (0%)
Lufia II: Rise of the Sinistrals
6 (5%)
Mobile Suit Gundam: Mysterious Dungeon
0 (0%)
Mysterious Dungeon 2: Shiren the Wanderer
6 (5%)
Ragnarok
6 (5%)
Rogue
6 (5%)
Pokémon Mystery Dungeon
0 (0%)
Pokémon Mystery Dungeon 2: Time & Darkness
0 (0%)
Strange Adventures in Infinite Space
3 (2%)
The Nightmare of Druaga: Mysterious Dungeon
0 (0%)
Torneko's Great Adventure: Mysterious Dungeon
1 (0%)
Torneko: The Last Hope
0 (0%)
Weird Worlds: Return to Infinite Space
5 (4%)
Other
6 (5%)

I hope you were at least surprised to see some of the games on this list. It was a bit thrown together, but I wasn't able to find a comprehensive list of commercial roguelikes: I appear to have missed at least one.

Which brings us to the next poll: 'What features must a game have to be a roguelike?'

Review: Call of Dirty

I've got nowhere else to rant about it, but I'm currently playing through the dirty brown spray that is Call of Duty 4. I suspect deep down it's my play style, but I'm failing to see anything of the Game of the Year recommendations that seem to have sprung up mushroom-like from it's fertiliser-based medium.


This isn't a 'every game that's not a rogue-like sucks' rant. But the best moments of Call of Duty are when you don't get to control where you move. The rest of the time you're being yelled at to run somewhere, then stand between your AI colleagues and shot at targets. What I'm saying is that this game would be improved by being an on-rails shooter, one where you don't even get camera control.


I'm coming from the 'let you explore the combat arena then introduce enemies' school of combat that Valve espouses. So I'm forever running ahead of the AI, then shooting at enemies across the length of a dining table. Which is good in a way, because at any further than two or three metres, it's impossible to tell who you're targetting, so I've experienced plenty of 'Game over due to team killing' moments. It's even funnier when the enemies run straight past you and you just shoot them in the back, or get killed in your allies cross-fire. Or when you run back down a street you're supposed to have gone up, and have infinitely spawning allies and enemies standing next to each other, shooting at opponents that are slightly further away.

Other design problems: Grenades should be weapon selectable, giving you a chance to, say, aim them, not automatically thrown when you just want to think about using them. Particularly as they're a weapon that can horribly back fire.

The Javelin scene is just comical. Suddenly I go from a rooftop fire fight to shooting a whole lot of tanks and both my allies and enemies just stand there watching me scurry around looking for something I have no idea what or how to use.

Door opening - The whole point of a game is that the player should be the first one through the door. So why can't I open doors at all? I had one instance outside the TV studio where I lined up my squad of eight or nine at that point and had to wait around for the scripted open the door routine, on one of six identical doors. It was like waiting outside the toilets at a concert...

My recommendation: Buy Black, not brown. It at least has a sense of style.

[Edit: While I disagree with CoD being a great game, it does have a great message. Have a read through the last comment nominated here for a good view of what Call of Duty 4 does right. I think reviewers may have got confused a little and marked the message, not the game play].

Tuesday, 8 January 2008

The R word

Play This Thing has referred to roguelike games for the last two games it's reviewed: Meritous and Transcendence. This echoes an argument I'll always make: that games and game designers outside the genre have a lot to learn from the writers of roguelikes.

I'd like to propose a new genre that encompases games of this nature, called roguelike-likes. Roguelike-like games are clearly not roguelikes but have been designed and/or inspired by Rogue and its ilk.

You've probably voted for a few in the latest poll.

Monday, 7 January 2008

Privateer: Ascii Sector

Another game that blurs the boundaries of what constitutes a roguelike is Privateer: Ascii Sector. Ascii Sector is a ascii art remake of the 1993 space sim/rpg Wing Commander: Privateer using ascii art assets and animation. Unlike the original, it's only in two dimensions, but otherwise it looks incredible.

I've not had a chance to play it yet, but you can read a more comprehensive write up of the game at the Artful Gamer.

Tuesday, 1 January 2008

What is a roguelike?

The new poll on commercial roguelikes is up. Of course, I've been fairly broad in defining what commercial is, and more importantly, what a roguelike is.

I'm interested to hear your thoughts on the matter. Is it not using graphics? Perma-death? Randomly generated dungeons? Rapidly ramping up difficulty level? Should I have added Uplink: Hacker Elite?

Results for 'What is your favourite roguelike of the year'; new poll

The full poll results for voting for Ascii Dreams Roguelike of the Year 2007 are below. Again, thanks to everyone who voted (all 152 of you).

Angband
14 (9%)
Beggar
1 (0%)
Berserk!
11 (7%)
CastlevaniaRL: Serenade of Chaos
7 (4%)
ChessRogue
5 (3%)
Cracks and Crevices
2 (1%)
Deep
1 (0%)
DoomRL
42 (27%)
Dungeon Crawl Stone Soup
26 (17%)
DrashRL
1 (0%)
Dwarf Fortress
50 (32%)
First Age Angband
7 (4%)
Frozen Depths
6 (3%)
GearHead
9 (5%)
Gumband
3 (1%)
Incursion: Halls of the Goblin King
23 (15%)
Into The Darkness
1 (0%)
IronBand
7 (4%)
Lair of the Demon Ape
1 (0%)
LambdaRogue
1 (0%)
Lands of Elderlore
1 (0%)
Lords of DarkHall
2 (1%)
Magic Monsters
1 (0%)
MazeCrawl
1 (0%)
Paprika
1 (0%)
Saffron
3 (1%)
Sewer Jacks
2 (1%)
Subterrane
1 (0%)
The Sewer Massacre
1 (0%)
Tower
1 (0%)
T-Engine/ToME/ODE
11 (7%)
Urban Warfare: The Escape
1 (0%)
UnAngband
13 (8%)
UnReal World
9 (5%)
Warp Rogue
6 (3%)

Next poll is 'What is your favourite commercial roguelike?'. I may run out of time getting this set up - if so, it'll be a later in the week thing.