Showing posts with label risorg. Show all posts
Showing posts with label risorg. Show all posts

Friday, January 16, 2009

A neat Ask/Tell change

* EDIT * In order to alleviate some reading confusion, the below post is in regards to Risorg2, a sequel to my first game of Interactive Fiction, Risorgimento Represso. Specifically, this post deals with some methods I came up with during development for simplifying Ask/Tell conversation topics for characters within the game.

I struggled with my original Risorg with the idea of being able to ask characters about everything in the game. I go for the complete experience, and it always seems wrong to me when the guy in the shop north of the town square either claims to know nothing about objects in the town square or has some equally silly response of "There's not much I can tell you," or "I don't think you need to worry about it."

Real people don't act like that. Ask a merchant who's got a shop in the market square what he thinks of the market square and darn right he'll have an opinion.

Of course, with Risorg1, trying to do this resulted in LOTS of quoted strings in characters 'Ask' routines, even to the extent of running into Inform limits. I compromised for game objects by having NPC's Ask routines run WordInProperty on the common game objects I wanted to ask them about. This worked okay, but with collisions from time to time, and still meant a lot of coding. There were also holes, as I wouldn't put a WordInProperty for every item into every character's Ask routine.

In between Risorg1 and Risorg2 development, I played around a lot with ways of attaching topic information to the objects themselves. After a fair bit of work, this is working *really* nicely. For objects in scope & held, we now get nice things like this:

>ask old crone about threadbare
Which do you mean, the threadbare red carpet or the threadbare woollen socks?

>socks
"Definitely not interested in buying," says the old crone. "I've got a drawerful of my own."

So we get the regular parser disambiguation for items in scope, which is nice. This ends up calling an item.information() routine within the object, and the parameter passed is the NPC doing the asking.

So each object that I've got of class "Askable" just lists all the NPCs and their response to the item. It makes it really easy to do it this way. Previously, with each NPC, you had to think of all the items in the game and code responses. Now, with each item, I just think of all the NPCs (a much more manageable number) and make sure the ones I want are accounted for in this object.

The other nice part is if you ask about a game object that isn't in scope, WordInProperty is then used to try to find a game object being asked about. If a game object is found, the same information routine is run.

So in the socks/carpet example above... if the carpet had been left outside the shop, asking about 'threadbare' would have resulted in the socks getting matched. Asking about 'threadbare carpet' would result in the carpet getting matched, even though it's not there. A simple TestScope in the carpet's information routine allows me to craft different responses from the shopkeeper if the carpet is not in scope.

Finally, if no match is provided by any object in the game, it falls through to an AskGeneral action that matches quoted words within the NPC, in the same old way.

All in all, it's a pretty neat and tidy solution and lends real verisimilitude to the game, being able to ask NPCs about any object in the game.

Of course, all this being said, I'll release the game and someone will promptly find the one object that they can't ask person X about.

Monday, March 13, 2006

IF: how Risorgimento Represso was born...

In answer to a comment on an earlier post about whether I used a transcript to create Risorgimento Represso... sorry to take so long to reply, but I hadn't read the comment until now.

No, with Risorg1, I jumped right into it.

In fact, when I started coding, I didn't even realize I was writing a game.

I started with a short story I'd written (or started to write), and thought I'd turn the first part into an IF game just to learn Inform. I also wanted to try out the Enchanter-style spell code from the Balances sample Inform game.

In that original version, you had to retrieve a fizmo spell scroll and unblock a sewer pipe in the basement using that, retrieve Ninario's glasses, and get him to send you home, and that was where it ended.

When that was finished, I realized I really didn't like having the spell scrolls in there--it seemed really derivative, and unoriginal. So I opted to create a different method for unblocking the pipe.

At that point, I looked at this little mini-game I had, and how relatively easy it was to create, and realized that I had the start of a real game. I sat down and thought a little bit about what elements I wanted in the game.

