Hello Guest, please login or register.
Did you miss your activation email?
Login with username, password and session length.

Pages: [1]   Go Down

Author Topic: Story progress tracking.  (Read 920 times)

0 Members and 1 Guest are viewing this topic.
Story progress tracking.
« on: March 12, 2009, 08:23:14 pm »
  • *
  • Reputation: +9/-0
  • Offline Offline
  • Gender: Male
  • Posts: 3725
I was just wondering, how people keep track of the progress of the story in a game. It doesn't really matter what programming language.

For example: A character has to say something that leads the player to a dungeon, once this dungeon has been cleared the same character is in a different area of the map. The character then leads the player to a switch that opens up a new area, after which the character continues to be nothing more then generic until the player completes several dungeons and meets some other characters. This character then plays a role in a sidequest.

Show content
Some more concrete examples: In OOT when does the game know that Sheik has to turn up at the temple of time, then death mountain, then Lake Hylia, after which in Kakariko Village and then in the desert and finally back in the temple of time.

OR:

In the minish cap when Talon and Malon have to get back in their home, link has to go in the house; get the key; get out of the house and then give the key to Talon. Resulting in Talon being in the house, Malon with horse and cart in town.

OR:

again MC. When does the game know how to activate the scene in North Hyrule field when Vaati attacks Link, coming out of Hyrule Castle, in between the four trees. Or to trigger the scene that Vaati takes over the King.

I was think about two options:
1) some local variables denoting the state of instances in the world, which results in many variables being saved in a save file. Variables which can be unnecessary in a linear progression of parts.
2) using a finite state machine. Less variables to save, but can be big and confusing when there are a lot of nodes and transitions. Especially when there is not a definite linear order of the nodes. But the problem of size can be solved by making more and smaller finite state machines.

As I said it doesn't matter much in which language, it is more about the  design.
Logged
Re: Story progress tracking.
« Reply #1 on: March 12, 2009, 08:30:02 pm »
  • *
  • Reputation: +3/-0
  • Offline Offline
  • Gender: Male
  • Posts: 6629
Personally I just use a flag list, it's not the most efficient system around, but it's simple and very flexible, it's also what commerical games tend to use as well. Basically you just store a huge hash-table of name/value pairs. For each fork in the games story you create a flag (eg. "area51_bHasFoundAlien") and set it to the appropriate value (usually a boolean of true and false). Then when the user enters a scene trigger or something similar, the engine checks all the flags the trigger is assigned, if they are all set it plays the cinematic/kills the player/anything. And lets be fair, the save file is only going to be as long as your flag names, a game with a few thousand flags is only going to have a save file a few kilobytes long.

This may sound complex, and it can be at times. However it works spectacularly well if you implement a scripting language to deal with all game events and abstract it from the engine.
Logged
Pages: [1]   Go Up

 


Contact Us | Legal | Advertise Here
2013 © ZFGC, All Rights Reserved



Page created in 0.272 seconds with 41 queries.

anything