Max Payne :: Cinematics

File: /articles/cinematics.php
Updated: 29.08.2001 - 10:30 - @395

click here for a printable version

Version: 1.0

Content:

  1. Introduction
  2. Setting up your scene
  3. The Dynamic Object
  4. Animating the camera (DO)
  5. Triggering your cutscene
  6. Conclusion

1. Introduction

I will show you how to create your own cutscenes in Max Payne in this tutorial. This is meant for more intermediate users of MaxEd. While the whole process is actually quite simple, following the needed manipulations can be tricky if you don’t already have some experience with MaxEd under your belt.

I’ll assume you have read the reference guide that came with MaxEd, and have read and understood all the previous tutorials out there. You’ll also need to know how to create your own keyframes, animations, and basic messages.

2. Setting Up Your Scene

First, you need to make a little scene for your camera to whiz around and look at. I suggest something simple first, such as two rooms and a hallway. If you want, you can add an enemy for a more advanced cutscene technique. Make sure you have everything that’s needed, a jumppoint, appropriate textures, and even some lighting for practice. Once you’ve got your level all tailored, you’re ready to make your camera.

3. The Dynamic Object

How most cutscenes work in Max is really quite simple. Instead of having the point-of-view (camera) come from some set point behind Max, the camera is attached to a dynamic object (DO) of your creation, that is then animated. However you want the camera to ‘act’ when you trigger the cutscene.

So that means the first step we should take is to create the DO to which we will attach the camera. Create a small mesh that you can still see easily enough, but isn’t extremely obtrusive into your level. The size really doesn’t matter, but when it is a good, fairly small size, it makes accurate animation easier. Once you have it made, place it wherever you want your camera’s ‘start point’ to be.

Now, we want our DO to be invisible, so it won’t show up before, during, or after our cinematic. To do this, we need to give it a special texture, the dummy texture. It is included in the basic_room.lvl textures, under the ‘dummy’ category. The way Max Payne interprets the dummy category, makes it so it becomes not only invisible, but also allows other objects (Max, bullets, other meshes) to pass through it. Now that you have it textured, we need to make it dynamic, so select it and press ‘d’. Edit your mesh and make sure that all the collisions are off, that it is not lightmapped, and that it is continuously updated.

Whenever an animation occurs in Max Payne, for optimization reasons animations will not be rendered if they are not in Max’s field of vision. For this reason we need to turn on ‘cont. upd.’ So the engine will still render the animation, even if Max’s view is elsewhere. Experiment with this option off to see just why it is so vital.

Now to animate our camera.

4. Animating the Camera (DO)

Now this is where the real fun comes in. I suggest for our first cinematic, we do something trivial like fly through the hallway, and rotate the camera left. To do this, we add two keyframes to our little DO. Keep in mind that the yellow line (of the x/y/z coord) coming from your DO is which direction the camera looks in.

Have the first keyframe be in the same room as Max start in, have the second be in the other room (visible through the open hallway), and the third be in the same place as the second, but rotated 180 degrees so it is facing back at Max. Now create two animations: keyframe0 to 1, and keyframe1 to 2. Set the lengths to something like 2 and 1 respectively, that way it will take the camera 2 real-time seconds to traverse the hallway, and 1 second to complete the rotation after it goes through the hallway. Once your animations are complete, edit the messages so that after the first animation is done, the second animation is run (ie: in ‘Animation(Animation_0)’, in the bottom section, add:

this->do_animate(animation_1);

or whatever applies to your animations).

5. Triggering Your Cut Scene

In order for the camera to become attached to your DO, you need to trigger it somehow. I suggest a simple ‘player collide’ trigger place at the entrance to your hallway. Now when you activate the trigger, it runs the ‘T_Activate’ tab, so you’ll want to be editing there.

In the ‘send before’ section, have it so your trigger targets your DO (camera mesh) and send the message cam_attachtodo(3,true);. This will attach the camera to the DO you specify for 3 seconds, and also enable aborting it (which I’m not fully sure about).

Also, have it begin the DO’s animation with DO_Animate(animation_0);. If you want to make it so your trigger only activates the first time Max walks into it, also add the line this->t_enable(false);, which will disable the trigger. Now save and run your level, then walk into the hallway and watch the cut scene.

I have noticed that it can be a bit funny if the camera has to ‘pass through’ Max, so don’t worry if you get the ‘hall of mirrors’ effect for a second after your animation starts.

6. Conclusion

So now you know how to create your own cutscenes. If you added an enemy entity to try something more difficult, see if you can get your camera to successfully circle around the enemy’s head in your cut scene.

I suggest you create a level, and add several cinematics just for practice. If you feel like you’re ready to experiment, try looking into the maxpayne_gamemode->gm_changeglobalgamespeed(A, B); -message, where ‘A’ is the speed you want (1=normal), and ‘B’ is the amount of time you want it to take for the new speed to take full effect. Don’t forget to change the game speed back to 1, though.

Well, good luck on your future maps.


--Carl Hapley aka SpazWad

slightly edited by mixuk

If you want to comment this article, mail SpazWad