Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
syui committed Feb 8, 2025
1 parent 3ba5d80 commit 751e81b
Show file tree
Hide file tree
Showing 25 changed files with 231 additions and 27 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@
config
book/_book
book/node_modules
book/desktop.ini
book/*/*.ini
book/*.ini
6 changes: 6 additions & 0 deletions book/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,15 @@
* [揺れものを設定する](gas/05_kawaii.md)
* [カメラワークの設定する](gas/06_camera.md)
* [アニメーションを作成する](gas/07_anim.md)
* [niagaraでダメージを出す](gas/08_niagara.md)
* [椅子に座る](gas/09_chair.md)
* [control rig sample](crs/README.md)
* [CRでキャラクターを動かす](crs/01_character.md)
* [ボスを作る](crs/02_boss.md)
* [city sample](city/README.md)
* [惑星形式のmapを作る](city/01_remove.md)
* [橋を作る](city/02_bridge.md)
* [建造物を作る](city/03_house.md)
* [json blueprint utilities](json/README.md)
* [apiから情報を取得する](json/01_varest.md)
* [pixel streaming](pixel/README.md)
Expand All @@ -26,4 +31,5 @@
* [superhero fligth animations](plan/01_flying.md)
* [ultra dynamic sky](plan/02_uds.md)
* [ocean waves](plan/03_ocean.md)
* [nice interaction system](plan/04_item.md)
* [end](end/README.md)
10 changes: 10 additions & 0 deletions book/city/01_remove.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
# 惑星形式のmapを作る

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

これを現実に合わせた形を独自に作っています。これを`planet system`と呼びます。

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

## 海の境界を消す

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

## ocean wavesで惑星の海を作る

[ocean waves](https://www.unrealengine.com/marketplace/ja/product/ocean-waves)

必要なものを`/Content/OceanWaves/Levels/EarthSizedOceanPlanet`からcopyして持ってきましょう。

- `BP_EarthSizedSphericalMesh`
Expand All @@ -20,6 +28,8 @@

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

[ultra dynamic sky](https://docs.google.com/document/d/1xAr0Hd3mY7Mp0g0waKLUvJaddUPaVxEeRoEEFXctCE0/)

1. `/Content/UltraDynamicSky/Blueprints/Ultra_Dynamic_Sky`を開きます。
2. そこに地球と月と太陽のBPを入れます。各自が用意してください。なお、地球は`SkyAtmosphere`の下に置いてください。
> 名前は 地球(BP_Earth), 月(BP_Moon), 太陽(BP_Sun) としておきます。
Expand Down
9 changes: 9 additions & 0 deletions book/city/02_bridge.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# 橋を作る

[automotive bridge scene](https://www.fab.com/ja/listings/a472df9d-9179-4743-8d41-335f9ef55546)

1. `/Content/AutomotiveBridgeScene/Blueprints/BP_CurvedBridge`, `BP_StraightBridge`を開きます。これをつなぎ合わせていくことで橋を作ります。
2. Lampが動きませんので、選択した上で`Static Mesh``city sample`に入っている`/Content/Prop/Kit_StreetLamp_C/Mesh/streetLampC`と入れ替えます。
3. 私はベンチのところを`traversable(トラバーサブル)`するためにGASの`/Content/LevelPrototyping/LevelBlock_Traversable`を入れています。Base Materialを`/Content/Characters/Echo/Materials/M_hide`にして透明にします。

![](../img/0003.png)
9 changes: 9 additions & 0 deletions book/city/03_house.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# 建造物を作る

1. [twinmotion](https://www.twinmotion.com/)をinstallして、建造物を作ります。template(テンプレート)を編集しても構いません。
2. できたらexportしてueの$projectを選択します。`$project/${name}_Assets`が作成されます。`datasmith`の置き場所は変更しても構いません。
3. $projectを開いて、pluginの`datasmith`を入れます。そして、`$name (Datasmith シーン)`のファイルをmapにD&Dします。
4. すり抜け問題を解消するには作成された`mesh`を全選択して、右クリックで`アセットアクション -> プロパティマトリクスで選択内容を... -> collision complexity(use complex collision as simple...)`を選択します。
> 私の場合はmeshが`/Content/Twinmotion/room/Geometries/`にあります。
<iframe width="100%" height="415" src="https://www.youtube.com/embed/BsLOlAr-wBY?si=jahPUVD8YMMfefvm&start=152&end=160&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>
33 changes: 33 additions & 0 deletions book/city/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,36 @@

[city sample](https://www.unrealengine.com/marketplace/ja/product/city-sample)

ニューヨーク(NY)をモデルに都市が作られています。人と自動車が動いています。自動車は乗ることや破壊することができます。

## AutomatedPerfTesting

`AutomatedPerfTesting`は5.5で追加されたpluginです。

> Experimental release of Automated Perf Testing Plugin v0.1, providing Gauntlet Test Controllers, UAT Test Nodes, and BuildGraph macros for adding common automated performance tests to a project’s automated build and test.
- https://dev.epicgames.com/documentation/ja-jp/unreal-engine/unreal-engine-5.5-release-notes
- https://dev.epicgames.com/documentation/en-us/unreal-engine/API/Plugins/AutomatedPerfTesting

そのうち解消されると思いますが、現在(2024-11-18)、city sampleはbuildできません。`Engine/Plugins/Performance/AutomatedPerfTestingにAutomatedPerfTestConfig.cs`, `AutomatedPerfTestNode.cs`が含まれていないため`${project}/Build/Script/CitySample.Automation.csproj`に記述されているcompileが通らないのです。

```html
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="CitySample.Automation.csproj.props" Condition="Exists('CitySample.Automation.csproj.props')"/>

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<Compile Include="$(EngineDir)\Plugins\Performance\AutomatedPerfTesting\Build\Scripts\AutomatedPerfTestConfig.cs" />
<Compile Include="$(EngineDir)\Plugins\Performance\AutomatedPerfTesting\Build\Scripts\AutomatedPerfTestNode.cs" />
</ItemGroup>

</Project>
```

これはgithubにあるsrcから持ってくるしかありません。アクセスするにはorgに参加します。

https://github.com/EpicGames/UnrealEngine/tree/release/Engine/Plugins/Performance/AutomatedPerfTesting/Build/Scripts

91 changes: 91 additions & 0 deletions book/crs/02_boss.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
# ボスを作る

敵(enemy)やボス(boss)には必要なものが多いです。動きや攻撃パターン、エフェクト、ステータスやドロップアイテム、ゲージ表示、BGMなどが必要になります。場合によっては演出も必要です。

<iframe width="100%" height="415" src="https://www.youtube.com/embed/BsLOlAr-wBY?si=jahPUVD8YMMfefvm&amp;start=20&end=50&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>

bossは`/Content/ControlRig/Characters/Mech`を元に作ります。

## 注意

ここからはbattle systemのassetを購入したほうがいいかもしれません。できれば評価が高くsale中のものを選びましょう。ほとんどこれ一つでゲームが作れてしまうので、多くの開発者はこのジャンルのassetを改造してゲームを作っています。スタイリッシュアクションの動きを見るとわかります。

https://www.fab.com/category/game-template/rpg

## 動きを作る

まずABPを作成し、基本的なAnimGraphを作成します。

projectにはsampleのABPがあるはずですからAnimGraphに`idle`, `jump`, `run`などが揃っているをcopyします。

[![](../img/0004.png)](../img/0004.png)

ここでは`AnimGraph -> Locomotion -> Idle`を編集します。

動きはABPの`Look At`が使えます。boneを指定するとPlayerに追従します。

`[Mech_Idle] --> [Look At](Bone to Modify:cannon_01) --> Output Animation Pose`

[![](../img/0006.png)](../img/0006.png)

## 攻撃を作る

私は最初に購入したassetの[space frontier stations & ships](https://docs.google.com/document/d/1p5MY13cpTlVtqP7sCQpAoE_k5VHklmndZ4cHeBy105Y/edit?tab=t.0#heading=h.nx19nrsdk37u)を使いました。なお、購入はおすすめしません。長いので以降は`space station`とします。

ここからはassetの解説になります。しかし、基本的な考え方については変わりません。まずは考え方を紹介します。

1. ターゲットをロック
2. ダメージ処理

ターゲット(target)をロック(lock)できるようなシステムは大抵、攻撃頻度やダメージ、コリジョンなど基本設定ができるようになっています。`epic games`が提供するassetや無料のassetでも同じです。そういった物を見つけてbossのBPに組み込みます。

ただし、ダメージ処理、例えば、HP管理や倒された時の処理は自分で書く必要があるかもしれません。

### 最初に触ったassetが影響を与える

ここからは少し昔の話をします。基本的には読み飛ばしてください。

私はueで最初に触り始めたのがこのasset(space station)でした。当時は何もわからずに手探りで自分のモデルを表示して遊んでいました。宇宙空間に自分のモデルを表示したときは本当に嬉しくて感動しました。

当時は`superhero flight animations`という空を飛ぶためassetも購入して同時に使っていましたが、今でもその影響は残っています。

その人のゲーム作りは最初に触ったassetが強く影響を与えるのだと思います。これはgame engineも同じです。

### space stationの基本構造

1. `/Content/SpaceStation/Blueprints/Weapons`で各武器のタイプを選べます。ここでは`BP_TurretGatling`を開きます。
2. `/Content/SpaceStation/Blueprints/Weapons/BP_TurretGatling(Self)`の詳細から`Weapon -> Shooting Delay:1`にして`Turret -> Turret Aiming Speed:150`にします。これは発射速度とターゲットに合わせる速度の設定です。
3. `/Content/SpaceStation/Blueprints/Weapons/Parent/DT_WeaponTypes`を開きます。ここで弾丸の音(sound)やエフェクト(effect)を設定します。
4. 最後に`/Content/Blueprints/CBP_SandboxCharacter(Self)`の詳細で`actor(アクタ) -> Tags[0] -> Allow Shooting`, `Tags[1] -> ShootingTarget`を追加します。これでPlayerがターゲットにロックされるようになります。
5. あとは`/Content/SpaceStation/Blueprints/Weapons/BP_TurretGatling`をmapに置いてください。

### ダメージ処理

damage(ダメージ)の処理を書きます。

`/Content/Blueprints/CBP_SandboxCharacter``Event Any Damage`を追加します。これでdamageを受けますが、hpを用意してそれが0になったときゲームオーバー(gameover)する処理を書いたりします。

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

これはGame Ability System(GAS)を使うと便利です。

https://dev.epicgames.com/documentation/ja-jp/unreal-engine/gameplay-ability-system-for-unreal-engine

## HPゲージの表示

`widget``ProgressBar`を作ります。まず`BP_Mech`にbox collisionを入れて、そこに入ると`boss active`になります。`true`ならwidgetを表示する仕組みです。

ProgressBarは`0.0 -> 1.0`なので注意してください。`HP_Current`から`HP_Max`を割り算します。

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

## 撃破処理

bossを撃破するまでの処理を書きます。

damageを受けて0になると消滅し、ドロップアイテムを落とします。消滅時はniagaraでeffectを再生します。damageを受けたときも同じです。

ドロップアイテムは`nice interaction system`というassetを使用しています。これは`E`を押すとアイテム(item)が取得できるものです。

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

2 changes: 2 additions & 0 deletions book/crs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@

[control rig sample](https://www.fab.com/ja/listings/2ce3fe44-9ee6-4fa7-99fc-b9424a402386)

`control rig sample`では人間以外のcharacterを動かすことができます。

12 changes: 4 additions & 8 deletions book/default/00_asset.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

ゲームは無料のassetだけでも作れます。しかし、時間やクオリティを向上させたい場合は有料のassetを使いましょう。

本書の一部では有料assetの使い方を解説します。
本書の一部では有料assetの使い方を解説します。[sale](https://www.fab.com/ja/channels/unreal-engine?ui_filter_price=1&ui_filter_is_discounted=1&is_discounted=1)中のものを探しましょう。

## asset

Expand All @@ -20,18 +20,14 @@
|---|---|---|
|[pixel streaming](https://github.com/EpicGamesExt/PixelStreamingInfrastructure/blob/master/Docs/pixel-streaming-2-migration-guide.md)|2|ゲームをserverにdeployしてwebからプレイ|
|[twinmotion](https://www.twinmotion.com/ja)|20250101p|建造物をインポート|
|[vrm4u](https://github.com/ruyo/VRM4U/releases/tag/20250103)|20250103|vrmモデルを動かす|
|[vrm4u](https://github.com/ruyo/VRM4U/releases/tag/20250206)|20250206|vrmモデルを動かす|
|[kawaiiphysics](https://github.com/pafuhana1213/KawaiiPhysics)|20241201|揺れものを設定|
|[varest](https://github.com/ufna/VaRest)|20240828|curlのようなもの。supportが終了しているのでbuildが必要|
|[tatools](https://www.fab.com/ja/listings/a5d3b60d-b886-4564-bf6d-15d46a8d27fe)|20241206|animを作る|

## 有料

|name|latest|
|---|---|
|[superhero flight animations](https://www.fab.com/ja/listings/41185c19-5191-4153-8293-8cc9901efa95)|20241217|空を飛ぶ|
|[ultra dynamic sky](https://docs.google.com/document/d/1xAr0Hd3mY7Mp0g0waKLUvJaddUPaVxEeRoEEFXctCE0/)|20250203|空や天候を自動化|
|[ocean waves](https://www.unrealengine.com/marketplace/ja/product/ocean-waves)|20240923|惑星の海を作る|
|[magicalanimset](https://www.fab.com/ja/listings/a63386b8-7cad-42cd-8b81-a9de147e1f08)|20241222|少女の戦闘アニメーション|
[こちら](/plan/README.md)

## link

Expand Down
6 changes: 3 additions & 3 deletions book/default/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@ ue5でゲームを作成するまでの過程をまとめます。

|name|latest|body|
|---|---|---|
|[unreal engine](https://dev.epicgames.com/documentation/ja-jp/unreal-engine/unreal-engine-5.5-release-notes)|5.5.2|ゲームエンジン|
|[unreal engine](https://dev.epicgames.com/documentation/ja-jp/unreal-engine/unreal-engine-5.5-release-notes)|5.5.3|ゲームエンジン|

## 使用するタグ

タグ(tag)

```html
# youtube
## https://www.youtube.com/embed/${id}?start=0&end=10&mute=1&rel=0&showinfo=0&controls=0
<iframe width="100%" height="415" src="https://www.youtube.com/embed/?start=0&end=10&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>
```

```html
# blueprint
## https://blueprintue.com/render/${id}/${n}
<iframe src="https://blueprintue.com/render/" scrolling="no" allowfullscreen style="width:100%;height:400px"></iframe>
Expand Down
3 changes: 0 additions & 3 deletions book/end/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
![](../cover_b.jpg)

# Unreal Engine 5 Guide Book

<a href="/book.pdf" target=”_blank”>download</a> | <a href="https://ue-book.syui.ai" target="_blank">web</a>
6 changes: 4 additions & 2 deletions book/gas/04_vmc.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

カメラ(camera)からcharacterを動かす技術をモーションキャプチャ(motion capture)といいます。様々なprotocol(プロトコル)がありますが、`vrm4u`では[vmc](https://qiita.com/mintan/items/72d63cce4e6197b151b7)というprotocolを使います。

`epicgames`[livelink](https://dev.epicgames.com/documentation/ja-jp/unreal-engine/live-link-in-unreal-engine)というものを作っています。
`epic games`[livelink](https://dev.epicgames.com/documentation/ja-jp/unreal-engine/live-link-in-unreal-engine)というものを作っています。

必要なものは多く、基本的には`web-camera``client-app`, `ue-plugin`が必要です。私は以下を使っています。

Expand Down Expand Up @@ -56,5 +56,7 @@ clientから送信されるportをpluginで受信します。build packageの`.e
/Content/Chracters/$model/ABP_Pose_$model
```

<iframe src="https://blueprintue.com/render/za634zjp/1" scrolling="no" allowfullscreen style="width:100%;height:400px"></iframe>
`Blend Poses by bool`を使います。`[Mesh Space RefPose] --> [VrmVMC] --> [Blend Poses by bool(true)]`

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

15 changes: 13 additions & 2 deletions book/gas/07_anim.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,22 @@
# アニメーションを作成適用する
# アニメーションを作成する

control rigからも作成できます。しかし、購入したものを使うのが一番です。

無料でやるなら`.fbx`, `.vrma`などから作成します。
[magicalanimset](https://www.fab.com/ja/listings/a63386b8-7cad-42cd-8b81-a9de147e1f08)

無料でやるなら`.fbx`, `.vrma`などから作成する方法があります。

- https://www.mixamo.com/
- https://booth.pm/ja/items/5512385
- https://github.com/BandaiNamcoResearchInc/Bandai-Namco-Research-Motiondataset

## control rigから作る

再生して録画ボタンを押すと作れます。

## tatoolsを使う

[tatools](https://www.fab.com/ja/listings/a5d3b60d-b886-4564-bf6d-15d46a8d27fe)を使います。

https://github.com/threepeatgames/ThreepeatAnimTools

5 changes: 5 additions & 0 deletions book/gas/08_niagara.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# niagaraでダメージを出す

- https://www.youtube.com/watch?v=wYq2SR63vkM


16 changes: 16 additions & 0 deletions book/gas/09_chair.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# 椅子に座る

椅子に座る動作を設定します。大変ですが以下の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を購入しましたが、結果はほとんど変わりませんでした。

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

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

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

用意されているanim montageは後ろ向きになっているため、animを180度回してから録画して新たに作ります。この際、高さなども調整してください。anim montageはloopさせるため、立ち上がり(front_end)が反対になってしまいます。これはBP_Chairにある矢印方向を180度回せばokでした。
Loading

0 comments on commit 751e81b

Please sign in to comment.