Game-rendered cutscenes

Blitz3D Forums/Blitz3D Programming/Game-rendered cutscenes

Adam Novagen(Posted 2009) [#1]
Hey all,

This isn't an essential question at the moment, but it may eventually become useful to me (and others.) SO. I've been tinkering with a little side-project game, and would eventually like to add some animated cutscenes. However, I consider pre-rendered stuff to be cheap copouts, unless you're going for something like Final Fantasy quality, which I'm not.

I'd like to just make dynamic, non-pre-rendered cutscenes in the game itself, using the game itself, like in... I dunno... Oh, the original Spyro games, or the Jak trilogy. You know, cutscenes that use the game's own models & rendering engine, but aren't confined to a few boring "marionette" movements.

Any suggestions on how best to go about this?


puki(Posted 2009) [#2]
All done with moving the camera. Zooming in on faces, zooming out. Virtually all cut-scenes make extensive use of movie-like camera work.


Nate the Great(Posted 2009) [#3]
just make a huge animated mesh with cameras paths and everything else in something like 3ds max then export it and when you load it and animate it it will do it all for you.


Kryzon(Posted 2009) [#4]
Funny you mention the Spyro games, I absolutely love the cutscenes and voice-work in those series. Rather inspiring I'd say.

I have done a bit of cutscene work in 3DS Max using the B3D Pipeline, which is a boon to your work I might add, both in production time and quality. Ah, and a better way to specify this kind of cutscene (instead of game-rendered) is Real-Time Cutscene\Cinematic.

Basically you would have a full scene just like Nate mentioned. In this scene, you would have your set, your characters and your nodes.
The good thing about 3DS + Pipeline is that you can make Dummies which can be exported as Pivots inside your .B3D file. Those dummies can have properties such as hierarchical animation. With only that, the possibilities are endless.

The following would be if you'd use 3DS Max to build a cutscene for use in B3D (sorry for the biblic size):

Firstly, you would need to create a camera.
Be in mind that the FOV (Field of View) of this camera may not be the same that it would inside Blitz3D (the default FOV in blitz3D is 90º, represented by a zoom of 1. The default in Max is 45º, represented by a zoom of 2.41421). That means that if you place a camera at the exact same position and orientation of that camera in max, the scene will "feel" different. That's why you need to change the FOV of that camera you just created in Max to 90º, so you can see what you will get when you run your scene in B3D.

For basic camera work, you would animate a camera (along a path or whatever. Using key frames for instance), and then create a Dummy and Quick Align it to that animated camera. When it snaps to the camera's position, parent the dummy to the camera so it will follow it's every movement and rotation. That way, when you hit "Play", not only will the camera move but also the dummy.

The problem in Max is that the Z axis is what would be the Y axis in Blitz3D, so you need to select that "camera dummy", go to Hierarchy tab -> Affect Pivot Only, turn on Angle Snap and turn the Dummy's pivot so that the Y axis gets in the position the Z axis was. That way, when you play your film in B3D the camera will already be facing the right direction (the same of the camera inside max). It was a toughie finding that out...

Do notice that while you animated your camera you are also animating other things in the scene, like characters, objects etc. You can do this in the same Scene because when you export it all as a single .B3D, the animation of all entities inside the scene will be exported altogether. The only problem you will have is to animate them all inside B3D, but that's a problem I'll leave to your wit (it's related to the Scene Root).

Just some tips:

- In case it wasn't clear why you parented that dummy to the camera, when you export your B3D model through the pipeline with the "Export Helpers" turned on, the dummy will become an animated pivot. If you Get or Find that Child inside your scene and parent a B3D camera to it using EntityParent Camera,Dummy,False (that False paremeter is so it will have the same position and orientation), and then animate the model, your camera will just go through the same motion you made inside the modelling program.

- You can use other Dummies to represent the positions of special things like special-effects, particle systems, etc.

- Make sure to follow what I've said in this thread:
http://blitzbasic.com/Community/posts.php?topic=82365#928714

- You can sync dialogue and sound effects very easily with this method: go to the Time Configuration window that I mentioned on that thread and look on the right side of it. There's a group called Time Display. Change that to "MM:SS:TICKS", and you can see the time that something in your animation will happen (just swing your animation bar to the event to see the exact minute, second and tick):

That way, you just have to go to an audio editing program, crop a sound effect and paste it in a new track at the exact time the event happens in the animation. It's easy to know that time, you just looked at it on the animation bar. That way, when you play the soundtrack AND Animate the scene at the same time inside B3D, they will both get synced and you'll have a nice soundtrack filled with foley and voicework (if you want it, of course).

- It's very important to limit the FPS of the animation inside Max when you have finished it. In that thread I suggested you to use that Frame Tweening code (which has the benefit of skipping frames if in need), but it's much faster to just use the internal B3D's Timer commands (CreateTimer, WaitTimer) using the same FPS you converted your animation into, in 3DS Max. You really need to limit your animation or it can get unsynced with the soundtrack. Other problems are also if someone Alt + Tabs out of your application - most likely that will cause the animation and audio to get unsynced.

- This is also important. You need to develop a cinematic engine in your game to take care of the cutscenes and the transition from interactive to these passive sequences. It can be very bothering to do that manually every time; to set up the camera position, disable some collisions, whatever. Also, it will make your code clearer and more fun to work with (and easier to include further cutscenes in it). Modularity is key.

After establishing this development process you can now concentrate on the fun part of the cinematics, which is the animation itself. Everything is worth here, from the camera work to animation principles (these principles are techniques that were developed by professional animators, mostly from Disney IIRC. They can help your animation look much more lifelike). Some of these principles are...

The Anticipation: When you throw a ball, you don't just throw it from a standing position; firstly, you turn your body and contract your arm in order to get the reach needed to apply such impulse to the projectile. That's what anticipation studies, the poses and movements things make before they actually apply the principal motion.

The Follow-Through: The way things like clothing extensions and relaxed limbs act when they are 'pulled' by the larger body. They always move later on, and are thrown forward when the body stops. We can also include similar principles in this category, like the "Drag" and "Overlapping Action" (they basically mean that if a character\object was moving in a certain direction and then suddenly changed it, it's appendages will continue to go on the previous direction for a few frames or more, depending on the motion).

The Ease-In, Ease-Out: When you start to run, you don't start with your maximum speed already. You progressively gain speed. If you're going to stop, you just don't snap to zero movement in a second. You take your time to stop. That's what Ease-In\Ease-Out studies, the motion that occurs while a body is trying to reach a certain speed. Note this doesn't only occur while running, but almost for every other organical motion (even if the motion is very simple\small).

The Secondary Action: Studies what other kinds of motion can be happening to parts of the main body and other appendages, such as "the arms moving synced with the legs when walking or running". If you don't take care of this part in your animation, everything will look stiffed and robotic. Things should have an almost physical sense behind them.

(disclaimer: animation principles info taken from it's wikipedia article and from a Clay Animation book that I can't remember the name now, sorry!)

I bet if I were to work professionally on game dev it could definately be in the "Cinematics" department. It's nice that you are touching on this subject, 'cause I love to talk about it!


Adam Novagen(Posted 2009) [#5]
Hm, thanks Kryzon, this help a lot! I might not use 3DS Max, but this information is extremely useful to me, and has given me many great ideas to try out. The only reason I might not use 3DSM is because it might be an interesting project for me to try: developing a cinematic engine from the ground up. Oh, and thank you for reminding me of the term "realtime;" that was what I was looking for, but I couldn't remember it. :B

ANYWAY, as I said, this has given me a lot to work with. As far as the actual animation concepts go, I'm pretty well familiar with those, having done a fair amount of animation myself, including frame-by-frame GIFs. You might like to check out one of my most notable successes HERE.

Thanks everyone!


Kryzon(Posted 2009) [#6]
Oh, I meant cinematic engine as in a way for you to easily implement animated cutscene meshes into your game world (you could still use 3DS Max to build and animate the scene), not really a script based cinematic engine.
You would call in a "Cutscene" function and supply the animated mesh and it would take care of all the important things like positioning the camera, reading nodes and preparing emitters and other special effects that the scene would use. That's what I mean with a cutscene engine.

Of course, it's still a very interesting project to develop your own system from scratch, but it will take a serious amount of time for it to be as good as if you used 3DS Max in the first place. Many companies use Max or Maya even to make their cutscenes because these programs have full animation support, with years of development behind them. There is also the other companies that have proprietary cutscene tools too, like the Level Editor for Warcraft 3 for instance. Since I want to get things going fast (and easy =P), I myself always use 3DS Max (although I have always wished to build my own level-editing and cutscene-making application).

That GIF was lovely, I didn't know you could do that! I love the waves in the water, and the little drop when the bucket stops pouring. 5 stars. I wonder what software (and process, really) did you use to make that?


Adam Novagen(Posted 2009) [#7]
Thanks Kryzon! For Flood Fill, I used the same program I always use: the marvelous GIMP. As far as the process, since the GIMP regards each layer as a frame in an animation, I just copied the previous layer & altered what needed to change. Simple really, if a bit tedious. I'm happy with the water too, except for the part where the emote climbs onto the raft; I got lazy with the waves, and they kind of "spring" back to flatness like Jello. XD


_PJ_(Posted 2009) [#8]
Personally, I think these kind of cutsceens, (although requiring a little more control over the positions of entities etc. and timing) actually work better, mainly because of the advantages over pre-rendered or vidoe cutscenes, such as The cutscene can reflect the EXACT state of events, such as object positions, particular customisations and other effects specific alterations that have been made as a result of gameplay.

There are a few main considerations I believe, and once you have those down, then you can pretty much work the cutscene how you like.

1) Remember that only animations and appearances possible within your "engine" will be available during the cutscene. If necessary,t he first step maybe to create more.

2) Know the locations and states of your entities. If these entities have "pathfinding" or may continue to interact with the "world" during the cutscene, make sure the AI style routines are continued throughout the cutscene.

3) Disable character input (aside from perhaps PAUSE or SKIP CUTSCENE etc.) Also, a little contrary to the above, remember to disable certain events which may affect the cutscene:
For example (and these are very dependant on the game type and so on)
A poisoned character may lose health regularly. To have such timed events continue during a period when the character cannot take any action is unfair.
An enemy may be trying to attack, this is something that can be dealt with in a number of ways depending on the purpose of the cutscene:
a) Dont start the cutscene until all enemies are destroyed or unable to enter the cutscene view.
b) Disable enemy attacking (may seem a little odd if the enemy moves but doesn't do anything)
c) Disable the enemy attack from having any true effect during the cutscene. Graphically it will occur, fireballs may be thrown etc. but n damage will be dealt.

Typical state-based graphical effects may affect the camera/view in a way that "spoils" the cutscene: For example, an explosion can occur which covers the cutscene camera view so the intended scene is not visible. Either, disable such activity during the cutscene, or carefully place the cutscene camera where it shouldnt be affected.

4.) Setup 1 or more cameras, perhaps with waypoints and code for turning/following etc.
Also setup timers to ensure that the cutscene proceeds at the desired rate.

5) If dialogue or subtitles are a part of your cutscene, tie these to the timers as well for synchronisation.

6) Depending on the cutscene and game, and what purposes it should serve, the cutscene can be "triggered" by a variety of means, such as:

a) On an Event - The Player uses an item. This cutscene can potentially occur at anytime the consitions are met, therefore the cutscene camera may be dependant on current position of the Player character.

b) On Reaching a specific location - This cutscene can be simpler to implement, depending on any requirement conidtions needed in-game for the player to enter thhe "trigger location". The cutscene camera can be pre designated to a set position that focuses on the location.

