add book
33
.github/workflows/gh-pages.yml
vendored
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
name: github pages
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-deploy:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- name: Setup Node.js
|
||||||
|
uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: 23
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
env:
|
||||||
|
TZ: "Asia/Tokyo"
|
||||||
|
run: |
|
||||||
|
cd ./book
|
||||||
|
npm i
|
||||||
|
npx honkit build
|
||||||
|
|
||||||
|
- name: Deploy
|
||||||
|
uses: peaceiris/actions-gh-pages@v3
|
||||||
|
with:
|
||||||
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
publish_dir: ./book/_book
|
||||||
|
publish_branch: gh-pages
|
||||||
|
user_name: 'ai[bot]'
|
||||||
|
user_email: '138105980+yui-syui-ai[bot]@users.noreply.github.com'
|
4
.gitignore
vendored
@ -9,3 +9,7 @@
|
|||||||
/scpt/*.jpeg
|
/scpt/*.jpeg
|
||||||
/scpt/*.png
|
/scpt/*.png
|
||||||
config
|
config
|
||||||
|
book/_book
|
||||||
|
book/node_modules
|
||||||
|
book/*/*.ini
|
||||||
|
book/*.ini
|
||||||
|
1
book/CNAME
Normal file
@ -0,0 +1 @@
|
|||||||
|
ue-book.syui.ai
|
5
book/README.md
Normal file
@ -0,0 +1,5 @@
|
|||||||
|

|
||||||
|
|
||||||
|
# Unreal Engine 5 Guide Book
|
||||||
|
|
||||||
|
<a href="/book.pdf" target=”_blank”>download</a> | <a href="https://ue-book.syui.ai" target="_blank">web</a>
|
35
book/SUMMARY.md
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
# Summary
|
||||||
|
|
||||||
|
* [Unreal Engine 5 Guild Book](README.md)
|
||||||
|
* [default](default/README.md)
|
||||||
|
* [asset/plugin](default/00_asset.md)
|
||||||
|
* [start](default/01_start.md)
|
||||||
|
* [install](default/02_install.md)
|
||||||
|
* [tips](default/03_tips.md)
|
||||||
|
* [game animation sample](gas/README.md)
|
||||||
|
* [キャラクターを追加する](gas/01_character.md)
|
||||||
|
* [飛びつける高さを増やす](gas/02_jump.md)
|
||||||
|
* [キャラクターの見た目を変える](gas/03_vrm.md)
|
||||||
|
* [モーションキャプチャで動かす](gas/04_vmc.md)
|
||||||
|
* [揺れものを設定する](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)
|
||||||
|
* [基本事項](pixel/01_server.md)
|
||||||
|
* [有料アセット](plan/README.md)
|
||||||
|
* [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)
|
43
book/city/01_remove.md
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
# 惑星形式の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`
|
||||||
|
- `BP_EarthSizedOcean`
|
||||||
|
- `WaterVolume`
|
||||||
|
|
||||||
|
`BP_EarthSizedSphericalMesh`の`transform-location-z:-63600000`にします。`Sphere Radius:63600000`にします。`SphereEdge Length:16000000`になるはずです。
|
||||||
|
|
||||||
|
次に海上の影問題を修正するため`Material Overrides`, `Material Outer/Inner`をすべて変更します。私は`/Vefects/Water/VFX/WaterMaterials`を使用しました。
|
||||||
|
|
||||||
|
次に`BP_EarthSizedOcean`の`Volume Maaterials`で`WaterVolume`をセットします。`Above/Underwater`を`/Vefects/Water/VFX/UnderWater`に変更します。`height:0`にします。これは海に入って出たときに海中を適用する高さを設定します。
|
||||||
|
|
||||||
|
## 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) としておきます。
|
||||||
|
3. `BP_Earth`は詳細から`transform-location-z:-636000000`, `transform-scale:6360000`にします。
|
||||||
|
4. `Sky_Sphere_Mesh`の`transform-scale:50000`にします。
|
||||||
|
5. 関数の`Current Star Color(pure)`にて高度を取得できるため、各componentの表示と非表示(visibility)を切り替えます。
|
||||||
|
|
||||||
|
<iframe src="https://blueprintue.com/render/k3xgicx_/1" scrolling="no" allowfullscreen style="width:100%;height:400px"></iframe>
|
||||||
|
|
||||||
|
- `BP_Earth`: `transform-location-z:-636000000`, `transform-scale:6360000`
|
||||||
|
- `Sky_Sphere_Mesh`: `transform-scale:50000`
|
9
book/city/02_bridge.md
Normal file
@ -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`にして透明にします。
|
||||||
|
|
||||||
|

|
9
book/city/03_house.md
Normal file
@ -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>
|
37
book/city/README.md
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
# city sample
|
||||||
|
|
||||||
|
[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
|
||||||
|
|
BIN
book/cover.jpg
Normal file
After Width: | Height: | Size: 250 KiB |
BIN
book/cover_b.jpg
Normal file
After Width: | Height: | Size: 128 KiB |
21
book/crs/01_character.md
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
# CRでキャラクターを動かす
|
||||||
|
|
||||||
|
`control rig`は`CR_xxx`というファイル名がつけられています。
|
||||||
|
|
||||||
|
## dragon
|
||||||
|
|
||||||
|
例えば、ABPで`head_global_ctrl`の値を更新します。
|
||||||
|
|
||||||
|
<iframe src="https://blueprintue.com/render/o3glwh72/1" scrolling="no" allowfullscreen style="width:100%;height:400px"></iframe>
|
||||||
|
|
||||||
|
## mech
|
||||||
|
|
||||||
|
1. `/Content/ControlRig/Characters/Mech/Meshes/SKM_Mech`からABP, BP, SM(StaticMesh)を作成します。
|
||||||
|
2. ABPから`Control Rig`で`cannon_ctrl`などを動かせます。
|
||||||
|
|
||||||
|
```sh
|
||||||
|
- /Content/ControlRig/Characters/Mech/BP_Mech
|
||||||
|
- /Content/ControlRig/Characters/Mech/ABP_Mech
|
||||||
|
- /Content/ControlRig/Characters/Mech/Meshes/SM_Mech
|
||||||
|
```
|
||||||
|
|
91
book/crs/02_boss.md
Normal file
@ -0,0 +1,91 @@
|
|||||||
|
# ボスを作る
|
||||||
|
|
||||||
|
敵(enemy)やボス(boss)には必要なものが多いです。動きや攻撃パターン、エフェクト、ステータスやドロップアイテム、ゲージ表示、BGMなどが必要になります。場合によっては演出も必要です。
|
||||||
|
|
||||||
|
<iframe width="100%" height="415" src="https://www.youtube.com/embed/BsLOlAr-wBY?si=jahPUVD8YMMfefvm&start=20&end=50&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)
|
||||||
|
|
||||||
|
ここでは`AnimGraph -> Locomotion -> Idle`を編集します。
|
||||||
|
|
||||||
|
動きはABPの`Look At`が使えます。boneを指定するとPlayerに追従します。
|
||||||
|
|
||||||
|
`[Mech_Idle] --> [Look At](Bone to Modify:cannon_01) --> Output Animation Pose`
|
||||||
|
|
||||||
|
[](../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>
|
||||||
|
|
6
book/crs/README.md
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
# control rig sample
|
||||||
|
|
||||||
|
[control rig sample](https://www.fab.com/ja/listings/2ce3fe44-9ee6-4fa7-99fc-b9424a402386)
|
||||||
|
|
||||||
|
`control rig sample`では人間以外のcharacterを動かすことができます。
|
||||||
|
|
38
book/default/00_asset.md
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
# asset/plugin
|
||||||
|
|
||||||
|
現在使用しているplugin(プラグイン)やasset(アセット)の`version(バージョン)`を記述します。
|
||||||
|
|
||||||
|
ゲームは無料の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
|
||||||
|
|
||||||
|
|name|latest|body|
|
||||||
|
|---|---|---|
|
||||||
|
|[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|人間以外のキャラクター|
|
||||||
|
|
||||||
|
## plugin
|
||||||
|
|
||||||
|
|name|latest|body|
|
||||||
|
|---|---|---|
|
||||||
|
|[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/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を作る|
|
||||||
|
|
||||||
|
## 有料
|
||||||
|
|
||||||
|
[こちら](/plan/README.md)
|
||||||
|
|
||||||
|
## link
|
||||||
|
|
||||||
|
こちらで最新情報を取り扱っています。
|
||||||
|
|
||||||
|
- https://git.syui.ai/ai/ue/
|
||||||
|
- https://blueprintue.com/profile/ai/
|
||||||
|
- https://dev.epicgames.com/community/profile/organization/gdkg/ai/
|
58
book/default/01_start.md
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
# start
|
||||||
|
|
||||||
|
## ueとは
|
||||||
|
|
||||||
|
`Unreal Engine`は`epic games`という会社が作っているゲームエンジンです。よく`ue`と略されます。
|
||||||
|
|
||||||
|
最新バージョン(latest version)は`5`なので、`ue5`となります。
|
||||||
|
|
||||||
|
`ue`の他には`unity`, `godto`が有名です。`DirectX`というものがあり、例えば、`DX12`からGPUに命令を送ることができます。ゲームエンジンの多くは`DX11`, `DX12`を使用します。
|
||||||
|
|
||||||
|
|name|url|
|
||||||
|
|---|---|
|
||||||
|
|unreal engine|https://unrealengine.com/|
|
||||||
|
|github|https://github.com/EpicGames/UnrealEngine|
|
||||||
|
|
||||||
|
ソース(source)からビルド(build)して使うこともできます。一部でbuildしないと使えない機能があります。private repoなので[こちら](https://www.unrealengine.com/ja/ue-on-github)からアクセス権をもらいます。
|
||||||
|
|
||||||
|
## ueの特徴と注意
|
||||||
|
|
||||||
|
`c++`か`blueprint`で書きます。
|
||||||
|
|
||||||
|
ueの特徴はグラフィックが綺麗なことです。と言ってもきれいなグラフィックはunityなどでも実現可能です。しかし、ueは初期設定でもそれが実現できるので、主にグラフィック用途で使用されています。
|
||||||
|
|
||||||
|
ueはバグ(bug)が多く基本的に動きません。これはアップデート(update)が速く、3Dを扱うソフトウェア(software)なので仕方ありません。複雑なのです。
|
||||||
|
|
||||||
|
ueを長く使っているとわかることですが、ゲーム制作にはあまり向きません。unityのほうがおすすめです。ueはきれいな画像やシーンを作る用途におすすめです。
|
||||||
|
|
||||||
|
「ueはバグが多く基本的に壊れている」このことを最初に理解しておかないと「おかしいなあ」と時間を無駄にしてしまいます。また、保存せず長時間コードを書き続けるのは危険です。クラッシュ(crash)すると消えてしまいます。プロジェクト(project)そのものが壊れることもよくあります。注意しましょう。
|
||||||
|
|
||||||
|
## 用語の解説
|
||||||
|
|
||||||
|
|title|short|body|
|
||||||
|
|---|---|---|
|
||||||
|
|unrealengine|ue|アンリアルエンジン|
|
||||||
|
|version|ver|バージョン|
|
||||||
|
|code||コード、プログラミング言語で書かれた文章|
|
||||||
|
|build||ビルド、osで実行できる形式にすること。windowsなら`.exe`|
|
||||||
|
|compile||コンパイル、コンピュータで実行できる形式にすること。buildと同じ意味で使われる|
|
||||||
|
|source|src|ソース、主にソースコードの略|
|
||||||
|
|server||サーバー、リクエストに応じるコンピュータ|
|
||||||
|
|deploy||serverに実行ファイルを置くこと|
|
||||||
|
|example|ex|例、uriではexample.comが有名|
|
||||||
|
|install||インストール、アプリをインストールすること|
|
||||||
|
|application|app|アプリ、ソフトウェア(software)のこと|
|
||||||
|
|library|lib|ライブラリ、softwareを構築するための部品|
|
||||||
|
|package|pkg|パッケージ、appだったり、libだったり色々。基本的にpkg managerでinstallできるものを指す|
|
||||||
|
|update|up|アップデート、5.5の`x.5`の部分を言う ex: 5.4 -> 5.5|
|
||||||
|
|upgrade||アップグレード、5.5の`5.x`の部分を言う ex: 4.0 -> 5.0|
|
||||||
|
|asset||アセット、ueでは購入できるlibやexampleを指す|
|
||||||
|
|plugin|plug|プラグイン、エンジンに直接入れる追加機能。新たなblueprintなどを使えるようになる|
|
||||||
|
|crash||クラッシュ、アプリやosが落ちること|
|
||||||
|
|cache||キャッシュ、一時ファイルのこと。tmpなども使われる|
|
||||||
|
|repository|repo|リポジトリ、主にsrc codeの一式が置いてある場所|
|
||||||
|
|project||プロジェクト、ueでは主に新しいゲームを作った時のフォルダ一式|
|
||||||
|
|blueprint|bp|ブループリント、ueのノードベースで書く形式。anim blueprintはabp、character blueprintはcbpと略される事が多く、ファイル名は`BP_XXX`, `ABP_XXX`, `CBP_XXX`となる。基本大文字が使われる|
|
||||||
|
|variable|var|変数、一時的な値の保存場所|
|
||||||
|
|
||||||
|
基本的に英語で書けるものは英語で書きます。ueのmenuは英語にするのがおすすめです。様々な単語に慣れておきましょう。
|
53
book/default/02_install.md
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
# install
|
||||||
|
|
||||||
|
srcからbuildしない場合は`epicgames launcher`からinstallします。
|
||||||
|
|
||||||
|
https://www.unrealengine.com/download
|
||||||
|
|
||||||
|
また、[vsinstaller](https://visualstudio.microsoft.com/ja/downloads/)を使用して必要なpackageを入れてください。
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
[vscode](https://github.com/microsoft/vscode)でbuildするには`.uproject`を右クリックして`.sln`を作ります。
|
||||||
|
|
||||||
|
## package build
|
||||||
|
|
||||||
|
まずは新しいprojectを作り、package buildできるかを試してみましょう。
|
||||||
|
|
||||||
|
ueではbuildが通らないことがよくあります。長い時間をかけて作り上げたもののbuildが通らない事態は避けましょう。
|
||||||
|
|
||||||
|
なお、`mac`, `linux`は、ほとんどうまくいきません。package化に成功してもappが正常に起動しないことがあります。使用するpluginやassetなども影響します。
|
||||||
|
|
||||||
|
```sh
|
||||||
|
# corss compile tool : https://dev.epicgames.com/documentation/ja-jp/unreal-engine/linux-development-requirements-for-unreal-engine
|
||||||
|
# ubuntu(xorg + nvidia)
|
||||||
|
|
||||||
|
$ sudo apt-get install xorg xvfb
|
||||||
|
Xvfb :99 &
|
||||||
|
export DISPLAY=:99
|
||||||
|
|
||||||
|
$ sudo apt-get install vulkan-tools
|
||||||
|
$ sudo apt-get install mesa-vulkan-drivers
|
||||||
|
```
|
||||||
|
|
||||||
|
## engineとproject
|
||||||
|
|
||||||
|
installする場所は自分で決められます。参考の場所を紹介します。
|
||||||
|
|
||||||
|
```sh
|
||||||
|
# engine
|
||||||
|
C:\Program Files\Epic\UE_5.5\Engine\Binaries\Win64\UnrealEditor.exe
|
||||||
|
|
||||||
|
# project
|
||||||
|
C:\Users\$USER\Documents\Unreal Projects\MyProject\MyProject.uproject
|
||||||
|
```
|
||||||
|
|
||||||
|
## windows tool
|
||||||
|
|
||||||
|
|name|url|
|
||||||
|
|---|---|
|
||||||
|
|pwsh|https://github.com/PowerShell/PowerShell|
|
||||||
|
|windows terminal|https://github.com/microsoft/terminal|
|
||||||
|
|openssh|https://github.com/PowerShell/Win32-OpenSSH|
|
||||||
|
|vscode|https://github.com/microsoft/vscode|
|
||||||
|
|
91
book/default/03_tips.md
Normal file
@ -0,0 +1,91 @@
|
|||||||
|
# tips
|
||||||
|
|
||||||
|
この章は読み飛ばしてください。まとめやすいように重要項目を上にしています。
|
||||||
|
|
||||||
|
最初はわからないかもしれませんが、最後まで読んでまた来ると、わかるようになっているかもしれません。
|
||||||
|
|
||||||
|
## variable(var)
|
||||||
|
|
||||||
|
まずは変数の紹介です。変数はローカル変数(local)、グローバル変数(global)があります。最初はprojectで読み込むところに作ります。
|
||||||
|
|
||||||
|
1. フォルダの`/Content/Blueprints/`で右クリックして、ブループリントクラス、`GameInstance`を作ります。例えば、`GM_xxx`にします。(名前はなんでもいいです)
|
||||||
|
2. `設定 -> プロジェクト設定 -> マップ&モード`の`Game Instance:GameInstance Class`に`GM_xxx`を読み込みます。
|
||||||
|
|
||||||
|
なお、名前に`Default`, `Test`, `Config`などを使う場合は予約されていることがあります。注意してください。
|
||||||
|
|
||||||
|
これを開いて、変数のところで`UserTest`という名前で`string`型の変数を作ります。コンパイル(compile)してください。デフォルト値は`World`とでも入れておきましょう。
|
||||||
|
|
||||||
|
次に、`/Content/Blueprints/CBP_SandboxCharacter`を開いて、EventGraphで右クリックし、`Cast To GM_xxx`を選択します。
|
||||||
|
|
||||||
|
インプット(input)のpin(ピン)にあるObjectには`Get Game Instance`をつなぎます。そして、アウトプット(output)の青線は`Get UserTest`と検索し、それを`Print String`につなぎます。
|
||||||
|
|
||||||
|
さて、ここにkeyを設定して再生すると`World`と表示されるはずです。
|
||||||
|
|
||||||
|
特に重要なのが`変数の型`です。種類もそうですが、変数の型の右側にある色アイコンをクリックしてみると、たくさんの形式があることがわかります。
|
||||||
|
|
||||||
|
- 単一
|
||||||
|
- 配列
|
||||||
|
- 設定
|
||||||
|
- マップ
|
||||||
|
|
||||||
|
配列を使ってみましょう。`UserTestList`という名前で`string`の配列を作成します。
|
||||||
|
|
||||||
|
ここで、デフォルト値に追加できることに気づくはずです。
|
||||||
|
|
||||||
|
例えば、単語を3つ追加してみます。
|
||||||
|
|
||||||
|
- [0]ai
|
||||||
|
- [1]burst
|
||||||
|
- [2]can
|
||||||
|
|
||||||
|
`Cast To GM_xxx`から`Get UserTestList`を引っ張り出し、`Length`につなげます。それをprintしてみると、`2`と表示されるはずです。
|
||||||
|
|
||||||
|
`length(len)`はその配列に追加された数を知ることができます。
|
||||||
|
|
||||||
|
では、全部の値を取り出すため`for`を書きましょう。`UserTestList`から`For Each Loop`を伸ばして`Loop Body`からprintにつなぎます。値は`Array Element`から取ります。
|
||||||
|
|
||||||
|
もし文字列をつなぎたいなら`Append`が使えます。
|
||||||
|
|
||||||
|
変数にはObjectをいれることもできます。たくさんのObjectを入れておき、`Find`で検索して取り出すこともできます。
|
||||||
|
|
||||||
|
では、characterを全部まとめて検索できる変数を作ってみます。
|
||||||
|
|
||||||
|
名前は`UserCharacterObj`でstringを選択し、マップを選択します。右側のマップは`オブジェクト(object)`と検索し、object参照を選択します。
|
||||||
|
|
||||||
|
```sh
|
||||||
|
str obj
|
||||||
|
--- ---
|
||||||
|
```
|
||||||
|
|
||||||
|
`cbp character`と検索し、characterのcbpを入れていきます。名前はわかりやすいものにしてください。例えば、`manny`, `quinn`など。
|
||||||
|
|
||||||
|
では繋いでいきます。
|
||||||
|
|
||||||
|
```sh
|
||||||
|
[Get Game Instance] --> [Cast To GM_Defaultconfig] --> [UserCharacterObj]
|
||||||
|
|
||||||
|
--> [Find(manny)] --> [Get Object Name] --> [Print String]
|
||||||
|
```
|
||||||
|
|
||||||
|
<iframe src="https://blueprintue.com/render/_q-q_ffz/" scrolling="no" allowfullscreen style="width:100%;height:400px"></iframe>
|
||||||
|
|
||||||
|
基本的にこれを利用して、他のBPと値をやり取りすることになります。例えば、`ABP_SandboxCharacter`で条件を満たしたとき実行してほしいアニメーション(anim)があったとします。
|
||||||
|
|
||||||
|
この場合、まず`GM_xxx`の変数で`UserCharacterAnim`をboolean型で作り、実行してほしいタイミングで`CBP_SandboxCharacter`に書いた`Cast To GM_Defaultconfig`から`UserCharacterAnim`を`true`に変更します。`Set UserCharacterAnim`で検索してください。そして、ABPには`UserCharacterAnim`がtrueならanimを再生する処理を書きます。
|
||||||
|
|
||||||
|
## function(func)
|
||||||
|
|
||||||
|
次は関数です。関数は簡単で、何度も繰り返す部分を再利用可能な形で残します。それが関数です。
|
||||||
|
|
||||||
|
新しい関数を作ってみましょう。左バーの関数(+)を押せば作成されます。名前は`FuncTest`にします。
|
||||||
|
|
||||||
|
関数を表す紫色のボックス(box)を選択した状態でinputとoutputの見てもらって、inputにboolという名前でboolean型を作ります。outputにはstrという名前でstring型を作ります。
|
||||||
|
|
||||||
|
処理の内容はboolがtrueなら`[yes]`というstringを出力し、falseなら`[no]`にします。
|
||||||
|
|
||||||
|
<iframe src="https://blueprintue.com/render/pvn4lao9/2" scrolling="no" allowfullscreen style="width:100%;height:400px"></iframe>
|
||||||
|
|
||||||
|
確認してみましょう。`[9]`を押すと`[yes][no]`が表示されます。
|
||||||
|
|
||||||
|
<iframe src="https://blueprintue.com/render/pvn4lao9/1" scrolling="no" allowfullscreen style="width:100%;height:400px"></iframe>
|
||||||
|
|
25
book/default/README.md
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
# default
|
||||||
|
|
||||||
|
## 本書の目的
|
||||||
|
|
||||||
|
ue5でゲームを作成するまでの過程をまとめます。
|
||||||
|
|
||||||
|
主に`example`形式で記述し、実行するとその通りの結果になることを目指します。
|
||||||
|
|
||||||
|
|name|latest|body|
|
||||||
|
|---|---|---|
|
||||||
|
|[unreal engine](https://dev.epicgames.com/documentation/ja-jp/unreal-engine/unreal-engine-5.5-release-notes)|5.5.3|ゲームエンジン|
|
||||||
|
|
||||||
|
## 使用するタグ
|
||||||
|
|
||||||
|
```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>
|
||||||
|
```
|
2
book/end/README.md
Normal file
@ -0,0 +1,2 @@
|
|||||||
|

|
||||||
|
|
11
book/gas/01_character.md
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
# キャラクターを追加する
|
||||||
|
|
||||||
|
これには`IKリターゲット`が必要です。
|
||||||
|
|
||||||
|
1. `Content/Blueprints/CBP_SandboxCharacter_Manny`をcopyして`CBP_SandboxCharacter_test`を作ります。
|
||||||
|
2. `CBP_SandboxCharacter_test`を開いて、`Mesh`の下にあるSKM(スケルタルメッシュ)の`Manny`を選択します。その状態で`詳細(details) -> タグ(tags) -> Component Tags`から`index[0]`を`RTG_UEFN_to_UE5_test`に書き換えます。
|
||||||
|
3. `Content/Blueprints/RetargetedCharacters/ABP_GenericRetarget`を開き、変数の`IKRetargeter_Map`に新しく`RTG_UEFN_to_UE5_test`を追加し、ファイルは`/Content/Characters/UE5_Mannequins/Rigs/RTG_UEFN_to_UE5_Mannequin`を参照します。
|
||||||
|
4. `/Content/Widgets/GameAnimationWidget`を開いて、characterのiconのところをcopyして貼り付けます。そして、詳細からObjectで `Content/Blueprints/CBP_SandboxCharacter_test`を参照します。
|
||||||
|
|
||||||
|
これで新しいキャラを使用することが可能になります。
|
||||||
|
|
12
book/gas/02_jump.md
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
# 飛びつける高さを増やす
|
||||||
|
|
||||||
|
1. `Content/Blueprints/CBP_SandboxCharacter`を開いて、関数の`TryTraversalAction`を編集します。
|
||||||
|
2. 一番下の`Max:275`を`Max:475`に変更します。
|
||||||
|
3. `/Content/Characters/UEFN_Mannequin/Animations/Traversal/CHT_TraversalAnims`を開きます。
|
||||||
|
4. `Mantles(編集)`から先程変更した値のところを全部`275 -> 475`に書き換えます。
|
||||||
|
|
||||||
|
例えば、levelにあるblockの高さを変更して飛びつけるか確認します。
|
||||||
|
|
||||||
|
1. `LevelBlock_TraversableXX`を選択します。
|
||||||
|
2. トランスフォーム(transform)の拡大(scale)のところで青色(transform-scale-z)を`4.5`にします。
|
||||||
|
|
105
book/gas/03_vrm.md
Normal file
@ -0,0 +1,105 @@
|
|||||||
|
# キャラクターの見た目を変える
|
||||||
|
|
||||||
|
キャラクターの見た目を変えるには`.vrm`を使うと便利です。これは`pixiv`が作っている規格です。
|
||||||
|
|
||||||
|
ueで読み込むには`vrm4u`というpluginを使用します。
|
||||||
|
|
||||||
|
<iframe width="100%" height="415" src="https://www.youtube.com/embed/0Ig_-JSRV0M?si=Kz_jCbYTHr_OzPpP&start=0&end=23&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>
|
||||||
|
|
||||||
|
## vrm4u
|
||||||
|
|
||||||
|
1. [vrm4u](https://github.com/ruyo/VRM4U/releases)をダウンロード(download)して、`$project/Plugins`に入れる。
|
||||||
|
> $project/Plugins/VRM4U/VRM4U.uplugin
|
||||||
|
2. editorのファイルエクスプローラーでモデルファイルの`.vrm`をD&Dします。色々と聞かれますが適当にokや選択します。配色タイプが聞かれます。例えば、`$project/Content/Characters`に`model`フォルダを作り`model.vrm`をimport(インポート)した場合で解説します。
|
||||||
|
> $project/Content/Characters/$model
|
||||||
|
|
||||||
|
重要なファイルは`$project/Content/Characters/$model/SK_$model`, `ABP_Post_$model`, `RTG_UEFN_$model`になります。なお、`vrm 1.0`を使用します。
|
||||||
|
|
||||||
|
https://vrm.dev/vrm1/
|
||||||
|
|
||||||
|
## 指の角度を調整する
|
||||||
|
|
||||||
|
これは`RTG_UEFN_$model`で調整します。各指にある線を選択して値を変更します。
|
||||||
|
|
||||||
|
- `回転アルファ:0.5`
|
||||||
|
- `ボールベクターオフセットを維持:false`
|
||||||
|
|
||||||
|
## 前髪の角度を調整する
|
||||||
|
|
||||||
|
これは`/Content/Character/$model/VM_${model}_VrmMeta`で調整します。具体的には以下のような値にすればいいでしょう。
|
||||||
|
|
||||||
|
```json
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"bone Name": "J_Sec_Hair1_03",
|
||||||
|
"Hit Radius": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"bone Name": "J_Sec_Hair2_03",
|
||||||
|
"Hit Radius": 0.01
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"bone Name": "J_Sec_Hair3_03",
|
||||||
|
"Hit Radius": 0.01
|
||||||
|
}
|
||||||
|
],
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"bone Name": "J_Sec_Hair1_04",
|
||||||
|
"Hit Radius": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"bone Name": "J_Sec_Hair2_04",
|
||||||
|
"Hit Radius": 0.01
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"bone Name": "J_Sec_Hair3_04",
|
||||||
|
"Hit Radius": 0.01
|
||||||
|
}
|
||||||
|
],
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"bone Name": "J_Sec_Hair1_05",
|
||||||
|
"Hit Radius": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"bone Name": "J_Sec_Hair2_05",
|
||||||
|
"Hit Radius": 0.01
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"bone Name": "J_Sec_Hair3_05",
|
||||||
|
"Hit Radius": 0.01
|
||||||
|
}
|
||||||
|
]
|
||||||
|
```
|
||||||
|
|
||||||
|
飛行時に髪が爆散する問題は以下です。
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"bone Name": "J_Sec_Hair2_03",
|
||||||
|
"Hit Radius": 0.0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"bone Name": "J_Sec_Hair1_09",
|
||||||
|
"Hit Radius": 0.01
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"bone Name": "J_Sec_Hair1_10",
|
||||||
|
"Hit Radius": 0.01
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## アウトラインを追加する
|
||||||
|
|
||||||
|
アウトライン(outline)
|
||||||
|
|
||||||
|
1. `/Content/Blueprints/RetargetedCharacters/CBP_SandboxCharacter_$model`を作成します。前と同じ要領で新しいキャラクターを追加し、GASで使えるようにします。
|
||||||
|
2. componentで`BP_VrmOutlineComponent`を追加します。
|
||||||
|
|
||||||
|
## 見た目をきれいにする
|
||||||
|
|
||||||
|
これには様々なやり方が存在します。調べた限りではちゃんと機能するやり方がわからないように感じます。
|
||||||
|
|
||||||
|
私はcomponentの`VrmPoseableMesh`を追加して、そこに配色タイプの`custom`を当てることで調整しています。ベースは配色タイプの`unlit`を使用します。もし`unlit`で`.vrm`をimportしていない場合は再度importしてください。
|
||||||
|
|
62
book/gas/04_vmc.md
Normal file
@ -0,0 +1,62 @@
|
|||||||
|
# モーションキャプチャで動かす
|
||||||
|
|
||||||
|
カメラ(camera)からcharacterを動かす技術をモーションキャプチャ(motion capture)といいます。様々なprotocol(プロトコル)がありますが、`vrm4u`では[vmc](https://qiita.com/mintan/items/72d63cce4e6197b151b7)というprotocolを使います。
|
||||||
|
|
||||||
|
`epic games`は[livelink](https://dev.epicgames.com/documentation/ja-jp/unreal-engine/live-link-in-unreal-engine)というものを作っています。
|
||||||
|
|
||||||
|
必要なものは多く、基本的には`web-camera`、`client-app`, `ue-plugin`が必要です。私は以下を使っています。
|
||||||
|
|
||||||
|
- camera: ノートパソコンに付属しているwebカメラ
|
||||||
|
- client: [webcam motion capture](https://webcammotioncapture.info/)
|
||||||
|
- plugin: [vrm4u](https://github.com/ruyo/VRM4U)
|
||||||
|
|
||||||
|
clientはそれぞれのosにあったものを選びます。無料でも可能ですが、性能的には有料アプリがおすすめです。いくつか紹介しておきます。
|
||||||
|
|
||||||
|
この辺の情報は最初はわからないと思いますが、基本的には以下の流れで情報を処理します。
|
||||||
|
|
||||||
|
```sh
|
||||||
|
[camera] --> [client] --> [plugin]
|
||||||
|
```
|
||||||
|
|
||||||
|
## client
|
||||||
|
|
||||||
|
|name|body|free|
|
||||||
|
|---|---|---|
|
||||||
|
|[vmc](https://github.com/sh-akira/VirtualMotionCapture)|vmcの開発元が出しているclient。protocolと同じ名前がつけられている|🟩|
|
||||||
|
|[vseeface](https://www.vseeface.icu/)|高性能なclient|🟩|
|
||||||
|
|[xr animator](https://booth.pm/ja/items/4513654)|お手軽に表示できるclient|🟩|
|
||||||
|
|[waidayo](https://booth.pm/ja/items/1779185)|iosにも対応しているclient|🟩|
|
||||||
|
|[vrm posing desktop](https://store.steampowered.com/app/1895630/VRM_Posing_Desktop/)|steamから出ているclient|🟥|
|
||||||
|
|[webcam motion capture](https://webcammotioncapture.info/)|安定したclient。使ってみた中では動きが一番良かった|🟥|
|
||||||
|
|
||||||
|
## build packageを使うときportに注意
|
||||||
|
|
||||||
|
clientから送信されるportをpluginで受信します。build packageの`.exe`で確認するときは、editor(エディタ)を落としておきましょう。
|
||||||
|
|
||||||
|
## 停止したときだけvmcを有効にする
|
||||||
|
|
||||||
|
<iframe width="100%" height="415" src="https://www.youtube.com/embed/BsLOlAr-wBY?si=jahPUVD8YMMfefvm&start=195&end=204&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>
|
||||||
|
|
||||||
|
キャラクターがidle状態、つまり、停止しているときだけVMCのモーションキャプチャを反映させます。
|
||||||
|
これはVMCモードの変数を用意し、ABPで条件を書いて実現しています。キャラクターを動かしたときは一時的に無効にします。
|
||||||
|
|
||||||
|
関数を作り、bool型でグローバル変数で作ります。それをVMCモードの`enable/disable`とします。カメラは正面と通常を切り替えています。
|
||||||
|
|
||||||
|
```sh
|
||||||
|
/Content/Blueprints/CBP_SandboxCharacter
|
||||||
|
```
|
||||||
|
|
||||||
|
<iframe src="https://blueprintue.com/render/za634zjp/2" scrolling="no" allowfullscreen style="width:100%;height:400px"></iframe>
|
||||||
|
|
||||||
|
移動するときは一時的に無効にします。移動が完了すると有効にします。GASの移動は終了後に少し滑るので`delay`を入れています。
|
||||||
|
|
||||||
|
<iframe src="https://blueprintue.com/render/za634zjp/3" scrolling="no" allowfullscreen style="width:100%;height:400px"></iframe>
|
||||||
|
|
||||||
|
```sh
|
||||||
|
/Content/Chracters/$model/ABP_Pose_$model
|
||||||
|
```
|
||||||
|
|
||||||
|
`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>
|
||||||
|
|
14
book/gas/05_kawaii.md
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
# 揺れものを設定する
|
||||||
|
|
||||||
|
[kawaiiphysics](https://github.com/pafuhana1213/kawaiiphysics)
|
||||||
|
|
||||||
|
`$project/Plugins/kawaiiPhysics/kawaiiPhysics.uplugin`
|
||||||
|
|
||||||
|
1. 基本的には`/Content/Characters/$model/ABP_Pose_$model`に設定します。
|
||||||
|
2. 外付けの服などに設定する場合はABPを作成し、そこに設定します。
|
||||||
|
|
||||||
|
<a href="../img/0002.png"><img src="../img/0002.png"></a>
|
||||||
|
|
||||||
|
服が揺れる様子です。`limit(制限) -> Capsule Limits -> Driving Bone`にBone(ボーン)を入れて体に入りこまないようにしています。
|
||||||
|
|
||||||
|
<iframe width="100%" height="415" src="https://www.youtube.com/embed/0Ig_-JSRV0M?si=Kz_jCbYTHr_OzPpP&start=28&end=50&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>
|
15
book/gas/06_camera.md
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
# カメラワークを設定する
|
||||||
|
|
||||||
|
スキル発動したときカメラをぐるっと回す演出です。
|
||||||
|
正面カメラを設置し、タイムラインで動かしたあとに通常(後方)カメラに切り替えることで実現しています。
|
||||||
|
|
||||||
|
<iframe width="100%" height="415" src="https://www.youtube.com/embed/BsLOlAr-wBY?si=jahPUVD8YMMfefvm&start=29&end=34&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>
|
||||||
|
|
||||||
|
|
||||||
|
```sh
|
||||||
|
/Content/Blueprints/CBP_SandboxCharacter
|
||||||
|
```
|
||||||
|
|
||||||
|
<iframe src="https://blueprintue.com/render/exmpoyfu/1/" scrolling="no" allowfullscreen style="width:100%;height:400px"></iframe>
|
||||||
|
|
||||||
|
ボス戦のときだけこの演出を実行します。なお、`true`, `false`はどちらも最終的に`skill(スキル)`の実行につながるようにしてください。
|
22
book/gas/07_anim.md
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
# アニメーションを作成する
|
||||||
|
|
||||||
|
control rigからも作成できます。しかし、購入したものを使うのが一番です。
|
||||||
|
|
||||||
|
[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
book/gas/08_niagara.md
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
# niagaraでダメージを出す
|
||||||
|
|
||||||
|
- https://www.youtube.com/watch?v=wYq2SR63vkM
|
||||||
|
|
||||||
|
|
16
book/gas/09_chair.md
Normal file
@ -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でした。
|
63
book/gas/README.md
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
# game animation sample
|
||||||
|
|
||||||
|
[game aimation sample](https://www.fab.com/ja/listings/880e319a-a59e-4ed2-b268-b32dac7fa016)は`epic games`が提供しているassetです。
|
||||||
|
|
||||||
|
[G]ame [A]nimation [S]ampleでGASと略すことがあります。
|
||||||
|
|
||||||
|
なお、[G]ame [A]bility [S]ystemもGASなので紛らわしいです。
|
||||||
|
|
||||||
|
まずはこれを使ってキャラクター(character)を動かしてみましょう。
|
||||||
|
|
||||||
|
## level(map)
|
||||||
|
|
||||||
|
1. `/Content/Levels/DefaultLevel`を開きます。
|
||||||
|
2. 再生ボタンを押します。
|
||||||
|
3. ゲームがプレイできます。
|
||||||
|
|
||||||
|
|key|en|ja|
|
||||||
|
|---|---|---|
|
||||||
|
|w,a,s,d|move|移動|
|
||||||
|
|space|jump|ジャンプ|
|
||||||
|
|space|sprint|ダッシュ|
|
||||||
|
|ctrl|walk|歩く|
|
||||||
|
|c|crouch|しゃがむ|
|
||||||
|
|マウススクロール|camera|カメラ|
|
||||||
|
|
||||||
|
ボタンに乗るとキャラを切り替えることができます。
|
||||||
|
|
||||||
|
レベル(level)はマップ(map)とも呼ばれます。プレイ(play)する場所を作ります。
|
||||||
|
|
||||||
|
特にボタンが重要です。tipsを確認しましょう。
|
||||||
|
|
||||||
|
- https://www.youtube.com/watch?v=IqHrhcA7Rsk
|
||||||
|
|
||||||
|
`/Content/Levels/DefaultLevel`を右クリックして`参照ビューア`を選択してみます。どのファイルを参照しているかわかります。
|
||||||
|
|
||||||
|
## BP
|
||||||
|
|
||||||
|
characterは`/Content/Blueprints/CBP_SandboxCharacter`で動かしています。このファイルを開いて編集してみましょう。
|
||||||
|
|
||||||
|
1. `EventGraph`というノードが記述されている場所(画面中央)で右クリックし、`Debug Key 1`を追加します。
|
||||||
|
2. Releasedというピン(pin)から`Print String`を追加します。
|
||||||
|
3. ゲームを再生します。
|
||||||
|
4. キーボード(keyboard)の`[1]`を押すと、画面に`Hello`が表示されます。
|
||||||
|
|
||||||
|
これがbp(blueprint)でゲームを作る要領になります。
|
||||||
|
|
||||||
|
## ABP
|
||||||
|
|
||||||
|
characterの動きは`/Content/Blueprints/ABP_SandboxCharacter`で設定されています。
|
||||||
|
|
||||||
|
## input
|
||||||
|
|
||||||
|
まずkeyがどこで設定されているのかと言うと、`/Content/Input/IMC_Sandbox`で設定されています。
|
||||||
|
|
||||||
|
例えば、`/Content/Input/IA_Aim`をコピー(copy)して、新しく`IA_One`を作ってみましょう。それを`IMC_Sandbox`で読み込んで`[1]`に割り当てます。
|
||||||
|
|
||||||
|
次に、`IA_One`を先程の`CBP_SandboxCharacter`にドラッグ&ドロップ(D&D)します。
|
||||||
|
|
||||||
|
すると`EnhancedInputAction IA_One`という赤いノードが作成されたと思います。`Debug Key 1`を削除して代わりにつなぎます。色にも意味がありますが、そのうちわかってくると思います。
|
||||||
|
|
||||||
|
ゲームを再生してみると先ほどと同じkeyで動きます。
|
||||||
|
|
||||||
|
|
10
book/gitbook.md
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
## start gitbook(honkit)
|
||||||
|
|
||||||
|
```sh
|
||||||
|
$ nvm use 23
|
||||||
|
$ npm install honkit --save-dev
|
||||||
|
$ npx honkit init
|
||||||
|
$ npx honkit serve
|
||||||
|
$ npx honkit build
|
||||||
|
```
|
||||||
|
|
BIN
book/img/0001.png
Normal file
After Width: | Height: | Size: 264 KiB |
BIN
book/img/0002.png
Normal file
After Width: | Height: | Size: 454 KiB |
BIN
book/img/0003.png
Normal file
After Width: | Height: | Size: 960 KiB |
BIN
book/img/0004.png
Normal file
After Width: | Height: | Size: 415 KiB |
BIN
book/img/0005.png
Normal file
After Width: | Height: | Size: 498 KiB |
BIN
book/img/0006.png
Normal file
After Width: | Height: | Size: 68 KiB |
5
book/json/01_varest.md
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
# apiから情報を取得する
|
||||||
|
|
||||||
|
[varest](https://github.com/ufna/VaRest)などのpluginを使うと便利です。しかし、supportが終了しているため独自にbuildする必要があります。あるいは有料のものを購入するのもいいでしょう。
|
||||||
|
|
||||||
|
<iframe src="https://blueprintue.com/render/4yf7viyt/1" scrolling="no" allowfullscreen style="width:100%;height:400px"></iframe>
|
3
book/json/README.md
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
# json blueprint utilities
|
||||||
|
|
||||||
|
`json`を扱う。
|
8
book/package.json
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"dependencies": {
|
||||||
|
"got": "^14.4.5"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"honkit": "^6.0.2"
|
||||||
|
}
|
||||||
|
}
|
5
book/pixel/01_server.md
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
# 基本事項
|
||||||
|
|
||||||
|
pcのdisplay(ディスプレイ)が必要になる。画面の電源もつけておく必要があります。
|
||||||
|
|
||||||
|
|
32
book/pixel/README.md
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
# pixel streaming
|
||||||
|
|
||||||
|
`pixel streaming`は`.exe`をサーバー(server)に置いてwebからプレイするためのものです。
|
||||||
|
|
||||||
|
[pixel streaming 2](https://github.com/EpicGamesExt/PixelStreamingInfrastructure/)が最新です。[ガイド](https://github.com/EpicGamesExt/PixelStreamingInfrastructure/blob/master/Docs/pixel-streaming-2-migration-guide.md)に従い構築しましょう。
|
||||||
|
|
||||||
|
1. projectのpluginで`pixel streaming`をdisableにし、`pixel streaming 2`をenableにする。
|
||||||
|
2. これをpackage buildして、app.exeを作ります。引数は以下のようにしてください。
|
||||||
|
|
||||||
|
なお、sshなどで作業している場合はfirewallの許可が出ませんので、local-desktopで作業してください。または手動でruleを更新してください。
|
||||||
|
|
||||||
|
```sh
|
||||||
|
./$project/Windows/app.exe -AudioMixer -RenderOffScreen -PixelStreamingSignallingURL="ws://127.0.0.1:8888"
|
||||||
|
```
|
||||||
|
|
||||||
|
次にserverの設定です。
|
||||||
|
|
||||||
|
```sh
|
||||||
|
# git clone https://github.com/EpicGamesExt/PixelStreamingInfrastructure.git
|
||||||
|
$ git clone --branch UE5.5 https://github.com/EpicGamesExt/PixelStreamingInfrastructure.git
|
||||||
|
$ cd PixelStreamingInfrastructure/SignallingWebServer/platform_scripts/cmd
|
||||||
|
$ ./setup.bat
|
||||||
|
$ ./start.bat
|
||||||
|
```
|
||||||
|
|
||||||
|
`PixelStreamingInfrastructure/SignallingWebServer/config.json`の書き換えと起動。特に注意すべきは`http_root`です。Publicからwwwに変更されています。path(パス)にも注意してください。
|
||||||
|
|
||||||
|
```sh
|
||||||
|
$ cd PixelStreamingInfrastructure/SignallingWebServer
|
||||||
|
$ vim config.json
|
||||||
|
$ npm start -- --public_ip localhost
|
||||||
|
```
|
3
book/plan/01_flying.md
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
# superhero flight animations
|
||||||
|
|
||||||
|
[superhero flight animations](https://www.fab.com/ja/listings/41185c19-5191-4153-8293-8cc9901efa95)
|
9
book/plan/02_uds.md
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
# ultra dynamic sky
|
||||||
|
|
||||||
|
[ultra dynamic sky](https://docs.google.com/document/d/1xAr0Hd3mY7Mp0g0waKLUvJaddUPaVxEeRoEEFXctCE0/)
|
||||||
|
|
||||||
|
blueprintなどでも`uds`と略されます。
|
||||||
|
|
||||||
|
1. `/Content/UltraDynamicSky/Blueprints/Ultra_Dynamic_Sky`, `Ultra_Dynamic_Weather`をlevelに置きます。
|
||||||
|
2. `Ultra_Dynamic_Weather(Self)`の詳細から`Random Weather Variation:Hourly`にします。これで天候がすぐに変わります。
|
||||||
|
|
3
book/plan/03_ocean.md
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
# ocean waves
|
||||||
|
|
||||||
|
[ocean waves](https://www.unrealengine.com/marketplace/ja/product/ocean-waves)
|
9
book/plan/04_item.md
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
# nice interaction system
|
||||||
|
|
||||||
|
[nice interaction system](https://www.fab.com/ja/listings/63b61e4a-dc11-4ee0-a6b1-f4860bd29198)
|
||||||
|
|
||||||
|
1. [docs](https://niceshadow.gitbook.io/nice-interaction-system)があります。基本的にGame Modeの設定に入っているPlayer Controller, Game Stateのファイルを開きます。GASは`GM_Snadbox`などがそれにあたります。これらのBPにcomponentを追加します。
|
||||||
|
2. Player Controller: `AC_PC_Interaction`
|
||||||
|
> The only thing you need to do now is open your Player Controller and add the AC_PC_Interaction component:
|
||||||
|
3. Game State: `AC_GS_Interaction`
|
||||||
|
> Now just add the AC_GS_Interaction component to your game state:
|
12
book/plan/README.md
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
# 有料アセット
|
||||||
|
|
||||||
|
|name|rank|latest|body|docs|
|
||||||
|
|---|---|---|---|---|
|
||||||
|
|[ultra dynamic sky](https://www.fab.com/ja/listings/84fda27a-c79f-49c9-8458-82401fb37cfb)|3|20250203|空や天候を自動化|[docs](https://docs.google.com/document/d/1xAr0Hd3mY7Mp0g0waKLUvJaddUPaVxEeRoEEFXctCE0/)|
|
||||||
|
|[superhero flight animations](https://www.fab.com/ja/listings/41185c19-5191-4153-8293-8cc9901efa95)|2|20241217|空を飛ぶ||
|
||||||
|
|[ocean waves](https://www.fab.com/ja/listings/bfb5c9f8-4e57-4cbe-8273-c88540965412)|1|20241217|惑星の海を作る|[docs](https://www.youtube.com/playlist?list=PLvRH9sjZUdXfuLpvStHfpKyESQoOq28R7)|
|
||||||
|
|[nice interaction system](https://www.fab.com/ja/listings/63b61e4a-dc11-4ee0-a6b1-f4860bd29198)|3|20250206|アイテムを取得する|[docs](https://niceshadow.gitbook.io/nice-interaction-system)|
|
||||||
|
|[magicalanimset](https://www.fab.com/ja/listings/a63386b8-7cad-42cd-8b81-a9de147e1f08)|3|20241222|少女の戦闘アニメーション||
|
||||||
|
|[space frontier stations & ships](https://www.fab.com/listings/79323b40-dc56-43bf-8aea-b13800266329)|1|20241114|宇宙船のシステム|[docs](https://docs.google.com/document/d/1p5MY13cpTlVtqP7sCQpAoE_k5VHklmndZ4cHeBy105Y/)|
|
||||||
|
|
||||||
|
`rank`は更新頻度(追加)や価格から判断されます。`3`のassetがオススメです。
|