I wanted some multi-level puzzles, like the Babel fish puzzle in the Hitchhiker's Guide to the Galaxy game that Douglas Adams created in collaboration with Infocom. You can see the babel fish inspiration in Risorgimento Represso's "getting past the bear" and "getting into the farm" puzzles, where every solution you think of to an immediate problem results in a new, unforeseen problem--while at the same time being a necessary step towards the solution.

I wanted to leave the stereotypical doddering old wizard in there; making such a clichéd character interesting and fun was a challenge I wanted to meet.

I didn't know what to do with Ninario for the span of a whole game, and how to free up the player without leaving Ninario sitting dully in his study. Likewise, I didn't just want Ninario wandering around his own little area... so having him abducted was the perfect way to get him out of the way once his possibilities as an NPC were exhausted.

Ninario's unauthorized use of magic seemed a perfect explanation for his abduction. In the original short story, it was his reason for fleeing his fortress along with the main character, so it translated fairly easily into the game. And then the Wizards Guild's heavy-handed dealing with Ninario gave rise to the whole idea of the Guild suppressing scientific innovation; the renaissance repressed idea, which is, of course, the meaning of the title.

I wanted a bear, in deference to the original Colossal Cave (aka Adventure).

Once I knew I wanted a bear, I needed to have a place to put a bear... so why not a mountain trail? And the bear seemed an ideal place for a Babel fish puzzle.

Of course, if getting past the bear was going to be a significant, multi-level puzzle, there had to be something on the other side. A lonely, wind-blown mountaintop seemed the perfect place for a world-weary hermit. And once I had a hermit, what was more natural than having a bottle with a hermetic seal?

Finally, I knew I wanted to make a cheesy game. Once I decided that, I also knew that Renaldo, the evil head of the Wizards Guild, would have to be lactose-intolerant. It's not a huge part of the game, and there is, in fact, only one tiny part of the game where you can find that out, but it rounded out my vision of that character--and resulted in me deciding that the Cheese Shop in Vechlee would be another victim of the Wizards Guild, with a sign posted outside about it being shut down. Ostensibly, it was for use of modern production methods, but behind the scenes, I knew it was Renaldo's lactose-intolerance.

I came up with these required elements in conjunction with a map of the game world. Some of the things I wanted resulted in having to place certain things on the map. Other times, the drawing of the map drove the selection of the elements I wanted.

When this stage was complete, I had a map, and a pretty good idea of the required elements. A lot of the puzzles grew naturally out of the orientation of the map. I had Ninario's tower and caer, and it made perfect sense that any structure like that would have heavy-duty doors and a gate--especially if the inhabitant was living in fear of Wizards Guild reprisals.

The need for doors gave rise to the cannon, which led to the gunpowder puzzle. The need for a gate led to the hydrolytic counter-balancing machine, which is, I believe, the only puzzle in the game with three distinct solutions. Getting into the shed comes a close second with two quite different solutions.

I wanted the hydrolytic counter-balancing machine to be unusable once the puzzle was solved, to simplify it, so I had the text describe it as coming to a halt, and a hose popping off it. And then I thought, rather than having the hose just hang free from the machine, why not make it an object that popped off, and had a use later in the game? That led to the whole idea of getting into the upper floor of the Wizards Guild, the dumb waiter, the second bottle of Wizstrip, and enabled me to bring the background knowledge I had of Renaldo (his lactose-intolerance) in as a funny consequence of sending one of the many pieces of cheese up to the second floor in the dumb waiter.

So it was a sort of chicken-and-egg development, with each element feeding off the others, and growing into a much larger game than I had originally anticipated.

With Risorg2, starting with a transcript, I am, thus far, creating a much more structured environment. I'm not sure yet if that's helping or hindering me. It's certainly helping me to stay in one "mode" at a time. I'm either in programming mode or writing mode, and can be more focused on whatever I'm doing at time, but it may result in a more narrow game when all is said and done.

