Custom Services #

Pragma Engine provides a rich library of features for Game and Social interactions, and can be customized to add features or extend existing functionality with configuration, plugins, and custom services. This section will explain how to build a custom service, leverage a custom database, and use plugins for custom implementations and intra-service communication.

The Food Chain of Flexibility #

Other backend solutions often use a black box approach, which may seem to reduce complexity on the surface, but creates significant friction when a provided solution does not exactly match a game’s design. In situations where the precise, constrained offering doesn’t fully capture a studio’s unique scenarios, the developers are forced into a situation where they must compromise the integrity and creativity of their design. Their options are either give up on their unique game design in favor of a more generic solution that matches the black box strict options, or adopt the complexity of networking, authentication, and other high friction backend tools that the black box solution offered to abstract away in the first place.

Pragma Engine provides three paths for development that capture every use case to support unique game design and reduce friction caused by backend tooling. Adopting the lightweight Pragma Engine pattern for developing custom services means leveraging Pragma’s preexisting authentication, networking, and AWS managed service systems.

Developers have three options:

  • Configuration: tunable values constrained by Pragma’s preset configs, no code required
  • Hybrid: plugins with predetermined interfaces that provide entry points for custom logic
  • Complete freedom: custom service development without the deep complexity of backend environment tooling and setup
Example: Store vs Craft

The Store and Crafting systems provide an excellent example to demonstrate the food chain of flexibility with Pragma Engine.

Configuration: The Store service requires no code for completing basic exchange transactions, with developers only needing to write content data files to configure the store itself. This requires no code but must fit within the limitation of fixed prices.

Example: Trade 30 coins for 3 iron ore.

Hybrid: The Crafting service has a Crafting Plugin that enables the injection of custom code within the larger preset structure. Developers can handle more complex exchange systems that include calculations.

Example: Dynamic starter bundle has 1 helmet (15 coins), 1 armor set (50 coins), and 1 weapon (80 coins). If a player already has the weapon, only charge them 65 coins in exchange for the helmet and armor set.

Complete freedom: If neither of these solutions fully capture a game’s design for item exchange or crafting, instead of compromising their creativity, the developer can create a completely new microservice using this custom service guide.

The creation and implementation of custom services can be complex, with many customizable configurations and options. To demonstrate the steps with clear implementation code blocks, sections will include MyCustom dropdowns, which provide specific examples for an imaginary MyCustom service.

Contents #

Key ConceptsKey concepts for understanding custom services.
Creating a Custom ServiceCreate a custom service.
Adding Database StorageAdd database storage to a custom service.
Calling with Custom PluginsCalling a custom service with custom plugin.