Time Tracking
LLMs in general struggle with understanding and reasoning about time and this often leads to stories that feature impossible chronologies. By default, IW already takes care of this using a hidden variable called whereWhen that stores the current time and place. However, the AI does not appear to adhere to this very rigorously, and so is often vague on the specific time and location. Often this is acceptable (indeed, many stories travel "at the speed of plot" and do not track time and place rigorously), but can cause contradictions.
The most common problem is that the AI asserts a time or place which does not make sense given the story. For example, you enter one location, and the AI later asserts you are in another. Usually, the AI does not directly contradict recent events. However, it may not have a sufficiently-detailed summary of events further in the past, and its ability to infer higher-order logic seems limited. For example, the AI may assert that you don't have to go to work because it's Sunday when you were in work yesterday, unable to work out that yesterday must have been no later than Friday.
A secondary problem is that the AI struggles to make inferences about intervening times. If something is supposed to happen at 10pm, and time skips forward to 11pm, the AI may not realise that 10pm has passed even if it does understand the current time correctly.
Improving Time Tracking[edit]
The simplest way to improve time tracking is to make the AI write out the current time each turn, whether in outcomeDescription, secretInfo, or a dedicated tracked item. This ensures that the times/dates of all turns in short-turn memory are given to the AI each turn, and it can improve its ability to reason about events in the future relative to the current turn.
This can be as simple as asking the AI to write the current time and location, though you may wish to specify a format. Here is one example template (courtesy of Ridgtof) which should be added to Main Instructions:
<whereWhenInstructions> 1. This is how you should format location information in whereWhen: {Specific Place}, {Town or City}, {Country}, {Continent}. 2. This is how you should format time and date information in whereWhen: HH:MM {AM/PM} on {Day} {Month}, {Year}. 3. When written, whereWhen should look like this: {Specific Place}, {Town or City}, {Country}, {Continent}, at HH:MM {AM/PM} on {Day} {Month}, {Year}. </whereWhenInstructions> Always write whereWhen at the beginning of outcomeDescription on a single line, immediately followed by two newlines and a horizontal line, before writing any other information in outcomeDescription. Move time forward from the previous turn in a reasonable way, based on the events of the main scene in outcomeDescription. Periods of travel, unconsciousness, or time lapses affect the degree of time passage. Take into account if specific durations were specified in playerAction.
Note that the AI's ability to infer logical results from the progression of time remains, as discussed above, limited. It may be necessary also to instruct the AI to write the time elapsed since last turn.
Granularity of Time Tracking[edit]
Note that, depending on the world, there are pros and cons to details time tracking. Sometimes, you may wish to measure events in longer periods of time, such as hours, days or weeks. In this case, the ability of the AI to reason my be improved by having it track these longer time periods specifically, so that it doesn't have to infer that a day has passed due to the passage of some number of hours (or at least, to make it easier for it to do so).
Scheduled Events[edit]
In addition to tracking the current time itself, you may wish to record anything that is due to happen at a particular time, so make it easier for the AI to realise that it is supposed to happen.
Without time tracking, scheduled events often occur sooner - for example, a character may tell the player to return in a number of days, but should the player return at any time after a few turns, the character will happily accept that the time has already elapsed, even if it hasn't.
In order to fix this, simply implement a tracked item with either the time that events are supposed to happen or (perhaps more reliably) a countdown to when they should occur (as usual, the AI can be instructed to write this information into secretInfo each turn instead of using a tracked item).
Other Considerations[edit]
Most AI models seem to err on the side of short-duration turns. When asked to write the time elapsed since last turn, they will often choose a time that is just about plausible, but very much on the short side. This may be a particular consideration for slow-burn worlds which intend to have the story unfold over longer periods of time - without additional guidance, the AI may allow the player to complete far more than expected in a short amount of game time.