Sign in to follow this  
un bon fricot

New modder seeking tutorials on animation in Blender; adding voiced dialogue

Recommended Posts

Hi, I am new to modding KoTOR. Can anyone point me towards information on the following subjects? I've been able to find more general tutorials, but after reading them I still don't know how to accomplish these specific tasks, or even whether I have all the right tools. I apologize if this isn't the most focused thread: I figured this would be better than making three.

  • How do I test my mod in-game?
    • Is there a convenient way of putting an affected module at the start of the game?
    • If I change something twenty hours into the game, can I use a save point from just before then to see the change? How can I avoid making changes that will corrupt this savegame.
    • If my mod makes a global change, do I have no choice but to start a new game and play the whole thing?
  • How do I add or edit animations using Blender?
    • Where can I find the latest version of KotorBlender and MDLEdit (or do I want MDLOps)?
    • Is KotorBlender compatible with Blender 3's addon system?
    • Why do the game models have these weird boxes rather than actual bones?
    • It looks like the ASCII itself has animation data, so how do I see these animations in Blender?
    • Once I've exported my edits from Blender, and converted everything back to binary, how do I put it in the game?
  • How do I add a new line of voiced dialogue?
    • I know some of the audio is stored with slightly nonstandard headers and extensions. Do I need to recreate these nonstandard headers in order to add audio?
    • Do I need a specific sample rate and format, or will the engine handle 32kHz wavs/mp3s?
    • Does all my new dialogue live in override/StreamVoice/?
    • I realize I need DLGEdit, rather than KotOR Tool, to edit .dlg files without mangling them. However, my understanding of .dlg files is that they don't contain dialogue, they only contain references to offsets in dialog.tlk. So, what do I use for editing dialog.tlk?
    • I saw some .lip files while messing around with the KotOR tool. I'm guessing I need to generate lipsync information at build time, so how do I do that?
    • I noticed some lines in TSL cause a musical sting to play. Is this accomplished through scripting? Does KoTOR1's scripting have this feature?

Share this post


Link to post
Share on other sites

To your first question, you can use the cheat console to warp to any module, but certain  mods might require specific circumstances regarding plot states/variables. There are some saves available in the download section that may prove useful for such cases. However, a critical factor is that certain game states, notably anything in the GIT, are stored in a save the first time you enter an area, so ideally for testing purposes you will want a save right before entering every module for the first time.

It's rare that a single mod would require a full playthrough to test, unless it is an extremely large mod like a total conversion or other similarly expansive project (for example, K1CP or TSLRCM). But assuming you don't have appropriate saves to hand, then you could conceivably have to play a decent chunk of the game in order to test everything. You can often fudge what you need though by editing saves with KSE and/or manually via KGFF (e.g. changing globals, editing GITs, etc.).

Regarding Blender, that's only a relatively recent development for KOTOR modding, so you won't find a lot of specific information about it. But what I can tell you is that with the advent of seedhartha's fork of KBlender you won't need MDLEdit or MDLOps, as it now imports and exports binary models directly. The ASCII workflow is only needed when using Max/GMax.

Binary models go in the Override folder.

Use SithCodec to strip fake headers or add them from/to audio. The underlying format is either an MP3 with a fake WAV header, a WAV with a fake MP3 header, or just an non-obscured WAV. Which it is depends on what specific type of audio it is (VO, music, SFX, etc.). As to the format, just take a vanilla example and copy whatever that is.

As a general rule you don't edit the TLK exactly. TSLPatcher can only append new lines, it can't edit existing ones, so there's no practical method to distribute mods that edit the vanilla TLK lines without a hard overwrite of the TLK. If you want to know how to append, read TSLPatcher's included readme PDF which explains the process (and how to use it for all other major mod installation functions).

Where audio goes depends on the type (and which game). VO goes in streamwaves (K1) / StreamVoice (TSL) in a sub-folder for the specific DLG inside the sub-folder for that module, except for global lines. Music goes in streammusic and SFX in streamsounds.

LIP files are generated using the CSLU Toolkit and LipSync Editor. As to the how, here's an overview of the process. It doesn't work so hot for alien gobbledygook though.

If you are talking about TSL's alignment gain stings, those are hardcoded. There was a mod released just the other day that tries to emulate that functionality for K1 - https://deadlystream.com/files/file/1956-k1-alignment-fancy-bits/

 

Share this post


Link to post
Share on other sites

Thank you very much! This is all very helpful.

I think most of my ideas for mods are non-starters unless I can animate.

  • Am I understanding correctly that KotorBlender, even seedharta's fork, is not currently able to do this?
  • Are there plans to add this feature? Are there obstacles that mean it will never happen?
  • If I have to add this feature myself, would I be able to look at the source of a GMax-targeting tool, in order to see how it might be done? Or maybe documentation on the mdl and mdx formats?

On the musical sting, I'm referring to how the music changes when, for example, Kreia wakes up to scold you for the first time. I might be misinterpreting what is actually happening there, but it had me under the impression that you could replace the background music at certain nodes in a conversation.

