主なコンテンツ

〜主なコンテンツ〜

1. Unityで製作したゲームと製作Tips
  1. 三月精チャレンジ(東方Project二次創作)
    1. 作り方
  2. 英語学習2D(オリジナルスマホアプリ)
2. UE4
3. ゲームアプリ見学
4. Bitbucket & SourceTreeでの一連の流れ
  1. 前半
  2. 後半
5. Tips
  1. UnityのTips
  5. SQL文のTips
  6. Final IK
  7. GearVR+Unity

2022年12月13日火曜日

28. On Unreal Engine Versions、29. Project Creation

Unreal Engine のバージョンに関する注意 - [リソース] タブからプラグインをダウンロードする場合:


Unreal Engine 5.0 の公式リリース (Preview または Early Access ではない) を使用している場合は、Plugin - Unreal Engine 5.zip というファイルをダウンロードします。 このバージョンは、Unreal Engine 4.27 および Preview 1 と 2 でも動作します。


Unreal Engine 5.1 を使用している場合は、Plugin for 5.1.zip をダウンロードします。


こんにちは、ようこそ。


このレクチャーでは、まったく新しい Unreal Engine プロジェクトを作成し、マルチプレイヤー セッション用のプラグインを追加して、プロジェクトがすぐにオンライン スチーム セッションで動作するようにします。


これにより、実際のマルチプレイヤー セッションでインターネットを介してプロジェクトを簡単にテストできるようになります。


始めましょう。


最初のステップは、新しいプロジェクトを作成することです。


Epic Games ランチャーを開き、ライブラリに移動します。


私達は Unreal Engine 5 を使用しており、撮影時の最新バージョンはアーリー アクセス 2 です。


Unreal Engine 5 が簡単に起動できるので、利用可能な最新バージョンを使用します。


次に、ゲームを選択します。提供されたテンプレートのいずれかを使用するのではなく、空白を選択できるように、すべてをゼロから作成します。


次に、プロジェクトの目的地を選択する必要があります。


ここに貼り付けて、[フォルダーの選択] をクリックします。


このプロジェクトの名前は Blaster とします。


さて、これは C++ プロジェクトになります。


C++ を選択し、[作成] をクリックします。


空のプロジェクトがありますが、実際には空白ではありません。


完全に空ではないこのレベルがあります。


床とその他のオブジェクトがあります。


しかし、ほとんどの場合、このプロジェクトはかなり必要最小限のものです。


Unreal Engine 5 を初めて使用し、たとえば Unreal Engine 4 から来た場合は、おそらくコンテンツ ブラウザがどこにあるのか疑問に思っているでしょう。


また、コンテンツ ドローをクリックして表示することも、コントロール + スペースで表示と非表示を切り替えることもできます。

これをここの一番下にドッキングしたい場合は、[レイアウトでドッキング] をクリックすると、コンテンツ ブラウザが表示されます。


開発するときは、出力ログを表示したいので、ウィンドウに移動して出力ログを確認し、そこにもそのタブを表示できるようにします。


ここで、PLACE ACTOR'S (アクタを配置) パネルが表示されない場合は、ウィンドウに移動して PLACE ACTORS を確認できます。


これは、レベルの作成時に一般的に使用されるアクタを取り込むのに役立ちます。


これで空のプロジェクトができました。実際のマルチプレイヤーでの Steam セッションを通じてこのプロジェクトをテストできるようにしたいと考えています。


もう大丈夫です。


マルチプレイヤー プラグインの作成に関する最初のセクションをスキップした場合は、プラグインをダウンロードできます。


リンクはこのビデオのリソースにあり、このビデオのこのプロジェクトにそのプラグインを追加します。


次のステップは、プラグインをプロジェクトに追加することです。


これが私のプロジェクト フォルダで、ここにプラグインをダウンロードしたので、先に進んで解凍します。


このプラグイン フォルダが残っていて、それを開くとプラグインが表示され、そのマルチプレイヤー セッションの中にプラグインが表示されます。


その中には、プラグインするドットや C++ を含むソース フォルダーなど、さらにいくつかのフォルダーがあります。


