惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Google DeepMind News
Google DeepMind News
Microsoft Azure Blog
Microsoft Azure Blog
博客园 - 聂微东
大猫的无限游戏
大猫的无限游戏
IT之家
IT之家
月光博客
月光博客
博客园_首页
Jina AI
Jina AI
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
AWS News Blog
AWS News Blog
S
Securelist
T
Tailwind CSS Blog
C
Cyber Attacks, Cyber Crime and Cyber Security
罗磊的独立博客
D
Docker
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Apple Machine Learning Research
Apple Machine Learning Research
Scott Helme
Scott Helme
H
Help Net Security
Project Zero
Project Zero
P
Proofpoint News Feed
D
DataBreaches.Net
Recorded Future
Recorded Future
Simon Willison's Weblog
Simon Willison's Weblog
V2EX - 技术
V2EX - 技术
The Cloudflare Blog
Hugging Face - Blog
Hugging Face - Blog
I
Intezer
Engineering at Meta
Engineering at Meta
The Register - Security
The Register - Security
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
I
InfoQ
酷 壳 – CoolShell
酷 壳 – CoolShell
雷峰网
雷峰网
S
Secure Thoughts
GbyAI
GbyAI
U
Unit 42
Blog — PlanetScale
Blog — PlanetScale
T
Threat Research - Cisco Blogs
The Last Watchdog
The Last Watchdog
Y
Y Combinator Blog
F
Fortinet All Blogs
博客园 - Franky
T
The Blog of Author Tim Ferriss
Hacker News: Ask HN
Hacker News: Ask HN
Microsoft Security Blog
Microsoft Security Blog
Stack Overflow Blog
Stack Overflow Blog
S
Security @ Cisco Blogs
Cyberwarzone
Cyberwarzone

Hacker News - Newest: "AI"

