findusl / initiative-tracker

Helper for initative based combat, primarily D&D 5e
4 stars 0 forks source link
compose-desktop compose-ios compose-multiplatform dungeons-and-dragons jetpack-compose kotlin-multiplatform kotlin-native ktor shared-models

Initiative Tracker

Summary

Technical Overview

This application consists of a backend and a frontend application. Both frontend and backend have multiple targets.

Functionality Overview

This app is used during D&D 5e Combat, to reduce the workload on the DM, increase the player immersion and speed up the combat. More in Detail on this below. The app can probably be applied to most initiative based combat systems.

Functional Details

Features

The initiative tracker provides multiple features that improve combat. The current combat situation is hosted by the DM and in real time shared with the players using Websockets and the backend.

User guide

I hope it's quite intuitive to use. Maybe worth mentioning, for the dungeon master, once you finished setting up your monsters, you can "start" a combat with the play button on top. That adds the button for advancing initiative, and it changes the swipe actions.

Technical Details Frontend

Most frontend code is shared in the module frontendshared. The platform modules are required for correct gradle tasks specific to the platform.

Locally hosted backend vs remote hosted backend

The frontend can connect to a local backend (default localhost) and a remote backend. This mainly affects whether ssl is used or not. This is configured by setting the property buildkonfig.flavor in gradle.properties to lan or remote.

For default values see the section buildkonfig in frontendshared/build.gradle.kts. Custom values can be set in local.properties see local.properties.template. The associated code is in HTTPClient code.

For more details on how to run the backend, see below.

Running the desktop frontend

You can run the desktop application by running Main.kt in the desktop module. Either with your favorite IDE or with the gradle task :frontenddesktop:run.

Running the android app

Use Android studio and run the frontendandroid target.

Build the android app (on my computer)

Android Studio -> generate signed apk Development/my_release.keystore

Technical Details Backend

The backend supports linux native and JVM target. Mostly because I want to, you can just use JVM.

JVM

Run directly

You can run the jvm backend using the gradle task :backendjvm:run or by running the Main method in the backendjvm module.

Run in docker

There are also a few docker tasks from the ktor docker plugin to build or run it as a docker container.

Native Linux

Run directly

The task :backendshared:linuxX64Binaries will build the binaries into backendshared/build/bin/linuxX64, and you can run them.

Run in docker

Use the dockerfile in backendshared/Dockerfile