Dialogue Modding – pt 4 – Cinematics

Cinematics and Staging

Cinematics and staging are my absolute favorite parts of conversation modding. (That was sarcasm. I hate this part.) Whereas the conversation file dictates what’s said and when, cinematics dictate how it looks when it’s being said.

And, obnoxiously, they also dictate what’s said and when (lol).

Staging

Stages (.stg) are referenced by cinematics and exert a lot of influence over what a scene looks like. They are necessary components of any scene, as they determine where characters are located and what cameras are available for use.

Generic stages are located in packages\core\data\designerresources.rim while custom stages are in modules\campaign_base\data\designercutscenes.erf. Stages have two main components: places and cameras. The default/generic stages that will be used for most back and forth conversations in the game have a number of places for Hawke + party to stand as well as up to a small group of people to talk to, and shot reverse-shot camera angles at varying zoom levels.

You’ll recognize a generic stage when you see one. Look familiar?

Any more complex arrangement requires a custom stage.

The place list is relatively straightforward. It will with a few exceptions have a places for player, follower1, follower2, and follower3. It may also include stage places for any number of specific NPCs in the scene. Below the position and orientation are three places to list cameras – default, close up, and wide. These cameras can be loaded in cinematics by tagging the actor stage place rather than a camera stage place.

The camera list is basically more of the same. Cameras will generally be included for specific close ups, over the shoulder shots, wide establishing shots, etc. These fields all exist in the DAO stage editor as well, and documentation exists to get an idea of the more obscure functions. FOV (field of view) is an option one might wish to adjust – the multiple DOF (depth of field) options maybe less-so.

Places and stages are identified in cinematics by tag, so take note of them.

I highly recommend mocking up stages in the Origins toolset stage editor if one has a need to relocate or add new places or cameras. The only field that is not straightforward to copy between the toolset and the .stg is the orientation – and I’ve written about converting between quaternion and vector in another post.

Stage Placement

Unless otherwise specified, a cutscene will just take place wherever the player and NPC are standing when the conversation is initiated. For generic stages this is sufficient but custom stages are usually intended to take place in a very specific part of the area. Stage placement can mean the difference between this:

and this:


Unfortunately, there are no shortcuts to take for stage placement. Stages have to be placed in the area (.are) file. The game can’t be tricked into placing them otherwise. As there are limited areas in the game, and no two mods can override the same area, consider carefully if this is an appropriate measure for your mod.

PyGFF can view but not edit areas. For that you will need TlkEdit2, which runs on Java and is old as shit (isn’t modding great?). You may have to close and reopen the program a few times if copy+pasting multiple items as it’s pretty temperamental but the Stage List is straightforward enough.

Cinematics

Any line with cinematics – that is, any line that has voiceover and/or animations and isn’t a skip line – has a corresponding .cl. There is a .crf archive for each conversation, prefaced “cln_”, that contains these files, located in modules\campaign_base\data. The .cl files can be bulk exported with pyGFF, and follow the naming convention [name of conversation][string reference].cl. You can add a new .cl that didn’t previously exist by simply following that naming convention and the game will recognize it (more on that when we get to cloning).

A .cl in DA2 is internally indistinguishable from a cutscene. In DAO dialogues, most cinematics and basic animations were handled inline, but there was an option to convert the line to an external cutscene so it could be edited in more detail. That’s kind of where the DA2 system is at – every line is exported as a separate mini-cutscene.

“Standalone” cutscenes (.cut), located in modules\campaign_base\data\designercutscenes.erf, also exist, but not quite to the extent they did in DAO.

Editing cinematics absolutely requires the toolsetRemember how pyGFF mistakenly outputs a null string as an empty string? pyGFF mucks up enough when editing cinematics that you will probably corrupt the file and crash your game if you try it.

There are a lot of fields in .cl/.cut files. I will do my best to point out fields that I find most useful to understand, but if your needs outpace the scope of this section of the tutorial the only advice I can give is to familiarize yourself with the toolset cutscene editor and look for similarities.

Cutscene Properties

(toolset documentation)


You may need to edit the run time depending on the nature of the changes you’re making to dialogue. Note that cutting the run time shorter than the voiceover (or any other sound effects) won’t actually cut off the audio early – it will continue to play over the next line.

I haven’t seen any .cl files that have an end script but .cut files commonly use gen00cs_cutscene_end to handle various scripting events. You can take advantage of the end script field in .cl files to run a custom script in the middle of a dialogue – this is something I certainly did multiple times before switching to custom plot scripts for most use cases. (More on those later though.)