AI can't read an investor deck AI as an attorney? Student uses ChatGPT, Gemini to sue UW over alleged racial discrimination Hacking MCP Servers in AI Systems – The Rug Pull: Tool Changes After Approval GitHub - MeepCastana/KubeezCut: Free Web based video editor GitHub - GenAI-Gurus/awesome-eu-ai-act: Curated tools, official sources, OSS, templates, and guides for EU AI Act compliance. Can AI judge journalism? A Thiel-backed startup says yes, even if it risks chilling whistleblowers Coming soon: 10 Things That Matter in AI Right Now DARPA built an AI to fact-check enemy weapons claims What explains heterogeneity in AI adoption? When AI Meets Muscle: Context-Aware Electrical Stimulation Promises a New Way to Guide Human Movements - Department of Computer Science AI Changed How We Build. It Did Not Change What Matters. Linux rules on using AI-generated code - Copilot is OK, but humans must take 'full responsibility for the… Meta spins up AI version of Mark Zuckerberg to engage with employees Code Mode: Let Your AI Write Programs, Not Just Call Tools | TanStack Blog GitHub - Delavalom/graft: Go framework for building AI agents. Type-safe tools, multi-provider (OpenAI, Anthropic, Gemini, Bedrock), zero vendor SDKs. India's TCS tops estimates, says new AI models did not dent services demand Gen Z's fading AI hype Strong feeling: we are in a folded AI reality GitHub - machinarii/total-recall-catalog: A reference catalog of latest knowledge retrieval, memory & RAG systems GitHub - mensfeld/code-on-incus: Give each AI agent its own isolated machine with root, Docker, and systemd. Active defense detects and stops threats automatically.. Quantization, LoRA, and the 8% Problem: Benchmarking Local LLMs for Production AI Iran war: We spoke to the man making Lego-style AI videos that experts say are powerful propaganda Powell, Bessent discussed Anthropic's Mythos AI cyber threat with major U.S. banks GitHub - immartian/bellamem: Persistent belief-graph memory for AI agents. Retrieves decisive context by importance — not recency, not RAG, not /compact. recursive-mode: The Repo-Native Operating System for AI Engineering After the attack on Sam Altman's home, will AI CEO's go on the offensive? The biggest advance in AI since the LLM Opus 4.6 vs GPT 5.4 One Prompt Unity World Generation Test “AI polls” are fake polls Client Challenge Can AI be a 'child of God'? Inside Anthropic's meeting with Christian leaders How to Switch AI Chatbots and Why You Might Want To GitHub - MattMessinger1/agentic_refund_guardrail: Safe refund policy layer for AI agents — Python + TypeScript. Same behavior, shared tests. Adam/papers/emergent_values_whitepaper.md at master · strangeadvancedmarketing/Adam Ask HN: How do you stop playing 20 questions with your AI coding tools How far can automation and AI support psychotherapy? - @theU GitHub - stagas/rtdiff: realtime git diff gui and AI-assisted commits A Mac Studio for Local AI — 6 Months Later A History of the Early Years of AI at the University of Edinburgh Why AI Coding Tools Still Feel Stuck on Localhost MSN AI Datacenters Are Becoming Strategic Targets twitter.com Penn Researchers Use AI to Surface Unreported GLP-1 Side Effects in Reddit Posts Show HN: MoodSense AI (ML and FastAPI and Gradio, Deployed on Hugging Face) Moodsense Ai - a Hugging Face Space by aman179102 AI models are terrible at betting on soccer—especially xAI Grok GitHub - xialeistudio/echoic GitHub - HimashaHerath/github-dev-wrapped: AI-powered weekly GitHub activity reports deployed to GitHub Pages GitHub - alejandrobalderas/claude-code-from-source: Architecture, patterns & internals of Anthropic's AI coding agent — reverse-engineered from source maps AI and Tech brief: Ireland ascendant GitHub - Titovilal/context0: Context0 - Never Surrender Training for a Marathon with an AI Coach: What Worked and What Didn't Cyber Pulse: Agentic Intel - Apps on Google Play I Built an AI PR Reviewer That Catches Bugs by Not Looking for Bugs Gen Z workers are so fearful AI will take their job they’re intentionally sabotaging their company’s AI rollout | Fortune How AI Is Reimagining the Game of Golf–For Both Players and Courses GitHub - nattergabriel/reseed: A CLI tool for managing and distributing agent skills across projects Is SVG the final frontier? My AI workflow evolved from prompts to a near-autonomous workflow MLSharp Help - 3DGS Viewer & Generator I put my cognitive field based AI's runtime on GitHub Is Numble the first AI-proof game? A3: Kubernetes for autonomous AI agent fleets | Emergent Principles Deepali Vyas ("The Elite Recruiter") GitHub - msmarkgu/RelayFreeLLM: A restful API designed to route user prompts to various AI model providers. Unionized ProPublica staff are on strike over AI, layoffs, and wages Unleashing the Advantage of Quantum AI We're heading for an AI-fueled 'dementia crisis,' brain scientist warns The AI-Assisted Breach of Mexico's Government Infrastructure [pdf] GitHub - stef41/lmscan: 🔍 Detect AI-generated text and fingerprint which LLM wrote it. Open-source GPTZero alternative. Zero dependencies, works offline. MSN GitHub - visionscaper/collabmem: Enabling long-term collaboration with Agentic AI - building up episodic and world model memory over time with in-context awareness We gave an AI a 3 year retail lease in SF and asked it to make a profit | Andon Labs AI Code is Hollowing Out Open Source, and Maintainers are Looking the Other Way What leaked "SteamGPT" files could mean for the PC gaming platform's use of AI AI is the boss at this retail store. What could go wrong? GitHub - Wuzu11517/agentic-proxy: Local proxy meant to help reduce With Drones, Geophysics and ArtificiaI Intelligence, Researchers Prepare to Do Battle Against Land Mines A Single Operator, Two AI Platforms, Nine Government Agencies: The Full Technical Report 在 Steam 上购买 FriedrichAI: Offline AI 立省 10% GitHub - inevolin/resume-cli: Hit Claude usage limits? Resume any AI coding session elsewhere. Switch tools at zero friction. GitHub - atripati/ark: AI Runtime Kernel — a context operating system for AI agents. Eliminates tool bloat, loads only what’s needed, and gives LLMs their reasoning space back. How to Build a Secure AI PR Reviewer with Claude, GitHub Actions, and JavaScript This Startup Wants You to Pay Up to Talk With AI Versions of Human Experts Intel Arc Pro B70 Brings 32GB VRAM to Local AI for $949 WordPress 7.0: The Good, the AI, and the Still Missing AI on the couch: Anthropic gives Claude 20 hours of psychiatry IatroBench: Pre-Registered Evidence of Iatrogenic Harm from AI Safety Measures AI Agents Know About Supabase. They Don't Always Use It Right. The history and future of AI at Google, with Sundar Pichai Inside an AI‑enabled device code phishing campaign How Meta Used AI to Map Tribal Knowledge in Large-Scale Data Pipelines AI for Systems: Using LLMs to Optimize Database Query Execution Forecasting the Economic Effects of AI Introducing Tinker: Play with AI, bring your ideas to life AI sheds light on an ancient gaming mystery People really hate AI but not as much as Iran—or Democrats | Fortune What is an AI Product Engineer? Phoebe Gates wants her $185 million AI startup to succeed with 'no ties to my privilege or my last name': 'I have a chip on my shoulder' | Fortune
The Low-Tech AI Of Elden Ring
nega.tv via · 2026-06-23 · via Hacker News - Newest: "AI"

