News for hackers. Stuff that matters.
Re:Amnesia is now open source by tehsauce on Wednesday September 23, 2020 @04:47PM (#24571826)
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/blo...

Implementation:

https://github.com/FrictionalGames/AmnesiaTheDarkDescent/blo...

There's also naming gems like "mindfuckevents"

https://github.com/FrictionalGames/AmnesiaTheDarkDescent/blo...

Re:Amnesia is now open source by tleb_ on Thursday September 24, 2020 @04:06AM (#24576429)
And the macros used for the implementation are available here: https://github.com/FrictionalGames/AmnesiaTheDarkDescent/blo...

Scary stuff.

Re:Amnesia is now open source by MatthiasP on Thursday September 24, 2020 @05:53AM (#24576978)
The most scary part is the usage of if(0).
Re:Amnesia is now open source by eska on Saturday September 26, 2020 @10:12AM (#24598995)
That's common for generated code, though. It makes it so that the other code can always use "else if".
Re:Amnesia is now open source by ibobev on Saturday September 26, 2020 @12:06PM (#24599790)
I'm also amused that such gameplay scripting logic is implemented in C++, but not on some scripting language like Lua or Python.
Re:Amnesia is now open source by zemnmez on Wednesday September 23, 2020 @09:40PM (#24574460)
isnt the man pig the enemy from the DLC ‘a machine for pigs’? or is that coincidence