Having Trouble with creating Multiple Scene Endings

Well, one of the nice things about making text games is that they run on comparatively low-spec machines. (These days they’ll run on a lot of people’s phones, OS permitting.) I’m using an old reconditioned office pc with “only” 3.8 G of RAM and Inform 7 runs and compiles quite happily on it. I suspect that unless your present pc is over 20 years old, it will run I7 ok – but of course I appreciate there may be other reasons you’re reluctant to trust it with your work (like a dying hard disk, or a twitchy OS.)

Anyway, yes, once you download and intall I7 on your laptop, you’ll be able to work offline. When you start making a new game the wizard walks you through where you want to save it, and after that it’s just a matter of hitting CTRL-s. They’re perfectly ordinary files as far as your OS is concerned so you can back up your work to anywhere you like (the cloud, for example.)

Re: death. Inform is designed to be a single-player system, so it simply has a global “flag” (a variable that can only be either true or false) to indicate whether the player is dead or not. Dead = game over. Obviously since you’re going to have more than one player you’ll have to handle it differently. Nothing to stop you having a death-flag for each player, if you wanted.

Re: combat. One of the limitations of a text-based system is that it can be difficult to explain what exactly is happening during combat. Andrew Plotkin once said that combat is a problem in time and space (because you have to arrange for your weapon to occupy the same space as your opponent at the same time.) But text is very poor at describing exact spatial relationships.

To see what I mean, try writing a room description that will let a player work out that if he climbs on top of the piano, he can reach a ventilation duct high up on one wall – without saying so outright.

But if you draw a picture of the scene, it’s pretty simple, isn’t it? Pictures and text have different strengths and different weaknesses.

So one of the big problems of combat in a text medium is that it can get pretty boring, if all the player can do is type “hit ogre with sword” over and over until the dice gods favor him. In order to make the game interesting, the player needs to have to choose between different strategies.

If you haven’t already seen it, I’d have a look at the recipe book: example 113 “Don Pedro’s Revenge” always looked like a fun system to me.

Getting a bit long. Comments on the scene change machinery in the next post.

2 Likes

“Scene change machinery is stuck” is the problem message you get when a series of scenes form an endless loop. Of course, this is exactly what we want, but Inform is changing instantly from one scene to the next and then to the next, which is not what we want.

I remember running into this problem when I wrote a transport system using scenes. Can’t remember how I fixed it, only that it was one of those “computerish” problems (like having to tell the system that you’re not allowed to put a box inside itself, for example.)

Re: Tokens. I now see what you’re doing with Death. You’re holding the player in a boring place and then replacing them somewhere on the map.

Literally, you’re holding them in Limbo – so why not call the room that? Just a thought.

You don’t need to have a “limbo room” if you don’t want to: inform can easily randomly relocate them between one turn and the next, if you want to. But I think having a limbo room might be cool – if you give the player a decision to make while they’re there. How about offering a variety of respawning points, but requiring the player to sacrifice equipment or solve a puzzle to get a nicer spawn point?

But to answer your question, no, I don’t think the tokens are the problem with the scene machinery getting stuck. It’s having the conditions for switching scenes set up wrongly that causes this problem.

1 Like

One of the best rogue-like text RPGs in Inform that shows how it can be done is Kerkerkruip, which was released in 2011 and is still occasionally updated and developed.

(I would also point people to The Reliques of Tolti-Aph which was the original example of RPG like elements which included the source text created by Graham Nelson as an early showcase for I7s capabilities, but it seems the page with the full source is currently not available on the Inform site.)

3 Likes

Potential solutions that come to mind… I haven’t tried these… but one way might be to store the turn count as a variable and then put a condition in the scene change “if the turn count is greater than $turncount”. Or just a true/false flag $holdturn which is set to true when the scene/turn changes, and then the scene can’t change until the player acts and it is set to false.

Another method might be to drop the whole concept of scenes completely and just have an “Every Turn” rule that cycles “the player” through each living playable character in order (and gives the monsters a turn if that applies.)

(Psuedo-code for example below, not tested)

Every turn when turncycle is true:
     if every character is not in Death:
          If B is not in Death:
               now the player is B;
               say "You are B.";
          otherwise if C is not in Death:
               now the player is C:
               say "You are C.";
...
1 Like

Interesting. I’d never heard of Kerkerkruip before. Looks really interesting from the website. I found the reliques source a while ago, but I think I7 is now so different that most of the code wouldn’t run. It wasn’t ever really a combat game though, I remember all the encounters being puzzles of some sort. I would have supposed that a “puzzle fight” is probably the closest we can get to text combat before you showed me this kerkerwhatsit. Thanks!

1 Like

Mmm, yes. “now the player is passive” sorta thing.

2 Likes

@Dizzydonut