ここで、このプラグイン フォルダーを使用します。このフォルダー内に直接マルチプレイヤー セッションを含むプラグイン フォルダーが必要です。


このプラグイン フォルダをプロジェクトにドラッグします。


今、これらの他のフォルダーの中に入れたくありません。


コンテンツなどにドラッグしないでください。


プロジェクトレベルでここに保管してください。


それが私たちが望むところです。


プラグイン フォルダーが既にある他のプロジェクトにこれを持ち込む場合、独自のプラグインを追加した可能性があります。その場合は、そのマルチプレイヤー セッション フォルダーを取得して、プラグイン フォルダーに貼り付けます。


これで、マルチプレイヤー セッションがプロジェクトにプラグインされました。


さて、このプロジェクトをマルチプレイヤー用に構成するには、いくつかの手順に従う必要があります。これらの手順の概要を PDF にまとめました。この講義のリソースに記載されているので、実行する予定がある場合は参照してください。 これも他のプロジェクトで。


それでは、それらの手順を見ていきましょう。


最初に行う必要があるのは、オンライン サブシステムのスチーム プラグインを有効にすることです。これを行うには、編集とプラグインに移動できます。


ここのプラグイン エディターで、オンライン サブシステム スチームを検索できます。ここにオンライン サブシステム スチーム プラグインがあります。


有効になっていることを確認すると、Unreal は、この変更を有効にするために再起動する必要があることを通知し、再起動できるようにします。


今、私はそれを選択するつもりです。


マルチプレイヤー セッション用のモジュールをビルドするかどうかを尋ねられます。


[はい] をクリックします。


Unreal がオンライン サブシステムで再起動し、Steam プラグインが有効になりました。

Hello and welcome.


In this lecture, we're going to create a brand new Unreal Engine project, and we're going to add our plug in for multiplayer sessions so that our project will work with online steam sessions right out of the box.


This will make it easier for us to test our project across the Internet in a real multiplayer session.


Let's get started.


Our first step will be to create a brand new project.


So we're going to open up our Epic Games launcher and go to the library.


We're using Unreal Engine five for this, and at the time of filming, the latest version is early access 2.


You're going to use the latest version available so we can simply launch Unreal Engine five.


Now we're going to select games and we're going to be creating everything from scratch so we can select blank rather than using one of the templates provided.


Now we need to select a destination for our project.


I'm going to stick mine here and click Select Folder.


And for the name of this project, I'm going to call it Blaster.


Now, this will be a C++ project.


So I'm selecting C++ and I'm going to click Create.


So I have my blank project and it's not really blank.


We have this level that's not exactly empty.


We have a floor and some other objects.


But for the most part, this project is pretty barebones.


Now, if you're new to Unreal Engine five and you're coming from, say, Unreal Engine four, you're probably wondering where the content browser is.


And you can bring it up by clicking on content draw, and you can also show and hide it with control + space.

Now, if you prefer to have this a docked to the bottom here, you can click dock in layout and now you have your content browser.


Now when I develop, I like to have the output log, so I'm going to go to a window and check output log just so I can have that tab there as well.


Now, if you don't see the PLACE ACTOR'S (アクタを配置) panel, you can go to a window and check PLACE ACTORS.


This can be useful for bringing in commonly used actors when creating a level.


Now we have a blank project and we like to be able to test this project through steam sessions in real  multiplayer.


Now that's okay.


If you skip the first section on creating the multiplayer plug in, you can download the plug in.


The link will be in the resources for this video and we're going to add that plug in to this project in this video.


So our next step is to add our plug in to our project.


Now here's my project folder and I've downloaded the plug in here, so I'm going to go ahead and extract it.


And I'm left with this plugins folder and if I open it, I see plug ins and inside of that multiplayer sessions, that's our plug in.


And inside of that we have some more folders, including a dot you plug in and a source folder that contains some C++.


Now I'm going to take this plug ins folder and I need the plug ins folder that has multi-player sessions directly inside of it here.


So I'm going to take this plug ins folder and I'm going to simply drag it over to my project.


