generated from krampus/template-godot4
All checks were successful
linting & formatting / build (push) Successful in 40s
89 lines
5.5 KiB
Markdown
89 lines
5.5 KiB
Markdown
---
|
|
tags:
|
|
- lore
|
|
- mechanics
|
|
---
|
|
A giant fucking ghoulie!!!
|
|
|
|
Summoned when the [[grunk alert]] maxes out. Hunts down the player and grunkifies 'em.
|
|
|
|
"The angriest dog in the world, and he _fucking hates power washing_"
|
|
|
|
Concept: No head, tall spindly legs.
|
|
Visually, I imagine it straining to pull itself out of the grunk.
|
|
|
|
### Behavior
|
|
See [[grunk beast behavior tree.canvas|grunk beast behavior tree]].
|
|
Related to [[grunk alert]].
|
|
|
|
The beast is inactive below alert level 2. When level 2 is reached, the beast [[#Spawning|spawns]] in the vicinity of the player.
|
|
|
|
At a high level, there are broadly three behavior types we want the beast to have:
|
|
- Lurking (unaware of the player, just meandering about)
|
|
- When lurking, the beast randomly wanders between preset lurk points.
|
|
- Tracking (actively looking for the player)
|
|
- When tracking, the beast investigates the latest **point-of-interest** (POI)
|
|
- Pursuit (chasing the player)
|
|
- When in pursuit, the beast directly chases the player.
|
|
|
|
|
|
The beast's behavior while active is controlled by _anger level_.
|
|
#### Anger level
|
|
Each beast maintains an independent _anger level_. This is a number between `0` and `150`.
|
|
|
|
- The beast will slowly relax over time if the player doesn't actively agitate it:
|
|
- Anger decreases by `1` per second
|
|
- Sounds will slightly agitate the beast:
|
|
- A sound in the beast's hearing range increases anger by `10`, up to once per second.
|
|
- If the sound is also in the beast's _provocation range_, increase anger by an additional `30`.
|
|
- Set the POI to the location of the sound.
|
|
- [[alarm|Alarms]] will substantially agitate the beast and furthermore draw it towards the player:
|
|
- When an [[alarm]] is triggered, increase anger by `60`.
|
|
- At alert level 4 or above, increase anger by an additional `60`.
|
|
- Set the POI to the alarm's location.
|
|
- If the beast does not have a path to the player, additionally respawn near the player.
|
|
- Any attempt by the player to fight back against the beast will greatly anger it:
|
|
- If the player touches the beast, increase anger by `35`, up to twice per second (once per 0.5 seconds).
|
|
- If the player shoots the beast with a beam, increase anger by `100`, up to once per four seconds.
|
|
- If the player sticks a sticker on the beast, _decrease_ anger by `60`. #easter-eggs
|
|
- Set the POI to the player's location.
|
|
- The beast should lurk when at low anger:
|
|
- When anger is `<30`: Slowly wander between lurk points
|
|
- The beast should enter tracking mode at medium anger levels:
|
|
- If anger is `>=30` and not in **pursuit mode**:
|
|
1. Pathfind to the POI. (middle speed)
|
|
2. Once there, wander around in a small radius.
|
|
3. (randomly with low probability) Sniff for the player, up to once per six seconds.
|
|
- When the beast sniffs for the player, if the player is within _sniff range_, increase anger by `40` and set the POI to the player's location.
|
|
4. If the POI moves outside _tracking range_, start tracking again from step 1.
|
|
- The beast should pursue the player when it gets angry enough:
|
|
- When _not_ in **pursuit mode** and anger is `>=80`:
|
|
- Increase anger by `20` and enter **pursuit mode**.
|
|
- In **pursuit mode**:
|
|
- Pathfind directly to the player at pursuit speed.
|
|
- Pursuit speed should be faster than the player's walking speed and just slightly slower than the player's running speed. The player can escape if they run fast and don't make any mistakes.
|
|
- If the player is in _grabbing range_, grab the player, up to once per four seconds.
|
|
- Start grab animation. If the player is still in grabbing range at the end of the animation, the player gets grabbed. GAME OVER MAN!!
|
|
- If anger is `>140` and the player is in _pouncing range_, pounce for the player, up to once per four seconds.
|
|
- (ditto with the grab action)
|
|
- If anger is `<80`, stop **pursuit mode**.
|
|
- If the beast does _not_ have a valid path to the player:
|
|
- If the beast does _not_ have line-of-sight to the player, _decrease_ anger by `10` up to once per four seconds.
|
|
- If the beast DOES have line-of-sight to the player, _increase_ anger by 6 per second.
|
|
#### Spawning
|
|
The beast spawns by physically pulling itself out of the ground in a grunky spot.
|
|
|
|
We want the beast to spawn somewhere which would ideally have the following properties:
|
|
- Should be near the player.
|
|
- The player should _see_ the beast spawn.
|
|
- The beast should block the player's easiest escape route.
|
|
|
|
Every area in the map is part of a _spawn zone_. Each _spawn zone_ has a number of _priority spawns_ associated, which are just small patches of the floor. Priority spawns are destroyed if sprayed/toothbrushed; therefore, the beast will only spawn in a place that is still substantially covered in grunk. Additionally, each spawn zone has an indestructible _default spawn_ which will be used if all priority spawns are unavailable.
|
|
|
|
When it's time to spawn a beast, we select a spawn point as follows:
|
|
- Use the highest-priority priority spawn for this zone which the player is currently looking at (currently in frustum and line-of-sight unblocked).
|
|
- If the player is not currently looking at any spawn points in this zone, use the highest priority priority spawn which the player can see (line-of-sight unblocked).
|
|
- If the player cannot see any spawn points for this zone, use the highest-priority priority spawn.
|
|
- If there are no priority spawns for this zone, use the default spawn with the highest priority.
|
|
- If the player is not in a spawn zone or the spawn zone has no default spawns, use a randomly-select map-default spawn.
|
|
- If there are no map-default spawns, log an error and do not spawn a beast. |