プロのゲーム攻略サイト

www.zgtz168.com

バロトラウマ – キャラクター作成ガイド

これは、ゲーム内のキャラクター エディターを使用して独自のキャラクターを作成するための Barotrauma 開発チームの公式マニュアルです。このマニュアルは包括的ではありませんが、技術的な詳細について説明しています。後でビデオ チュートリアルを追加する予定ですが、テキスト形式で説明したほうがよいと思われるものもあります。

その他の圧外傷ガイド:

  • リアクター ガイド。
  • ステルス裏切り者ガイド
  • 潜水艦エディタの基本
  • 潜水艦建造者ガイド
  • 医師ガイド

はじめに

このガイドは、現在リリースされているものではなく、エディタの次のバージョン (間もなく!) に関するものですが、現在のバージョンでも多くの場所で使用できるはずです。さらに、キャラクターエディタ自体はまだ開発中です。多くのことが変更され、改善の余地がたくさんあります。また、現在、キャラクターの作成には少し技術的な魔法が必要であり、.xml の編集が怖い場合は、それに飛びつくことはお勧めしません.

これは、ゲーム内のキャラクター エディターを使用して独自のキャラクターを作成するための Barotrauma 開発チームの公式マニュアルです。このマニュアルは包括的ではありませんが、技術的な詳細について説明しています。後にビデオ チュートリアルを追加する予定ですが、テキスト形式で説明したほうがよい場合もあると思います。
バロトラウマのすべてのキャラクターはラグドールの「スケルトン」で構成されていますそのキャラクターで、他の上で。キャラクター エディターでは、これらの両方を編集できます。ラグドールは、ジョイントで接続された手足から作成されます。アニメーションは、基本的にラグドールの動きに関する定義です。以下では、これらの各手順の詳細な手順と、.xml の編集に関する情報を確認できます。

ヒント: キーボードのキー [1]、[2]、および [3] を使用して、四肢、関節、およびアニメーションの編集モードをすばやく切り替えます。

新しいキャラクターの作成

現時点では、魚や虫のような生き物を作成するのが最も簡単ですが、歩くものはすべて少し難しいです。したがって、理想的には、最初のキャラクターとして足が 10 本あるカニに挑戦しないでください。

新しいキャラクターを作成するには、[ファイル] パネルにある [新しいキャラクターを作成] ボタンをクリックします。次のビューでは、作成しようとしているキャラクターに関する基本的な情報を求められます。構成ファイルへのパスとテクスチャ パスは、どちらも Barotrauma プロジェクト フォルダーからの相対パスです。

この時点で用意しておくべきものの 1 つは、キャラクターのテクスチャです。 Barotrauma では、すべてのキャラクターはスプライトを持つ手足でできています。実際には、キャラクターのすべての手足のスプライトが見つかるスプライト シートが必要になります。 「テクスチャ パス」フィールドにテクスチャ ファイルへのパスを書き込みます。

また、ゲームのカスタム コンテンツを含む、キャラクター用の新しいコンテンツ パッケージを選択または作成する必要があります。コンテンツ パッケージは基本的に MOD です。キャラクターに使用するコンテンツ パッケージを選択するか、名前を付けて [新規作成] ボタンをクリックして新しいコンテンツ パッケージを作成します。

3 番目に必要なのはキャラクター設定ファイルですが、これは自動的に作成されます。 「Config File Output」フィールドでそのパスを定義できます。デフォルトでも問題ないはずです。

基本情報を入力したら、手足を作成します。 「+」および「-」ボタンを使用して手足を追加または削除します。 2D グリッド (「X」フィールドと「Y」フィールド) を定義し、[複数追加] ボタンを押すと、複数の手足を簡単に追加できます。

ここでの定義についてはあまり心配しないでください。後で編集できる手足をいくつか追加したいだけです。ここでジョイントを定義することも可能ですが、現時点ではお勧めできません。後ではるかに簡単に実行できます。

ファイル構造

新しいキャラクターを作成するとき、キャラクター設定ファイルのパスを定義するよう求められます (例:Mods/MyMod/Characters/Mycharacter.xml)。テクスチャ ファイルとサウンド ファイルは、キャラクター設定ファイルと同じフォルダーまたは同じ場所のサブフォルダーに配置することを強くお勧めします。

エディターで新しいキャラクターが作成されると、システムはコンテンツ パッケージ内のキャラクター構成ファイルへの参照を自動的に追加し、アニメーションとラグドール ファイルを作成します。

何らかの理由でデフォルトのパスを使用したくない場合は、「ragdolls」要素と「animations」要素の「folder」属性の値を変更することで、キャラクター構成のパスを変更できます。