Now, I don't want it inside any of these other folders.


Don't drag it into content or anything like that.


Just keep it here at the project level.


That's where we want it.

Now, if you're bringing this into some other project that already has a plugins folder, maybe you've added some plugins of your own, then you would simply take that multi-player sessions folder and stick it right into your plugins folder.


And now we have our multi-player sessions plug in here in our project.


Now, in order to configure this project for multiplayer, we need to follow several steps and I've outlined those steps in a PDF which you can find in the resources for this lecture, so you can refer back to that if you plan on doing this again with some other project.


So let's go through those steps.


The first thing we need to do is enable the online subsystem steam plug in, and to do that we can go to edit and plug ins.


And here in the plug ins editor, we can search for online subsystem steam and here's the online subsystem steam plug in.


We're going to check enabled and Unreal tells us we need to restart for this change to take effect so we can restart.


Now I'm going to select that now.


It's going to ask me if I'd like to build the modules for multiplayer sessions.


I'm going to click Yes.


And now Unreal has restarted in our online subsystem steam plug in is enabled.


(エディタでPLAYをするところまで中略)

ここで再生をクリックします。


メニュー セットアップ関数でも処理されるビューポートにこのメニュー ウィジェットが追加されていることがわかります。


ホストをクリックすると、ゲーム セッションがホストされ、参加をクリックすると、存在するゲーム セッションが検索され、存在する場合は参加します。


現在、エディター内のプレイや PIE では Steam セッションを使用できません。


Steam セッションを作成して参加するには、実際にゲームをパッケージ化する必要があります。


したがって、このゲーム スタートアップ マップは、ゲームをパッケージ化してテストするときに主に使用されます。ゲームを頻繁にパッケージ化することが重要であるため、このコース全体で頻繁に行います。


エラーのないパッケージであることを確認し、実際のインターネットでゲームをテストします。


現在、Unreal Engine Preview 2 または最新の公式リリースである Unreal Engine 5.0 を使用している場合は、プラグインに変更を加える必要がある場合があります。


これで、ソリューション エクスプローラーに移動できます。


Blaster の下には、プラグイン フォルダがあります。


プラグインを選択してマルチプレイヤー セッション、ソース マルチプレイヤー セッション、プライベートを開くと、これら 3 つのクラスに到達し、multiplayerSessionsSubsystem を開いて、ここでこの部分を検索できます。


プレビュー 2 または最新の公式リリースである Unreal Engine 5.0 の Create Session 関数内。


これに行を追加する必要があります。追加する必要がある行は、lastSessionSettings->bUseLobbiesIfAvailable = true です。


そのため、プレビュー 2 または最新の公式リリースである Unreal Engine 5.0 を使用している場合は、必ずこの行を multiplayerSessionSubsystem.cpp に追加し、先に進んでコードをコンパイルしてください。


Visual Studio を閉じてコンパイルしたら、エディタを閉じてプロジェクトに戻り、プラグインとマルチプレイヤー セッションに移動して、そこからバイナリを削除し、中間フォルダを削除します。


次に、新しいプロジェクトを右クリックして戻り、Visual Studio プロジェクト ファイルを生成します。


そうすれば、プラグイン コードに加えた変更が有効になります。


したがって、セッションの検索と参加に問題がある場合は、一度試してみてください。


最新の公式リリースである Preview 2 または Unreal Engine 5.0 を使用している場合。


もう 1 つチェックする必要があるのは、config フォルダーです。defaultEngine.ini を開いて、onlineSubsystemSteam に移動します。


ドキュメントからコードをコピーした場合は、これがある可能性があります。


ただし、プレビュー 2 または Unreal Engine 5.0 (最新の公式リリース) を使用している場合は、これら 2 行を beInitServerOnClient = true に置き換えて、セッションを作成できるようにする必要があります。


そのため、最新の公式リリースであるプレビュー 2 または Unreal Engine 5.0 で、その変更を行います。 プラグインコードを変更します。


マルチプレイヤー セッションでプラグイン フォルダーの中間ファイルとバイナリを削除し、Visual Studio プロジェクト ファイルを生成します。