Share this post


Link to post
Share on other sites

Changing the background music is scriptable. Turning it on, off, switching to a different track.

You should be able to add animations in Blender, but I don't use it so I can't really tell you much about it. You'd be better off quizzing @seedhartha about it directly, assuming the readme doesn't cover it.

Share this post


Link to post
Share on other sites

You can edit and create animations in KotorBlender, no problem.

> Why do the game models have these weird boxes rather than actual bones?

Low-poly parts are used both as bones for skeletal animation, and shadow casters. High-poly parts are bound to low-polys via vertex groups. This is just how 3ds Max works, which Bioware used at the time.

In KotorBlender you need to animate these low-poly parts, instead of armature. Just import some existing models and see how it works. Armature can still be created (see Recreate Armature under KotOR Model), but only for preview, not export purposes.

I tried to make armature animations exportable, but quickly found that not to be practical, due to different coordinate system of armature bones and other shenanigans.

Share this post


Link to post
Share on other sites
On 1/6/2022 at 8:55 PM, seedhartha said:

You can edit and create animations in KotorBlender, no problem.

> Why do the game models have these weird boxes rather than actual bones?

Low-poly parts are used both as bones for skeletal animation, and shadow casters. High-poly parts are bound to low-polys via vertex groups. This is just how 3ds Max works, which Bioware used at the time.

In KotorBlender you need to animate these low-poly parts, instead of armature. Just import some existing models and see how it works. Armature can still be created (see Recreate Armature under KotOR Model), but only for preview, not export purposes.

I tried to make armature animations exportable, but quickly found that not to be practical, due to different coordinate system of armature bones and other shenanigans.

Ah, thank you for the explanation. It turns out I wasn't seeing any animations because I never looked past frame 55.

Sorry for all the questions, but I'm really confused by having all of the animations right there on the same timeline.

  • How do I indicate whether a keyframe is part of a new animation?
  • How do I edit the name of an animation, or set the name of a new one?
  • How do I indicate that the duration of an existing animation has changed?
  • How can I tell how far the game will move the root when the animation plays, e.g. with the gizka hopping animation?
Edited by un bon fricot

Share this post


Link to post
Share on other sites

In KMax animations are defined in the model base, I would assume KBlender follows the same approach. That includes the name, length/keyframe range, SFX, supermodel, animation scale, etc.

The Gizka hopping anim is just a standard walkcycle, so it doesn't move anywhere. Physical movement within the game is handled by scripted move commands.

Before you go further, you should probably outline what exactly it is you're hoping to achieve. Chances are you're going to have to curb your ambitions, because what you can do with animations in either game is extremely limited. You can't add new general purpose animations (i.e. combat, conversation, etc.), only replace existing ones. There is some wiggle room within the existing framework, depending on the circumstances, substituting certain animations for others. For example, using the dance animation "slot" for something else.

The only real true freedom you have is with stunt animations, but those are only used during cutscenes/conversations.

Share this post


Link to post
Share on other sites

I had assumed the animation metadata is imported by KotorBlender from the model files somehow, I'm just having trouble seeing it all in the UI.

Here are the three big things I'd like to do, animation-wise:

  • Add new holograms to the Twisted Rancor Trio puzzle.
  • Animate picking up gizka / failing to pick up gizka.
  • Change the dancing in the Lyn Sekla audition, increasing the number of dancing animations if possible.

I assume the first one is feasible because the holograms are just planes with animated textures. The second one would, I assume, involve adding a new stunt animation in a conversation. I'm not sure whether the third is feasible or not: scripts like k_ptar_dancenear.ncs seem to queue the relevant animation with ActionPlayAnimation, but I don't know whether the integer argument is an index into a hardcoded array or something we're able to change.

Share this post


Link to post
Share on other sites

I just checked and everything you need is in the Object Properties of the OdysseyBase of the model as I suggested above, the same as KMax. How you go about adding new anims though is something I can't help with, since I don't use Blender.

I've already done the first. You can have a look at what I did with that if you want to expand on the idea - https://deadlystream.com/files/file/1736-movie-style-holograms-for-twisted-rancor-trio-puzzle/

The second one isn't really going to work. Since this involves the player, the only practical way to do it would be with a stunt animation, but those are fixed position (i.e. they are animated in the position you want them within the module the scene occurs in). Since you can pick up a Gizka anywhere inside the Hawk or on Yavin Station, it would be pretty jarring.

The last one would need to be a stunt animation for the player at least, but in this case it would be fine since the scene takes place in a specific fixed position. Lynn herself could either use a stunt animation or the substitution trick, since she's a unique NPC you only see in that scene.

The scripted call of animations does indeed use limited hardcoded values. In K1 it is the anims listed in nwscript.nss, which is only a subset of the available anims in the game. However in TSL you can call any anim via its animations.2da row ID. This makes animating cutscenes via scripting difficult in K1.

Share this post


Link to post
Share on other sites

Join the conversation

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

Guest
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.

Sign in to follow this