πŸ—ΊοΈ

Map Images

Pre-Seeded Assets

TactiHub ships with 188 pre-installed images in the repository:

  • 165 Map Floor Images (WebP) β€” Blueprint, Darkprint, and Whiteprint for all R6 Siege maps
  • 23 Gadget Icons (WebP) β€” Icons for R6 Siege gadgets

These are located under packages/server/uploads/:

uploads/
β”œβ”€β”€ maps/          # Map Floor Images (git-tracked)
β”‚   β”œβ”€β”€ bank-1-blueprint.webp
β”‚   β”œβ”€β”€ bank-1-darkprint.webp
β”‚   β”œβ”€β”€ bank-1-whiteprint.webp
β”‚   └── ...
└── gadgets/       # Gadget Icons (git-tracked)
    β”œβ”€β”€ barbed-wire.webp
    └── ...

After seeding (pnpm db:seed), the database references these files automatically β€” no additional import needed.


Floor Image Variants

Each floor can have up to 3 image variants:

VariantDB ColumnDescriptionRequired?
BlueprintimagePathDefault viewYes
DarkprintdarkImagePathDark variantOptional
WhiteprintwhiteImagePathLight variantOptional

When more than one variant is available, the View Mode Switcher appears in the top-left of the canvas.


Upload via Admin Panel

Admins can upload and manage images through the admin panel:

  1. Go to Admin Panel > Games > Maps
  2. Select a map and click Manage Floors
  3. For each floor, Blueprint, Darkprint, and Whiteprint can be uploaded
  4. Supported formats: PNG, JPG, WebP
  5. All uploads are automatically converted to WebP and optimized via Sharp

Admin-uploaded images override the seed paths in the database.


Batch Processing

For processing many images from an external source folder:

pnpm --filter @tactihub/server tsx src/scripts/process-images.ts "/path/to/source/folder"

The script:

  • Converts all images to WebP format
  • Uses deterministic filenames ({slug}-{num}-{variant}.webp)
  • Requires no database access
  • Saves results to packages/server/uploads/maps/

Upload Directories

DirectoryContentsGit-tracked?
uploads/maps/Map floor imagesYes (pre-seeded)
uploads/gadgets/Gadget iconsYes (pre-seeded)
uploads/games/Game logos/imagesNo (gitignored)
uploads/operators/Operator/agent imagesNo (gitignored)

Technical Details

  • Images are processed by Sharp: resize + WebP conversion
  • processUpload() returns null for empty file buffers (e.g. form submit without file selection) β€” the caller skips processing
  • Image dimensions stay identical across all variants β€” the View Mode Switcher only swaps the background image 1:1