Extend Codegen CLIを使用してExtend Service ExtensionのUnreal SDKプラグインを生成する
注釈:本資料はAI技術を用いて翻訳されています。
Overview
This guide shows the shortest path to generate an Unreal plugin for a custom service by using the Extend Codegen CLI.
Use this flow when you already have:
- the AccelByte Unreal SDK in your Unreal project
- an OpenAPI 2.0 JSON file for your service
- the Unreal template pack ZIP from GitHub Releases
Before You Start
Prepare these items first:
- An Unreal project with the AccelByte Unreal SDK already installed.
- A Linux environment or Windows 11 WSL2 with
bash,make, and Docker available. - A valid OpenAPI 2.0 JSON file for your custom service.
- The
accelbyte-unreal-sdk-template-pack.zipfile.
You can get its OpenAPI 2.0 JSON from the AGS Admin Portal on the app's Open API Documentation page. If you need the OpenAPI file before deployment, see Generate Service Extension OpenAPI without deploying.
Validate the OpenAPI file with Swagger Editor before running code generation. Invalid specs are the most common reason generation fails.
Quick Start
1. Pull the Extend Codegen CLI Docker image
docker pull accelbyte/extend-codegen-cli:0.0.29
2. Download and extract the Unreal template pack
wget https://github.com/AccelByte/extend-codegen-cli/releases/download/v0.0.29/accelbyte-unreal-sdk-template-pack.zip
unzip accelbyte-unreal-sdk-template-pack.zip
3. Open the extracted folder
cd accelbyte-unreal-sdk-template-pack/
4. Prepare the spec folder
Create a spec folder in your Unreal project, then place the same OpenAPI file in the root and in these three subfolders:
spec/Clientspec/GameServerspec/Models
Example:
/path/to/my-unreal-project/
|__ MyAwesomeGame.uproject
|__ Config/
|__ Content/
|__ Plugins/
|__ Source/
|__ spec/
|__ Client/
| |__ guild.json
|__ GameServer/
| |__ guild.json
|__ Models/
| |__ guild.json
|__ guild.json
Use a simple lowercase filename such as guild.json. The template pack uses that filename as the service identifier when generating code.
If you generate multiple services, make sure each OpenAPI file uses a unique basePath. Duplicate basePath values can create naming and runtime conflicts.
5. Run code generation
Run:
make all \
CODEGEN_IMAGE_VERSION=0.0.29 \
PROJECT_PATH=/path/to/my-unreal-project \
SPEC_PATH=/path/to/my-unreal-project/spec \
PACKAGE_TYPE=plugin \
ADMIN_API_PATH=/admin/
Parameter summary:
CODEGEN_IMAGE_VERSION: version ofaccelbyte/extend-codegen-clito usePROJECT_PATH: Unreal project rootSPEC_PATH: path to thespecfolderPACKAGE_TYPE=plugin: generate a standalone Unreal pluginADMIN_API_PATH: optional split between client and server endpoints
6. Confirm the plugin was generated
For PACKAGE_TYPE=plugin, the generated plugin is created in your project under Plugins/AccelByteUe4SdkCustomization/:
AccelByteUe4SdkCustomization/
|__ AccelByteUe4SdkCustomization.uplugin
|__ Resources/
|__ Source/
|__ AccelByteUe4SdkCustomization/
|__ AccelByteUe4SdkCustomization.Build.cs
|__ Private/
|__ Public/
|__ Api/
|__ Models/
7. Add the generated plugin dependency
Add AccelByteUe4SdkCustomization to your project's .Build.cs file:
PublicDependencyModuleNames.AddRange(new string[] { ..., "AccelByteUe4SdkCustomization" });
If you generated with PACKAGE_TYPE=module, also add the module to AccelByteUe4Sdk.uplugin.
{
"Name": "AccelByteUe4SdkCustomization",
"Type": "Runtime",
"LoadingPhase": "PreDefault"
}
Use the Generated API
Include the generated API header:
#include "Api/AccelByteGuildApi.h"
Then call it through the AccelByte API client:
FApiClientPtr ApiClient = AccelByteOnlineSubsystemPtr->GetApiClient();
// ApiClient->GetApiPtr<AccelByte::Api::YourApiName>()->SomeFunction(...);
If you need to override the custom service ServerUrl or basePath, see Enabling environment switching for Unreal.
Need More Detail?
Use these references when you need more than the quick start:
- Generate Service Extension OpenAPI without deploying
- Extend Codegen CLI - Templates and Debugging
- Unreal SDK setup guide
Troubleshooting
make fails before generation starts
Check these first:
- Docker is installed and running.
- Your user can run Docker commands.
- The OpenAPI file is valid OpenAPI 2.0.
Unreal cannot build after plugin generation
Check these items:
- The base AccelByte Unreal SDK is already installed.
AccelByteUe4SdkCustomizationwas added toPublicDependencyModuleNames.- The generated
.upluginfile is valid.
Generated code conflicts with another custom service
Check these items:
- Each OpenAPI file uses a unique filename.
- Each OpenAPI file uses a unique
basePath.
Regenerating removes manual edits
Treat generated files as build output. Keep custom logic in your own project code instead of editing the generated plugin directly.