Skip to content

Commit

Permalink
fix book
Browse files Browse the repository at this point in the history
  • Loading branch information
syui committed Feb 19, 2025
1 parent 5828440 commit fb0c16c
Show file tree
Hide file tree
Showing 12 changed files with 203 additions and 23 deletions.
3 changes: 3 additions & 0 deletions book/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
* [アニメーションを作成する](gasp/07_anim.md)
* [niagaraでダメージを出す](gasp/08_niagara.md)
* [椅子に座る](gasp/09_chair.md)
* [階段に登る](gasp/10_stairs.md)
* [issue](gasp/00_issue.md)
* [control rig sample](crs/README.md)
* [CRでキャラクターを動かす](crs/01_character.md)
Expand All @@ -35,6 +36,8 @@
* [ultra dynamic sky](plan/02_uds.md)
* [ocean waves](plan/03_ocean.md)
* [nice interaction system](plan/04_item.md)
* [replicated interaction kit vol 3](plan/05_chair.md)
* [dragon ik plugin](plan/06_dragonik.md)
* [unity](unity/README.md)
* [blender](blender/README.md)
* [モデルをカスタマイズする](blender/01_model.md)
Expand Down
8 changes: 4 additions & 4 deletions book/city/01_remove.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

game engineのmapは基本的に平面で作られています。どこまで行っても地平線が広がっているだけで、そこから抜け出すことはできません。月や太陽があっても背面の絵を動かしているだけです。

これを現実に合わせた形を独自に作っています。これを`planet system`と呼びます
これを現実に合わせた形にします。地球があって、上に飛ぶと大気圏があり、大気圏を抜けると宇宙があり、月があり、太陽があるという形にすることを目指します。全てはつながっていて、そこに行くことができます。これを`planet system`と呼ぶことにします

地球があって、上に飛ぶと大気圏があり、大気圏を抜けると宇宙があり、月があり、太陽があるという形にすることを目指します。全てはつながっていて、そこに行くことができます
基本的に`/Map/Small_City_LVL`を使って構築していきます

## 海の境界を消す

海には境界があってそれが惑星システム(planet system)を構築する際に邪魔になるので消します
city sampleの海には境界があってcollisionが設定されています。邪魔になるので消します

`/Map/Small_City_LVL`を使います。`GroundCollisionCube`,`DroneBlockingVolume`を探して削除します。これは海面にplane(平面)を設置しています
`GroundCollisionCube`,`DroneBlockingVolume`を探して削除します。

## ultra dynamic skyで天候と惑星を作る

Expand Down
13 changes: 9 additions & 4 deletions book/city/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -363,8 +363,7 @@ GameAnimationSample
"PS5",
"XSX",
"Windows"
],
"EpicSampleNameHash": "111"
]
}
```

Expand All @@ -389,7 +388,7 @@ GameAnimationSample
+CVarsArray=(Type=CVarBool,Name="DDCVar.NewGameplayCameraSystem.Enable",ToolTip="",DefaultValueFloat=0.000000,DefaultValueInt=0,DefaultValueBool=True)
```

現在、[characterのcollisionが機能しない問題](/city/00_err.html)が発生します。
現在、[characterのcollisionが機能しない問題](/city/00_issue.html)が発生します。

### Collision Trace Channel

Expand All @@ -406,5 +405,11 @@ GameAnimationSample

mapにはactorがまとめられているものがあり、それはmapにくっついていません。移動できない場合があります。

基本的にはA-mapとB-mapはある程度位置を完成させてからcopyしましょう。
基本的にはmap[A]とmap[B]はある程度位置を完成させてからcopyしましょう。

## BGMを変更する

例えば、BGMの一部を変更したい場合は、`プロジェクト設定 -> ゲーム -> World Audio Data`を見てください。

私はmatrix(マトリックス)のテーマを消したかったので、`/Content/Audio/MetaSounds/Music/`にある`music_leavebehind_New_Mix_Meta`, `music_leavebehind_New_Mix_NHT_Meta`の音量を`0.0`にしました。

