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
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:
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.
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.