# Horrorcraft A co-op horror game template for Unreal Engine 5.6, 5.7 and 5.8. One to four players go into a dark facility, collect scrap and carry it back to the extraction zone to meet a quota before the deadline. A monster hunts them by sound and by light. Dead players watch the living, and between days the team spends what it earned in a shop. That scrap run is one of nine game modes, and a mode is a Data Asset: you make your own without code. Everything is replicated, for a game hosted by a player or a dedicated server, and tuned from Blueprint children and Data Assets. The demo map plays as soon as you press Play. ## Contents - [Installing](#installing) - [Quick start](#quick-start) - [What you get](#what-you-get) - [Controls](#controls) - [Making it your own](#making-it-your-own) - [Game modes](#game-modes) - [The run: days, quota and shop](#the-run-days-quota-and-shop) - [Players](#players) - [The monster](#the-monster) - [Loot, keys and doors](#loot-keys-and-doors) - [Replacing the art](#replacing-the-art) - [Building your own map](#building-your-own-map) - [The industrial kit](#the-industrial-kit) - [Random floors](#random-floors) - [Sounds](#sounds) - [HUD](#hud) - [Input](#input) - [Menus and online](#menus-and-online) - [Dedicated server](#dedicated-server) - [Playing online: Steam and EOS](#playing-online-steam-and-eos) - [Blueprint reference](#blueprint-reference) - [C++ reference](#c-reference) - [Map URL options and test commands](#map-url-options-and-test-commands) - [Troubleshooting](#troubleshooting) - [Versions and platforms](#versions-and-platforms) - [Demo content](#demo-content) - [Credits](#credits) ## Installing Horrorcraft is one code plugin. Menucraft (menus) and Lobbycraft (sessions) are inside it as modules, so there is nothing else to install. 1. Install it to the engine from the Fab library, or copy the `Horrorcraft` folder into your project's `Plugins` folder. Your project needs C++ enabled to compile it from source (the Fab build comes compiled). 2. Enable **Horrorcraft** in Edit > Plugins and restart. Its content shows up in the Content Browser under **Plugins > Horrorcraft Content** (turn on *Show Plugin Content* in the browser's settings). 3. Add the choices that belong to your project to `Config/DefaultEngine.ini`: ```ini [/Script/EngineSettings.GameMapsSettings] GameDefaultMap=/Horrorcraft/Maps/L_MainMenu.L_MainMenu EditorStartupMap=/Horrorcraft/Maps/L_Demo.L_Demo GlobalDefaultGameMode=/Horrorcraft/Blueprints/BP_HCGameMode.BP_HCGameMode_C [OnlineSubsystem] DefaultPlatformService=Null bHasVoiceEnabled=true ``` 4. To package, add the maps you ship to Project Settings > Packaging > **List of maps to include** (the demo's are `/Horrorcraft/Maps/L_MainMenu`, `/Horrorcraft/Maps/L_Demo` and `/Horrorcraft/Maps/L_Rooms`). Everything else the plugin needs comes with it: - **Sounds and the menu** start on the plugin's own assets. Change them in Project Settings (Game > Horrorcraft Sounds, Plugins > Menucraft) and your choice is saved in your project. One exception: Menucraft's **Pause On Game Menu** is switched off every time the game starts, because a co-op match can't stop for one player's pause menu. - **Engine-level settings** are in `Plugins/Horrorcraft/Config` (`Engine.ini`, `Game.ini`, `Input.ini`): Enhanced Input, the CommonUI viewport and input data, the Game User Settings class (Menucraft's), the navmesh agent and runtime navmesh generation, physical surface types 1 to 3 (Wood, Metal, Dirt), open-mic voice, the folders to always cook. The engine layers those files over your project's ini while the plugin is enabled, and they win, so change them there. In a project that already has its own Game User Settings class or uses surface types 1 to 3, check those two first. **If you own Menucraft or Lobbycraft as separate plugins,** don't enable them in the same project as Horrorcraft. It already contains both, and two copies of the same module won't compile. ## Quick start 1. Open `L_Demo` (Plugins > Horrorcraft Content > Maps) and press **Play**. It starts in the lobby, in the Scrap Run. To try another mode press **B**, then **Match options**, and click **Mode**: the lobby reloads in it when you close the screen. 2. Press **Enter** to start the mission. You have 10 minutes. 3. Pick up scrap with **E** and carry it to the green extraction zone. The day ends when everyone still alive stands in it. 4. Press **Enter** on the results for the next day. In the lobby, **B** opens the shop. To play with others, set *Number of Players* to 2 to 4 under Play's options (Net Mode: Play As Listen Server). You can also run the game from `L_MainMenu` (Standalone Game or a packaged build) and use **Host** and **Join**. Join opens the list of games found, with host, mode, map, seats and ping. ## What you get - A day loop: Lobby (shop open, host starts) > Mission (timer) > Results (host moves on). The quota is checked every few days. If the team meets it a higher one starts. If not, the team is fired and the run starts over. - Survivors in first person or over the shoulder (V switches). They walk, sprint on stamina, jump, carry a flashlight on battery and interact. There are four inventory slots with the active item in hand, drop and throw, weight that slows you down, health, death and spectating. - A monster on a StateTree. It patrols, investigates noises, chases what it sees, spots lit flashlights from far away, opens unlocked doors, and hits and kills. Players can't fight it. They run, hide and distract it. - An objective line and first-day hints so new players know what to do. - Proximity voice that fades with distance. The monster hears it too. - Loot spawns that roll new scrap every day, keys and locked doors, and an extraction zone. - Nine game modes as data: the scrap run, an escape, a last-night survival, an investigation, a hunt where a player is the monster, a lockdown built on an objective of its own (the one to copy for yours), and three that each lean on one idea: blind monsters and codes called out by voice, a core that takes both hands to carry, and floodlights the monsters can't walk into. - A rhythm for the hunt, per mode: constant, faster with every objective, calm broken by hunts, or monsters joining one at a time. - Weapons, off as shipped: the **Armed** mutator puts a pipe, a fire axe and a flare gun on the map, and a monster that takes enough hits goes down for a while. Each weapon is a line of data. - 16 things to wear (hard hats, masks, packs), picked in the lobby and seen by everyone. - An arm that comes up to hold the flashlight or the item in hand, with no Anim Blueprint. - A shop with six team upgrades, from longer battery to a bigger bag, each one a line of data you can change. - Match options for the host: a difficulty and mutators (twice the monsters, weak flashlights, permadeath...). - Switches and triggers that open doors, call the monster, count toward objectives and more, set up without a graph. - Six ready-made interactables (light switch, breaker, lever, button, crank, valve) with parts that move, some used by holding the key, and a generator that breaks down. - Every line of text in one Data Asset, to reword or translate. - 24 Blueprint events to hang your own logic on, and a stat system your own numbers can join. - Sounds for every event. Footsteps change with the floor (concrete, wood, metal, dirt), the monster breathes, a heartbeat rises as it gets close, and there is ambience. - A HUD in UMG whose layout you redesign in a Widget Blueprint. - Input as Enhanced Input assets for keyboard, mouse and controller. Players can rebind it in Settings > Controls. - Menus (main menu, pause, settings, loading screen) from Menucraft and sessions (host, join, LAN, Steam, EOS) from Lobbycraft. Both are inside the plugin. - An industrial kit of 79 pieces (walls, pillars, pipes, ducts, crates, racks, a generator, weapons, things to wear...) with procedural materials, 9 kinds of scrap and a flashlight made the same way, and lamps that flicker, fail and pulse. - Random floors: a generator that lays out a new plan of rooms every session, the same on every machine. - A demo facility built from the kit (a yard, a hall, rooms, doors, a locked storeroom, four generators, three valves) and a random-floors map with six kinds of room. ## Controls | Action | Keyboard and mouse | Controller | |---|---|---| | Move, look | WASD, mouse | Left stick, right stick | | Sprint | Left Shift (hold) | Left stick click | | Crouch (toggle) | C, Left Ctrl | Right stick click | | Jump | Space | A / Cross | | Interact (pick up, doors) | E | X / Square | | Flashlight | F | Y / Triangle | | First or third person | V | D-pad up | | Select slot | 1 to 5, mouse wheel | | | Drop held item | G | | | Throw held item | Q | Right trigger | | Start mission, next day (host) | Enter | View / Share | | Shop (lobby) | B | B / Circle | | Pause menu | Escape | Menu / Options | | Next player (spectating) | Left click, Space | A / Cross | ## Making it your own Five levers, from the lightest to the deepest. The first four need no graph and no code. The fifth is Blueprint. **1. Numbers.** Every class has a Blueprint child with its numbers on it (see Blueprint reference). **2. Data.** These are Data Assets: make more of them in the Content Browser (Miscellaneous > Data Asset). | Asset | What you add with it | |---|---| | **HCModeRules** | A game mode: objectives, mission length, its own map, its own monsters, its own stat changes | | **HCMutator** | A match option for the host, or a difficulty level: a name and a list of stat changes | | **HCScrapType** | A kind of scrap: name, mesh, value, weight, fragile or not | | **HCEntityType** | Something to identify in an investigation: the evidence it leaves, how fast and hard it hunts | | **HCEvidenceType** | A kind of evidence: its name and what the tool reads | Shop items are a list on BP_HCGameState, and the main menu's modes a list on WBP_HCMainMenu. **3. Stats.** Shop items, modes, difficulties and mutators all work the same way: a list of **stat modifiers**, each one a stat, a multiplier and an amount to add. The game reads the stats through `Get Stat` on the game state, so a change takes effect on every machine as soon as it is bought or switched on. | Stat | What it is | |---|---| | Battery Drain, Flashlight Brightness, Flashlight Range | The flashlight | | Max Stamina, Stamina Regen, Walk Speed, Sprint Speed, Sprint Noise | Moving | | Max Health, Inventory Slots, Revive Window | The survivor (Revive Window times 0 is permadeath) | | Monster Speed, Monster Damage, Monster Count | The hunt (Monster Count times 2 spawns a second set) | | Monster Sight, Monster Hearing | How far the monsters see (flashlights included) and hear | | Mission Time, Loot Value | The mission | | **Custom** | A stat of your own, named in the modifier's **Custom Id** | **A stat of your own**, without C++: pick the name ("TrapDamage"), read your number with **Get Custom Stat** (game state; pass the name and your base value), and give any shop item, mode or mutator a modifier with Stat **Custom** and that Custom Id. Lockdown does this as an example: it doubles `TrapDamage`. Bind **On Stats Changed** on the game state if you need to react when it changes. **4. Switches and triggers.** Two actors you drop in a level and fill in on the Details panel, no graph: - **BP_HCSwitch**: a lever, a button, a fuse box, a candle. A player uses it with E. **On Actions** is the list of what happens then; **Show When On** and **Hide When On** are lights or any other actors it turns on and off, for every player. Tick **Can Switch Off** for a two-way switch (it gets **Off Actions**), set **Required Key Id** to make it need a part. Each day it goes back to how you placed it. - **BP_HCTrigger**: a box. Its **Actions** happen when a living player walks in, once per mission or every time with a **Cooldown**. An alarm, a trap, a scare, a checkpoint. Ready to drop on a wall, in `/Horrorcraft/Interactables` (each one a BP_HCSwitch or BP_HCDevice with kit parts and settings filled in; the demo has the six switches by its entrance, each lighting a lamp): | Blueprint | Used by | Moves | |---|---|---| | BP_HCLightSwitch | A press, on and off | The toggle flips | | BP_HCBreaker | A press, on and off | The handle swings down | | BP_HCLever | A press, once | The handle comes down | | BP_HCButton | A press, once | The cap goes in | | BP_HCCrank | Holding E for 4 s; letting go starts it over, and the monsters hear it | The handle turns while held | | BP_HCValve | Holding E for 3 s; the progress stays when a player lets go | The wheel turns with the progress | | BP_HCGenerator | Holding E for 3 s, loud | Runs 60 to 120 s, then breaks down with a noise and needs a restart | **Holding the key.** Any switch, device or Interactable component gets it from **Use Seconds** on its Interactable: above 0, the key has to be held until the progress fills, and the HUD shows how far it got. **Keep Progress** keeps it when the player lets go (a repair) or starts it over (a crank), **Extra User Speed** is how much each extra player helps (0.5: two players take two thirds of the time) and **Use Noise Loudness** is a noise once a second while it works. Letting go, looking away, walking off, getting hurt or dying stops it. **The part that moves.** Every switch and device has a **Moving Part** component, with no mesh as it comes. Give it a mesh and place it where it rests while off, then: **On Rotation** and **On Offset** (how it ends up once on), **Move Seconds**, **Spin While Used** (degrees a second while held, a crank) and **Follow Progress** (it goes from off to on with the hold progress instead, a valve wheel). It moves on every machine from replicated state, so it costs no network. | Action | Does | |---|---| | Objective Progress | Moves the mode's Custom objective named **Id** forward by Amount | | Open Doors, Close Doors, Unlock Doors, Lock Doors | On the doors picked in **Targets** | | Call Monsters | Every monster in play comes to look here | | Monsters Chase Player | Every monster in play goes after whoever did it | | Stun Monsters | For Amount seconds | | Make Noise | A noise of loudness Amount: monsters within hearing come | | Play Sound | One of the Horrorcraft Sounds, or a **Custom Sound** of yours, for everyone | | Give Item | A loot, key or tool Blueprint (**Class**) into the player's bag | | Add Credits | Amount to the team | | Damage Player | Amount, to whoever did it | | Spawn Actor | **Class** at the first of Targets, or at the switch | Each action has a **Delay**, so a few of them make a sequence: the lights go out, two seconds later the monster comes. A generator that opens the exit, a ritual of five candles, a tripwire that gives you away and a room that locks behind you are all one of these two actors with three or four lines filled in. From a graph of your own, **Run Actions** does the same with any list. **5. Events.** Override these in the Event Graph of the Blueprint child. Each one is an event node, "On ...". | Blueprint | Events | |---|---| | BP_HCGameMode (server only: the game mode doesn't exist on clients) | On Lobby Started, On Mission Started, On Mission Ended, On Player Died, On Loot Banked, On Objective Progress, On Evidence Found, On Entity Named | | BP_HCCharacter | On Damaged, On Died, On Revived, On Flashlight Toggled (every machine); On Item Picked Up, On Item Released (server) | | BP_HCMonster | On State Changed, On Attacked, On Stunned, On Watched Changed (every machine) | | BP_HCDoor | On Door State Changed (every machine, once per change) | | BP_HCLoot | On Landed (server) | | BP_HCDevice | On Activated, On Device Reset (dispatchers, every machine) | | BP_HCSwitch, BP_HCTrigger | On Switched (every machine); On Triggered (server) | For widgets, which run on each player's machine, the game state has dispatchers that fire everywhere: **On Phase Changed**, **On Objectives Changed**, **On Evidence Changed**, **On Credits Changed** and **On Stats Changed**. **Nodes for your own logic** (server, unless noted): | You want to | Node | |---|---| | Give or take credits | **Add Credits** (game state) | | Hand out a shop item as a reward | **Grant Shop Item** (game state) | | Give a player an item (a starting tool, a reward) | **Give Item** (character) | | Use up the item in a player's hand, like a door does its key | **Take Held Item** (character), then **Consume** on it | | Send the monster somewhere, or after someone | **Investigate At**, **Chase Target** (monster's controller) | | Stop, hide or speed up a monster | **Stun**, **Set Dormant**, **Set Speed Scale** (monster) | | Check a map after changing it | **Check Game** (the doctor), or `HC.Doctor` in the console | | Make the monsters calm, or start a hunt | **Set Hunting** (game mode), **Set Passive** (one monster) | | Play one of the game's sounds for everyone | **Play Sound For Everyone** (game state) | | Buy from a shop widget of your own, on any machine | **Buy Shop Item** (player controller) | | Answer the investigation from your own widget | **Name Entity** (player controller) | **An objective of your own.** Give a mode an objective of type **Custom** with an **Id** ("Valves", "Photos"), an Amount and its HUD line. The quickest way to move it forward needs no graph: place a **BP_HCDevice** and type the same Id into its **Custom Objective Id**. For anything else (a photo taken, a monster stunned), call **Add Custom Objective Progress** on the game mode (Get Game Mode > Cast to HCGameMode). With an Escape objective in the mode, the extraction zone holds the team until yours is done; with no Escape and no Survive, the round is won the moment it is. The **Lockdown** mode and the three valves in the demo map are this, ready to copy. **Your own shop, journal or options screen.** The three that come with the plugin are C++ screens styled by Menucraft's theme. To replace one, make a Widget Blueprint (parent: Common Activatable Widget) and set it on BP_HCPlayerController under **Screens** (Shop Screen Class, Journal Screen Class, Match Options Screen Class). It reads the game state and calls Buy Shop Item or Name Entity. **Match options.** In the lobby the host opens them with the shop key (in the Scrap Run they are the shop's second tab): the **mode**, one **difficulty** and any number of **mutators**, all three lists on BP_HCGameMode (**Modes**, **Difficulties**, **Mutators**). Changing the mode opens the map again in the new one and takes the clients along, as a new run. The main menu's Mode button has a list of its own (**Modes** on WBP_HCMainMenu), so a mode you add goes in both. Everyone sees what was chosen on the HUD. Eight mutators and three difficulties come with the plugin, in `/Horrorcraft/Modes`. They are examples to copy. **Every word on screen.** The HUD, the hints, the results, the shop, the journal, the match options, the main menu and the prompts ("Open", "Pick up {0}") read their text from one Data Asset, **DA_HCTexts** (`/Horrorcraft/Blueprints`), set as **Texts** on BP_HCGameState and on WBP_HCMainMenu. Open it and rewrite any line. Keep the `{0}`, `{1}` the game fills in (a key, a number, a name). To ship more than one language, gather that asset in the Localization Dashboard like any other text asset. Shop item names are on BP_HCGameState, and mode, mutator, entity and scrap names on their own assets. **The main menu's buttons.** **Buttons** on WBP_HCMainMenu is the list, top to bottom: Continue, Mode, Host, Join, Settings, Quit. Remove one, reorder them. To lay the menu out yourself, design the Widget Blueprint (a panel named `ButtonPanel` receives the buttons, a text named `StatusText` the status line; or place your own buttons and call **Host Game**, **Join Game**, **Continue Run** and **Cycle Mode**). **A new monster.** A Blueprint child of BP_HCMonster and its numbers: speeds, attack, and its senses (**Sight Range**, **Lose Sight Range**, **Sight Half Angle**, **Hearing Range**, **Sees Flashlights**, **Light Sight Range**). A blind one that hears everything, or one that only sees straight ahead, is a few fields. Put it in a level or in a mode's **Monsters**. **What still takes C++.** A new kind of objective that the Custom one can't express, a new action for switches and triggers, a monster sense beyond sight, hearing and flashlights, and a different shape for the three built-in screens (you can replace them with widgets of your own, see above). ## Game modes A mode is a Data Asset (**HCModeRules**): a name, a list of objectives and a mission length. The main menu's **Mode** button cycles through the ones listed on WBP_HCMainMenu (**Modes**), and the host's map opens with the one chosen. Nine come with the plugin, in `/Horrorcraft/Modes`: | Mode | How a round goes | |---|---| | **Scrap Run** (DA_Mode_ScrapRun) | The campaign described in the next chapter: days, a quota, credits, the shop. | | **Escape** (DA_Mode_Escape) | Start three of the four generators, then get everyone alive to the green zone. 8 minutes. | | **Last Night** (DA_Mode_Survive) | Nobody leaves. Have someone alive when the 5 minutes run out. | | **Haunting** (DA_Mode_Investigation) | Work out which of four entities haunts the place from the evidence it leaves, name it in the journal, then leave. A wrong name loses. 10 minutes. | | **Hunted** (DA_Mode_Hunted) | Escape, but one player is the monster. From two players up; a different player each round. | | **Lockdown** (DA_Mode_Lockdown) | Shut three valves. No way out: the round is won when the last one is shut. A quarter less stamina. 7 minutes. | | **Dead Air** (DA_Mode_DeadAir) | The monsters are blind and hear much further. Three screens each show a number, and the four levers for each are a long way from it: whoever reads has to tell whoever pulls. A wrong lever is loud, brings the monsters and changes the number, which also changes by itself every 25 seconds. Then leave. 9 minutes. | | **Dead Weight** (DA_Mode_DeadWeight) | A 40-kg reactor core sits at the far end. Whoever carries it is slow, can't run and can't use the flashlight, so the others light the way and keep the monsters busy. Bank it at the green zone, then leave. 8 minutes. | | **Lights On** (DA_Mode_LightsOn) | The monsters can't step into a floodlight's light. Start five of the six; each one burns for a minute and every one started makes the monsters 5% faster. Then leave. 9 minutes. | The last three have their props (screens and levers, the core, floodlights) on the demo facility only, so their rules name that map and the menu's Map button is ignored for them. To play them on a map of yours, place the props there and clear **Map** on the rules. Every mode plays alone or with a team. With fewer players the monsters are slower (**Solo Monster Speed** on the rules, 85% for one player, rising to full speed at **Full Team Size**). That comes from the rules, so it applies when the game mode has some: the menu sets them, and a map opened straight in the editor has none unless you set **Rules** on its game mode. **Making your own.** In the Content Browser: Miscellaneous > Data Asset > **HCModeRules**. Add objectives and write each one's HUD line (`{0}` is the progress, `{1}` the amount): | Objective | Done when | |---|---| | **Bank Value** | Scrap worth Amount was banked at the extraction zone this mission. | | **Use Devices** | Amount of the map's **BP_HCDevice** actors were switched on with E. | | **Survive** | Someone is alive when the time runs out. Time up then wins the round, where it normally loses it. | | **Escape** | Every living player stands in the extraction zone. The zone holds them until the other objectives are done. | | **Identify** | The team named an entity in the journal. The round is only won if the name was right. | | **Custom** | Yours: something in the level moved it forward Amount times (see Making it your own). | How a round is won depends on which of these the mode has. With **Escape**: by leaving through the zone once the others are done. With **Survive**: by having someone alive at time up, the others done. With neither: the moment the others are all done. Everyone dead loses, and so does time up without a Survive objective. A mode needs at least one objective to be winnable. Add the asset to **Modes** on WBP_HCMainMenu, or set it as **Rules** on a game mode Blueprint for a map that only plays that mode. A mode can also bring its own **Map** (the menu opens that one for it; add it to the maps you package), its own **Monsters** (classes and counts, spawned where the map's monsters stand while those sit the mission out; Last Night does this) and its own **Modifiers** (stat changes for that mode only; Lockdown does this). **The rhythm of the hunt.** **Monster Pacing** on the rules says how the pressure changes during a mission: | Pacing | What the monsters do | Used by | |---|---|---| | **Constant** | The same from start to end | Scrap Run, Dead Air | | **Escalating** | Faster by **Escalation Per Step** (8%) for every device started, lever found or custom step, with a roar each time | Escape, Lockdown, Lights On | | **Bursts** | Calm for **Calm Seconds**: they wander, notice nobody and hit nobody. Then a hunt for **Hunt Seconds**, and calm again. Every HCLamp in the level flickers while a hunt lasts | Haunting (50 s calm, 25 s hunt) | | **Waves** | One monster at the start; the others join one at a time, the last at half time | Last Night, Dead Weight | **Set Hunting** on the game mode starts or ends a hunt from your own graph (a cursed object picked up, a door forced), and the game state's **On Hunt Changed** tells every machine. **Set Passive** does the same for one monster. Two stats change the monsters' senses for a mode or a mutator: **Monster Sight** (flashlights included; times 0 is blind) and **Monster Hearing**. **Monsters Fear Light** makes them stop at the edge of any device that is on and has a **Safe Radius**. **BP_HCDevice** is the thing to switch on: a generator, a fuse box, a terminal. It shows a red light, turns green when started, makes a noise the monster hears (**Start Noise Loudness**) and fires **On Activated** on every machine for your own logic (turn the lights on, open a gate), and **On Device Reset** when a new mission switches it off again. Set **Required Key Id** to make it need a part first: any BP_HCKey with that Key Id, used up like a door key. With a **Custom Objective Id** it counts toward that objective of yours instead of Use Devices. A device is hidden in modes that have no objective for it. **Active Seconds** makes it break down after a while, **Active Seconds Variation** so nobody can time it, and **Breakdown Noise Loudness** calls the monsters when it does; it only counts the first time, and the restart needs no part. **Show When On** and **Hide When On** are the lights it powers, as on a switch. **Safe Radius** turns it into a floodlight: on, its lamp lights that far. **Code panels.** **BP_HCCodeDisplay** is a screen with a number from 1 to **Options**, and **BP_HCCodeLever** a lever with a **Number** and the **Display** it answers (pick the screen in the level). Put the levers far from their screen. The right lever moves the Custom objective named in the screen's **Custom Objective Id** ("Codes"); a wrong one makes a noise of **Wrong Noise Loudness**, sends every monster there and changes the number. **Change Seconds** changes it on a clock as well. Both are hidden in modes without that objective. **Something to carry out.** A scrap type (**HCScrapType**) with an **Objective Id** moves that Custom objective when it is banked at the zone, and **Two Handed** stops whoever carries it from running or using the flashlight. DA_Scrap_Core in `/Horrorcraft/Modes` is the example. Place it with an **HCLootSpawn**: Types with just that asset, Spawn Chance 1, **Only With Objective** on, Required Objective **Custom** and its id in **Required Custom Id**. **Investigation.** Rules with an Identify objective pick one of their **Entity Types** in secret each round. An entity type (Data Asset **HCEntityType**) is a name and the evidence it leaves: freezing cold, signal spikes, voices on tape. Three tools read them, one each (**BP_HCTool_Thermometer**, **BP_HCTool_SignalMeter**, **BP_HCTool_Recorder**): a tool shows its reading on the HUD while held, and logs the evidence for the team when held within **Evidence Range** (12 m) of a monster, if this round's entity leaves that kind. Tools are carried like scrap, are worth nothing and stay in the bag at the extraction zone. The shop key opens the **journal** during the mission: the evidence so far and a button per entity. The four that come with the plugin are told apart by what is missing as much as by what is found: three leave two kinds each, and the Revenant leaves all three. They hunt differently too: each type has a **Speed Scale** and a **Damage Scale** for the monsters that round (the Shade is quick and hits lightly, the Wraith is slow and hits hard). For more than numbers, read `AHCGameState::Entity` in your own monster. Place tools with an **HCLootSpawn** whose **Only With Objective** is on, so they only appear in modes that use them. **A player as the monster.** Tick **Player Monster** on the rules. From two players up, one of them (a different one each round) drives the map's first monster: same speed, same attack, same stun as the AI's, with the interact key to strike. They win when no survivor is left. The other monsters sit the round out, and with a single player the AI keeps the monster. With **Quota Campaign** ticked the rules run the scrap campaign and the objectives are ignored. ## The run: days, quota and shop This is the **Scrap Run** mode. The run state lives on **BP_HCGameState** (class `AHCGameState`). Each day goes like this: 1. **Lobby.** Doors and the monsters are back where the level placed them, and everyone is alive. The monsters stand still and there is no scrap yet. Players can open the shop. The host presses Enter. 2. **Mission.** Scrap is rolled at the spawn points and the timer runs (**Mission Duration** on BP_HCGameMode, 600 s). When a living player steps into the extraction zone, the scrap they carry is banked: its value counts toward the quota and is added to the team's credits. Keys stay with the player. 3. **Leaving.** Once every living player stands in the zone, a countdown starts (**Departure Delay**, 5 s) and the HUD says so. Anyone stepping out cancels it, so a player can drop scrap off and go back for more. When it runs out the team leaves, and whatever they still carry is banked too. 4. **Results.** The day ends when the team leaves (*Departed*), when time runs out, or when everyone is dead. Scrap left in the facility is lost. The results show each player's banked value today and over the run, and who died (`AHCPlayerState`). The host presses Enter for the next day. **Joining a mission in progress.** **Late Join** on BP_HCGameMode says what happens to someone who arrives after the host started: | Late Join | The newcomer | |---|---| | **Play** (default) | Gets a body at a player start and plays. Doors, devices, objectives and the clock reach them as they are by then, and the monsters are tuned again for the bigger team | | **Watch** | Watches the living until the next day or round | | **Refuse** | Is turned away. The game is closed until its next lobby | Whoever died in this mission and joins again only watches, whatever the setting: leaving is not a second life. A living player who leaves and comes back does get a new body, at full health and with empty hands. On the results screen everyone who arrives watches. The games list shows "in mission" or "in mission, closed" next to the mode and the map (the session's `STATE` setting). Quick play does not look at it, so against a closed game it fails and you are left on the menu. A player who leaves drops what they carried, and the day carries on without them, with the monsters tuned for one player fewer. The quota is checked on the results screen every **Days Per Quota** days (3). If it was met, the next quota is the last one times **Quota Growth** (1.5) and progress starts again from zero. If it was missed, the team is fired and quota, credits, upgrades and days go back to the start. | BP_HCGameState | Default | Meaning | |---|---|---| | Starting Quota | 100 | First quota of a run | | Quota Growth | 1.5 | Each new quota is the last one times this | | Days Per Quota | 3 | Days until the deadline | | Shop Items | 6 items | What the shop sells: Name, Price and a list of stat modifiers | Upgrades apply to the whole team and last for the run. Each is a shop item with stat modifiers (see Making it your own), so these six are only where it starts: | Upgrade | Price | Effect | |---|---|---| | Battery | 80 | Flashlights drain half as fast | | Stamina | 120 | 50% more stamina | | Time | 150 | 180 seconds more per mission | | Lamp | 100 | Flashlights 60% brighter, reaching 40% further | | Boots | 140 | Sprinting is 60% quieter for the monster | | Bag | 200 | A fifth inventory slot | **Saving the run.** The host's run (quota, day, credits, upgrades and each player's scoreboard totals) is saved at the start of every day's lobby (`UHCRunSave`, slot **Run Save Slot** on WBP_HCMainMenu, which passes it to the map). Getting fired deletes the save. While a save exists the main menu shows **Continue run (day N)**. It hosts with the map option `?Continue=1`, in the mode the run was started in, and picks it up where it was. You can read the state from any machine with **Get Game State** cast to HCGameState: Phase, Day, Run Day, Quota, Quota Progress, Extracted Value (today), Credits, Day End, Quota Outcome, **Get Time Remaining** and **Owns Shop Item** (by its index in Shop Items). Bind **On Phase Changed** to react to the phases (Lobby, Mission, Results). ## Players **BP_HCCharacter** (class `AHCCharacter`). **Seeing your own body.** Off by default, and each player's own choice: Settings > Gameplay > **See your own body**. With it on, looking down shows your arms and legs (the head is hidden from its owner and the camera moves forward by **Own Body Camera Forward**). It is a Menucraft custom setting with the Id `ShowOwnBody`, which the plugin adds when the project has none by that Id. To have it on by default, add your own in Project Settings > Plugins > Menucraft > Custom Settings with the same Id and Default 1. | Group | Settings | |---|---| | Movement | Walk Speed 350, Sprint Speed 600, Crouch Speed 180, Sprint Noise Loudness | | Stamina | Max Stamina 100, Stamina Drain 20/s while sprinting, Stamina Regen 12/s | | Flashlight | Max Battery 100, Battery Drain 0.8/s (about two minutes), the Flashlight spot light itself | | Inventory | Inventory Slots 4, Throw Speed, Slowdown Per Kg 1%, Min Speed Factor 0.5, Stamina Drain Per Kg 2% | | Interaction | Interact Range 250 cm | | Health | Max Health 100 | | Voice | Voice Range 25 m, Voice Attenuation, Voice Noise Loudness | - **Crouch** (toggle): you move slower, sit lower behind cover, and footsteps play at **Crouch Step Volume** (Horrorcraft Sounds). Sprinting stands you up. - **Weight.** Each kilogram you carry makes you slower and sprinting more expensive, down to Min Speed Factor. - **Damage** uses the engine's standard path, so **Apply Damage** on a character hurts it. At zero health the character drops everything where it stands and falls as a ragdoll. Its player then spectates a living teammate. - **Revive:** for **Revive Window** seconds (60) a living teammate can aim at the body and press E ("Revive (name)"). The player comes back where they fell with **Revive Health** (30). Set the window to 0 to turn revives off. The **Revive** node does the same from Blueprint (server). - **Voice.** With voice chat on (`bHasVoiceEnabled` in your `DefaultEngine.ini`, and `[Voice] bEnabled`, which the plugin sets), each player is heard from where they stand, fading out by Voice Range. The monster hears anyone who is talking. - **Stats** (shop items, the mode, the difficulty, mutators) are recomputed from the class defaults every time one changes, so put your base values in the Blueprint, not on a character in the level. ### Your own characters Players and monsters show whatever skeletal mesh you put in their Blueprint's **Mesh**. There are two ways to animate it: - **Your Anim Blueprint** (for example the one that came with your character): set it on the Mesh as usual and the **HCLocomotion** component steps aside. - **No Anim Blueprint:** fill the **Locomotion** component with root-motion loops. That means **Idle**, then **Walk**, **Run** and **Crouch** with one loop per direction (Forward, Backward, Left, Right; empty directions use Forward), and **Crouch Idle**. The component plays the loop that matches speed and direction and paces it to the movement. The demo uses Epic's UEFN mannequin and the Game Animation Sample's neutral loops this way. In first person the owner never sees their own body, but it still casts their shadow. **Third person.** The **V** key (IA_View) moves the view to **Third Camera**, a camera on a spring arm (**View Arm**) behind the right shoulder, and the whole body shows. Each player picks for themselves and nothing of it goes over the network. Settings > Gameplay > **Third-person view** is the view a player starts in. Set the distance and the shoulder on View Arm (**Target Arm Length**, **Socket Offset**) in BP_HCCharacter. Interacting follows the crosshair of whichever camera is on. To ship a game with one view only, take IA_View out of IMC_Survivor and leave the setting at the value you want. A player driving the monster (Hunted) stays in first person. If there is no skeletal mesh at all, a plain cylinder stands in. ### The hold pose The arm comes up while the flashlight is lit or there is an item in hand, and both arms for an item with **Two Handed** set. It needs no Anim Blueprint: the **Locomotion** component turns the arm bones over the loop it plays. - **Hold Pose** (on the Locomotion component of BP_HCCharacter) - one entry per stretch of arm: the **Bone**, the next bone down (**Toward**) and the **Direction** it points while holding, in the character's space (X forward, Y right, Z up). As shipped: `upperarm_r` down by the ribs, `lowerarm_r` level and ahead. - **Hold Pose Other Hand** - added for two-handed items. - A skeleton with other bone names sets its own. A mesh without those bones just keeps its loop. - With an Anim Blueprint of your own the component stays out of the way. Read **Get Hold Amount** (0 to 1) from it and do the pose in your graph. ### Cosmetics A cosmetic is a mesh hung on a bone. It changes nothing in the game. A player wears one per slot (Head, Face, Back), picks them in the lobby's **Look** tab, and every machine sees them. The choice is remembered on that player's machine and survives a change of mode. - **HCCosmetic** (Data Asset) - **Display Name**, **Slot**, **Mesh**, **Socket** (a bone or socket of the character's mesh, `head` or `spine_05` as shipped), **Offset** (place and turn on that bone) and **Hidden In First Person**. - **Cosmetics** on BP_HCGameState - the list players pick from. Empty it and the Look tab is gone. - 16 come with the plugin, in `/Horrorcraft/Cosmetics`: four hard hats, a headlamp, a wool cap, a respirator, goggles, a dust mask, a welding visor, a backpack, an air tank, a radio pack, a tool roll, a rope coil and a fuel can. - From a widget of your own: **Wear Cosmetic** on the player controller (None takes the slot off). What a player wears is **Worn** on their player state. - The offsets are for Epic's mannequin. Another skeleton needs its own, and usually other bone names. ## The monster **BP_HCMonster** (class `AHCMonster`), driven by `AHCMonsterController` and the StateTree **ST_Monster**. | Setting | Default | Meaning | |---|---|---| | Patrol Speed | 200 | | | Chase Speed | 450 | Between walk and sprint: sprinting escapes until stamina runs out | | Patrol Radius | 25 m | How far from where it stands it picks patrol points | | Attack Range | 150 cm | | | Attack Damage | 35 | Three hits kill | | Attack Cooldown | 1.5 s | Long enough for a hit player to run | | Light Sight Range | 35 m | A lit flashlight in clear view is seen this far away | | Eye Socket, Eye Material | `head`, M_Glow | Two glowing eyes on the skeletal mesh's socket | What it does: - **Patrol:** walks to random reachable points. - **Investigate:** walks to a noise it heard (sprinting, a thrown item landing, a door creaking, someone talking) or to the place it last saw its target. Hearing reaches 15 m. - **Chase:** follows a player it sees (20 m, 120° view) and hits them. A lit flashlight gives a player away from much farther. - **Doors:** it opens unlocked doors by walking into them. A locked door stops it, so a locked room is safe. Every BP_HCDoor carries a navigation link through its opening (**Passage**), because the navmesh keeps the agent's radius (55 cm) away from walls and an ordinary door is narrower than twice that: without the link, the room behind a door is one no monster can enter. A doorway with no door actor in it needs about 1.6 m of width. - It only moves during the mission. - Monsters walk through each other, so two of them never jam a doorway. Players still bump into them. **BP_HCStalker** is a second monster. It is a child of BP_HCMonster with **Freeze When Watched** on. While any living player looks at it (within **Watch Range**, inside **Watch Angle** of their view, nothing in between) it stands frozen mid-step, and it only moves and attacks when nobody does. It is pale, silent (**Breathes** off) and fast when unseen. Turn the setting on in any monster Blueprint to make your own. **Changing its look:** use BP_HCMonster's Mesh. Any skeletal mesh works, either with its own Anim Blueprint or with no Anim Blueprint and root-motion loops in its **Locomotion** component (see Your own characters). With no mesh it shows a stand-in cylinder. **Stopping it:** nothing kills it, but scrap thrown at it (Q) makes it stagger and stand still for **Hit Stun Seconds** (2.5; 0 turns that off). Scrap thrown elsewhere still lures it to the noise, unless it is already chasing someone. **Its size and the navmesh:** the plugin's `Config/Engine.ini` declares one navigation agent a little wider (radius 55) than the monster's capsule (45). Give a bigger monster a bigger radius there, or it will clip corners it can't fit past. A locked door blocks its paths. A closed one doesn't, because it opens those. **Its attack:** set **Attack Anim** on the monster to an animation of your own and it plays once on every hit, on every machine (no Anim Blueprint needed; with one, drive the attack from there). The demo has no attack animation, so the body lunges at its target instead. Any actor with a Locomotion component can do the same from Blueprint with **Play Once**. **Changing its behaviour:** duplicate ST_Monster and set it as **Behavior** on a Blueprint child of HCMonsterController, then set that as the monster's AI Controller Class. The tasks HC Monster Patrol, Investigate and Chase work in any StateTree run by an HCMonsterController. The controller sends the gameplay events **HC.Monster.Chase** and **HC.Monster.Investigate** when its senses fire, and your Blueprints can do the same with **Chase Target** and **Investigate At** (an alarm that gives a player away, a trap that calls it). The monster's **State** (patrol, investigate, chase) and **Is Stunned** read the same on every machine. A monster placed in a level can have its own speeds and damage in the Details panel: the game mode scales from what each one started with, every mission. ## Fighting back As shipped nothing hurts a monster: players run, hide and throw scrap to stop it for a moment. Weapons are there for the game that wants them, and they are off until the host turns on the **Armed** mutator. A weapon is a scrap type with **Weapon** set. The Attack key (left mouse button, right shoulder on a controller) uses the one in hand. | Scrap type setting | Meaning | |---|---| | Weapon | None, Melee (swung at what is within Reach) or Ranged (fired along the view) | | Damage | Taken from the monster's Max Health on each hit | | Reach | cm. 220 for the pipe, 2500 for the flare gun | | Attack Cooldown | Seconds between attacks | | Stun Seconds | How long a hit stops the monster | | Uses | Attacks before it breaks or runs out, hit or miss. 0 lasts forever | | Attack Noise | How loud an attack is to the monsters | Three come with the plugin, in `/Horrorcraft/Weapons`: **Pipe** (35 damage, 6 uses), **Fire axe** (50 damage, 4 uses) and **Flare gun** (60 damage from up to 25 m, 3 shots). A swing needs the monster roughly in front, a shot has to be aimed, and neither goes through a wall or a shut door. With a weapon in hand the HUD says which key attacks. There is no attack animation: the weapon swings or kicks in the hand and the arm follows (**Swing Raised** and **Swing Struck** on the Locomotion component, next to the hold pose). The extraction zone leaves weapons with whoever carries them, like keys and tools. On the monster: - **Max Health** (100) - damage it takes before going down. 0: weapons only stun it. - **Down Seconds** (40) - how long it stays away. It then comes back where the map placed it, at full health. 0: gone until the next mission. - The **Monster Health** stat scales Max Health from a difficulty, a mutator or a mode. - A monster driven by a player (Hunted) is only stunned. - Events: **On Hurt** and **On Downed** on the monster, **On Attacked** on the character. Progress: **Monster Downed**. **How the Armed mutator brings weapons in.** A loot spawn has **Required Custom Stat**: it only spawns while that custom stat is above 0. The weapon spawns on the two maps ask for `Weapons`, and Armed adds 1 to it. Use the same pair for anything a match option should switch on. ## Loot, keys and doors - **BP_HCLoot** (`AHCLoot`): a scrap item with **Value** and **Weight** (kg). E picks it up into a free slot. A thrown item makes a noise where it first lands, so you can throw one away to pull the monster off someone. - **Scrap types** (`HCScrapType` Data Assets): a name, a mesh, and the value and weight ranges an item rolls from. The plugin has 9 in `/Horrorcraft/Scrap`, from a fuse that weighs nothing to a 20-kg electric motor worth up to 80. The name shows in the pick-up prompt and the slots. - **BP_HCKey** (`AHCKey`): loot worth nothing that opens the door with the same **Key Id**. A door with no Key Id takes any key. The key has to be the item in hand, and using it uses it up. - **BP_HCDoor** (`AHCDoor`): opens and closes with E. Settings are **Open**, **Locked**, **Key Id**, **Open Angle**, **Swing Speed** and **Creak Loudness** (how loud the monster hears it). Each new day puts the door back as placed. - **HCLootSpawn** (`AHCLootSpawn`): a place where loot may appear. Every day, with **Spawn Chance** (0.6), it spawns a **Loot Class** of one of its **Types**, picked at random. With no Types it spawns a plain item whose value and weight come from its own **Value** (15 to 45) and **Weight** (3 to 15 kg) ranges. Place many with a chance below 1 and the layout is different every day. For a key, set Loot Class to BP_HCKey, Spawn Chance 1 and the Key Id. - **HCExtractionZone** (`AHCExtractionZone`): a box where living players bank what they carry. Loot rolled by a spawn point is gone at the end of the day. A BP_HCLoot, key or tool you drag into the level by hand is put back where you placed it every day, also after it was used up or banked. **Fragile scrap:** a type with **Fragile** on loses **Break Loss** (half) of its value each time a throw lands. Dropping it with G is safe. The prompt says "(fragile)". The fragile ones are the pressure gauge and the fuse. **A new kind of scrap:** right-click in the Content Browser > Miscellaneous > Data Asset > **HCScrapType**. Set its Display Name, a Static Mesh with simple collision (it falls under physics when dropped) and its Value and Weight ranges. Then add it to the **Types** of the loot spawns that should roll it. To make anything else usable with E (a lever, a terminal), add an **HCInteractable** component, set its **Prompt** and bind **On Interact**. It fires on the server with the player who used it. The server only lets it through when the player is in range and nothing blocks the line from their eyes to the actor (Visibility channel), so nobody uses things through a wall. The component's **Prompt** and **Enabled** replicate: change them on the server and every player sees it (the actor has to replicate). Before reaching for this, see whether a **BP_HCSwitch** already does what you need. ## Replacing the art Everything you see in the demo is there to be replaced, and none of it is wired into the code. Each piece has one place where it is swapped: | What | Where | What yours needs | |---|---|---| | Players | BP_HCCharacter > **Mesh** | A skeletal mesh, with its Anim Blueprint or loops in **Locomotion**. A head bone named in **Own Body Hidden Bone** | | Monsters | BP_HCMonster, BP_HCStalker > **Mesh** | The same. A bone or socket named in **Eye Socket** for the glowing eyes (or leave them hidden) | | Monster's look | The materials on the monster's **Mesh**, and **Eye Color** | | | Flashlight in hand | BP_HCCharacter > **Flashlight Model** | A static mesh pointing along +Y, pivot in its middle | | Scrap | The **HCScrapType** assets in `/Horrorcraft/Scrap` > **Mesh** | A static mesh with simple collision (it falls under physics) | | Doors | **Leaf Model** on each BP_HCDoor | A leaf that fills your opening, hinge side at the origin | | Devices, switches, code panels | The **Mesh** component of each (set its scale back to 1) | Their status lights take **Off Color** and **On Color** | | Walls, floors, props | They are ordinary static meshes: place your own | | | Colours of the kit | The `MI_Kit_...` instances | | | Lights | Each BP_HCLamp: colour, intensity, radius, mode | | | Retro filter, grain, exposure, fog | The map's Post Process Volume and Exponential Height Fog | | | HUD | Menucraft's theme for fonts and colours; **WBP_HCHUD** for the layout | Widgets named after the ones listed under HUD | | Shop, options, journal, players, games list | The **Screen Class** properties on BP_HCPlayerController and WBP_HCMainMenu | Any Common Activatable Widget | | Words | **DA_HCTexts** | | | Sounds | Project Settings > Game > **Horrorcraft Sounds** | | **The doctor.** After swapping things, play the map and type `HC.Doctor` in the console (the key under Esc). It looks over the map and the classes it uses and logs what is missing, each line with what to do: - no Player Start, no navmesh, a monster standing off the navmesh or with no behaviour; - a character or monster with no mesh, or with a mesh and nothing to animate it; - scrap whose mesh has no simple collision (it would fall through the floor), a loot spawn with no class; - a locked door nothing gives a key for, a code lever with no screen, a screen with fewer levers than numbers; - loot spawns that ask for a custom stat nothing gives (weapons that never appear), weapons on a map where no monster can be hurt, weapons with no Attack key; - cosmetics with no mesh, or on a bone the player's mesh doesn't have, and a hold pose that names bones it doesn't have; - a door the monsters have no path through, and **places where a player is out of every monster's reach**: it walks everywhere a player can get to from the Player Starts and asks, for each spot, whether a monster standing on the navmesh nearby could land a hit. A gap behind a shelf, an alley under 2 m wide, a corner behind a crate set at an angle: each is a free pass, and the finding says where (X, Y) and how many spots; - **a mode the map can't finish**: fewer generators than the mode asks for, no way out, no tools to investigate with. It checks every mode on the game mode's **Modes** list that plays on this map; - sounds left empty, no Texts asset. `ERROR` lines stop the game or make a mode unwinnable. `WARNING` lines work with a stand-in. From a Blueprint, **Check Game** returns the same list. It runs on the host, in the editor and in Development builds. ## Building your own map 1. Set the map's **GameMode Override** to **BP_HCGameMode** (World Settings). 2. Add **Player Start**s, a **Nav Mesh Bounds Volume** covering every floor the monster walks on, and one or more **HCExtractionZone**s. Build the place from the kit (next chapter), or from your own art. 3. Place **BP_HCMonster**, **BP_HCDoor**s and **HCLootSpawn**s. 4. So that Host opens your map, open **WBP_HCMainMenu** (`/Horrorcraft/Blueprints`) and set its **Mission Map**. It is already the menu the project shows (Project Settings > Plugins > Menucraft > Main Menu Class). Its **Title** is your game's name. 5. For generators or valves, place **BP_HCDevice**s. For a menu map of your own, set **Main Menu Map** on BP_HCPlayerController (where Pause > Main Menu goes) and add the map to the ones you package. Map URL options: `?MissionTime=300` sets the mission length, `?AutoStart=1` skips the lobby. ## The industrial kit `/Horrorcraft/Kit` is a set of 26 static meshes to build a plant with, and it is part of the product: use it in your game. The 9 scrap items (`SM_Kit_Scrap_...`) and the flashlight in the player's hand (`SM_Kit_Flashlight`) are in the same folder; those wear `MI_Kit_Prop_...` materials, whose rust stays put on the object when it is carried. Pieces stand on their pivot (floor level, in the middle); walls run along X, are 3 m high and 20 cm thick, and snap on a 4 m grid. | Group | Pieces (`SM_Kit_...`) | |---|---| | Structure | Wall_400, Wall_200, Wall_100, Wall_Door_400 (a 130 cm doorway for BP_HCDoor), Wall_Passage_400 (220 cm, open), Wall_Window_400 (barred), Floor_400, Ceiling_400, Pillar, Beam_400 | | Services | Pipe_400, Pipe_Elbow, Valve, Duct_400, CableTray_400, Grate_200, Railing_200 | | Furniture | Crate, Barrel, Rack, Locker, Table, FuseBox, Generator, Lamp_Cage, Door_Leaf | | Dressing | Pallet, Cone, Wall_Vent, Conduit_300 and Sign_Plate (the three wall ones face +X, pivot in the middle), and three marks a few millimetres thick to lay on the floor with collision off: Decal_Stripe, Decal_Puddle, Decal_Stain | There are no textures. One material, **M_Kit**, makes every surface from a colour, a wear colour and world-space noise (so a wall of ten pieces wears as one wall), with optional warning stripes. Its fourteen instances (`MI_Kit_...`: Concrete, PaintGreen, Hazard, MetalRust, Wood...) are the palette: change a colour there and the whole plant changes, or make an instance of your own. The pieces are simple shapes with their edges chamfered, made to read in the dark under a flashlight. Their collision is the mesh itself, so doorways stay open and the navmesh follows the real shape. Stretching a wall or a beam along its length is fine: the material doesn't stretch with it. - **The retro look.** The two maps draw the picture in big pixels and few colours: **MI_Retro_Medium** (`/Horrorcraft/Visual`) sits in the **Post Process Materials** of each map's Post Process Volume. Remove it there for a clean picture, or swap it for MI_Retro_Light or MI_Retro_Strong. Its three numbers are **Lines** (rows of pixels the picture is redrawn with, whatever the monitor), **Color Steps** and **Dither** (0 as shipped; above 0 it breaks up the colour bands, as noise or, with **Dither Grid** at 1, as a regular pattern). The HUD and the menus are drawn over it, sharp. - **BP_HCLamp** is the light that goes with it: **Mode** Steady, Flicker, Failing or Pulse, a colour, an intensity in candela and a radius. Each machine runs its own flicker. List lamps in a BP_HCSwitch's **Show When On** and a lever turns the lights on for everyone. - **BP_HCDoor** takes a **Leaf Model** (SM_Kit_Door_Leaf). With one set it hides its own cube frame, because Wall_Door_400 already has one. - **BP_HCDevice**: put SM_Kit_Generator or SM_Kit_Valve on its Mesh, in the level, and set the actor's scale back to 1. - **Keep headroom.** The monster is 2.2 m tall. Anything hung lower than about 2.5 m over a walkway (a pipe, a duct) closes the navmesh under it, and a doorway under it stops being a way through. `Tools/make_kit.py` in the repository regenerates the whole kit from a list of boxes and cylinders, if you want to see how a piece is made or add one the same way. The tool is not part of the Fab package. ## Random floors **BP_HCRoomGenerator** lays out a new floor plan every time the map opens. `L_Rooms` is the example: pick **Map: Random floors** on the main menu. - The map the generator sits in is the **start room**: player starts, the extraction zone, and a Nav Mesh Bounds Volume big enough for the whole grid. - Each other room is a level of its own, one grid cell in size (**Cell Size**, 20 m), built around its origin with no outer walls. An **HCRoomType** Data Asset points at it and says how often it comes up (**Weight**), how many a plan must have and may have (**Min Count**, **Max Count**) and whether it belongs far from the start (**Far From Start**: where the monsters wait). - The generator grows **Room Count** rooms off the start room so every one is reachable, adds a few extra doorways (**Extra Door Chance**) for loops, loads the room levels and builds the walls between them from **Wall Mesh**, **Passage Mesh** and **Pillar Mesh**. A doorway opens in the middle of a side. - The server picks a seed and every machine builds the same plan from it. **Fixed Seed** pins one plan. The plan lasts the session: a new day plays the same floors with new loot. - The host can't start the mission until every room has loaded. **A room of your own.** Make a level, build a 20 x 20 m room around the origin (a floor, a ceiling, what is inside: loot spawns, lamps, props, a generator, a monster), keep the middle 3 m of each side clear, save it, make an HCRoomType for it and add that to the generator's **Room Types**. Add the level's folder to the folders you always cook. Six come with the plugin, in `/Horrorcraft/Rooms`: Storage, Machine room (a generator and a valve, at least three per plan), Office, Pump hall, Den (the hunter) and Nest (the stalker). **Maps on the menu.** **Maps** on WBP_HCMainMenu is what the Map button cycles through (Facility, Random floors). A mode with a Map of its own ignores the choice. ## Sounds Every sound is listed in Project Settings > Game > **Horrorcraft Sounds**. Leave one empty to silence it. - **Events:** Footstep, Door Open, Door Close, Door Locked, Door Unlock, Flashlight, Pickup, Impact, Monster Roar (starts a chase), Monster Attack, Player Hurt, Player Death, Mission Over. They play in 3D where they happen, on every machine, with **Attenuation** (or a built-in 3 m to 30 m falloff). Mission Over plays in 2D. - **Loops:** Monster Breath (on the monster, all the time), Heartbeat (the local player, louder and faster within **Heartbeat Range**), Ambience (2D, at **Ambience Volume**). Use looping sounds. - **Step Length:** distance per footstep, for players and the monster. - **Footsteps By Surface:** a step sound per floor type. The floor's physical material picks the sound, and floors without one play **Footstep**. The demo has concrete (the default), Wood, Metal and Dirt, defined in Project Settings > Physics > **Physical Surface** (the plugin's `Config/Engine.ini`, `[/Script/Engine.PhysicsSettings]`). On a mesh with simple collision, like the engine cube, set the physical material as the component's **Phys Material Override**. A render material's Physical Material only counts for complex collision. The included sounds are Sound Cues in `/Horrorcraft/Audio`. Cues with several takes pick one at random. To add a take, open the cue and add a Wave Player to its Random node. Every sound is loaded when the player's controller starts, so none has to load at the moment it plays. ## HUD **HCHUD** puts **HCHUDWidget** on screen. Top left is one block: the run (day, quota, deadline, credits, or the mode and the round) and the clock in small type, what to do now under them, then the mode's objectives as a checklist. Bottom left are three thin bars with no labels: health in red, stamina pale, battery yellow. Bottom centre is a box per inventory slot, outlined when it is the one in hand and lit when it holds something, with the name and value of what is in hand and the weight carried next to them. A dot and the **[E]** prompt sit in the middle. "Watching (name)" shows while spectating. It uses Menucraft's theme fonts and colours. The shop key (**B**) opens a panel of rows: a name on the left, a price or a state on the right and a quieter line under it saying what it does. In the Scrap Run it has two tabs for the host, **Shop** and **Match options**. A shop item's second line is its **Description** on BP_HCGameState. Two lines tell new players what to do: - **Objective** (top left, the brighter line): start the day, find scrap and bring it back to the green zone, how much you carry, hurry when a minute is left, the next day. - **Hints** (first day of a run only, one at a time, each shown once): the quota and the shop in the lobby; the goal when the mission starts; that the monster can't be fought (run, lock a door, throw scrap) when it first comes near; carrying and throwing; that a locked door needs its key; low battery; what happens after dying. Turn them off with **Show Hints** on WBP_HCHUD. Both show the keyboard key bound to each action, so they follow remapping. A controller player sees the keyboard key too. The wording of every line is in **DA_HCTexts** (see Making it your own). It ships in English: the menus are translated (Menucraft, 11 languages), the game text is yours to translate. **Your own HUD:** open **WBP_HCHUD**, the Widget Blueprint the game already uses (BP_HCHUD shows it, and BP_HCGameMode's HUD Class is BP_HCHUD). Its designer is empty, and while it is empty the C++ parent builds the layout described above. Add widgets to design your own, named after these (all optional, leave out what you don't want): `RunText`, `PhaseText`, `TimeText`, `HealthBar`, `StaminaBar`, `BatteryBar`, `SurvivorPanel` (hidden while spectating), `SlotsText`, `SlotBox` (a Horizontal Box that gets a box per slot; without it Slots Text lists the whole bag), `PromptText`, `SpectateText`, `Crosshair`, `ObjectiveText`, `HintText`, `ScoreText` (the results scoreboard) and `DamageFlash` (a full-screen image that flashes when hurt). They update every frame. ## Input `/Horrorcraft/Input` holds the actions (`IA_`), three mapping contexts and **DA_HCInput**, a Data Asset that lists them all. The character and the player controller read DA_HCInput through their **Input Config** property. - **IMC_Survivor:** active while alive. - **IMC_Player:** always on: pause, ready, shop. - **IMC_Spectator:** while spectating. Default keys are set in the contexts. Players change them in Settings > Controls, because IMC_Survivor and IMC_Player are listed in Project Settings > Plugins > Menucraft > **Remappable Contexts**. ## Menus and online The main menu, pause menu, settings screen, confirm dialogs and loading screen come from **Menucraft**. Its manual ships with the plugin, in `Docs/Menucraft.md` ([online](https://apps.tessaroapps.com/menucraft/docs/)): themes, the settings screen, your own settings, the loading screen, languages. Horrorcraft adds its main menu (**HCMainMenuScreen**: Continue run, Mode, Map, Quick play, Host, Join, Settings, Quit), the games list, the shop, the journal, the match options and the players' list. The main menu takes its look from the Menucraft theme; its **Title** is a property on WBP_HCMainMenu and its buttons are made in C++. Pause > Main Menu leaves the session and opens the **Main Menu Map** set on BP_HCPlayerController (`L_MainMenu`). Hosting and joining go through **Lobbycraft**, which picks the online platform from the project's config. That is Null (LAN) as shipped, or Steam or EOS (next section). As shipped the game is a listen server: the host plays, and only the host can start the mission and move to the next day. It also runs as a dedicated server (see below). Lobbycraft's manual is in `Docs/Lobbycraft.md` ([online](https://lobbycraft.tessaroapps.com/)): invites and friends, achievements, stats, cloud saves, a server list, and the Doctor that checks your online config. What the game does with it: - **Join** opens the **games list** (HCGamesScreen): every game found with its host, mode, map, seats and ping, and Join on each row. To replace it, set **Games Screen Class** on WBP_HCMainMenu. A game tells the list its mode and map through the session's settings (`MODE`, `MAP`), and the mode follows when the host changes it in the lobby. - **Quick play** joins the fullest game with a free seat, and hosts the mode on the Mode button when there is none. - In the lobby the shop key has a **Players** tab (HCPlayersScreen, **Players Screen Class** on BP_HCPlayerController): everyone with their ready state. Your own row switches yours, and so does **Enter** for anyone who is not the host. The host's click on another player removes them from the game. **Invite friends** opens the store's overlay (only there with Steam or EOS). Under it, the **chat**: type and press Enter. The last lines also show on the HUD for ten seconds. - **Require All Ready** on BP_HCGameState makes the host wait: Enter does nothing until every player is ready, and the HUD tells each side what it is waiting for. Off as shipped. Ready states start again each day. - An accepted invite, or "Join game" on a friend, leaves the current game and joins the other one. That is Lobbycraft's doing. See its manual to ask the player first. - Changing the mode from the lobby is a **seamless travel**, so the clients stay connected through it. Steam's and EOS's connections don't survive the other kind. **Progress outside the match.** **DA_HCProgress** (set as **Progress** on BP_HCGameState) is a list of rules: when this happens, unlock that achievement, add to that stat, send that score. Each player's own machine applies them through Lobbycraft on the store the game runs under. With no store they do nothing. | When | Who gets it | The amount | |---|---|---| | Round Won, Round Lost | Everyone | Seconds left | | Quota Met, Fired | Everyone | The quota; the day the run reached | | Scrap Banked | Whoever carried it | Its value | | Player Died, Player Revived | That player; the one who revived | | | Entity Named Right | Everyone, at the end of the round | | A rule can be limited to one mode (**Only In Mode**), which is how the examples keep a leaderboard per mode. The names in the asset (`HC_FIRST_WIN`, `HC_SCRAP_BANKED`, `HC_ESCAPE_TIME_LEFT`...) are examples: create achievements, stats and leaderboards with those names in Steamworks or the EOS portal, or put your own names in. For an event of your own, call **Report Progress** on the game mode. **On Progress** on BP_HCPlayerController fires on the player's machine for every event, rules or not. **The campaign's save in the cloud.** With **Cloud Save** on (BP_HCGameMode and WBP_HCMainMenu, on as shipped) the run is also copied to the store's cloud each time it is saved, and a main menu that finds no run on this machine looks for one there and brings it down. A local save always wins: the cloud is only asked when there is none. All of it is Lobbycraft's waiting room and session nodes shown the Horrorcraft way, and nothing here is out of your reach from a Blueprint. The voice in the game stays Horrorcraft's own (it fades with distance and the monsters hear it). Lobbycraft's room-wide voice channel is left off. ## Dedicated server Horrorcraft runs with nobody hosting. There is no host to press Enter then, so one player **runs the match**: the game state's **Leader**. On a listen server that is always the host. On a dedicated server it is the first player in, and when they leave it passes to whoever has been there longest. A mode change keeps the same leader. The leader does everything the host does, from their own machine: starts the mission, moves on from the results, sets difficulty, mutators and mode, and removes players. **Is Host** on the player controller is true for them, the HUD shows them the host's prompts, and the players list marks them. The server refuses all of it from anyone else. If you build your own screens, the calls are on the player controller: **Advance Match**, **Cycle Difficulty**, **Toggle Mutator**, **Change Mode**, **Remove Player**. The lists to show come from the game state (**Mode Choices**, **Difficulty Choices**, **Mutator Choices**). When the last player leaves in the middle of a mission the server opens the map again, so the next one to arrive finds a lobby. **Trying it without building anything.** The editor can play the part of the server: ``` UnrealEditor.exe YourProject.uproject /Horrorcraft/Maps/L_Demo?Rules=/Horrorcraft/Modes/DA_Mode_Escape.DA_Mode_Escape -server -log -port=7777 UnrealEditor.exe YourProject.uproject 127.0.0.1:7777 -game ``` **A real server executable** needs an engine built from source (Epic's launcher engine can't build one) and a `YourProjectServer.Target.cs` with `Type = TargetType.Server`. That is Unreal's rule, not Horrorcraft's. Lobbycraft registers the server's session by itself when it starts (`[Lobbycraft] bAutoRegisterDedicatedServer`, `DedicatedMaxPlayers`; `-lan` for a LAN game), and the games list on the menu asks for dedicated servers as well as hosted games. **Your own actors on a dedicated server.** A server does not load a component that renders and collides with nothing: text, an icon, a mesh with collision off. On an actor placed in a map, the variable that pointed at it is null there. Check before using one in code that the server runs, and if such a component is the actor's root, set its **Always Load on Server**, or the actor has no position on the server. Horrorcraft's own loot spawns and room markers had exactly this. Tested: a cooked server executable built on a source 5.6.0 engine, with two clients (leader, options, start, loot places, hand-over, empty server), and the same with the editor as the server on 5.8. Not tested: a dedicated server through Steam or EOS, and changing mode on one. On 5.6.0 exactly, Unreal's **Set State Tree** stops a packaged game when the component has no tree yet (fixed in later 5.6 releases). The monster's controller uses its own component (HCMonsterTreeComponent) to go around that. If you give trees to components of your own on that version, do the same. ## Playing online: Steam and EOS As shipped the project uses the **Null** subsystem. Host and Join work on a LAN and in Play In Editor, with no account. To play over the internet, switch to Steam (or EOS). The game code stays the same. Only the config changes. ### Steam 1. **Plugins.** Edit > Plugins: enable **Online Subsystem Steam** and **Steam Sockets**. Restart the editor. 2. **Config.** In your project's `Config/DefaultEngine.ini`, replace the `[OnlineSubsystem]` section with these (keep `bHasVoiceEnabled=true` and the `[Voice]` section for proximity voice): ```ini [/Script/Engine.GameEngine] !NetDriverDefinitions=ClearArray +NetDriverDefinitions=(DefName="GameNetDriver",DriverClassName="/Script/SteamSockets.SteamSocketsNetDriver",DriverClassNameFallback="/Script/OnlineSubsystemUtils.IpNetDriver") [OnlineSubsystem] DefaultPlatformService=Steam bHasVoiceEnabled=true [OnlineSubsystemSteam] bEnabled=true ; 480 (Spacewar, Valve's test app) while developing; your own App ID when you ship. SteamDevAppId=480 bInitServerOnClient=true [/Script/SteamSockets.SteamSocketsNetDriver] NetConnectionClassName="/Script/SteamSockets.SteamSocketsNetConnection" ``` Since 5.6 the old `SteamNetDriver` entries no longer load (the driver moved). A project that still lists them silently falls back to plain IP, so lobbies are found but joining fails. Use the Steam Sockets driver above. 3. **Run it outside the editor.** Steam needs the Steam client running and signed in. Use **Standalone Game** or a packaged build (Development is fine). The `steam_appid.txt` file is written next to the executable for you. 4. **Test with two accounts on two machines.** Steam never shows you your own lobby, so you can't test joining on one PC. A second PC works, and so does a virtual machine with a second Steam account. 5. **Same build on both.** Steam drops lobbies from a different build of the game ("Removed incompatible build" in the log), so host and client must run the same package. Lobbies carry a Lobbycraft tag, so on the shared 480 app you only see games made with it, not everyone else's test lobbies. That tag is the same for every Lobbycraft game: your own App ID is what keeps other games out. When you ship, put it in `SteamDevAppId` (and the depots in Steamworks) and keep the rest. ### EOS (Epic Online Services) 1. Enable **Online Subsystem EOS** and **Socket Subsystem EOS** in Edit > Plugins. You need the socket plugin because an EOS lobby announces its host by an EOS peer-to-peer address, so the game has to use the EOS net driver. 2. In the Epic Developer Portal, create a product with a client (policy: Peer2Peer) and note its **Artifact**, Product, Sandbox, Deployment and Client IDs. Enter them in Project Settings > Plugins > **Epic Online Services** as an Artifact. Keep the client secret out of source control (`Config/Windows/WindowsEngine.ini` is a good place). 3. In your project's `Config/DefaultEngine.ini`: ```ini [/Script/Engine.GameEngine] !NetDriverDefinitions=ClearArray +NetDriverDefinitions=(DefName="GameNetDriver",DriverClassName="/Script/SocketSubsystemEOS.NetDriverEOS",DriverClassNameFallback="/Script/OnlineSubsystemUtils.IpNetDriver") [OnlineSubsystem] DefaultPlatformService=EOS bHasVoiceEnabled=true [OnlineSubsystemEOS] bEnabled=true [/Script/OnlineSubsystemEOS.EOSSettings] DefaultArtifactName=<your artifact name> bUseEOSConnect=True ``` 4. Players sign in through the Epic launcher (`-AUTH_TYPE=` on the command line it passes). To run EOS beside Steam with Steam sign-in, set `NativePlatformService=Steam` under `[OnlineSubsystem]` and add Steam as an identity provider in the portal. That needs your own Steam App ID, because the 480 test app doesn't issue the ticket EOS asks for. **What was verified, and where.** Lobbycraft, the online layer Horrorcraft uses, was tested between two machines. Steam lobbies were created, found and joined on 5.6, 5.7 and 5.8. EOS lobbies were created and found on 5.8 (joining from a second Epic account is not tested yet). Horrorcraft's own automated tests run on LAN (Null): on 5.8 in the editor and in a packaged build, on 5.6 and 5.7 in the editor only, with the stand-in characters (the Epic mannequin in the demo is a 5.8 asset). Voice: the path from a talking player to the monster is automated; how the voice fades with distance has not been checked with real microphones on two machines yet. ## Blueprint reference | Blueprint | Class | What to tune there | |---|---|---| | BP_HCGameMode | `AHCGameMode` | Mission Duration, Departure Delay, Auto Start, Rules, Difficulties, Mutators, pawn, game state, HUD, controller | | BP_HCPlayerController | `AHCPlayerController` | Input Config (pause, ready, shop, spectator keys), the three Screens, Main Menu Map | | BP_HCHUD | `AHCHUD` | Widget Class (WBP_HCHUD) | | WBP_HCHUD | `UHCHUDWidget` | Show Hints, Hint Seconds, and the HUD layout once you design one | | WBP_HCMainMenu | `UHCMainMenuScreen` | Title, Buttons, Texts, Maps, Modes, Mission Map, Max Players, Run Save Slot | | BP_HCGameState | `AHCGameState` | Starting Quota, Quota Growth, Days Per Quota, Shop Items, Texts | | BP_HCCharacter | `AHCCharacter` | Speeds, stamina, flashlight (and the Flashlight Model in hand), inventory, health, voice, Input Config | | BP_HCMonster | `AHCMonster` | Mesh and animation, speeds, attack, senses (sight, hearing, flashlights), Eye Color | | BP_HCStalker | `AHCMonster` (child of BP_HCMonster) | The same, with Freeze When Watched on | | BP_HCDoor | `AHCDoor` | Leaf Model, angle, speed, creak loudness (per instance: Open, Locked, Key Id) | | BP_HCLoot, BP_HCKey | `AHCLoot`, `AHCKey` | Mesh, Value, Weight, landing noise | | BP_HCDevice | `AHCDevice` | Mesh, Device Name, Required Key Id, Custom Objective Id, Start Noise Loudness | | BP_HCSwitch | `AHCSwitch` | Mesh, prompts, On and Off Actions, Show and Hide When On, Required Key Id (per instance) | | BP_HCTrigger | `AHCTrigger` | The box, Actions, Once Per Mission, Cooldown (per instance) | | BP_HCLamp | `AHCLamp` | Mode, Color, Intensity, Radius, Speed, Bulb Glow | | BP_HCRoomGenerator | `AHCRoomGenerator` | Room Types, Room Count, Cell Size, Grid Radius, the wall meshes, Fixed Seed | | DA_Room_* | `UHCRoomType` | Level, Weight, Min Count, Max Count, Far From Start | | DA_HCTexts | `UHCTexts` | Every line of text the game shows | | DA_Mode_* | `UHCModeRules` | Name, objectives, mission length, Map, Monsters, Modifiers, solo scaling, Player Monster, Entity Types | | DA_Entity_* | `UHCEntityType` | Name, the evidence it leaves, Speed Scale, Damage Scale | | DA_Evidence_* | `UHCEvidenceType` | Name, the tool readings | | DA_Difficulty_*, DA_Mutator_* | `UHCMutator` | Name, description, stat modifiers | | BP_HCTool_* | `AHCTool` | Detects, Item Name, mesh | Nodes (the ones marked server only act there): | Node | On | Does | |---|---|---| | Start Mission, End Day (How), Next Day | HCGameMode (server) | Move the match along | | Add Custom Objective Progress, Add Objective Progress | HCGameMode (server) | Move an objective forward | | Name Entity (Guess Entity on the game mode) | HCPlayerController / HCGameMode | The team's answer to an Identify objective | | Cycle Difficulty, Toggle Mutator | HCGameMode (server) | The host's match options | | Change Mode | HCGameMode (server) | In the lobby: opens the map again in another mode, clients included | | Get Monsters In Play | HCGameMode (server) | The monsters hunting this mission | | Buy Shop Item | HCPlayerController | Buys for the team, from any machine | | Get Stat, Get Custom Stat | HCGameState | A number after shop items, mode, difficulty and mutators | | Owns Shop Item, Is Campaign, Is Objective Done, Are Tasks Done, Has Evidence | HCGameState | State, on any machine | | Get Time Remaining, Get Time To Departure | HCGameState | Seconds left in the mission, and until the team leaves | | Add Credits, Grant Shop Item | HCGameState (server) | Rewards | | Play Sound For Everyone | HCGameState (server) | One of the Horrorcraft Sounds, on every machine | | On Phase Changed, On Objectives Changed, On Evidence Changed, On Credits Changed, On Stats Changed | HCGameState | Dispatchers, on every machine | | Has Objective | HCModeRules | Whether a mode asks for that kind of objective | | Set Flashlight On | HCCharacter | Switches the flashlight (refused on an empty battery) | | Select Slot, Release Held (Throw) | HCCharacter | Inventory, from the owning player or the server | | Get Held, Carried Weight, Carried Count, Is Alive | HCCharacter | State | | Give Item, Add To Inventory, Take Held Item | HCCharacter (server) | Put an item in the bag, take the held one out | | Interact With, Find Interactable | HCCharacter | Use something (server); what the player aims at (local) | | Die, Revive | HCCharacter (server) | Kill a player, bring one back | | Consume | HCLoot (server) | Uses the item up | | Stun, Is Stunned, Set Dormant, Set Speed Scale, Try Attack | HCMonster (server, Is Stunned anywhere) | The monster's body | | Set Passive, Is Passive, Set Sense Scale | HCMonster (server) | Calm or hunting; how far it sees and hears | | Set Hunting | HCGameMode (server) | Starts or ends a hunt for every monster | | Try Code | HCCodeDisplay (server) | A lever of that screen was pulled | | Has Hands Full | HCCharacter | Carrying something two-handed | | Chase Target, Investigate At, Set State | HCMonsterController (server) | The monster's mind | | Set Open (Open, Opener), Set Locked | HCDoor (server) | Opens, closes, locks or unlocks a door | | Run Actions | anywhere (server) | Makes a list of switch/trigger actions happen | | Set On | HCSwitch (server) | Switches it, running its actions | | Play Sound Asset For Everyone | HCGameState (server) | Any sound of yours, on every machine | | Host Game, Join Game, Continue Run, Cycle Mode | HCMainMenuScreen | The menu's buttons, for a menu of your own design | | Play Once | HCLocomotion component | Plays an animation once over the loops | | Wear Cosmetic | HCPlayerController | Puts a cosmetic on this player and remembers it | | Attack | HCCharacter | Swings or fires the weapon in hand | | Hurt By, Is Down | HCMonster (server) | A weapon hit, and whether it is down | | Set Holding, Get Hold Amount | HCLocomotion component | The hold pose | | Stop Using | HCCharacter (server) | Lets go of what the player holds the key on | | Reset Use | HCInteractable component (server) | Back to no progress and nobody on it | | Is Host | HCPlayerController | True for the player who runs the match: the host, or the leader on a dedicated server | | Advance Match, Cycle Difficulty, Toggle Mutator, Change Mode, Remove Player | HCPlayerController | What the leader does, from any machine | ## C++ reference The plugin has six modules: `Horrorcraft` (the game), `Menucraft` and `MenucraftLoading` (menus, loading screen), `Lobbycraft` and `LobbycraftEditor` (sessions, the Doctor). Everything below is in `Horrorcraft`: every class has the prefix `HC` and logs to `LogHorrorcraft`. - `AHCGameMode`: the match flow on the server (`StartMission`, `ExtractFrom`, `EndDay`, `NextDay`, `Buy`, objectives, monsters in play, match options). - `AHCGameState`: replicated match state, `GetStat`, the dispatchers. `PlaySoundAll` plays an `EHCSound` everywhere. - `UHCModeRules`, `UHCMutator`, `UHCEntityType`, `UHCEvidenceType` (`HCModeRules.h`) and `UHCScrapType`: the data. - `AHCCharacter`, `AHCPlayerController` (spectating, shop and journal RPCs, the screens), `AHCPlayerState` (scoreboard), `AHCHUD` and `UHCHUDWidget`. - `AHCMonster`, `AHCMonsterController` (senses), `HCMonsterTasks.h` (StateTree tasks), `UHCLocomotionComponent`. - `AHCLoot`, `AHCKey`, `AHCTool`, `AHCLootSpawn`, `AHCDoor`, `AHCDevice`, `AHCExtractionZone`, `UHCInteractableComponent`. - `AHCSwitch`, `AHCTrigger`, `FHCAction` and `UHCActionLibrary` (`HCActions.h`): the no-graph actions. `UHCTexts`: the wording. - `AHCRoomGenerator` and `UHCRoomType` (`HCRooms.h`): random floors. `AHCLamp`: the lights. - `UHCShopScreen`, `UHCJournalScreen`, `UHCMatchOptionsScreen` (`HCShop.h`), `UHCMainMenuScreen`. - `UHCRunSave`: the saved run. `UHCSoundSettings`: the sounds page, with `PlayLocal` and `TickFootsteps`. - `UHCInputConfig`: the input Data Asset. ## Map URL options and test commands | Option | Does | |---|---| | `?MissionTime=<seconds>` (map URL) | Mission length for this map | | `?AutoStart=1` (map URL) | Starts the mission as soon as the map opens | | `?Continue=1` (map URL) | Loads the saved run (what the main menu's Continue does) | | `?Rules=<asset path>` (map URL) | Plays that mode, e.g. `?Rules=/Horrorcraft/Modes/DA_Mode_Escape.DA_Mode_Escape` | | `?SaveSlot=<name>` (map URL) | Saves and loads the run in another slot (the tests use their own) | Builds that are not Shipping also register the test commands the automated checks use (`HC.LoopProbe`, `HC.ClientWatch`, `HC.NavCheck`, `HC.ModeCheck`, `HC.HuntCheck`, `HC.OptionsCheck`, `HC.ActionsCheck`, `HC.RoomsCheck`, `HC.SaveCheck`, `HC.LateCheck`, `HC.DedicatedCheck`, `HC.DoorCheck`, `HC.DoctorCheck`, `HC.MenuClick`, `HC.InputCheck`, `HC.Shots`). The script that starts the processes and reads the verdicts is not part of the package, so on their own they are of little use. They are not in a Shipping build. ## Troubleshooting - **The monster doesn't move:** it only moves during the mission (press Enter), and it needs a Nav Mesh Bounds Volume over the floor. Press P in the editor viewport to see the navmesh. It is built at runtime so moved doors and props re-path. - **Enter does nothing:** only the host starts the mission (on a dedicated server, the leader). In Play In Editor with several players, the first window is the host. With **Require All Ready** on, everyone has to be ready first. - **No sound in a packaged build:** the sounds are only referenced from Project Settings, so `/Horrorcraft/Audio` has to be in Project Settings > Packaging > **Directories to Always Cook** (the plugin's `Config/Game.ini` already lists it). - **Players hear each other everywhere, or not at all:** voice chat needs `bHasVoiceEnabled=true` under `[OnlineSubsystem]` and `bEnabled=true` under `[Voice]` (the plugin sets that one). Voice Range sets where it fades out. ## Versions and platforms Unreal Engine 5.8, Win64. First and third person, listen server (the host plays) or dedicated server, 1 to 4 players. The automated tests (126 checks) run on a listen server with a client in separate processes, **in the editor and in a packaged Development build**. They cover a whole day (doors, keys, loot, throwing, the monster finding a player by their flashlight and killing them, spectating, revive, extraction), the shop, the next day, a met quota and a missed one, time running out, saving and continuing a run, and joining through the session menus. Each other mode is played through a round to its win (and Haunting to a loss on a wrong name). Hunted is played with two players, each driving the monster, and the driver leaving. The host's match options are set through their screen, and a switch and a trigger are checked to do what their actions say. On the random-floors map a server and a client are checked to build the same plan, every monster to have a walkable way to the start, and an Escape round to be won on it. Real key presses test the flashlight, walking, crouching, the shop and starting the day. The stalker is checked to hold still while watched and to close in when it isn't. A player joins a mission in progress, dies, comes back and is turned away from a closed game. A dedicated server runs a match led by a client and passes it on. A monster follows a player through a shut door, a crank is turned by holding the key, faster with two players (and a hit makes the player let go), a generator powers its light, breaks down and restarts, the Armed mutator brings weapons in and enough hits take a monster down, cosmetics go on and reach the other machine, and the doctor is run on both maps and on one broken on purpose. For Steam and EOS, see "What was verified" under Playing online. Not covered by an automated check: the Blueprint events reaching a graph, a mode on a map of its own, five of the eight mutators, items placed by hand coming back each day, and anything on two real machines over the internet. The demo art is placeholder for showing the template (see Demo content). ## Demo content Everything in `/Horrorcraft/DemoContent` is there for the demo map and is not part of what is sold. The game runs without it: characters fall back to a stand-in cylinder. - **Characters:** Epic's UEFN mannequin and 14 of its locomotion loops (idle, and walk, run and crouch in four directions), from Epic's free **Game Animation Sample** on Fab. The players and both monsters use it. Put your own character in the Blueprints' Mesh, with your Anim Blueprint or with your loops in the **Locomotion** component (see Your own characters). The facility, the scrap and the flashlight are the plugin's own kit, not demo content. ## Credits Sounds: CC0 recordings from Freesound, listed in `ThirdPartyNotices.txt`. Key and button icons in the menus: "Input Prompts" by Kenney (CC0), listed in `ThirdPartyNotices-Menucraft.txt`. Horrorcraft by Filipe Tessaro, [tessaroapps.com](https://tessaroapps.com). Support: contato@tessaroapps.com