Key Concepts #
Custom services are made up of several pieces that fit together to create any custom functionality:
- Protos for RPCs
- Custom service Kotlin file
- Game client files: Pragma SDK, [ServiceName]Service, and [ServiceName]ServiceRaw
In the next few sections, we’ll introduce each of these files and their locations. We’ll then take a look at the flow of steps required to build a custom service.
We recommend you start by creating your desired game interface to map out the user experience for your service.
Protos for RPCs #
Pragma Engine uses a custom protocol built on top of protobuf to define the API between the SDK and the Pragma Engine platform. All service calls must first have their interface defined via protobuf. A compiler subsequently generates code so that both Pragma Engine and your game client can communicate.
Protos can be found in 5-ext/ext-protos/src/main/proto/
.
Custom service #
The bulk of your custom service is defined in a Kotlin file. All your custom service’s server-side business logic resides here.
The custom service file can be found here: 5-ext/ext/src/main/kotlin/
Game client #
Pragma SDK #
The built-in Pragma Engine session and services available for communicating with the Pragma Engine platform, which includes the generated classes from the protobuf files used to make RPC requests to the engine.
For instructions on integrating the Pragma SDK with your game, see the Pragma Engine SDK guides for Unreal and Unity.
Client-side custom service code #
A directory inside your game project that contains any SDK files that interact with the custom service you’ve built. This includes custom service files like [ServiceName]Service and [ServiceName]ServiceRaw. These files are authored by you (or generated by Unreal) and tell your game how to communicate with your custom service.
- [ServiceName]Service: Game logic that calls the RPC methods defined in [ServiceName]Raw
- [ServiceName]ServiceRaw: RPC methods & delegates that communicate with the Pragma SDK (auto-generated in Unreal)
This section provides an example of a structure you can use for a basic custom service, but naming conventions and structure should be adapted to your project.