FROMSOFT has a reputation for diverse and punishing npc encounters across the entire Soulsborne extended series, but the implementation of the AI decision making itself is perhaps unexpectedly low-tech. Since the majority of the code is implemented in Havok Script (A games-oriented Lua implementation from Havok) it’s pretty easy to take a peek behind the fog wall to see how they’re implemented.

Note that none of what follows is original research, I’m just reading the code that others have done the hard work of extracting, decompiling, and reversing.

Goals

The primary tool of the FROMSOFT AI approach is the Goal1, which is their own terminology for a unique state that the AI can be in. Goals can be parametized when instanciated, and can access data stored on the Actor itself, but are otherwise really just an immutable table of functions.

Now the simplest option would be to organize states into a Finite State Machine or maybe a Hierarchical Finite State Machine, but FROMSOFT go one step further and give the system a stack of states. This turns it from an FSM into Pushdown Automaton (PDA).

That’s an entirely abstract definition, so after you get back from wikipedia let’s talk about it concretely from the top down.

Each frame Actors will update the Goal on top of their stack of Goals. When the Goal updates, it can then push more Goals as Sub-Goals onto the stack, the topmost of which will execute next frame. The Goal’s update function returns a value indicating either Continue, Success, or Failure. Continue will leave the stack unchanged, the other two will cause the Goal to be popped from the stack. Failure will additionally cause all other unexecuted Goals to be popped from the stack up to the parent Goal (The Goal which pushed this sub-goal).

For example, we might define a Goal called CoolBossBattle, during the course of its execution it might then push a series of Attack Sub-Goals. Those attack Goals can be parametized by various means, but the main one is the animation id2.

[ GOAL STACK ]

3: Attack (R2, Combo)           <<<<-- Currently Updating
2: Attack (R2, Repeat)
1: Attack (R2, Finisher)
0: CoolBossBattle

After a few seconds the first attack lands, and that Goal completes with success and is popped from the stack. However the next fails, causing the stack to unwind to its parent.

[ GOAL STACK ]

2: Attack (R2, Repeat)          <<<<-- Failed, will be popped from the stack.
1: Attack (R2, Finisher)        <<<<-- Will be removed as well.
0: CoolBossBattle

Readying it to chose its next action now that the attempted combo of attacks has ended.

[ GOAL STACK ]

2: Attack(L1)
1: Attack(L1)
0: CoolBossBattle               <<<<-- Updating, pushes 1, and 2 for the next frame.

Not too complex3!

In their APIs they refer to the root of this stack as the “Top Level Goal”, which I’ve made confusing by referring to the currently executing goal as the “top” of the stack. So keep in mind those are separate things.

Activate

Goals are defined by a few functions used as callbacks, and the one which contains the most AI logic is usually activate. This is called the first time that a Goal is updated, and then every subsequent time that the Goal exhausts its Sub-Goals and starts executing again.

For boss and regular npc Goals the code in Activate is responsible for choosing the next action that the Actor will take using a mix of context from the world and Actor, and randomness (which also comes from the Actor itself).

The most widely used approach uses common code to perform a weighted random selection between a number of Actions (which are just functions), calling the winner.

To return to our CoolBossBattle, this time in some Rusty pseudocode…

fn action_giga_death_ray(goals: &Goals, actor: &Actor) {
    todo!();
}

fn action_leap_attack(goals: &Goals, actor: &Actor) {
    todo!();
}

fn action_ground_slam(goals: &Goals, actor: &Actor) {
    todo!();
}

fn action_light_attack_combo(goals: &Goals, actor: &Actor) {
    let target_distance = actor.target_distance(Target::Enemy);
    let fate = actor.next_random();

    // ApproachTarget itself being a goal defined in common code!
    if target_distance > 2.0 {
        goals.push_sub_goal(Goal::ApproachTarget, Target::Enemy);
    }

    goals.push_sub_goal(Goal::Attack, AnimId::R1, Combo::Initial);
    goals.push_sub_goal(Goal::Attack, AnimId::R1, Combo::Repeat);

    // Unlucky buster! It's the long combo.
    if fate < 0.2 {
        goals.push_sub_goal(Goal::Attack, AnimId::R1, Combo::Repeat);
    }

    goals.push_sub_goal(Goal::Attack, AnimId::R1, Combo::Finisher);
}