We'll have to wait and see...

IF: Risorgimento Represso release 4 (and source code)

I finally got around to uploading release 4 of Risorgimento Represso to the IF Archive. This version has a number of bugfixes, and is noteworthy for being the final, never-again-to-be-updated release. Oh, it adds a Glulx binary as well, more for the sake of completeness than anything else. The Glulx version does not add any fancy graphics or anything to the game, but was really done to check that my auto-opening and auto-unlocking door features from Risorg would work in Glulx.

I also released the game's source code, which can be found either at my website on MTS (click here) or at the IF Archive here. It's written in Inform, and thus requires the Inform 6.30 compiler and library in order to build successfully. It does include a Makefile though for easy building, so if you're at all interested in Inform or writing your own interactive fiction in general, check it out.

With Risorg1 now firmly out of the way, never to be worked on again, I have been focusing on Risorg2. I've almost completely exhausted the work I've done on the transcript. Let me explain; whenever I have a free moment, but don't necessarily feel like coding the game, I'm working on a high-level transcript of play, detailing room descriptions, play-by-play action and so on. That way, when I feel like coding, I can stay at the coding detail level, and just paste in big chunks of already-written text when it comes to actually spitting stuff out at the user. Not only do the room descriptions slot right in place, but I even have a model for the code--from my transcript, I know how the objects and NPCs should react to a lot of the user input, and can code them accordingly, from the ground up.

I'm also finding that as I write the transcript, I stay more in "player mode"--I anticipate, a lot more, the different things players might try when confronted with specific situations. This should make the beta-test process easier, as some of the more obvious things a beta-tester might try will already have sensible, (and entertaining) responses, rather than generic failure messages.

But anyway, to continue my original train of thought, I've been working on the code to such an extent that I've just about reached the limit of what I had already transcripted, so I guess it's either back to transcript for a little while, or else continue improving and rounding out the code I've already written, or just forge ahead with coding, creating the game experience as I go. I think I'll stick to keeping the transcript and coding tasks largely separate though. It seems to be working pretty well, and I think I'll end with a tighter game as a result.

Monday, January 16, 2006

IF: a non-update update

In order to address the emails I've gotten from a couple of Risorgimento Represso fans, asking about when the sequel is coming out, I thought I'd post this publicly.

Progress is still very slow. I've still been mainly concentrating on the final, never-going-to-make-another-even-if-I-have-a-paper-bag-over-head-bug release of RR, which adds the Glulx target, and provides true context-sensitive hints (which I now wish I hadn't bothered starting to do, as it's quite time consuming). Once I get that out of the way, I can get back to alternating work between the Risorg2 transcript of expected gameplay, and the actual coding.

Patience is a virtue. Anyway, look at this way, even if it was 100% finished, I still couldn't release Risorg2, as I have no idea what I'm going to call it.

Wednesday, June 15, 2005

IF: Risorg2

The header at the top of this blog claims that it chronicles work on interactive fiction, but there's been no mention of IF on here for quite some time.

I'm still working on a sequel to Risorgimento Represso. It's imaginatively titled Risorg2, for want of something better. I've got quite a bit of it planned out in my head, and I'm creating it by starting with a transcript, just to see what that's like. The transcript runs to about 4,000 words at the moment. A winning run-through of RR is about 19,000, so I guess you could say I'm about 20% done. Not that length of transcript is the be-all and end-all, but I'm trying to create a game of a similar scope, so it's a good metric to use.

I don't think I'll create the whole transcript end-to-end before doing some coding. As I run out of literary steam, I'll turn to do some of the coding. As I get to sticky patches of the coding that I don't feel up to banging through, I'll go back to the transcript.

I've made some fairly key decisions while working on this transcript. I worked very hard in RR to avoid gender-specific references to the PC. In the end, everyone I've talked to seems to have envisioned the PC as male anyway. So in Risorg2, the PC is definitely male. It helps me avoid some convoluted English usages now that I can refer to him as 'him'. It also allows the PC's relationship with the companion NPC, who is female, to be more fully defined. I could even give the PC a name if I wanted to, but I don't know if I'll go that far.