c) Between Levels - These cutscenes are perhaps the simplest, and often 'work' in a similar manner to whatever format your game needs when loading levels etc. Only the level design can be swet up perhaps with randomised factors carefully pre-calculated instead of random, and of course, the characters' initial location and action are all able to be generally defined by your direction.


In cutscenes that are not necessarily required to be seamless or taken directly from a dynamic moment iduring gameplay, you haev more control over how things are set. This is something that can minimise the workload and reduce factors that may interfere. Many of the points noted in numbers 1, 2 and 3 above may be eradicated if your cutscene does not require many of the 'ongoing' attributes from current gameplay.

----

Temportary Locations:

Often, a cutscene may be needed to reflect goings on elsewhere, or involve locations and characters not currently 'existent' within the 'world'. In these cases, it may be necessary to include the building/loading and setup of the cutscene area and contents along with the "level".
In most cases like this, it's not necessary to include full details of this location, as the cutscene camera may only show something like half a room. Until a later date, perhaps, when the game action actually enters the location in question, only then does the entire locale need populating.


Kryzon(Posted 2009) [#9]
But Adam, how did you know that the amount of changes in the next layer would be enough to cover the kind of motion you wanted (meaning, how did you test what you currently had to see if it was getting the way you wanted, and not looking totally like crap) ?

EDIT: Take a look at Graphics Gale. It's not as full of features as Gimp but it definately has much more animation support for GIFs and anim strips (including animation preview, onion skin and several other cool stuff).


Adam Novagen(Posted 2009) [#10]
But Adam, how did you know that the amount of changes in the next layer would be enough to cover the kind of motion you wanted


Erm... The GIMP has an Animation Playback feature. Like GraphicsGale. And if you want onion skinning, you can tweak the layer transparency. That... Kinda makes it easy. I used to use GraphicsGale, before I found the GIMP... I am N-E-V-E-R going back.


Uncle(Posted 2009) [#11]
I made something similar a while back. I was going to use it for a game I was making, but in the end decided that cut scenes slowed the game down too much. Im not sure I might still have it knocking around on my HD somewhere. It allowed you to add objects, and create paths. Objects could be added to paths, along with the camera.

Here it is in action : http://www.youtube.com/watch?v=zSRheTOWz10


Adam Novagen(Posted 2009) [#12]
Wa-hey, looks pretty cool Uncle! I'd be happy to try it out; Star Wars ftw! :D