[I7] Determining the Current Scene; Verifying My Approach

What I needed was a way to check what the current scene was. I have a solution. What I want to do here is just make sure others feel this is a viable solution. Is there some way people would have done this differently and, perhaps, better?

Consider some logic like this:

A scene has a text called temporal cue.

Just Past Dawn is a recurring scene.
Just Past Dawn begins when the time of day is 6:00 AM.
Just Past Dawn ends when the time of day is 7:30 AM.
The temporal cue of Just Past Dawn is "It's just past dawn."

Early Morning is a recurring scene.
Early Morning begins when Just Past Dawn ends.
Early Morning ends when the time of day is 9:30 AM.
The temporal cue of Early Morning is "It's early morning."

There will be many such scenes corresponding to the following list:

  • Just past dawn: 6:00 AM to 7:30 AM.
  • early morning: 7:30 AM to 9:30 AM.
  • mid-morning: 9:30 AM to Noon.
  • noon: 12:00 pm to 1:00 pm
  • early afternoon 1:00 pm to 3:00 pm
  • mid afternoon: 3:00 pm to 5:00 pm
  • early evening: 5:00 pm to 7:00 pm
  • mid-evening: 7:00 pm to 9:00 pm
  • late-evening: 9:00 pm to 11:59 pm
  • midnight: 12:00 am - 1:00 am
  • early hours: 1:00 am - 3:00 am
  • pre-dawn: 3:00 am - 6:00 am

What I needed was a way to have the temporal cue provided when the player asks for the time. That, however, required hooking into whatever the current scene was. (Which I wouldn’t know, of course, because I would have no idea when the player would ask for the time.)

So here’s what I did:

The current scene is a scene that varies.

First when a scene (called the operating scene) which is not the Entire Game begins:
	now the current scene is the operating scene.

Asking for time is an action out of world.
Understand "time" as asking for time.

Report asking for time:
	say "[temporal cue of the current scene]".

This seems to work. I guess I’m just checking if this way makes the most sense or if people have a different idea about how this would be implemented.

This also does perhaps suggest the question of whether using scenes for this is even the best way to do it. While the game itself won’t display the internal clock, I suppose I could simply just do a time check. But I like the idea of scenes because it seems then you could check for things during a given scene.

For example, “if mid-evening is happening, tell the player they are getting tired. If late-evening is happening, tell the player they are extremely tired.”

1 Like

There is no inherent concept of “the current scene” because you can have several scenes active at once. Indeed, “the entire game” is always an active scene.

What you’ve done will work if those are the only scenes in your game. But you might want to add scenes not connected to the time system. In that case, you might say

A scene has a text called temporal cue.

Definition: a scene is temporal if the temporal cue of it is not empty.

First when a temporal scene (called the operating scene) begins:
	now the current scene is the operating scene.

(It would be nice to define a “kind of scene”, but the language doesn’t allow that.)

3 Likes

You could equally well do the entire thing with a global state variable rather than scenes.

That might come out as “if the clock period is mid-evening…” It wouldn’t be much harder. A scene is really just a convenient way to manage a global variable with some start/stop conditions.

Ooh, very good points about multiple scenes being operative together. I actually do plan on having other scenes – not related to the day-night cycle – in play. So that idea of the definition is absolutely something I’m going to need.

Thank you the assist in knowledge here as well as bringing something to my attention that I wasn’t even considering!

For what is worth, instead of using a definition, you can also use a property:

A scene can be temporal. A scene is usually not temporal.

But then you have to set it by hand, so I think a definition is better.

Another way:

To say temporal-cue:
    if just past down is happening:
        say "...";
    else if early morning is happening:
        say "...";
    [And so on.]

But again, I think zarf’s solution is best. I am just throwing some alternatives which can be useful is other situations.

2 Likes

This is great! Thank you for the additional ideas. This is actually one of the things I’m going to be presenting in my classes: different ways to accomplish the same task. Eventually this will lead to a “heuristics” document regarding how to start “thinking Inform.”

tangentially, I’m not enthutiast of time (moves) constraints; led to rather high zarf rating; I prefer a more relaxed approach, linking passing of time to specific action, e.g. to be in the “slice of life” theme, early morning start after breakfast.
(OK, culture clash here: in my country, that is, Italy, no one is actually fully functional prior of morning coffee… if someone has taken an actual Italian espresso, s/he know that is the ultimate “hack fuel”)

my favorite (ab)use of the passing of time is exploiting the change in lighting and angle (noticing shining but hidden sundry item(s) only under the low afternoon sun, for a rather unfair example…)

OTOH, the use of a “master variable” is a very effective tool of handling the narrative flow, but need a due care and diligence, e.g. is easy to jump out of scheduled events.

Best regards from Italy,
dott. Piergiorgio.

1 Like