/ti4-companion

Making it easier to share co-located Twilight Imperium 4 boardgame sessions and improving them with a real-time board for Public Objectives and Victory Points counter

Primary LanguageJavaScript

ti4-companion

for live version see https://ti4companion.paxmagnifica.com/

This is supposed to be a companion app for a session of Twilight Imperium 4th Edition board game.

It's supposed to be an easy way to share game state between players. Each player should be able to input and access the game state of the current session on their phone.

This should help with tracking the objectives, laws and directives in play and, later, technologies developed by each race.

A way of sharing the game state in read-only state that would show the big picture on a big screen (or people who are interested in the game but are not sitting together).

Support the creator

If you've used the application and found it useful or think this is a cause worth your support, consider giving a little tip for our efforts. Every bit counts and keeps the creator even more motivated to keep going!

donate some trade goods

Features

see our page

Plans

see issues

Sessions assisted by the app

big session with 7 people session for 4 players with a big screen session for 4 players at friend's house with a laptop as dashboard

development

to run the application

use provided docker-compose.yml, together with the committed .env.dev file, like this (in the root of the repo):

$ docker-compose --env-file .env.dev up -d

This will run postgres, backend and frontend services in dockers. Check docker-compose which services are available on which host ports.

initial data

If you run the application against an empty database, 2 sessions will be created with static Guids:

  • 1811a152-b64c-41cd-bdfd-8885fdfb7620 with password "test" for editing
  • 6fd5c725-30cd-4320-8889-c2f6427ba365 with password "test" for editing

so you can check the installation by trying to hit https://localhost:3000/6fd5c725-30cd-4320-8889-c2f6427ba365 or the other one

to add a migration

make sure you have Entity Framework CLI installed on your machine

make your changes to any class used in SessionContext (these are db entities)

in server directory run

$ dotnet ef migrations add NameOfYourMigration

this will automatically add required changes to server/Migrations/ directory

extracting faction images from codex pdf

The nutshell images of factions (the ones shown on session view) are extracted from codex pdf. The extraction was done using the ./extract-images-from-pdf.sh. More info below.

last used pdf: https://images-cdn.fantasyflightgames.com/filer_public/ff/5c/ff5cc986-344a-4460-a0cb-41d40a3446ed/ti_codex_2_cards_web.pdf

you need imagemagick or something like this (the thing in unix that installs convert and pdftoppm programs)

  1. download a codex pdf like the one above
  2. pray that the 24 factions are in the same order on the same pages
  3. if on different pages, update script to extract from correct pages
  4. if not in the same order as in the script - update the script with names which are lowercase of FACTION enum keys in client/src/gameInfo/factions.js (so The_Universities_of_Jol__Nar becomes the_universities_of_jol__nar.png)
  5. run ./extract-images-from-pdf.sh <name_of_the_pdf_file>

Contributing

code conventions

Code conventions are enforced automatically

  • for general formatting: .editorconfig
  • for frontend: eslint
  • for backend: dotnet format

Github actions will fail your contribution if you do not comply :)