I have already reworked Death so it works for multiplayer. Idk if this was a good idea or bad idea but bascly every time that the player dies I have the game say

*** You have died ***

I’ll take a look when I get time. You don’t have to but if you reply to this before I am able to check again could you give me a link?

That sounds much better, actually. I think when I make the actual game, I might go ahead and do that. Do you think Death would be a room that if a player is in Limbo for x amount of turns, he/she is moved to death? My current rule to end the game if all player are dead is set so if all playable characters are visible in death, the game ends by saying *** Game over ***

That is another thing that I partially have figured out-but still not completely done yet. I’ve actually started reprogramming RESTORE so when a player restores, currently it takes them to the first checkpoint. Unfortunetly, all thier stuff comes with them and its technically not a true restore because of that but. I’ll take what I can get, lol. Beggers can’t be choosers.

I’m not sure yet if I should keep having players respawn in a random room-or perhaps a checkpoint. Checkpoint is probobly a much neater and less confusing for players.

1 Like

Yeah, as you said, it’s hard to make text combat interesting with enough variation so it’s not just HIT OGRE WITH SWORD over and over.

My work in progress actually is a parody of an RPG (done in a choice engine, not Inform) and it took a while to find ways to make it interesting to fight (we’ll see if I succeeded eventually…) but I use real-time timers for combat and elements of “clicker” gameplay to charge attacks and spells and defense and such before the enemy turn comes about.

Hopefully the strategy comes from “do I need to charge my shield and block, or should I take the time to cast that spell that requires ten clicks and then heal afterward?”

1 Like

@HanonO

I will try them when I can get a chance.

I did try that when I first tried multiplayer, but I think players would get frustrated a bit more easily and it turned out not working well. Then again, I probobly had bad formatting again lol. It was a good idea though!

1 Like

Here’s Dom Pedro’s Revenge:

"Don Pedro's Revenge"

The Deck of the Helene Marie is a room. "The two crews are embattled all around you, but your attention is reserved for your particular enemy: Don Pedro."

Table of Random Prompts
position	prompt
boxed	"So securely boxed-in that you can really only parry or thrust, you try to "
boxed	"Trapped between your barrels, you decide to "
perched	"Able to slice at your attackers but not to advance or retreat, you choose to "
perched	"Perched up here with the advantage of height (but little mobility), you attempt to "
free	"Out on the open deck with no impediments, free to advance or retreat, you decide to "

When play begins: reset the prompt.

Every turn: reset the prompt.

To reset the prompt:
	sort the Table of Random Prompts in random order;
	repeat through the Table of Random Prompts:
		if the position entry is the placement of the player:
			now the command prompt is prompt entry;
			stop.

After reading a command: say conditional paragraph break.

A placement is a kind of value. The placements are boxed, perched, free. The player has a placement. The player is free.

Understand "retreat" or "parry" as retreating. Retreating is an action applying to nothing.

Check retreating:
	if the player is perched, say "You can't move backward or parry very successfully from this position." instead.

Carry out retreating:
	now the player is boxed;
	say "You protect yourself, but end up wedged in between two barrels."

Understand "thrust" or "advance" as advancing. Advancing is an action applying to nothing.

Check advancing:
	if the player is perched, say "You can't move forward from here, only slash." instead.

Carry out advancing:
	now the player is free;
	say "You push forward aggressively, making your way to the open deck."

Instead of jumping:
	now the player is perched;
	say "You leap and swing yourself boldly up into the rigging, leaving your attackers beneath you."

Instead of jumping when the player is perched:
	now the player is free;
	say "You leap down from your position, into the middle of the deck."

Test me with "advance / jump / advance / retreat / jump / retreat / retreat / advance".



The code in the recipe book is specially intended to be used and amended as you see fit, so don’t worry about “stealing” it.

1 Like

That does look pretty cool! Oh and I forgot to mention with my protype that we’ve been discussing, I have 3 copies of it. 1 copy still has the orignially bad scenes, 1 has the corrected but instaneous scenes, and the 3rd copy has the same scenes from the 2nd (the corrected ones) but with the 3rd ending (player is in death and has tokens)

I did change the name of some of the scense so it wasnt as confusing

1 Like

If you copy (click on the icon top-right in the code box to copy it to your clipboard) and then paste it into a new, blank game, then you can play it. See if it gives you any ideas.

1 Like

I will. Do you think it’s fine that in one of the copies I put the 3rd ending or do you think it’s unnecessary until we figure out how to fix the instant changes? Should I post the updated scenes that have the 3rd ending and changed name?

1 Like

I think that if I can figure out the fix for the instant changes, then the same fix will work for all three versions. Glad you’re keeping copies!

1 Like

ok, good to hear. So, I assume you probobly don’t need me to post the updated code then, right?

