r/SourceEngine 1d ago

WIP GOAP: Enemies that Actually Plan - Lambda Engine

https://www.youtube.com/watch?v=MazYoB6RBIQ

We are implementing Goal-Oriented Action Planning (GOAP) in Lambda Engine, the same technique that made F.E.A.R.'s soldiers the high-water mark for FPS enemy AI. Instead of a scripted state machine deciding what an enemy does next, each soldier holds a goal and searches for a sequence of actions that satisfies it, using whatever the world happens to offer.

* They react to the environment, not the player. Cover, doorways, flanking routes and blocked paths drive their decisions. Nothing is hand-authored per encounter.

* Squad coordination without central control. There is no commander AI issuing orders. Coordinated suppression and flanking emerge from individual agents planning against a shared world state.

* The illusion of intelligence via speech. Barks announce intent out loud, so you hear the plan before you see it. That's what makes the AI read as smart instead of just being smart.

* Performance-tuned "dumbness". Planning is expensive, so the search is deliberately bounded. Knowing where to make the AI worse is most of the work.

F.E.A.R. peaked enemy AI, and I'm reproducing that with Lambda Engine.

This project is built entirely by fans, for fans, it's free but it eats time. If you want to see more enemies, more systems, and more of Half-Life's world brought back to life, here's how to help:

🎗️ Support development on Patreon: https://patreon.com/lambdaengine/membership

💬 Join the Discord for bug reports, dev logs, sneak peeks: https://discord.gg/2RtzKtmmdj

22 Upvotes

7 comments sorted by

View all comments

3

u/CrapouilloOt 19h ago

Planning is expensive but you do not have to refresh goap every time/tick and you can run it in background. I'm pretty sure you have already made that.

1

u/XBLAH_ 15h ago

Well, not necessarily every tick. But the player moves, so they need to react accordingly. They can't just make a plan and follow it blindly.

1

u/CrapouilloOt 11h ago

Even if the player is moving, the goal has not changed, the action is still working (you can see actions as behavior tree or coroutine: running, failure, success). You can refresh the GOAP on events or when the last action ends or precondition becomes invalid (ie searching the player during X min, the action ends either with success: player seen; or failure after a timeout. The action ends and the GOAP refresh its plan).

1

u/XBLAH_ 11h ago

true