πΊοΈ
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:
| Variant | DB Column | Description | Required? |
|---|---|---|---|
| Blueprint | imagePath | Default view | Yes |
| Darkprint | darkImagePath | Dark variant | Optional |
| Whiteprint | whiteImagePath | Light variant | Optional |
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:
- Go to Admin Panel > Games > Maps
- Select a map and click Manage Floors
- For each floor, Blueprint, Darkprint, and Whiteprint can be uploaded
- Supported formats: PNG, JPG, WebP
- 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
| Directory | Contents | Git-tracked? |
|---|---|---|
uploads/maps/ | Map floor images | Yes (pre-seeded) |
uploads/gadgets/ | Gadget icons | Yes (pre-seeded) |
uploads/games/ | Game logos/images | No (gitignored) |
uploads/operators/ | Operator/agent images | No (gitignored) |
Technical Details
- Images are processed by Sharp: resize + WebP conversion
processUpload()returnsnullfor 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