1 change: 1 addition & 0 deletions book/default/00_asset.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
|[game animation sample](https://dev.epicgames.com/documentation/en-us/unreal-engine/game-animation-sample-project-in-unreal-engine)|5.5|キャラクターをパルクールアクション|
|[city sample](https://www.unrealengine.com/marketplace/ja/product/city-sample)|5.5|大規模な都市を構築|
|[control rig sample](https://www.fab.com/ja/listings/2ce3fe44-9ee6-4fa7-99fc-b9424a402386)|5.5|人間以外のキャラクター|
|[content examples](https://www.fab.com/ja/listings/4d251261-d98c-48e2-baee-8f4e47c67091)|5.5|機能別サンプル|

## plugin

Expand Down
33 changes: 31 additions & 2 deletions book/default/01_start.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,13 @@
|name|url|
|---|---|
|unreal engine|https://unrealengine.com/|
|github|https://github.com/EpicGames/UnrealEngine|
|unity|https://unity.com/|
|godto|https://godotengine.org/|

ソース(source)からビルド(build)して使うこともできます。一部でbuildしないと使えない機能があります。private repoなので[こちら](https://www.unrealengine.com/ja/ue-on-github)からアクセス権をもらいます。

- https://github.com/EpicGames/UnrealEngine

## ueの特徴と注意

`c++``blueprint`で書きます。
Expand All @@ -27,16 +30,42 @@ ueを長く使っているとわかることですが、ゲーム制作にはあ

「ueはバグが多く基本的に壊れている」このことを最初に理解しておかないと「おかしいなあ」と時間を無駄にしてしまいます。また、保存せず長時間コードを書き続けるのは危険です。クラッシュ(crash)すると消えてしまいます。プロジェクト(project)そのものが壊れることもよくあります。注意しましょう。

そして、バグにぶつかっても情報がほとんどありません。自己解決するしかないのです。情報量に関してはunityと比べ明確な差があります。

- グラフィックがきれい
- バグが多い
- 情報が少ない

## unityやblenderも使っている

私はキャラクター(character)を`.vrm`で作っています。

`.vrm`の開発は主に[unity](/unity/)が中心です。`.vrm`の仕様を作っているpixivがunityで読み込むためのpluginを開発しているからです。vrmに対応する様々なツールはunityで作られています
`.vrm`の開発は主に[unity](/unity/)が中心です。`.vrm`の仕様を作っているpixivがunityで読み込むためのpluginを開発しているからです。そのためかvrmに対応する多くのツールはunity専用です

もし`.vrm`を扱う場合は、どちらにせよ`unity`を使うことになると思います。私もモデルのカスタマイズなどでunityを使っています。

モデルのカスタマイズには[blender](/blender)というものもあって、`blender`も使用しています。

つまり、本当にueでゲームを制作すべきかはよく考えなければいけません。ゲーム開発は使用するものが少ないほど安定します。

結局、unityやblenderを使うことになるなら、unityで開発するのがオススメです。情報量、安定性、ツールの豊富さなどからそう判断します。

## ueを使う理由

私がueを使う理由は、最初にゲーム開発を始めたとき使ったものがueだったからです。その時の感動は忘れません。

その後、色々な情報を見聞きし、ueは初心者に向かないことを知りました。また、vrmを使う場合はunityのほうが圧倒的に有利で、情報も多く、ツールも豊富です。

では、なぜueを使い続けているのでしょう。

それはueの将来に期待しているからです。

確かに、現時点でueはおすすめできない。でも将来は...?

未来のことはわかりません。バグが多いueですが、アップデートも速いので、それは変化も進化も速いということ。

失敗を恐れず最新の技術を試していきましょう。

## 用語の解説

|title|short|body|
Expand Down
17 changes: 12 additions & 5 deletions book/gasp/09_chair.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,23 @@
# 椅子に座る

椅子に座るのと階段に登るのは鬼門です。完璧に調整するのが難しいからです。

椅子に座る動作を設定します。大変ですが以下のcomponentを使うと簡単にできます。調整は難しいですね。私の場合はgame animation sampleを使っていますが、最新版では勝手に動きが制御されるためanim montageをそのまま再生できません。したがって、別にabpを作成し、それを呼び出します。

- https://www.youtube.com/watch?v=VzyvpFvon0g
- https://blueprintue.com/blueprint/wg_vyr4o/

その後、動作が気に入らなかったため[replicated interaction kit vol 3](https://www.fab.com/ja/listings/3ce13688-fd10-462f-b90d-964c85a090ad)というassetを購入しましたが、結果はほとんど変わりませんでした。
# animation blueprint linking showcase

[こちら](https://www.fab.com/ja/listings/e52251d2-1a90-4428-a685-c5d4acdd9c07)にチュートリアルが公開されています。

主にABPの切り替えと椅子に座る内容があります。docsも公開されています。

[External Communication Showcase](https://docs.google.com/document/d/1D2rYh7XYkYaBlMPcD7rL4s6pV6e6Ty9xDYb9KW836NA/edit?tab=t.0#heading=h.tb8y73m27obr)

これは用意されているものをすべて使わないと設定できません。具体的にはBP_Chair, BP_InteractKitVol3, ABP_Manny, BP_ThirdPersonCharacterです。
# replicated interaction kit vol 3

まずcomponentを`CBP_SandboxCharacter`に入れて、ABPを呼び出し、keyを設定します。なお、anim montageはcomponentの方にも別のものを設定できますので、キャラによって背丈などが合わない場合には個別に設定します
`replicated interaction kit vol 3`というassetを改造します

<iframe src="https://blueprintue.com/render/9e2ls2nx/1" scrolling="no" allowfullscreen style="width:100%;height:400px"></iframe>
[こちら](/plan/05_chair.html)を参考にしてください。

用意されているanim montageは後ろ向きになっているため、animを180度回してから録画して新たに作ります。この際、高さなども調整してください。anim montageはloopさせるため、立ち上がり(front_end)が反対になってしまいます。これはBP_Chairにある矢印方向を180度回せばokでした。
15 changes: 15 additions & 0 deletions book/gasp/10_stairs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# 階段を登る

階段でのめり込む問題があります。これを解消します。

1. `/Blueprints/ABP_SandboxCharacter`でAnimGraphの中からFoot Placementを探す。
2. 骨盤(pelvis)の悪態道補正モードを`Sudden Motion Only`から`Component Space`にする。

また、階段の段差(Step Height)は小さくしてください。のめり込まなくなった反面、スムーズさがなくなり画面がガタガタ揺れます。

## 階段を作る

1. map(level)を開く
2. `編集モード -> モデリング -> 作成 -> 階段`
3. `Step Height: 10.0`

3 changes: 3 additions & 0 deletions book/plan/02_uds.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,6 @@ blueprintなどでも`uds`と略されます。
1. landscapeにあるmaterialを編集します。
2. ultra dynamic weatherと検索して追加します。
3. base color, normalなどのpinがあればつなげます。


<iframe width="100%" height="415" src="https://www.youtube.com/embed/ENMuqbNSLTs?start=912&&rel=0&showinfo=0&controls=0" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
6 changes: 6 additions & 0 deletions book/plan/03_ocean.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,9 @@
次に海上の影問題を修正するため`Material Overrides`, `Material Outer/Inner`をすべて変更します。私は`/Vefects/Water/VFX/WaterMaterials`を使用しました。

次に`BP_EarthSizedOcean``Volume Maaterials``WaterVolume`をセットします。`Above/Underwater``/Vefects/Water/VFX/UnderWater`に変更します。`height:0`にします。これは海に入って出たときに海中を適用する高さを設定します。

## city sampleで使うと空間にロードされていないアクタを参照

> WaterVolume: 空間にロードされていないアクタを参照しています。
これは`BP_EarthSizedOcean`, `BP_EarthSizedSphericalMesh`の詳細から`is spatially loaded`のチェックを外します。
55 changes: 55 additions & 0 deletions book/plan/05_chair.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# replicated interaction kit vol 3

その後、動作が気に入らなかったので[replicated interaction kit vol 3](https://www.fab.com/ja/listings/3ce13688-fd10-462f-b90d-964c85a090ad)というassetを購入しました。しかし、キャラの背丈が合わない場合の調整が難しく、あまりおすすめしません。

また、用意されているものすべてを使わないと設定できません。難易度は高めです。具体的には`BP_Chair`, `BP_InteractKitVol3`, `ABP_Manny`, `BP_ThirdPersonCharacter`を使ってGASPの`CBP_SandboxCharacter`に組み込みます。

```sh
/Content/InteractionKitVol3/Blueprint/Blueprint/BP_Chair --> map(level)
/Content/InteractionKitVol3/Blueprint/ActorComponent/BP_InteractKitVol3 --> CBP_SandboxCharacter[Component]
/Content/InteractionKitVol3/Demo/ThirdPerson/Blueprints/BP_ThirdPersonCharacter --> CBP_SandboxCharacter[key-E, key-Space]
/Content/InteractionKitVol3/Demo/Characters/Mannequins/Animations/ABP_Manny --> CBP_SandboxCharacter[Set Anim Instance Class]
```

もしanimを作りたい場合は、`/Content/InteractionKitVol3/Demo/Characters/Mannequins/Rigs/RTG_UE5toUE5`を利用してください。

まずcomponentを`CBP_SandboxCharacter`に入れて、ABPを呼び出す方法があります。GASPの`Pre CMC Tick`の処理に注意してください。`InteractionKitVol3`を使用する場合は停止しなければなりません。

<iframe src="https://blueprintue.com/render/9e2ls2nx/2" scrolling="no" allowfullscreen style="width:100%;height:400px"></iframe>

しかし、ABPを呼び出して椅子から降りるときにもとに戻す方法では、その後動作がおかしくなります。

## 椅子から降りるとなにかにぶつかる

椅子から降りるとなにかにぶつかるようになるのは、`/Content/InteractionKitVol3/Blueprint/ActorComponent/BP_InteractKitVol3``Set Collision Response to Channel`の処理が原因です。

この処理をすべて削除しましょう。

しかし、座っている間は動けるようになるので、`IA_Move`に処理を入れます。

<iframe src="https://blueprintue.com/render/9e2ls2nx/4" scrolling="no" allowfullscreen style="width:100%;height:400px"></iframe>

## 背の低いキャラを座らせる

椅子とアニメーションを改造してちょうどいいように座らせることができます。矢印の向きが座る方向になります。これを逆にしてください。

<iframe width="100%" height="415" src="https://www.youtube.com/embed/0YFpV-sUups?si=aTNoK5NTO17ab-Rz&amp;mute=1&rel=0&showinfo=0&controls=0" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>

## Enable Auto Blend Outを使わない

ABPを利用せずGASPと統合する方法を紹介します。

そのままだと椅子に座ったあとにすぐ立ち上がってしまいます。これを修正するには`/Content/InteractionKitVol3/Animations/AnimationMontage/AS_F_Start`に以下の設定を行います。

> `/Content/InteractionKitVol3/Animations/AnimationMontage/AS_F_Start`
1. `Enable Auto Blend Out`をfalseにする
2. 終了時に通知で`End`という名前を作る
3. `/Content/InteractionKitVol3/Blueprint/ActorComponent/BP_InteractKitVol3`を修正する

`Enable Auto Blend Out`にすると終了を受け取れなくなります。なので通知から受け取って処理するように書き換えます。

<iframe src="https://blueprintue.com/render/9e2ls2nx/3" scrolling="no" allowfullscreen style="width:100%;height:400px"></iframe>

これで正常に椅子に座る、椅子から降りる、という動作ができるようになりました。

23 changes: 23 additions & 0 deletions book/plan/06_dragonik.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# dragon ik plugin

[dragon ik plugin](https://www.fab.com/ja/listings/d3f8d256-d8d9-4d27-91c1-c61e55e984a6)を使って、`chinese dragon`を動かします。

1. [codehawk64/dragonik-exampleproject](https://github.com/codehawk64/dragonik-exampleproject)を自分のprojectの`$project/Content/`にcopyします。
```sh
$ git clone https://github.com/codehawk64/DragonIK-ExampleProject.git
$ cp -rf DragonIK-ExampleProject/Content $project/
```
2. pluginで`dragon ik`を有効にする。
3. `/Content/Maps/ChineseDragonSolver_Map`を開く。
4. `/Content/CharacterExamples/Quadruped/ChineseDragonSolverExamples/ChineseDragon2/ChineseDragon2_Control`を開いて編集する。

<iframe src="https://blueprintue.com/render/i9d2qt45/1" scrolling="no" allowfullscreen style="width:100%;height:400px"></iframe>

> [ InputAxis -> EnhancedInput ] 修正されているかもしれません。
ue5.3では、"InputAxis Turn"は通常マウスの横方向の移動量を取得するために使用されます。これは、カメラやキャラクターの水平回転(ヨー)を制御するのに適しています。

しかし、ue5.5でInputAxisを使うと`不明な軸を...`というerrorが出るので、`EnhancedInput`を使います。ここではGASPの`/Content/Input/IMC_Sandbox`を使用します。

Enhanced Inputシステムを使用している場合、これは2D軸入力アクションとして設定できます。この場合、X軸の値がTurnに対応し、Y軸の値がLookUp(縦方向の視点変更)に対応します。

Loading

0 comments on commit fb0c16c

Please sign in to comment.