How do games implement their triggers and events that make up the plot of the story. For example, to be concrete how would one implement the story of a game such as The Legend of Zelda: A Link to the Past. I'm assuming there is some kind of scripting that somehow hooks into the game world state? I know absolutely nothing about scripting and game development. And have no clue how the underlying code would be architected in terms of classes, data structures, design patterns, etc.
|
In the simplest terms i can put it.
The FSM may be defined like
Each "state" within a FSM may contain its own FSM. All of this can be defined with data, and doesnt necessarily require its own scripting language. | |||||||||
|
I want to add some more information to what Matt already mentioned by explaining how the RPG Maker does specific story progression and states. Though one can implement a more complex system the simplified way how the RPG Maker does it should be a good start. In maps we can find certain triggers or entities. That can be an invisible tile which executes some code when the player steps on it or just a NPC you can talk to. Each one has different properties and provides different ways to interact with. Assume we have a NPC who would send you give you a quest - the first time you talk to him he would say something different than later on. Using pages for entities one can write code for different situations which is only executed under certain conditions. The RPG Maker uses so called switches - just boolean variables which are either on or off. At the beginning of the game a switch This is a very easy way to work with story progression, however the more content the game has the more switches you will have and at a certain point it is definitely better to consider using finite state machines! | |||
|