Tale (14): separated the story files, mud/IF modes

Monday 21 May 2012, 00:58:00 | mud / i.f.

Tale Release 0.4: what has changed?

I've decided to continue this blog in English, it might appeal to a bigger audience than I had in mind earlier. :-)

Separated the story files

This is by far the biggest change; the story files are now kept in their own directory and Tale is now a real stand-alone framework. When launching the Tale game driver you now need to give the location of the story files you want to run. The distribution still has the demo story but it's now in a separate 'stories' directory.

MUD mode vs IF mode

The difference when running in multi-user MUD mode versus Interactive Fiction mode is now bigger:

The driver uses IF mode by default but you can force it into MUD mode with a command line parameter.

Other stuff: There's a Resource manager class that allows the game code to link to resource files such as images or large text files that are embedded in the story's package path somewhere. Also used by tale itself to load the soul_adverbs.txt.

driver.clock : object that abstracts the game time and contains the config as well, to easily calculate game times, timespans, etc.

Some text layouting issues fixed (but not all, will do that next time)

Added an input() function to the driver that flushes pending output first, and strips the input before returning it. It's easier to always use this instead of calling [util.]input() yourself and dealing with these things.

Next time Right, I think the first things I'm going to do now is to fix the text layout bug regarding unformatted paragraphs (extra newlines appear). Also, maybe look into making the input case-insensitive so you can type "examine Laish" as well without getting an error. Lastly, it would be nice if stories could define new or override/disable existing commands. :-D