Saturday, February 28, 2009

[IF and Linux] Introduction

Introduction

I'm planning to start a series of posts on interactive fiction and Linux. The idea is to find out how easy it is to play and make interactive fiction on a modern Linux distribution. This should be a help both to Linux users who wonder what software to use, and to writers of IF-software who can see where the lacunae are.

Linux is an interesting platform for the IF community. It is by now a desktop OS that rivals Windows and OS X for features and ease of use. Though its market share (on the desktop, the server is another story) is still far below those two*, we can assume that its market share among people (potentially) interested in playing or writing IF is significantly higher: the average Linux user has more interest in programming and more willingness to use text interfaces than the average Windows user.

Criteria

When I'm looking at certain software, or a certain task, I will be asking three things:
  1. Can this be made to work?
  2. If so, does it work well?
  3. How easily can it be made to work?
Ideally, things work well without the user having to do anything complicated (like building something from source code). The user I will have in mind is someone who is comfortable using a package manager and familiar with Wine, but not comfortable with compiling programs from source code.

Package manager?

There a several ways in which you can get an executable program on your Linux computer. From easy to hard, these are:
  • Download and install it with the package manager for your distribution. This is incredibly easy; easier than running a Windows installer, for instance. It is like going into a menu and clicking a button that says "download and install program X for me!", and then it just works.
  • Manually download the package from some website, and then install it using the package manager. (Installing Gnome-inform7 currently works this way.) This is about as easy as running a Windows installer. Anyone who can play IF can do it.
  • Manually downloading an executable file ("binary") and putting it in /home/USER/bin, or some other directory meant for binaries. You can then run it from the command line or make a launcher. This is still OK, though you need a little familiarity with your OS.
  • Running a Windows executable using WINE. If it just works it's pretty easy, though you need to install WINE first. If it doesn't just work, getting it to work can range from the somewhat hard to the outright impossible.
  • Compiling from source. Theoretically, this is as easy as typing "./configure", "make" and "make install". In practice, it is often harder, and it is something that many general users will not be able to pull off. (I hate having to do this myself, since I can rarely get it to work.)
There are a couple of other ways, such as running a virtual OS, but let's not go into that.


* Or so I gather from statistics on the internet. I personally know a lot of people who use Linux, and only two people who use OS X. I guess all those physics and philosophy nerds just aren't a representative sample. ;)

Monday, February 09, 2009

[IF] Progress on Inform ATTACK

Quite a while ago, I released something called Idols of War, which was a test case for tactical combat in Inform 7. The core of that game was a system I call Inform ATTACK, for "Inform Advanced Turn-based TActical Combat Kit"; and it kind of worked, but not all that well yet. (In retrospect, I spent far too much of the development time for Idols of War on thinking op cool powers, combat moves, monster abilities, and so on--all of which can be easily recycled, so it might still turn out to be useful.)

I didn't spent much time programming, the past months; but I've been busy the past few days, and I now have a completely redesigned Inform ATTACK. What features does it have?


Completely locally customisable

The original ATTACK was written using procedures ("To strike a blow: ..."), which then contained clauses for all the special things that could happen. The new ATTACK uses rulebooks throughout. This means that you can extend and change the core system without tampering with the code. All you need to do is write new rules, and specify in which rulebook they need to go; and if you need to take out the standard rules, they are all named, so that is easy as well.

What this means is that you can define a new action, monster property, environmental influence, AI behaviour, combat description, or whatever, and you can put all the code needed to implement this in a separate paragraph. Nothing needs to go in the core system.

That is good because: (1) you don't want to mess with all that code if you don't have to; (2) defining everything pertaining to a single action / circumstance / property in a single place is a good way to keep bugs to a minimum; and (3) the core system can be made into an extension.

By the way, I have fallen completely in love with rulebooks. They are both powerful and elegant; a brilliant programming concept.


Weapons

The original ATTACK had no support for weapons; we have now have full support for weapons.


Artificial Intelligence

NPCs can evaluate their own combat options and make reasonably intelligent decisions about which option will be best for them; this includes choosing a target, choosing a weapon, and choosing an action. (The core rules implement AI support for all the core combat actions: attack, dodge, parry, concentrate, ready and reload.) Again, this can be easily extended for user-defined actions.


Variable combat order, initiative and reactions

In the previous ATTACK, the player always went first, and then the NPCs got their turn in a standard order. In the new ATTACK, the combat order is recalculated every turn based on events from the last turn--some NPCs may go before the player, others may go after him, depending on what they did, how much damage they took, how many people are attacking them, and so on.

If you are attacked and haven't acted yourself that turn, you must immediately respond. In such a situation, dodging and parrying get bonuses, and increase the chance that you may attack first next turn. You can also counterattack, but that is much more risky (though not always a bad idea).

All of this gives combat a much more dynamic feel.


Numbers on and off

ATTACK allows the player to choose between seeing and not seeing all the numbers that go into the combat calculations. Obviously, authors can set a default or choose to disable one of the modes entirely. Games where all combat is reported in prose should certainly be a possibility.


What's to do?

I think the best thing for me to do is write a serious game using ATTACK. That will allow my code to mature (and receive the bug fixes and extensions it almost certainly needs) before I actually try to release it as an extension--and it is certainly a lot more fun to write a serious game than to spend time on "testing content". I wasn't able to motivate myself to continue Idols of War, because the content that needed to be written to flesh it out was not in itself interesting. It was merely there to test the system.

If I work hard, I might be able to make the IF Comp. ;)