Implementing a Player Service

This page (plus the sub-pages) describes the two basic ways to implement a player service.

Two Ways to Implement a Player Service

Creating your own player service is the main purpose of the Microservice Dungeon project. With your own player, you can control robot swarms and compete against other players. To achieve this, you have to follow the Event-Driven Architecture style in order to react to the events sent by the core services.

1. Using a Player Skeleton

There are currently four player skeletons available, which are described in detail in the sub-pages of this page. The skeletons are available in the skeleton group of the Microservice Dungeon repo.

You basically fork the skeleton you want to use, implement your player logic and deploy it.

How to Fork a Skeleton

You need a GitLab account to fork a skeleton. In the Gitlab project of the skeleton, click on the Fork button in the upper right corner. This will create a copy of the skeleton in your own GitLab account. You need to specify a name and a namespace for your forked repository.

  • The name should be the name of your player, for example player-constantine.
  • The namespace is usually your own user account, but you can also create a group for your player and use this group as the namespace.

You should then clone the forked repository to your local machine.

How to Take Over Updates (e.g. Bugfixes) in the Skeleton into Your Forked Repo

To take over recent changes from the upstream repository into your forked version, you can follow these steps:

1. Add the Upstream Repository as a Remote

You need to add the original repository (the one you forked from) as a remote in your local Git repository. You can do this using the following command, replacing <upstream-url> with the URL of the upstream repository:

git remote add upstream https://gitlab.com/the-microservice-dungeon/player-teams/skeletons/player-java-springboot.git

Change URL for the other skeletons accordingly. You only need to do this step once.

2. Fetch the Latest Changes from Upstream

Fetch the latest changes from the upstream repository to your local repository using the following command:

git fetch upstream

This command will retrieve all the changes from the upstream repository without modifying your local branches.

3. Merge Changes

Merge the changes from the upstream repository into your local main branch.

git merge upstream/main

4. Resolve Conflicts (if any)

If there are conflicts between your changes and the upstream changes, Git will prompt you to resolve them. Open the files with conflicts, resolve the issues, and then commit the resolved changes. IDEs like IntelliJ can help you with this process.

5. Push the Changes to Your Fork

After resolving conflicts (if any) and making sure everything looks good, push the changes to your forked repository:

git push origin main

Now, your forked repository should be up to date with the latest changes from the upstream repository.

2. Building a Player Service from Scratch

Only recommended if you have a good understanding of the game mechanics and architecture. This is a good way to explore new programming languages and frameworks, though.


Java Player Skeleton

The Java Player Skeleton is based on Spring Boot. It is a good starting point for Java developers. You find it here. If you want to use it, fork this repo to your own repo, and start working.

Python Player Skeleton

The Python Player Skeleton is written in Python 3.12. It is a good starting point for Python developers. You find it here. If you want to use it, fork this repo to your own repo, and start working.

Kotlin Player Skeleton

This is the documentation for the Kotlin Player Skeleton. It is a good starting point for Kotlin developers. You find it here. If you want to use it, fork this repo to your own repo, and start working.

Typescript Player Skeleton

The Typescript Player Skeleton is based on NodeJS. It is a good starting point for developers who are most familiar with the Typescript / Javascript way of thinking. You find it here. If you want to use it, fork this repo to your own repo, and start working.

Rust Player Skeleton

The Rust Player Skeleton is implemented asynchronously with the Tokio Runtime. It is a good starting point for Rust developers. You can find it here. Fork this repo to your own repo, and start working.

Building a Player Service from Scratch

This page describes how you can build a player service from scratch, without using one of the predefined skeletons. This is only recommended if you have a good understanding of the game mechanics and architecture. In addition, you need to be quite familiar with the programming language and framework you want to use. If you are, go ahead :-). This is your decision.

Last modified February 4, 2025: fix go & npm dependencies (8ff1fa0)