fn action_heavy_attack_combo(goals: &Goals, actor: &Actor) {
    todo!();
}

fn activate(&self, goals: &Goals, actor: &Actor) {
    let target_distance = actor.target_distance(Target::Enemy);

    let mut weights = if target_distance > 6.0 {
        [
            15.0,
            65.0,
            0.0,
            10.0,
            10.0,
        ]
    } else if target_distance > 1.5 {
        [
            0.0,
            0.0,
            5.0,
            60.0,
            35.0,
        ]
    } else {
        [
            0.0,
            0.0,
            20.0,
            40.0,
            40.0,
        ]
    };

    // This doesn't exactly work this way in the Lua code, and these cooldowns
    // don't make sense either, but hopefully it gives the rough idea.
    //
    // The helper function is checking last played data for the animation on the
    // Actor itself, and then modifying the weights before they go into the
    // common battle randomized selection.
    weights[3] = if common::is_cooldown(goals, actor, AnimId::R1, 8.0) { 0.0 } else { weights[3]; };
    weights[4] = if common::is_cooldown(goals, actor, AnimId::R2, 10.0) { 0.0 } else { weights[4]; };

    let actions = [
        action_giga_death_ray,
        action_leap_attack,
        action_ground_slam,
        action_light_attack_combo,
        action_heavy_attack_combo,
    ];

    // Does some common setup for the number of actions and then rolls the dice
    // and chooses which function to call.
    common::battle_activate(goals, actor, weights, actions);
}

Modifying the weights dynamically is handled in many different ways, but the most common are simple rng rolls from the actor and hp thresholding.

Other, simpler, Goals than the top level battle Goal for an Actor may simply push a few sub-goals, perhaps reading some data from the Goal parameters. The nesting means that it’s possible to compose quite complex behavior from simple building blocks.

Interrupts

The other major callback defined for goals is the Interrupt. As the name suggests, this allows Goals to respond immediately to external events which are mostly configured on the Actor itself.

My understanding is that interrupts bubble up, that is, it will run the interrupt on the currently executing Goal and then its parents recursively, until it runs out of Goals or one of the interrupt callbacks returns true to indicate it has consumed the interrupt.

For example, if I wanted CoolBoss to move into a furious rage of attacks as soon as I set it on fire, then I might implement something like the following.

fn interrupt(&self, goals: &Goals, actor: &Actor, interrupt: Interrupt) {
    match interrupt {
        // If I start burning, attack!
        SpecialEffectActivate {
            target,
            special_effect,
        } => {
            if target == Target::Self && special_effect == SpecialEffect::Fire {
                // Since there might still be other things running when
                // interrupt is called we need to unwind so we're on top again.
                goals.clear_sub_goals();

                goals.push_sub_goal(Goal::Attack, AnimId::R1);
                goals.push_sub_goal(Goal::Attack, AnimId::R2);
                goals.push_sub_goal(Goal::Attack, AnimId::R1);
                goals.push_sub_goal(Goal::Attack, AnimId::R2);

                return true;
            }
        }
        // If somebody uses an item they might be in for it.
        UseItem => {
            let fate = actor.next_random();
            if fate < 0.5 {
                goals.clear_sub_goals();
                action_light_attack_combo(goals, actor);
            }
        }
        // Perform a ground slam if I get attacked from underneath.
        Damage {
            target,
        } => {
            if target == Target::Self {
                let distance = actor.target_distance(Target::Enemy);
                let fate = actor.next_random();
                if distance < 1.0 && fate < 0.8 {
                    goals.clear_sub_goals();
                    action_ground_slam(goals, actor);
                }
            }
        }
        _ => {}
    }

    false
}

This is used to implement some truly evil features, for example the Bell Bearing Hunter will detect you spell casting or using an item and from there has an 85% chance to immediately abort its current action and launch into an attack.

They also make use of dynamic spatial watch regions configured on Actors, which trigger interrupts. For example you might add a watch for the area behind or under a boss, and use that to adapt their behavior immediately when the player tries to get clever.

Timeouts

Goals, in addition to their individual state, carry a lifetime value in seconds. This is used to break out of states which become stuck for whatever reason, and lifetime seems to be used mostly as a bug containment mechanism.

It’s also possible to modify the lifetime of a parent goal during execution, to indicate continued forward progress.

