Cutscene Design

Forum for the creative side of the game development process: art, music, storyline, gameplay, concepts, etc. Any sort of relevant discussion is welcome here.

Moderator: PC Supremacists

User avatar
trufun202
Game Developer
Game Developer
Posts: 1105
Joined: Sun Sep 21, 2008 12:27 am
Location: Dallas, TX
Contact:

Cutscene Design

Post by trufun202 »

After I finish my next YouTube video, I think I might focus on cutscenes. I've never done anything with cutscenes, but I wanted to throw out my ideas and see what you guys think.

So here's my plan:
- Each cutscene will have its own Lua script.
- A cutscene will be driven by a "timeline" object. A timeline is a list of "events" (Lua methods) and their corresponding time to be invoked.
- Lua will build the timeline and define the methods that will be invoked by the engine per the given timeline.

For example, let's say we wanted a cutscene of the player walking up to a castle:

Visual timeline:
|------------------|----------------------|---------------------|-------------------------|
0 ShowCastle() 20 ApproachCastle() 25 CameraZoom() 30 ShowPlayerDialog() 45 FadeOut()

Lua building the timeline for the engine:

Code: Select all

timeline.AddEvent("ShowCastle", 0)
timeline.AddEvent("ApproachCastle", 20)
timeline.AddEvent("CameraZoom", 5)
timeline.AddEvent("ShowPlayerDialog", 5)
timeline.AddEvent("FadeOut", 15)
Notice that the time defined by Lua is the time since the last event. This way one event's running time doesn't impact the rest of the timeline. Each of the methods, such as "ShowCastle", "ApproachCastle", etc., are methods that are defined in the cutscene's Lua file.

What do you guys think? Am I over thinking this, under thinking this - or just plain retarded? Feel free to comment / ridicule as needed.
-Chris

YouTube | Twitter | Rad Raygun

“REAL ARTISTS SHIP” - Steve Jobs
User avatar
Falco Girgis
Elysian Shadows Team
Elysian Shadows Team
Posts: 10294
Joined: Thu May 20, 2004 2:04 pm
Current Project: Elysian Shadows
Favorite Gaming Platforms: Dreamcast, SNES, NES
Programming Language of Choice: C/++
Location: Studio Vorbis, AL
Contact:

Re: Cutscene Design

Post by Falco Girgis »

Wow, that actually sounds like a great idea. I hadn't actually "thought" about this--okay, that's a complete lie. All programmers who think of a problem, if only for a second, come up with some sort of rough outline for how to approach the issue. I hadn't put considerable thought into it is what I'm trying to say.

The rough outline in my head was to give each cutscene its own heartbeat that executes its own logic rather than the engine. But your approach is much more sophisticated, intelligent, pretty, and has nicer boobs than mine.

I hope you don't mind me warezing it? Haha.
User avatar
trufun202
Game Developer
Game Developer
Posts: 1105
Joined: Sun Sep 21, 2008 12:27 am
Location: Dallas, TX
Contact:

Re: Cutscene Design

Post by trufun202 »

GyroVorbis wrote:Wow, that actually sounds like a great idea. I hadn't actually "thought" about this--okay, that's a complete lie. All programmers who think of a problem, if only for a second, come up with some sort of rough outline for how to approach the issue. I hadn't put considerable thought into it is what I'm trying to say.

The rough outline in my head was to give each cutscene its own heartbeat that executes its own logic rather than the engine. But your approach is much more sophisticated, intelligent, pretty, and has nicer boobs than mine.

I hope you don't mind me warezing it? Haha.
Hmmmmm... Well now you've got me thinking. Maybe I'm overthinking this.

I kinda like the idea of keeping it simple and just giving the cutscene script a heartbeat. Then the script itself can worry about timing, etc. My timeline system may be too rigid.

I won't get started on this for a few weeks, so I'll keep thinking. But hey, if you wanna try it, go for it. :P
-Chris

YouTube | Twitter | Rad Raygun

“REAL ARTISTS SHIP” - Steve Jobs
User avatar
dandymcgee
ES Beta Backer
ES Beta Backer
Posts: 4709
Joined: Tue Apr 29, 2008 3:24 pm
Current Project: https://github.com/dbechrd/RicoTech
Favorite Gaming Platforms: NES, Sega Genesis, PS2, PC
Programming Language of Choice: C
Location: San Francisco
Contact:

Re: Cutscene Design

Post by dandymcgee »

Hmm.. They both like each other's ideas better than their own?
Falco Girgis wrote:It is imperative that I can broadcast my narcissistic commit strings to the Twitter! Tweet Tweet, bitches! :twisted:
User avatar
Arce
Jealous Self-Righteous Prick
Jealous Self-Righteous Prick
Posts: 2153
Joined: Mon Jul 10, 2006 9:29 pm

Re: Cutscene Design

Post by Arce »

Huh. I was always under the impression that each script would control their own respective 'cutscenes' by frame counting or something...

But I must say, I like your idea. In the long run, that would make development alot faster. And likely help to keep it concise on both the DC and PC builds...

No, i don't think we've given it a great deal of thought. This is quite an interesting topic. Honestly, I'd like to see your idea implemented. ;P

