How to make 'incorrect' turn count as a turn

Hi,

In one of my rooms there’s an NPC (using Eric Eve’s Conversation Responses and Suggestions). After 7 turns they reveal an exit:

Every turn:
If the player has been in roomname for exactly 7 turns and knowhall is false:
Say "Now you see exit";
now the Hall is known;
now knowhall is true;
say "condition met".

I got this work eventually, but it took 16 turns. I think this is because Inform doesn’t count…

>x hall
You can't see any such thing.

>x something
You can't see any such thing.

>dave
I didn't understand that sentence.

… as turns.

This is frustrating for the player because they could end up typing 100 incorrect turns and get stuck.

How do I ensure that this condition runs after any number of turns, correct or incorrect?

Thanks.

1 Like

Try some variant of this:

The command count is initially zero.
Before reading a command: increment the command count.

In your case, increment it only if the player is in “roomname”.

3 Likes

I tried this:

100m is a room. 100m command count is initially zero.

knowhall is a truth state that varies. knowhall is false.

Before reading a command when the location is 100m:
increment 100m command count.

Every turn when the location is 100m:
if 100m command count is 7:
if knowhall is false:
say "Now you see exit";
now the Hall is known;
now knowhall is true;
say "Condition met!";

A room can be known or unknown. A room is normally known. The Hall is a room south of 100m.  The Hall is a room.

But got this:

100m

>x
What do you want to examine?

>door
You can't see any such thing.

>blah
That's not a verb I recognise.

>hello
That's not a verb I recognise.

>keep going
That's not a verb I recognise.

>false commands
That's not a verb I recognise.

>After this one?
That's not a verb I recognise.

>nope
That's not a verb I recognise.

>not working
That's not a verb I recognise.

>this is the tenth incorrect command
That's not a verb I recognise.

>

I get the same result with this variation:

100m is a room. The command count is initially zero.

knowhall is a truth state that varies. knowhall is false.

Before reading a command when the location is 100m:
increment command count.

Every turn when the location is 100m:
if command count is 7:
if knowhall is false:
say "Now you see exit";
now the Hall is known;
now knowhall is true;
say "Condition met!";

A room can be known or unknown. A room is normally known. The Hall is a room south of 100m.  The Hall is a room.
1 Like

Wait, I think I’ve solved it:

100m is a room. The command count is initially zero.

knowhall is a truth state that varies. knowhall is false.

Before reading a command when the location is 100m:
increment command count;
if command count is 7:
if knowhall is false:
say "Now you see the exit.";
now the Hall is known;
now knowhall is true;
say "Condition met!";

A room can be known or unknown. A room is normally known. The Hall is a room south of 100m.  The Hall is unknown.

Yes, this works, @Draconis. Thanks for the heads-up.

1 Like

Yeah, the trick is that “every turn” rules only run on a turn—which a parse error isn’t.

2 Likes

This explains why, earlier in my game, my random messages that appear every 5,10,15,20 etc turns weren’t printing every 5,10,15,20 turns! I suspected it had something to do with ‘incorrect’ turns, but now I know.

The idea, by default, is that a “turn” represents a minute or so of time in the world. When you try to open a locked door and fail, that still takes time, but “BLAH” doesn’t even correspond to an action the computer can understand, so no time passes for your simulated character.

1 Like

Yeah, that makes sense, but I can see the player getting a bit lost in this scenario, not least because they have just been transported to a new area in the game. I’m covering myself in case there is total confusion. The response will be something like "You don’t have time for this nonsense and time is running out. Here is an exit’ or some such.

Changing the state of the world after the command line is read but before it’s known whether it’s a valid command or not is… weird. It might be better to issue a hint rather than actually changing the world.

2 Likes

Parser errors also don’t increase the “turns” or “moves” counter.

Really, if you’re implementing game logic like “the player has been in this room for 7 turns,” it’s completely standard for that to mean seven game actions. Nobody expects parser errors to count. It’s really not worth going to any extra effort to count them.

In fact, it’s usually bad for parser errors to count. If the player is trying to perform actions under time pressure, it would be completely unfair to count their typos against the time limit.

5 Likes

Understood, but this particular room is a bit of a bottleneck. It’s a new region into which the player is unexpectedly thrown, and there’s a new NPC who must be interacted with to not only progress but understand some context of the main narrative.

As I develop my game I’m always coming at it from the angle of a player who is unfamiliar with text adventure games. Perhaps this is naive of me, but I’m struggling to direct the player to correct syntax when interacting with the NPC without literally saying "you must type ‘ask the NPC about X’, and ‘don’t use question marks when asking a question’ and so on.

With this in mind, I think @rileypb’s idea of providing hints instead of the giving anything away is best.