Actor Data Access

In many AI decision systems you might have heard of fancy systems for data storage like “blackboards”. In the Souls games there’s an array of floats on each Actor which are set and read arbitraily from Goals by index. Good enough I suppose!

A callback I didn’t mention before, Initialise, is commonly used to reset this data when an Actor is assigned a new Top Level Goal.

Goals have access to a range of queries about the world through the Actor. As far as I can tell most of these are pretty “low cost” from a performance perspective. Aggro and Targeting seems to be handled outside, so it should be possible to keep the Goals very lean even considering it’s all interpreted Lua.

Actual Doing Stuff

Something I’ve entirely skipped over is how the Goals actually Do things. For the most part everything in FROMSOFT games is animation driven.

The Goal says “play this attack animation”, and then the animation events carry hitbox information and timings, special effect triggers, projectile creation events, and whatnot. They also have a variety of “combo” features which seem to boil down to choosing a different set of events in the animations to enable faster linking of chained animation during a combo attack.

At some point they went all-in on Havok middleware. The animations are authored with Havok Animation Studio (discontinued). Previously we mentioned the AI scripts are using Havok Script (also discontinued). Physics is handled by Havok’s physics, and pathfinding is delegated to Havok AI (not discontinued, but renamed to Havok Navigation).

Misc Stuff

  1. They seem to split AI scripting into a “logic” script, and a “battle” script, where the logic script is far more sharable, and the battle scripts are often bespoke. This seems super smart, it’s common to run into issues jamming both these things into singular hierarchies.

  2. Level designers are able to configure the Top Level Goal for an Actor in the level itself, so you can place some enemies down with a passive Goal rather than their usual combat Goal, and they would just chill whilst otherwise functioning normally.

  3. Most of the common code is relatively compact bits of Lua, but I believe load bearing Goals like Attack and MoveToSomewhere are implemented in C++ which gives you a pretty nice balance of scriptability and performance sanity.

  4. The update function itself is sometimes used to check conditions, I expect this must have caused problems occasionally. But so long as the interface for Actors in scripting is thin I guess you can keep it under control. (Don’t add a pathfind function call…)

  5. I’ve entirely skipped over the event scripting system used to do high level encounter logic and level scripting. Unlike the AI it seems to be entirely custom, with a very restricted VM. That said, since it’s not Lua it’s hard to see how they’re actually authored. If anyone knows of primary sources for info about their tooling that would be super cool!

Conclusion

There’s a lot of enduring hype for complicated AI systems (GOAP springs to mind) but I think the success of putting a lot of control in the hands of your designers and animators really speaks for itself.

A pushdown automaton is also fundamentally quite fast compared to Behavior Trees and planners. Behavior Trees often require top-down re-evaluation of a complex tree of scripted nodes, whereas this is almost always executing a single Goal from the top of the stack4. Planners like STRIPS, GOAP and HTN add an expensive search to the middle of everything.

Compared to FSMs the flexibility of dynamic transitions makes it easier to avoid an explosion in the number of states and their transitions. This also makes it far more reasonable to compose AI functionality in an imperative way.

Plus of course it’s dramatically more legible than planner based solutions where individual actions are moved out of the hands of combat designers.

Is it going to handle more complex scenarios than the typical Soulsborne npc or boss fight? I actually think it can go quite far.

References

Most of the info in this post comes from eladidu readable ds lua it’s fantastic and you can find many interesting definitions as well as a little tutorial.

If you want to get even more excited there’s a bunch of tools for extracting data from the game packages, as well as nice modding tools for patching things here and there.

  1. This is not to be confused with the concept of a goal which you might know from advanced planning systems like STRIPS, GOAP (Goal Oriented Action Planning) or HTN (Hierarchical Task Networks). Those systems use a search algorithm to dynamically find a sequence of Actions which move the world into a Goal State. There’s nothing remotely so complex happening here!↩

  2. Animation ids are largely based on playstation controller inputs which are then offset by a per-actor value in the npc definition. Moveset swaps can be performed by changing the offset dynamically from scripts!↩

  3. I’m glossing over a small problem… You want to be able to write your scripts so that sub-goals function as a queue, not a stack, so they are executed in the order they’re pushed. Unfortunately that slightly complicates the implementation and explanation so I’ve left it as an exercise for the reader.↩

  4. I’m not entirely sure whether they update only the current Goal from the top, or whether they recursively update currently active goals, but I suspect it might be the latter. This is still dramatically more efficient than re-evaluating decision criteria in a behavior tree.↩