3 ms·
The monster's AI is amusing to read, and its behavior has a surprising amount of depth. Really explains its scary, clever and unpredictable nature. It has over
by tehsauce 6y ago
The monster's AI is amusing to read, and its behavior has a surprising amount of depth. Really explains its scary, clever and unpredictable nature.
It has over 15 different behavior states:
Idle,
GoHome,
Wait,
Patrol,
Investigate,
Alert,
Search,
Eat,
Hurt,
Hunt,
HuntPause,
HuntWander,
AttackMeleeShort,
AttackMeleeLong,
AttackRange,
BreakDoor,
Dead,
Flee,
Stalk,
Track
States:
https://github.com/FrictionalGames/AmnesiaTheDarkDescent/blob/ea45a1e253aa1a50aa89654f56f352dbf13b0e0f/amnesia/src/game/LuxEnemy.h#L206 https://github.com/FrictionalGames/AmnesiaTheDarkDescent/blo...
Implementation:
https://github.com/FrictionalGames/AmnesiaTheDarkDescent/blob/master/amnesia/src/game/LuxEnemy_ManPig.cpp#L282 https://github.com/FrictionalGames/AmnesiaTheDarkDescent/blo...
There's also naming gems like "mindfuckevents"
https://github.com/FrictionalGames/AmnesiaTheDarkDescent/blob/master/amnesia/src/game/LuxEnemy_ManPig.cpp#L204 https://github.com/FrictionalGames/AmnesiaTheDarkDescent/blo...
- zemnmez 6y agoisnt the man pig the enemy from the DLC ‘a machine for pigs’? or is that coincidence
- tleb_ 6y agoAnd the macros used for the implementation are available here: https://github.com/FrictionalGames/AmnesiaTheDarkDescent/blob/ea45a1e253aa1a50aa89654f56f352dbf13b0e0f/amnesia/src/game/LuxEnemy.h#L313 https://github.com/FrictionalGames/AmnesiaTheDarkDescent/blo... Scary stuff.
- MatthiasP 6y agoThe most scary part is the usage of if(0).
- ExcavateGrandMa 6y agoEPIC :Ð
- eska 6y agoThat's common for generated code, though. It makes it so that the other code can always use "else if".
- ibobev 6y agoI'm also amused that such gameplay scripting logic is implemented in C++, but not on some scripting language like Lua or Python.