Error Catalog

Purpose

This document is the central overview of all errors in the game. The authoritative source in code is the catalog in:

room-of-horror-api/evaluation/ErrorCatalog.ts

At API startup, the catalog is upserted into the error_definitions table (incl. category, weighting, criticality, and feedback hints). The visible names and icons for the frontend live in room-of-horror-frontend/src/utils/Data.ts; the matching error objects in Unity carry the ID as a name prefix (e.g. 15 ErrorContainer).

The error names below are the literal German values from code and database (the training audience is German-speaking). The English translation is given in italics.

Scoring attributes

Every error has three scoring attributes:

Attribute Meaning
Category Professional classification (hygiene, patient safety, medication, …) — basis for the category breakdown in the final report
Weight (1–5) Severity; determines the share of the weighted total score
Critical Critical errors must not be missed — one missed critical error prevents passing

Current errors (IDs 0–31)

General room errors (selectable for all patients)

ID Error name Category Weight Critical
0 Urin im Bett — urine in the bed hygiene 3
3 Überfüllter Schubschrank — overfilled supply cabinet organization 1
4 Fehlerhafter Toilettenstuhl — defective commode chair patientSafety 3
5 Fehlende Arbeitsmittel — missing work materials organization 3
6 Ungesichertes Bett — unsecured bed patientSafety 5
7 Herumliegende Spritzen — syringes lying around sharps 4
10 Verschüttetes Glas — spilled glass environment 3
11 Badmülleimer voll — bathroom bin full hygiene 1
12 Mülleimer voll — bin full hygiene 1
13 Voller Urinbehälter — full urine container hygiene 3
14 Urinbehälter am Boden — urine container on the floor environment 3
15 Gehhilfe im Weg — walker blocking the way environment 4
16 Verwendung vom Notstrom — use of emergency power equipment 5
17 Verschmutzte Toilette — soiled toilet hygiene 1
ID Error name Category Weight Critical
1 Blutende Wunde — bleeding wound patientSafety 5
2 Blut im Infusionsschlauch — blood in the infusion tube contamination 5
8 Offene Wunde — open wound patientSafety 5

Patient-specific errors

ID Error name Category Weight Critical Patient
9 Falscher Medikamentenname — wrong medication name medication 5 (legacy, currently unassigned)
18 Alarm nicht in Reichweite — alarm out of reach patientSafety 5 B
19 Klingel zu hoch — call bell too high patientSafety 5 A (child)
20 Bett zu groß — bed too big patientSafety 5 A (child in adult bed)
21 Bett zu hoch — bed too high patientSafety 5 B
22 Zu viele Besucher im Zimmer — too many visitors in the room organization 3 C (choice dialog)
23 Klingelmatte liegt falsch — sensor mat misplaced patientSafety 5 D (dementia)
24 Tür 1 ist blockiert — door 1 blocked patientSafety 5 D
25 Normales Bett statt Schwerlastbett — regular bed instead of bariatric bed patientSafety 5 E
26 Keine Adresse in Patientenakte — no address in patient file organization 3 E (file error)
27 Patient spricht kein Deutsch — patient speaks no German patientSafety 4 F (translator dialog)
28 Diagnose und Medikation passen nicht zusammen — diagnosis and medication do not match medication 5 file error (all files)
29 Tür 2 ist blockiert — door 2 blocked patientSafety 5 D
30 Falsches Medikament wegen Allergie — wrong medication due to allergy medication 5 B (penicillin allergy)
31 Tür 3 ist blockiert — door 3 blocked patientSafety 5 D

The patient ↔ error mapping is defined in getPatientSpecificErrorIds() (room-of-horror-api/database/General.ts) and mirrored in patientSpecificErrorIdsByPatient (room-of-horror-frontend/src/utils/Data.ts). Details on the patient scenarios: Patient Models.

Technical rules

  • Errors are managed via numeric IDs; the ID must stay consistent across frontend, backend, and Unity.
  • The frontend only shows the errors allowed for the selected patient; the backend validates this again in EditGame.ts.
  • At game start Unity only activates error objects whose IDs are delivered by the backend. Unselected errors with correction components (MoveErrorContainer, VisualStateCorrection, TransformStateCorrection) are rendered in their correct state instead of being hidden.
  • File errors (26, 27, 28, 30) are not solved via room objects but via the interactive patient file (PatientFileUI.cs) — partly as multiple-choice decisions with exactly one professionally correct answer.
  • MAXIMUM_ERROR_AMOUNT in the API .env must equal the highest error ID (currently 31).

Adding a new error (checklist)

  1. Add an entry in evaluation/ErrorCatalog.ts (ID, name, category, weight, critical, feedback hint) and extend errorKeys in database/General.ts.
  2. Increase MAXIMUM_ERROR_AMOUNT in the API .env.
  3. Frontend: add entry + icon in src/utils/Data.ts; add the patient mapping if needed.
  4. Backend: extend the patient mapping in getPatientSpecificErrorIds() (otherwise the error is only selectable if listed as a general error).
  5. Unity: create an error object with ID prefix under Interactables; add a correction component for the inactive state if needed.
  6. Restart the API (the seed upsert updates error_definitions).

Information sources

  • room-of-horror-api/evaluation/ErrorCatalog.ts (IDs, categories, weights, criticality)
  • room-of-horror-api/database/General.ts (errorKeys, patient mapping, seeding)
  • room-of-horror-frontend/src/utils/Data.ts (display names, icons)
  • room-of-horror-unity/Assets/Scripts/ErrorObject.cs, InteractablesController.cs, PatientFileUI.cs

Missing information

  • The exact Unity object names and room positions per error are only maintained in the scene (SampleScene.unity) and not listed individually here.

Last build: 19 Aug 2026, 05:20+00:00


This site uses Just the Docs, a documentation theme for Jekyll.