Jump to content

What's a good way to handle cutscenes?

Recommended Posts

The main focus of my game is story and dialogue, so I want to aim for a fairly cinematic experience. I'm sure I can make a scene FAIRLY pretty, but I'm not so sure how to frame it.


How should I go about controlling the camera in LUA? Zooming in, centering on key areas, panning around the scene, rotating, that sort of thing.

Share this post

Link to post

Well I am not sure what exactly you want to do but here are some of the functions you would use -


Camera Zoom - http://www.leadwerks.com/werkspace/page/documentation/_/command-reference/camera/camerasetzoom-r207


Point at Entity (center in on entities) - http://www.leadwerks.com/werkspace/page/documentation/_/command-reference/entity/entitypoint-r167


Move (good for panning and general camera movement because it doesn't detect collision) - http://www.leadwerks.com/werkspace/page/documentation/_/command-reference/entity/entitymove-r165


Turn (Use this instead of SetRotation() to turn the camera over time) - http://www.leadwerks.com/werkspace/page/documentation/_/command-reference/entity/entityturn-r29


There are many more (SetRotation(),SetPosition(), etc.) but these should be good enough to make a simple scene.

Share this post

Link to post

Using all the functions Haydenmango talked about via coroutines is a good way to get cinematic control. Couroutines in Lua allow you to create scripts that execute from top to bottom while holding their state and not blocking your game loop. It's an easy way to control state in a logical way. You could write scripts that look like:


MoveToPoint(player, point)






A script like the above would define functions that you would create and you would yield inside each on which basically comes out of the function and allows your game loop to go and then comes back into the function where it left off to continue it's work. Only until you say the function is finished would it then move to the next function in the list.


Without something like coroutines maintaining state of cinematics can become messy and hard to follow.



Here's a post I wrote about this. I've tested it in Leadwerks and it works. If I had time I would love to make a library of yieldable functions to use with this, but my time is limited these days.





Here is an example I did with this in LE 2. You have to turn the volume way up to hear the audio that I have but you can see I play audio, move cameras around and such.



Share this post

Link to post

I encourage having a cinamatic camera different from your gameplay camera, and using pivots with specific names in the level.

When cinematic camera is active it's script would move and rotate from pivot to pivot.


Pivots with specific names would allow to play character sequence or particle effects when camera reaches it.


For example in the cinematic camera Example :





Etc ...

Share this post

Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...