You never answered Gyro's question...How'd you feel about having it warzed? Cheated? XD
<qpHalcy0n> decided to paint the office, now i'm high and my hands hurt
User avatar
trufun202
Game Developer
Game Developer
Posts: 1105
Joined: Sun Sep 21, 2008 12:27 am
Location: Dallas, TX
Contact:

Re: Cutscene Design

Post by trufun202 »

Arce wrote:You never answered Gyro's question...How'd you feel about having it warzed? Cheated? XD
Hell no, go for it! But if it sucks, I'm not claiming it. ;)
-Chris

YouTube | Twitter | Rad Raygun

“REAL ARTISTS SHIP” - Steve Jobs
User avatar
Falco Girgis
Elysian Shadows Team
Elysian Shadows Team
Posts: 10294
Joined: Thu May 20, 2004 2:04 pm
Current Project: Elysian Shadows
Favorite Gaming Platforms: Dreamcast, SNES, NES
Programming Language of Choice: C/++
Location: Studio Vorbis, AL
Contact:

Re: Cutscene Design

Post by Falco Girgis »

trufun and I are buddies. We don't mind sharing and trading partners from time to time.
User avatar
trufun202
Game Developer
Game Developer
Posts: 1105
Joined: Sun Sep 21, 2008 12:27 am
Location: Dallas, TX
Contact:

Re: Cutscene Design

Post by trufun202 »

GyroVorbis wrote:trufun and I are buddies. We don't mind sharing and trading partners from time to time.
Eiffel Tower!

EDIT: Damnit! Jokes aren't nearly as funny when you have to explain them. :P

http://www.urbandictionary.com/define.p ... ffel+tower
-Chris

YouTube | Twitter | Rad Raygun

“REAL ARTISTS SHIP” - Steve Jobs
User avatar
Falco Girgis
Elysian Shadows Team
Elysian Shadows Team
Posts: 10294
Joined: Thu May 20, 2004 2:04 pm
Current Project: Elysian Shadows
Favorite Gaming Platforms: Dreamcast, SNES, NES
Programming Language of Choice: C/++
Location: Studio Vorbis, AL
Contact:

Re: Cutscene Design

Post by Falco Girgis »

:lol: :lol: :lol:

Man, it's a good thing you did explain that. ROFL.
User avatar
cypher1554R
Chaos Rift Demigod
Chaos Rift Demigod
Posts: 1124
Joined: Sun Jun 22, 2008 5:06 pm

Re: Cutscene Design

Post by cypher1554R »

:lol: !

<no comment>
User avatar
dandymcgee
ES Beta Backer
ES Beta Backer
Posts: 4709
Joined: Tue Apr 29, 2008 3:24 pm
Current Project: https://github.com/dbechrd/RicoTech
Favorite Gaming Platforms: NES, Sega Genesis, PS2, PC
Programming Language of Choice: C
Location: San Francisco
Contact:

Re: Cutscene Design

Post by dandymcgee »

Lol! :lol:
Falco Girgis wrote:It is imperative that I can broadcast my narcissistic commit strings to the Twitter! Tweet Tweet, bitches! :twisted:
User avatar
mllarson
Chaos Rift Regular
Chaos Rift Regular
Posts: 183
Joined: Fri Nov 14, 2008 5:20 pm
Location: Minnesota, where "Cold as Hell" has real meaning...

Re: Cutscene Design

Post by mllarson »

So why don't you just have it so that the script plays "pass the peace pipe"? When one action is complete, it lets the engine know to proceed to the next one. Basing things off a timer / timeline might be bad if the computer playing the game lags. Falco was saying in another post that Lua scripts being ran per frame on the DC was impacting performance. What would happen if the specified time for an action passed by? If every action had a heartbeat, wouldn't that slow things? This way it's simple and less prone to timing issues. Waht do you think?
"Mmmm... these paint chips are scrumptious!"
User avatar
Arce
Jealous Self-Righteous Prick
Jealous Self-Righteous Prick
Posts: 2153
Joined: Mon Jul 10, 2006 9:29 pm

Re: Cutscene Design

Post by Arce »

timer / timeline might be bad if the computer playing the game lags.
'Timer' could (and often does) could refer to a frame-count of some sort. In which case lag would also lag the timer accordingly, so no issue.