As a special treat for those visiting, here's an excerpt from early in the game.


Wizard's Way
Persecution by the Wizards Guild caused numerous wizards from Vechlee to seek refuge in this northeastern corner of the city. With the final dissolution of the guild, many have returned home, leaving their hastily built, slipshod houses in Blumph to fall into disrepair. Apart from Ninario's crumbling brick house to the north, only one other in the area looks inhabited, a squat brownstone house to the east.

Southwest, the cobbled road rises up towards Blumph's high street.

>look e
The squat brownstone building is neat and carefully looked after. A large archway leads into an interior courtyard, but the closed wrought-iron gate tells you that visitors are not welcome.

>x courtyard
The interior courtyard is a large open area leading to the various parts of the house.

>open gate
The gate appears to be locked.

>climb gate
"It's interesting," says Crystal conversationally, as you place a hand on the gate, "just how much those spikes along the top look like they're poised in groin-piercing readiness."

You let go of the gate and reconsider.

>climb gate
"I find it fascinating," says Crystal, just a bit acerbicly, "how some people seem content to permanently endanger a chapter in their life that likely hasn't even been opened yet. Are you aware of just how much damage those spikes could do?"

You let go of the gate and reconsider.

>climb gate
"You know what I hate?" asks Crystal loudly. "That particular kind of person who doesn't listen to what you're saying and just goes ahead blindly with his own misguided agenda."

You let go of the gate and reconsider.

>climb gate
"Look, Ninny junior," says Crystal bluntly, "I figure hanging around with you while you wreak whatever havoc is coming in the course of this adventure is my best chance to get myself out of this blasted rock, so if you think I'm going to idly stand by and watch you impale yourself on this gate just so you can get inside a house that hasn't even proven to have anything to do with our assignment, you're wrong. Step away from the gate, now!"

You let go of the gate and reconsider.

>climb gate
Crystal's resulting stream of invective is of such a high and abusive order that any attempt to reproduce it fails to do it justice. Let us merely note that you are left white, trembling, and certain of your desire not to climb over the gate.

>climb gate
A single glance from Crystal as you step towards the gate makes you reconsider.


That's a part of what I have so far.

I debated changing languages for this game, but I've got so much code invested in the original RR that I can reuse for this one... the autodoors, some of the NPCs, and general templates for a lot of base-level objects that I think it will help the development process to stay with Inform.

I am targeting both Glulx and Zmachine from the beginning though, and my Makefile is configured to build both targets automatically, so that should guarantee I don't do anything specific to one language and not the other.

I still have a pending RR release (RRR?) that adds a Glulx game file and fixes a few other bugs, but I haven't bothered to release it yet. I should probably do that soon, just to get closure. Make it the last release of RR, barring any major problems.

Thursday, October 28, 2004

An update, at long last

Well, it's an update, but I haven't got a great deal to say.

I've added zplet, so you can now play Risorgimento Represso online if you like.

IF Comp04 is now taking place, but I haven't even had time to download the games, let alone play or review any of them. With two children under two in the house, it makes for a complete lack of time for IF.

I have a pending Risorg version 4 to release that adds true, context-sensitive hints, fixes a minor bug, and adds a Glulx game file, but I haven't gotten around to checking it into my CVS and releasing it.

I also have autodoor.h, which is a combination of the auto-opening, auto-unlocking door code I used in Risorg, along with Ross Raszewski's doors module... so it makes for auto-opening doors that are easy to use. I can't even remember if I worked out all the issues in Glulx with it or not. Because of the "look-through" feature, there were some string-handling hoops to jump through to get both Glulx and ZMachine to print things like "Looking through the open door, you see the kitchen."