重要: アニメーションまたはラグドール ファイルの名前を変更しないでください。変更すると、ゲームがそれらを使用できなくなります。これはいつか変更されることを願っていますが、現時点ではデフォルトのファイル名を使用してください。

重要: ファイル構造の問題を避けるため、キャラクター名の最初の文字だけを大文字にしてください。キャラクター名はフォルダ名と一致する必要があります。

ヒント: 1 つのキャラクターに複数のラグドールとアニメーションを設定できますが、現在ゲーム内で使用されるのはデフォルトのみです。

四肢の編集

手足の追加が完了したら、「作成」ボタンをクリックします。最初は、あなたのキャラクターはすべての手足が重なり合ってひどく混乱しているように見えます。これは、さまざまな手足を結合して分離するジョイントがまだないためです。ここでは、キャラクターがゲーム ビューでどのように見えるかは無視しましょう。ジョイントを追加する前は正しく見えません。

ヒント: ジョイントを作成した後に手足を追加し、手足が完成する前にジョイントを作成できます。ただし、手足を最初に定義する方が簡単です。それから関節。そして繰り返します。

ジョイントを追加する方法に入る前に、まずソース rect と手足のコライダーを調整する必要があります。ソース四角形は、四肢の位置と寸法に関する単純な定義です。これらは、テクスチャ ファイル上の四肢の位置をマークします (ピクセル単位)。一方、コライダーは手足の物理的な定義です。それらは、ゲームの世界で手足がどのように動くかを決定します。

よし、編集を始めよう。まず、[モード] パネルで [スプライトシート] と [四肢] のトグルが選択されていることを確認します。また、画面上部にある「Adjust Collider」トグルをクロスオーバーします。

ヒント: パラメータからコライダーの寸法を調整することで、コライダーの形状を変更できます。 「パラメーター」トグルを有効にして、選択した手足のパラメーターを表示します。

キャラクターの上に緑で描かれた手足のコライダーが表示されます。スプライト シート上の四肢を選択します。左上隅の小さなボックスをドラッグしてソース rect を移動し、右下隅のボックスをドラッグしてソース rect (およびコライダー) のサイズを調整します。

重要: 「コライダーの調整」モードが有効になっている場合、コライダーは自動的に再計算されます。コライダーのサイズが間違っていると、衝突が正しく機能しません。コライダーが小さすぎると、ラグドールが不安定になり、爆発することさえあります。

ヒント: 矢印キーを使用して、ソース四角形を一度に 1 ピクセルずつ移動します。

既存のリムを複製することで、さらにリムを追加できます。手足を選択し、「Duplicate Limb」[ctrl+c] をクリックします。新しい四肢が選択されます。ソース四角形を必要な位置にドラッグし、他の四肢で行ったのと同じようにサイズを調整します。手足のほとんどは削除 [delete] することもできますが、これにはいくつかの制限があります。

ヒント: 関節や手足が正しく削除または追加されない場合、またはエディターにその他の問題がある場合は、.xml ファイル内を調べてください。 .xml で四肢や関節を手動で追加または削除することもできます。

ジョイントの作成

メインの手足が完成したら (一度にすべてを定義する必要はありません)、手足間のジョイントの作成を開始できます。

「四肢」モードが選択されていることを確認してください。次に手足を選択し、「関節の作成」ボタンをクリックします[ctrl + e]。 2 本の手足の間に関節を描くことができるようになりました。ボタンまたはホットキーを押したときにジョイントの始点が定義されました。次に、ジョイントのもう一方の端を定義する必要があります。これを行うには、目的の手足の上にマウスを置き、マウスの左ボタンで選択します。

ヒント: [ctrl] を押して、複数の手足または関節を同時に選択して編集します。

ヒント: ジョイント編集モードで、[ジョイント設定のコピー] をクリックして、最初に選択したジョイントの設定を他のジョイントにコピーします。

編集モードが自動的に「ジョイント」に変更されます。このモードでは、ジョイントの端が赤い円として描かれているのがわかります。円の 1 つを選択すると、色が変わり、ジョイントの各端の横に 3 つの小さなウィジェットが表示されます。

ヒント: ゲーム ビューでもキャラクターの手足や関節を編集および作成できますが、通常はスプライト シートで行う方が簡単です。

円形のウィジェットをドラッグしてみてください。これが関節のアンカーポイントです。リムが他のリムに接続されるポイントを定義します。 2 つの端の間の距離が長いほど、ジョイントは長くなります。また、関節が長いほど、手足は互いに離れています。

ヒント: 手足が重なり合っているように見え、ジョイントの端がスプライト シートでは正しいように見えても、ゲーム ビューでは間違っている場合は、ジョイントの端を反転してみてください (つまり、ドラッグして位置を入れ替えます)。

