Step 4: A scripting language For a game that tells a story... What do we need? Let's see... We need a way to tell the characters and events in the world what to do and when should they do it. And that's it for the most part. Sounds easy, right? The easiest approach, for me at least, was making a set of commands to be triggered by an event. I started by learning how other tools do the job. A tree with nodes specifiing orders was visual and clean. So I started with the minimum amount of commands and later on, I could add more as I see I need them. A few ideas: - We want our characters to speak casually. - We want our characters to have long and convoluted conversations with npcs. - We want to be able to tell our characters to move. - We want to be able to tell our characters to play an animation. - For cinematic purposes, we need ways to control the camera. - We need to read and write state variables. - We need some kind of flow control, making it a true scripting language. This was the starting point. Reusing some old code I wrote for making all types of editors, I quickly had a tool for editing script trees. Each level loads a file with the scripts for the scene, and then, when triggered, a unity script executes each node following the tree flow. When it worked I was surprised how easy to use and powerful this tool was. An example: Some work in progress for a level. Another one, just for the laughs: And then, with the right tools developed, the time for my first cinematic arrived... https://ift.tt/eA8V8J
For a game that tells a story... What do we need? Let's see... We need a way to tell the characters and events in the world what to do and when should they do it. And that's it for the most part. Sounds easy, right? The easiest approach, for me at least, was making a set of commands to be triggered by an event. I started by learning how other tools do the job. A tree with nodes specifiing orders was visual and clean. So I started with the minimum amount of commands and later on, I could add more as I see I need them. A few ideas: - We want our characters to speak casually. - We want our characters to have long and convoluted conversations with npcs. - We want to be able to tell our characters to move. - We want to be able to tell our characters to play an animation. - For cinematic purposes, we need ways to control the camera. - We need to read and write state variables. - We need some kind of flow control, making it a true scripting language. This was the starting point. Reusing some old code I wrote for making all types of editors, I quickly had a tool for editing script trees. Each level loads a file with the scripts for the scene, and then, when triggered, a unity script executes each node following the tree flow. When it worked I was surprised how easy to use and powerful this tool was. An example: Some work in progress for a level. Another one, just for the laughs: And then, with the right tools developed, the time for my first cinematic arrived...
from GameDev.net http://bit.ly/2Jch04r
from GameDev.net http://bit.ly/2Jch04r
ليست هناك تعليقات