そして、接続できるはずです。

Now if we click play.


We see that we have this menu widget added to the viewport that's also handled in the menu setup function.


And if we click host will host a game session and if we click join will search for any game sessions that exist and join one if there is one.


Now we can't use steam sessions in the play in editor or in the PIE here.


We have to actually package the game to create and join steam sessions.


So this game startup map is mostly going to be used when we package and test our game, which we're going to be doing frequently throughout this course because it's important to package your game frequently


to make sure it's still packages without errors and to test your game across the actual Internet.


Now, if you're using Unreal Engine Preview two or Unreal Engine 5.0, the latest official release, there might be a change that you need to make to the plug in.


Now you can go into your solution Explorer.


And here under Blaster, you have a plug ins folder.


And if you select plug ins and open multiplayer sessions, source multiplayer sessions, private, you should get to these three classes and you can open multiplayerSessionsSubsystem and search for this part here.


Inside of the Create Session Function for Preview two or Unreal Engine 5.0, the latest official release.


You'll have to add a line to this and a line that you should add is lastSessionSettings->bUseLobbiesIfAvailable = true.


So if you're on preview two or Unreal Engine 5.0 the latest official release, make sure to add this line to multiplayerSessionSubsystem.cpp and go ahead and compile your code.


And after you've compiled close out of Visual Studio, close the editor and go back to your project and go into plug ins and multiplayer sessions and from there delete your binaries and delete your intermediate folders.


Then go back out right click on your new project and generate Visual Studio project files.


So that way those changes that you made to your plugin code will take effect.


So if you have issues finding and joining sessions, once we try, that's what you're going to try to do.


If you're using Preview two or Unreal Engine 5.0 which the latest official release.


And another thing you should check is your config folder, open defaultEngine.ini and go down to onlineSubsystemSteam.


Now if you copied your code from documentation, you might have this.


But if you're using preview two or Unreal Engine 5.0, the latest official release, you should replace these two lines with just beInitServerOnClient = true, that will allow you to create sessions.


So on preview two or Unreal Engine 5.0, the latest official release, make that change. make the change to the plug in code.


Delete your intermediate and binaries in the plug ins folder here in multiplayer sessions and generate Visual Studio project files.


And then you should be able to connect.


ゲームをパッケージ化する前に、編集とプロジェクト設定に移動して [maps to include] を検索すると、パッケージ ビルドに含めるマップのパッケージ リストの下に表示されます。


[/Game/Maps/Lobby]、またはロビー レベルを置く場所を追加したいと思います。


また、ゲームのスタートアップ マップを追加することもできます。 [/Game/Maps/GameStartupMap] です。


これにより、ビルドをパッケージ化するときに、これらのマップもビルドにパッケージ化されることが保証されます。


したがって、ゲーム内のすべてのマップをこのマップのリストに追加し、それらのパスを正しく配置していることを確認してください。


コンテンツまでのすべてがゲームに置き換えられ、フォルダー パスとマップの名前が最後に配置されます。


このビデオをまとめる前に、ビルドするパッケージでこのゲームをテストします。


これが私のプロジェクトです。ここを右クリックして、Build という名前の新しいフォルダーを作成します。


このビルド フォルダーは、ゲーム プロジェクトをパッケージ化するときに使用できます。


それでは、プラットフォームに行きましょう。


私は Windows マシンを使用しているため、Windows とパッケージ プロジェクトです。


そして、そのパッケージ プロジェクトの送信先を尋ねてきます。


新しく作成したビルド フォルダーを選択し、[フォルダーの選択] をクリックします。


出力ログをクリックして、このプロジェクトのビルドの進行状況を確認できます。


パッケージ化が完了したら、ビルド フォルダーに戻ると、Windows フォルダーが表示され、


ここに私のパッケージ ゲーム プロジェクトがあります。


この実行可能ファイル blaster.exe です。


次に、それをパッケージ化する他のすべてのフォルダーが必要です。


したがって、ここでは何も削除しないでください。


このゲーム プロジェクトを実行するには、blaster.exe をダブルクリックします。