ジョイントの両方の端を所定の位置に配置したら、長方形のウィジェットの 1 つを選択します。これらは関節角度ウィジェットです。それらは、関節の回転の制限を定義します。 There’s an upper limit and a lower limit. By default both are set to 0. When the joint limits are at the same value, the joint is as stiff as it gets. The upper limit should always be higher than the lower limit. Both limits go clockwise from -180 degrees to 180 degrees.

ヒント: By default, the rotations start from the top and end at the bottom, but the ‘Spritesheet Orientation’ has an effect on this. Click ‘Spritesheet’ on the ‘Modes’ panel to see the orientation controls.

It’s possible, for example, to define some of the limbs from left to right and others from top to bottom, but currently you can only have one universal offset for the character. You can freely change the orientation depending on which joint you are currently editing, but it’s a lot easier if at least most of the limb sprites are laid out in the same orientation in the sprite sheet.

The ‘Spritesheet Orientation’ property also has an effect on some gameplay features, like the damage sectors. So be sure that you save the ragdoll with the correct orientation.

Basic Setup for the Ragdoll

At this point, you should have a character with some limbs and joints ready. Limbs and joints together constitute the skeleton of a character, or a ragdoll, as we call it. Enable ‘Ragdoll’ on the ‘Modes’ panel to see the ragdoll drawn over the character. On the right, you will now see settings that affect the whole ragdoll.

The characters have something called the ‘main collider’. This is an approximation of the character’s dimensions used for animations, multiplayer syncing and AI decisions. When you have the ‘Colliders’ mode enabled, the main collider is drawn in white (capsule) over the character. It’s important that the collider is of an approximately correct size. It’s also important that the ‘Height From Floor’ parameter is given a reasonable value. Otherwise the character won’t stand where it should. Note that this parameter has an effect only when the character is standing; it doesn’t affect swimming animations.

Enable ‘Parameters’ on the ‘Modes’ panel to see the parameter editor on the right. Ensure that the main collider is set up properly. You can now also review all the colliders of the limbs to check that they are the right shape and size.

Yet another thing to check here are the limb types. Select the ‘Limbs’ mode to see the limb parameters for each limb in the parameter editor. Make sure that the character has a torso and/or a head, that the legs and arms are defined as such, and that the tail limbs are given the type ‘Tail’. If the limb types are wrong, your animations might not work as intended, because the system doesn’t know which limb it should move to make the character swim or walk, for example.

ヒント: When you have limbs or joints selected, only the selected elements are shown in the parameter editor. If you want to see all the limbs or joints, deselect all by clicking the right mouse button.

When you are done, click the ‘Recreate Ragdoll’ button on the ‘Tools’ panel to apply the changes.

ヒント: Currently there is no autosave in the editor (Sorry! We promise to do something about this later). Please use the quick save buttons often enough that you don’t lose your progress.

ヒント: Try undo [ctrl+z] and redo [ctrl+r]. They should work for most things. Just don’t try to undo destroyed limbs or joints. That won’t work.

Animations

Animations are what make characters alive. Unlike in many other games, in Barotrauma the characters are entirely driven by physical forces. When we make the feet of the character to take steps or the tail to swing when the character swims, we actually define forces on the limbs.

Doing this kind of animation can be a bit different from doing ordinary animations with keyframes. We don’t have the same control on the movement. The upside is that the animations can adjust to the environment without any kind of tweening or blending from an animation clip to another – we don’t have any clips, but we do have animation definitions as a collection of parameters.

There are currently four animation types for the characters that you can edit:‘Walk’, ‘Run’, ‘SwimSlow’, and ‘SwimFast’. Each of the animations is defined in a separate file and they have distinct parameters. Some of the parameters are common to all, some specific to the animation type. Most of these you don’t have to worry about, because you can easily experiment with the widgets that are drawn over the characters.

ヒント: Press [e] to switch between grounded and swim animations. Press [Left shift] to switch between slow and fast movement animations. There’s also a drop down for selecting the animations.

However, there are some important parameters that you can edit only in the parameter editor. Select ‘Parameters’ on the right side of the editor view to open the parameter editor.

  • Head/torso/foot move force defines the directional force applied to the given limb to move it.
  • Head/torso/foot torque defines the angular force that rotates the limbs to the rotation defined in the Head/torso/foot angle parameter.
  • Steer torque determines how fast the main collider is rotated when the character turns.
  • For humanoids only:get up force defines how much force is used to force the character standing.

ヒント: When the parameter editor is open, you can see which parameter(s) you are changing when dragging a widget over the character. The parameters that are updated should flash in green.

Limitations and Missing Features

There are some limitations to keep in mind when creating characters in the editor.