Also, the glory of devving for a console is that they've all got the same specs. Lag from on one means lag-free on all. Unless you fucked your shit in the ass. ;P
When one action is complete, it lets the engine know to proceed to the next one.
We're not multi-threading here...Nor does the engine cease to work as a lua script is called. Chances are high I've misinterpreted your post (I'm pretty tired atm. ;P) but I'm getting the impression that you're suggesting

Code: Select all

[engine]-/>start sutscene
-.>script 1
[script1]-.>script2
[script2]-.>scritp3
[script3]-/>end cutscene
-.>engine
Which wouldn't work, as each script occupies many frames and must yield to engine periodically.
Falco was saying in another post that Lua scripts being ran per frame on the DC was impacting performance.
Yes, but not significantly. Calling lua every frame shows on the stress-bar on the DC, but that's nothing we can't work with/around. Benefits outweigh the performance impact. Last I heard, he is calling the level.lua every frame; I highly doubt he's about to change that fact for the sake of a more usable (but unnecessary) cut scene engine.

Again, sorry if it sounds like I'm speaking out my asshole. Tired, and without enough caffeine. ;(

edit: In the end, i honestly do think we're all over thinking the cut-scene thing...The idea behind a timeline and addition to the engine entirely for the sake of cutscenes is pretty neat in theory, but in practice it may end up limiting, or pointless...We could already do frame-based cutscenes from the standard frame-by-frame level.lua...Then again, the trade-off is that it could probably get messy...I'm sure we'll give it more thought when we're further along.
Last edited by Arce on Wed Nov 26, 2008 10:37 pm, edited 1 time in total.
<qpHalcy0n> decided to paint the office, now i'm high and my hands hurt
User avatar
trufun202
Game Developer
Game Developer
Posts: 1105
Joined: Sun Sep 21, 2008 12:27 am
Location: Dallas, TX
Contact:

Re: Cutscene Design

Post by trufun202 »

mllarson wrote:So why don't you just have it so that the script plays "pass the peace pipe"? When one action is complete, it lets the engine know to proceed to the next one. Basing things off a timer / timeline might be bad if the computer playing the game lags. Falco was saying in another post that Lua scripts being ran per frame on the DC was impacting performance. What would happen if the specified time for an action passed by? If every action had a heartbeat, wouldn't that slow things? This way it's simple and less prone to timing issues. Waht do you think?
Yeah, I hear what you're saying. Since the cutscene events are going to happen in series, why not just have Lua tell the engine when to fire off the next event.

But, I've given this some thought, and I really like the simple approach. My game already calls Lua ever frame, and there's virtually no impact on performance. The heartbeat approach lets the cutscene do it's thing for as long as it wants, and it will let the engine know when it's done.

Falco wins this round. ;)

EDIT: Marcel wins this round as well, thanks for your help guys.
-Chris

YouTube | Twitter | Rad Raygun

“REAL ARTISTS SHIP” - Steve Jobs
User avatar
mllarson
Chaos Rift Regular
Chaos Rift Regular
Posts: 183
Joined: Fri Nov 14, 2008 5:20 pm
Location: Minnesota, where "Cold as Hell" has real meaning...

Re: Cutscene Design

Post by mllarson »

Actually I meant more along the lines of objects than scripts. Lets say that we have three objects: Billy Ray Bob, Bubba Joe Butthead, and the cameraman. We are making a riveting cutscene for that new drama-based game "Backwash Nights". Billy starts the cutscene by spewing out some drivel about how he towed his fat gramma to the store behind his Chevy pickup. Once he is done, he lets the game engine know that he's done, and then the engine lets Bubba know that it's his turn. The cameraman is just there to focus on the speaking person for now. So now Billy and Bubba are having a coversation, each passing the "peace pipe" (a.k.a. talking stick). Now this could be done in a frame by frame solution as well. Now, however, we want a third speaking character to be inserted into the scene (say we thought of something funnier to say). So along comes Lil' Mac, the town's midget pimp. He wants to tell Bubba that his sister made Mac some money last night, but now we have a problem. In a frame by frame script based on an absolute timeline, you'd have a hell of a time adding anything. In the way I'm talking about, the third character could be inserted easily. Once each entity is done doing what it needs to do, it yields to the next thing. Now lets complicate things a bit. Cameraman is being told to walk around Bubba's yard to get a better shot. Now cameraman has to call a pathfinding routine which could take an indeterminate amount of time (say the hound has impeded his progress, and he must find an alternate route). For a camera this seems kinda strange, but I'm just trying to illustrate the fact that certain actions may take an unknown amount of time. Also a cutscene might not take place in an exact point on a map. It could be called anywhere (like "catching the greased pig" minigame), so characters may need to find their way around obstacles.

Basically, if each character is an object (C++ is object oriented) that can be told what to do, do it it's own way, and then yield, it seems a lot easier than a frame-by-frame "move player up 1 pixel". Maybe I misunderstood the "frame by frame" meaning, but I'm just throwing out what I think.

-Matt

EDIT:
I'd like to elaborate a bit further on this. Let's say that we have a female character that is being told to move to a certain point on a map via a cutscene script. So she then must find a way to get to that point. As a land-based character, she has to find a path to that location, and then follow the path around trees, rocks, etc. You could hard-code her path in the script, as well, but now I'll throw a monkey at that wrench. Suddenly you have a brilliant idea. You decide to give the girl a pair of wings (like Nina in Breath of Fire). Now the girl could walk to the point, or if she deems it quicker, could fly to that point. The time it takes her to relocate can be unknown and still not mess up the flow. If you hard-coded her path in the script, then you'd have to change the script to get her to fly. In my approach, SHE decides how best to proceed without having to change the script, or other scripts, one iota, since the implementation on how to move, jump, fly, etc. is with the character herself, not in the script. Just call a function like moveTo(x coord, y coord) and wait until it returns. My point? Hard-coding is bad, simplicity is key...
"Mmmm... these paint chips are scrumptious!"
Post Reply