I am hoping to get some of the Comp04 games played and maybe even reviewed. I think I'll have to end up throwing them on the laptop so that I can play them at leisure outside of the computer room. There's always the PocketPC I could use too, but that's more aggravation than it's worth, as far as I'm concerned.

Risorg2 is progressing at a snail's pace. I've written the opening scene. It's far too long, but there's a certain amount of information I want to get conveyed across. I'll have to explore ways of revealing that information after the fact. Of course, seeing this one won't be intended for competition release, it might not be such a big deal.

I've also put some work into figuring out what's going to happen for roughly the first half of the game, and a few of the puzzles, as well. I don't anticipate it being finished any time soon.

Tuesday, November 18, 2003

IF Comp03 comes to an end...

It's all over, and RR finished in 2nd, behind Slouching Towards Bedlam. If you're still interested in the game, check out my main IF page or hit Baf's Guide.

I was a little surprised to finish so highly, but it was certainly nice. The prize will come in handy as well, as a couple of days before the competition intent to enter deadline, my employer announced that they were closing their office in Winnipeg... and this was exactly on week after my wife and I had signed up to get a new house built. So the financial situation is a little dicey, as what savings we had are tied up making payments toward getting the house finished.

Anyway, maybe coming in 2nd place is the break in the storm, and things will start looking up for us soon. : )

Saturday, July 05, 2003

RR first pass completed...

Well, I managed to get the first pass of the game completed, along with hints and the "amusing things to do" section. It's been sent off to the beta-testers as of July 3/03. A few of them are in the US, so I'm sure they won't be looking at it for a while to come. That's all right though. I wanted to make sure I got the thing off early, so there isn't a lot of pressure to test quickly in order to make it in for the competition.

I also spent some time reviewing all the Inform library patches that I hadn't ever looked at before, and ended up applying the ones that were likely to affect my game (such as looking into containers in the darkness).

Then on a whim, I started looking at the rest of the Inform compiler issues as well, and lo and behold, I found a description of my abbreviation problem, the one preventing me from using the latest abbreviations that -u was providing. So I grabbed the compiler source and patched everything I felt was important enough, and built it for the Linux box.

So this meant I would be able to use my new abbreviations. So I ran the compiler with -u, got a new set of abbreviations, and used them. Oddly, they generate a larger .z8 file than my original abbreviations... so I went back to the old ones.

One change that did make a big difference was the bug that prevented short jumps from being used if the jump was more than 31 bytes... in fact, in the Z-machine, short jumps can be up to 63 bytes. Making this change to the compiler shaved 1.5K off my code size. Okay, not that I needed that 1.5K, but if we ignored every possible 1.5K savings...

Wednesday, June 25, 2003

Risorgimento Represso: An IF work-in-progress

At the moment, the only IF I'm actively working on is my Comp03 entry, Risorgimento Represso.

I think it's too long of a game, really, for the competition, but I'm interested in releasing it under maximum exposure conditions. It's not too long if the players don't go wandering around talking exhaustively to the few NPCs. There aren't really that many puzzles.

How's it going with the game? Well, all right, I suppose. I'm having some trouble making the ending work (literarily speaking, not programming-wise) the way I want it. It just doesn't seem to ring true, and I'm not sure if it's too easy, too short, or what. Well, we'll see. I'm hoping to move it out to beta-test before the end of June (optimism mode now disengaging).

Apart from that, I had a fully-developed plot, puzzles and all, for an entry for the SwashComp, but I haven't had any time to work on it, so I've decided not to bother. I may work on it at another time, but because my Comp03 is a fantasy piece, it has a similar technological level to what's in the SwashComp game, so I think I'd rather move on to something radically different next.

I have a few more ideas from some of my short stories percolating in my head, but I'm not certain how well they'd translate to IF.

I have one other idea that I'm still developing, and I'm not sure whether I'll go anywhere with it. With the initial kicking around in the brain, it feels like it would be very interesting, but a bit of a struggle to write.