The most pressing of them are the following:

  • Unlike the animation parameters, many of the ragdoll parameters are not updated at runtime. Click ‘Recreate Ragdoll’ on the ‘Tools’ panel to see the changes.
  • You can edit attacks but cannot create them in the editor. So, to get the character to attack anything in the game, you’ll need to do some .xml editing.
  • You can’t see afflictions at all, which means all the damage to other characters must be edited in .xml.
  • You can’t edit the sprite deformations, which are used for example in the Moloch’s bladder to make it pulsate.
  • You can’t edit the character config file (“Mycharacter.xml”) at all, meaning that you’ll have to do .xml editing to enable AI for your character.
  • Creating humanoids is disabled to prevent crashes, because humanoids have prerequisites that are not enforced when creating a character. Note that you can still create humanoids using XML if you know what you are doing. Just use the vanilla human as the basis of your humanoid character and prepare for crashes.

Having the above mentioned limitations means that some things just have to be done by manual .xml file editing. Hopefully we can remove the need for this at some point, but for the time being, let’s look at how you can handle it.

XML Tweaking:The Character Config File

The two things that you will really need for your character are health and the AI. Health is pretty straightforward, but the AI might need a bit of explaining.

ヒント: Editing .xml files can be intimidating at first, but it’s not difficult. Just check the existing character files and extrapolate from there.

The non-human AI is currently just a simple state machine, where the AI determines which target it should prioritize in a given situation. In the ‘ai’ block, you can define these priorities:which things the character should target, which state it should use while targeting, and what (base) priority should be given to this target. The actual priority is determined by dynamic factors like the distance to the target. Some factors can be modified in the .xml. Let’s take a closer look at the most important of them:

  • combat strength – Defines how strong the AI thinks the character is.
  • sight – Multiplies the distance at which the character can see targets.
  • hearing – Multiplies the distance at which the character can hear (or “sense”) targets.
  • aggressive boarding – If true, the character tries to break into the submarine.
  • flee health threshold – If the character has less health than this, it will flee.
  • aggression greed – Determines how much the targeting priority increases each time the character does damage to the target. The actual priority adjustment is calculated based on the damage percentage multiplied by the greed value. The default value is 10, which means the priority will increase by 1 every time the character does damage 10% of the target’s current health. If the damage is 50%, then the priority increase is 5.
  • aggression hurt – Determines how much the targeting priority increases each time the character takes damage. Works like the greed value, described above. The default value is 100.

You might also want to add some sounds and particles (like blood) to your character. If you want the character to drop some items, give it an inventory too. Each of these should be easy enough to add. Just copy and paste the appropriate blocks from other files and adjust the values a bit.

ヒント: The AI characters only target entities that have tags in the XML definition. For some things, like the walls, this tag is added automatically in the code.

XML Tweaking:The Ragdoll Files

OK, so now you know how to edit the .xml files – let’s go a bit deeper:we need to add an attack for your character. And that takes tweaking a lot of parameters.

Fortunately you can edit the attack parameters in the editor too (where you have the tooltips for most of them). So I’m not going through all the parameters here. Just copy and paste an attack block from another character’s ragdoll file and place it under the limb you want to use for the attack. This is much easier if you have given easily readable names to your limbs.

An important part that you unfortunately cannot see in the editor (for now, that is) is the afflictions. Afflictions are what actually do damage to characters. All the afflictions in the game are defined in Content/Afflictions.xml, where you can also create your own.

So, you might want to add some afflictions inside the attack blocks in the ragdoll file, like so:

Some other things you may want to try to add to your character are damage modifiers and deformations. Damage modifiers can be positive (>1) or negative (<1), meaning that they can be used to define a shield or a weak spot, for example. Deformations are merely visual, but can be used to achieve things that are not otherwise possible to do. Take a look at MolochDefaultRagdoll.xml for a reference on both topics. Here’s some simplified code from Moloch’s ragdoll file:

ヒント: Everything you edit in the editor has a representation in the .xml files. If you edit the animations, the animation files will change. And if you edit the ragdoll, the ragdoll file will change.

Publishing Your Character

Custom characters need to be shared with other players so that you can play together with them in multiplayer mode.

Fortunately, publishing a mod is fairly simple:first you need to select your newly created content package, which creates a folder called ‘NewWorkshopItem’ inside your game folder and copies the character file there. This folder and all its contents will be uploaded to the Workshop.

Make sure all the files required for your mod are present inside the folder:textures, audio, ragdoll and animation files. If you have wisely put everything in the same folder as the character config file, you shouldn’t have to manually add any additional files:the entire folder is included in the workshop item.

Once everything is ready, simply click ‘Publish item’. The mod should now be found in Steam workshop, where others can find and download it.