ここで、ウィジェット ブループリントを使用してゲーム スタートアップ マップを開くと、ホストと参加が表示されます。


現在、このプラグインは Steam を使用しています。


したがって、セッションをホストまたは参加するには、マシンで Steam が実行されている必要があります。


これがSteamクライアントです。


このプロジェクトを 2 台の異なるマシンでテストすると、2 つの異なる Steam アカウントが必要になります。


1 人が各マシンにログインし、お互いのゲーム セッションを見つけるために、両方が同じ Steam リージョンに接続して、Steam と設定に移動し、ダウンロードをクリックできるようにする必要があります。


また、ダウンロード地域を米国フェニックスに設定しています。


したがって、このプロジェクトをパッケージ化して別のマシンに貼り付ける場合、そのマシンには独自の独自の Steam アカウントがログインされている必要があり、そのダウンロード地域は私のマシンである米国フェニックスと同じ地域に設定する必要があります。


[OK] をクリックして、これを閉じます。


これで、マルチプレイヤー セッション サブシステムが新しいプロジェクトにプラグインされました。これをこのコース全体で頻繁に使用して、マルチプレイヤー ゲームをテストし、Steam セッションを介してインターネット経由でプレイするときに期待どおりに動作することを確認します。


この講義では、ゲーム プロジェクトを作成し、メニュー システム プラグインを追加しました。


これで、メニュー ウィジェットとゲーム スタートアップ マップができました。このプラグインをコース全体で使用して、Steam ネットワークでゲームをプレイしているマシンに接続します。


素晴らしい仕事。


これで、実際にこのゲームの作成を開始する準備が整いました。これにより、ネットワーク全体で何かをテストできるようになります。


次の講義でお会いしましょう。

Now before we package the game, let's go to edit and project settings and search for [maps to include] and we'll see under packaging list of maps to include in a package build.


Now we can plus to add something to this and I'd like to add [/Game/Maps/Lobby], or wherever you put your lobby level.


And we can also add our game startup map. so [/Game/Maps/GameStartupMap].


Now this will ensure that when we package a build that it will also package these maps in the build.


So make sure you add all the maps in your game to this list of maps and make sure that you put their paths correctly.


Everything up to and including content is replaced with game and then place the folder path and the name of the map at the very end.


So before we wrap this video up, we're going to test this game in a package to build.


So here's my project and I'm going to right click here and create a new folder called Build.


And this build folder can be used when we package game projects and we're going to do that right now.


So let's go to platforms.


I'm on a Windows Machine, so Windows and Package project.


And it's asking me where it should send that package project.


I'm going to select my newly created build folder and click select folder.


I can click my output log to see the progress as we build this project.


So once my packaging is complete, I can go back to my build folder and now I see a Windows folder and


inside here's my package game project.


It's this executable blaster.exe.


Now we need all the other folders that package with it.


So don't delete anything here.


And we can run this game project by double clicking blaster.exe.


And we open up to our game startup map with the widget blueprint here and we see host and join.


Now this plugin uses steam.


So in order to host or join a session, Steam needs to be running on our machine.


So here's the Steam client.


And when I test this project with two different machines, I need two different steam accounts.


One logged in on each machine, and in order to find each other's game session, we need to both connect to the same steam region so we can go to Steam and settings and click downloads.


And I have my download region set to U.S. Phoenix.


So if I package this project and stick it on another machine, I need that other machine to have its own unique steam account logged in and its download regions should be set to the same region as my machine, U.S. Phoenix.


I'm going to click okay and close this.


So we now have our multiplayer sessions subsystem plug in on our new project, and we're going to use this frequently throughout this course to test our multiplayer game and make sure it works as expected when playing across the Internet through steam sessions.


So in this lecture we created our game project and we added the menu system plug in.


Now we have a menu widget and our game startup map, and we're going to be using this plug in throughout the course to connect it to machines playing our game across the Steam Network.


Awesome job.


We're now ready to start actually making this game so we can have something to test across the network.


I'll see you in the next lecture.


0 件のコメント:

コメントを投稿