Also, with the respawning stuff, do you think I should (after we get this scene problem fixed lol) start a new topic about how to get the respawning thing working?

Do you think I should start looking for a collaborater instead of doing the whole game myself? (and if so, any recommendations? by any chance would you be interested?)

Is it right to assume that if this game gets done (and gets done right) I no longer a noob at Inform 7? possibly advanced?

1 Like

Yes, don’t worry about the updated code for now. Also don’t worry about being a “noob.” No matter how good you get, what you want to do will always exceed your reach, and require you to scratch your head and think of ten different ways to try and solve the problem. That’s what coding is, really: its own puzzle. It’s why it’s so addictive a pastime, I think.

I was looking at the problematic scene switching just now, and realized that I don’t know what the player is supposed to be able to do during a scene. Is the setup supposed to be one hit/one action, and then the next player gets a turn?

2 Likes

Thanks for asking! What I have the prototype set up for is so each player gets to do (can’t remember without looking lol) I think it’s 5 actions, then its the next player’s turn. In the full game that I am creating (It’s called Explorus) it will be different because it will be set up for 5 players instead of 3 and each player will have a longer turn/get more actions each turn then in the prototype. Does that make any sense?

@Dizzydonut @HanonO And please, if you have any more questions about either the code, Explorus, or both-I’m very happy to elaborate. Explorus will hopefully be a very great game (and partly because of you!)

1 Like

Got it. Hmmm. Just a thought, but how about giving each player a certain number of “action points” to spend? Different actions have different costs, and once the player reaches 0 (or hasn’t enough points to attempt any action) then their turn’s over? Action points can’t be saved from turn to turn, you get a new “allowance” at your next turn. (Leveling up could mean access to more action points per turn, and/or more expensive actions.)

The thing about making a game enjoyable is to present the player with choices, but to limit those choices via costs.

1 Like

Hi, I just wanted to add a note about Playfic (though this might be a needless complication); Playfic uses the 6G60 version of Inform, which is a few years old. If you want to use the latest version of Inform online, there’s a new site called Borogove which has the 6M62 version, which is a couple of years more recent than 6G60 and has some relatively big new features (in particular, a way of making it easier to change default messages). There’s a thread on it here. It would also make it easier for you to use extensions if you want.

As for the scene change machinery getting stuck… one thing I thought of was using past tense as documented in §9.13 of the documentation. If you say “If X was Y” that checks whether “X was Y” was true at the beginning of the most recent action. So if you say “…when P1 was happening” that will check whether P1 was happening at the beginning of the turn. You can make that change to P2, and when the scene change machinery checks “…when P2 was happening” that won’t be true, so you get to stay on P2 instead of going into a loop.

Here’s a short example:

P1 is a recurring scene. P1 begins when play begins. P1 ends happily when P1 was happening and the location is not Dead. P1 ends tragically when P1 was happening and the location is Dead.

P2 is a recurring scene. P2 begins when P1 ends happily. P2 ends happily when P2 was happening and the location is not Dead. P2 ends tragically when P2 was happening and the location is Dead.

P3 is a recurring scene. P3 begins when P2 ends happily. P3 ends happily when P3 was happening and the location is not Dead. P3 ends tragically when P3 was happening and the location is Dead. 

P1 begins when P3 ends happily.

When P1 ends tragically:
	say "P1 carked it.";
	end the story.
	
When P2 ends tragically:
	say "P2 carked it.";
	end the story.
	
When P3 ends tragically:
	say "P3 carked it.";
	end the story.
	
When P1 begins:
	say "Starting P1."
	
When P2 begins:
	say "Starting P2."
	
When P3 begins:
	say "Starting P3."

Lab is a room. Dead is north of Lab. 

This particular solution only would work for scenes that change every turn, but it sounds like that’s what you want!

1 Like

So like an experiance system? I like that-sounds super mega awesome! Although, I might need help setting that up. Would it replace scenes or be in addition to them/ a varaible that would help with all the endings?

@matt_weiner Thanks for the note on Playfic. I was completely unaware of that lol and that’s wonderful to know. I have recently tried to use Borogove a couple days ago, but it only seems to let me export Gluxx and I want Parchment. I do like that it lets you do transcripts, though. Part of what makes this game even more of a challange (maybe too much of a challenge, idk) is I want to create my first “big” game with no extensions and see the limits of Inform. On future projects however, I may want Extensions, so thank you a lot for mentioning Borogove.

That looks great! I will test it ASAP. I don’t want the scenes to change every turn, but perhaps it’s what is needed to happen. Or maybe there’s a way to modify the code something like “when P1 was happening for turns” (or maybe minutes?). Idk if what I just said is any good or not lol. But thank you, I will definetly try your suggestion out when I get a chance.