There are two separate fields where the stage (here pro000st_flemeth_intro) is listed – one with the file extension (the resource reference) and one without. You can also see where the area and primary camera for the shot are listed. As far as I can tell, these fields aren’t all required, and many will be overridden by details in the action queue. That said, if the shot uses a stage, the stage resource reference is required.

Cutscene Actors

(toolset documentation)

Here’s where it starts to get messy. Several actors will be listed in the cutscene_actors list, including the MASTER (which handles camera switching, bink movies, and other things), a Primary Camera, possibly several other cameras, the PLAYER, possibly FOLLOWER 1 / 2 / 3, any NPCs or other creatures in the scene, and potentially things like props, visual effects (vfx), etc.

Most probably if we’re poking around in cinematics we’re primarily concerned with characters (or “creatures”), so we’ll focus on that.

Note the two places where the creature is identified by tag (gen00fl_carver). In other cases this may be PLAYER, FOLLOWER 1 / 2 / 3, etc.

In the case that the actor is not a creature, the model resource reference may also be filled in with a direct path to the model – whether it’s vfx such as blood/gibs (art\vfx\combat\vfx_gib_hlk_bld_p) or a prop like the murder knife  (art\levels\4cinematics\ferelden\prp_killdagger).

Poses are occasionally sprinkled in to (unsuccessfully) mask the fact that everyone is just standing stiffly around 99% of the time. Poses are referencing poses.gda. Pose 0 is standing neutral. If someone is crossing their arms, sitting, kneeling, etc. it’s usually a pose. Set previous pose if necessary to transition from an old pose to a new one.

The inventory is another bitwise flag that controls what equipment is visible in cutscenes (if equipped).

1 = main hand
2 = off hand
4 = chest
8 = head
16 = boots
32 = gloves

Down at the bottom are a bunch of fields that are unlabeled because they’re new to DA2 – the easiest to identify are a set of plot GUID, plot flag, and boolean at 5231-5233. These plot flags can be used to conditionally enable and disable objects in the cutscene – Carver and/or Bethany, Hawkes with different animations depending on their class, different lines of Varric’s voiceover playing over movies, etc. The integer above them, 5230, must be set to 3 for the plot flag to be checked. (Other int values in that field might be shortcuts for Hawke’s class and/or gender, as far as I can guess.)

Cutscene Action Queue

(toolset documentation)

Now here’s where all the advanced stuff has been hiding this whole time! Some of it is excellent and some of it is terribly obscure.

While the conversation files manage the dialogue wheel and tell the game which .cl files to play, it’s the speak line (ASLN) action that actually handles the dialogue as it’s being spoken. Most of the time only one line is spoken per .cl but sometimes you’ll have several lines strung together in a single file – this is where those skip lines have been hiding. If you’ve done much dialogue editing you’ve probably run into some cases where trying to rearrange lines of dialogue did weird and unexpected things – this is likely why.

The most important things to note here are the talk string, lip sync set, and vo bank, which collectively inform the game how to find the correct subtitles, facefx, and voiceover for each line. In the case of a more advanced cinematic with lots of animations or multiple lines, also note the start and stop time.

As with adding local strings to the conversation file to add or edit selectable player responses, we can also add local strings in the cinematics to edit the subtitles that display over spoken lines.

Jump to stage place (AJSP) and jump to stage camera (AJSC) are also important – they snap creatures and cameras to specific stage positions (identified by tag).

If you have a problem when editing cinematics where the camera seems to fall out of the map, set etc. etc. DEFAULT_CAMERA to 0 and see if that fixes it. Otherwise the game will try to load one of the default cameras associated with an actor stage place instead.

You might not need to tweak headtracking (ACHT), but if you do, you’ll really need it. This automates where characters are looking during the scene. You can set it to the tag of a specific object (such as an NPC) in the scene, or more generic tags like PLAYER or PREVSPEAKER.

This is getting lengthy so I’m not going to delve into any more specific actions in the queue. There will be a lot of play animation (AANI) actions, frame buffer effects (AFBE), and many various others. The point at which you start getting into actions which involve curves, keys, or GAD is the point at which trying to manually edit the cutscene gets really messy.

Moving right along

If part one of the tutorial was the foundation for understanding the basics in part two, much of what has been covered here in cinematics is laying the groundwork for delving into the specifics of how to clone (aka duplicate and repurpose) existing dialogue and cutscenes.