as I chart out Elden Ring AIs for the Fextralife wiki, I've been writing up deep dives on the details of different bosses' AI and the way FromSoft AI works in general on @[email protected]. my first talked about why Margit is so combo-happy https://cohost.org/nex3/post/8880-margit-s-actually-un
Natalie on cohost

Margit's actually unusual among the bosses I've charted out in how he handles combos. In Elden Ring, each attack animation activates a bunch of special effects throughout the animation which the AI logic can listen for. If AI code wants to do a combo, it'll tell the game "listen for special effect XYZ". Then when an attack animation activates that special effect, it'll run the associated callback in the AI code which will queue up another attack for the combo. Most bosses handle combos on an attack-by-attack basis. If the designer wants a particular attack to continue a combo, they'll listen for one of the special effects it activates, but a lot of the time they'll just run the animation without listening so it doesn't combo into anything. This allows them to limit how much the enemy combos without having to create redundant animations. Margit doesn't work like that, though. Margit's AI is always listening for every combo-related special effect, so any time his attack animations hits a possible combo that combo actually happens. In order to stop him from just incessantly attacking, there are additional counters in some of the attacks that cause the combo to stop after a certain number of attacks. In some cases there are even special attack animations that don't set combo special effects to act as hard stops. But the end result is that his possible combos end up way more complicated than other bosses even though he doesn't have that many more moves in an absolute sense.

Natalie on cohost
@[email protected] Despite Demi-Human Chiefs having drop-dead simple AI, I ended up writing a long post about the many challenges of creating AI charts https://cohost.org/nex3/post/30504-demi-human-chief-ai
Demi-Human Chief AI Deep-Dive

This post is actually less about the AI of the demi-human chiefs than it is about my process of diving into the AI. Although their decompiled AI file is 1513 lines long (50% larger than that of Margit [https://cohost.org/nex3/post/8880-margit-s-actually-un], by far the most complex boss I've looked at so far), 70% of that is just the Goal.Activate function which chooses what to do when an enemy doesn't have any actions queued. And that's only so long because it assigns probability weights to attacks in a weirdly long-winded way for every different possible set of states and positioning (including "you encounter the non-boss version of the enemy at night" and one other state that as far as I can tell can never be set). ---------------------------------------- The boss's actual AI is among the simplest I've seen so far. It's got a few combos, but they're all short and they rarely overlap one another's attacks. Demi-Human Chief Combo Chart [https://cohost.org/api/v1/attachments/65f04c08-3a85-480d-992b-9880bc0b7a77] [https://cohost.org/api/v1/attachments/65f04c08-3a85-480d-992b-9880bc0b7a77] Creating this chart was difficult for me not because of the complexity of the AI, but because of the inherent challenge of taking something complex and making it simple. The code for an enemy, even one as simple as Demi-Human Chief, has way more information than an average wiki reader needs or wants. I could tell you exactly where you'd need to stand to trigger what percentage chance of a second Head Bash, or which frames of that attack can actually damage you, but anyone who cares that much might as well just boot up DSAnimStudio themselves. My job is to distill all that information down into its most useful form. It's not really separating signal from noise, since all of the information could be something someone cares about—it's more like turning a novel into a screenplay, cutting down as much as you can while still trying to stay true to the heart of the original. Which is to say, I have to make tough decisions about how to represent the information I find in the game's files. Take this simple attack animation, for example: [https://staging.cohostcdn.org/attachment/cf3c531f-c7ba-4c7c-8b42-b3648534b65b/3000.gif] The Demi-Human Chief hops forward a bit and slashes once with its knife, so one simple option would be to call this attack something like "Clockwise Slash" or "Hop Slash". While this might be fine for an enemy with as few moves as this one, I want to be as consistent as possible across all the bosses I chart out and naming each individual animation separately is unsustainable for more complex bosses with dozens of distinct animations. Each attack name has its own entry in the Attacks & Counters table on the wiki, so parsimony is a virtue. So instead, I simply call this attack "Slash" and add a little ↻ label to help disambiguate it from slashes in other directions. I allow the initial hop to flutter down into the dustbin of unstated truths. After all, I don't include information about the AI's various dedicated movement animations, so why mention a small movement at the beginning of an attack? After much internal debate I chose a different approach for this animation: [https://staging.cohostcdn.org/attachment/fe49b335-4fd2-457c-bf78-eab2d17b1f44/3001.gif] If I adhered strictly to the principle of parsimony, I might have categorized this simply as two clockwise slashes. But after much internal debate, I decided that attacks with distinctive movements that a player would be likely to recognize should get their own names. When you're fighting this guy it's easy to notice it spinning around like an angry beyblade and tell that that's no mere combination of smaller attacks, so I called it "Spinning Attack". On the other hand, this animation... [https://staging.cohostcdn.org/attachment/4c4679c9-76a8-4bc6-aafc-38dcfa625a7c/3004.gif] ...I ended up simply categorizing as three slashes in a row. Sure, if I categorized it as "Fury Slices" or something like that I could mention that the attacks comes swiftly one after the other, but anyone paying a bit of attention to the fight will figure that out for themselves quickly enough. Another bit of information hits the cutting-room floor.

Natalie on cohost
The Troll bosses are a cool example of the way FromSoft re-uses and expands AI across different variations of the same enemy you encounter over time https://cohost.org/nex3/post/33774-troll-ai-deep-dive
Troll AI Deep Dive

There are three troll bosses in Elden Ring: two Stonedigger Trolls (one in Limgrave Tunnels, one in Old Altus Tunnel), and one troll knight (Bols, in a Liurnia evergaol). There are also a few dozen trolls scattered throughout the overworld, with four models and six separate AI files: Troll, Troll_Carriage, Troll_Woman (which seems to be unused), Troll_RoyalKnight (including Bols), Troll_Yeti, and Troll_Mine` (just the two Stonediggers). These provide a glimpse into the way From Software handles shared logic between diverse enemies, and how they evolve AI into progressively more complex battles. ---------------------------------------- If you've worked in software, you may have heard of the "DRY" principle: "Don't Repeat Yourself". If two chunks of code need to do something similar, that logic should be shared between them, for example by putting it in a function. This is emphatically not how FromSoft's AI operates. Every single troll AI file (as well as the animation files for each model) is completely separate. While there are differences between them, clearly one base AI was created first (likely the simple Troll) and then copied five more times and tweaked as necessary. Although my software engineer instincts recoil at the duplication, as an AI cartographer I'm intrigued by what I can learn from what's left behind. Take this attack, for example: A troll performs a bite attack [https://staging.cohostcdn.org/attachment/f4152442-e7a1-4a70-a553-6c34f756d414/troll-3006.gif] I've played 400-some hours of Elden Ring, and I'm not sure I've ever seen that attack in action. But it's there in the code, ready to be activated if you're in a five meter radius of a troll and five meters off the ground. This is probably technically possible if you're up on a ledge above a troll, but the code is still there for all three bosses I was analyzing despite their arenas being perfectly flat. Anyway, let's take a look at the combo charts! Here's Stonedigger: Stonedigger Troll AI combo chart [https://cohost.org/api/v1/attachments/fed84589-6423-492c-9c36-91e1e4a882f2] [https://cohost.org/api/v1/attachments/fed84589-6423-492c-9c36-91e1e4a882f2] All in all a fairly linear chart; it's certainly got combos, but it only has a few actual decision points where one move might be followed by multiple others. It's got some cheeky little rewards in there for players who pay attention: you can tell how to respond to an arm sweep based on whether it's clockwise or counterclockwise, and you can learn that a roar is always followed by an overhead hammer swing. But altogether not a complex boss. Bols ramps up the complexity: Bols AI combo chart [https://cohost.org/api/v1/attachments/e79070b6-aa1b-4ad5-aad9-f66fc7740931] [https://cohost.org/api/v1/attachments/e79070b6-aa1b-4ad5-aad9-f66fc7740931] You can see that it has the same bones as Stonedigger, and in fact is almost a superset of its moves. But being a later-game boss, it ramps up the complexity: there are a few more non-combo moves, a new Dragging Slash attack that can weave its way into the combos, and the left leg stomp can now combo to an arm slam that isn't there for Stonedigger. From a player's perspective, lessons they've learned from earlier bosses still apply to similar bosses later, even if it's most often just going to be pure muscle memory. But more advanced enemy variations will also feel a bit more unpredictable, a bit harder to grok, as their movesets expand and the way those moves can chain into one another gets more complex. And so Elden Ring is able to reach gargantuan sizes through careful re-use of relatively few pieces, while keeping the game feeling fresh throughout.

Natalie on cohost
Guardian Golem's AI is very simple but it did inspire me to try a new way of distinguishing combos in my charts https://cohost.org/nex3/post/35718-ai-deep-dive-guardi
AI Deep Dive: Guardian Golem

Guardian Golem's AI is not particularly complex. Guardian Golem combo chart [https://cohost.org/api/v1/attachments/2b9081fa-b99c-4503-8a3d-3bdae1d94e2c] [https://cohost.org/api/v1/attachments/2b9081fa-b99c-4503-8a3d-3bdae1d94e2c] I'm guessing this was just a normal mob for a long time, and ended up being pulled in as an early boss more because it looked imposing than because it posed a particularly chewy problem for the player. The AI is as simple as you'd expect: other than a few conditionals that give different behavior for bow-wielding golems, it's pretty much a straightforward march of individual attacks and a small handful of combos. This did lead me to one cool innovation that I think will help me make more useful charts in the future. The golem has two combo branches that both begin with it slamming the hilt of its axe into the ground, and it's possible to distinguish between them by watching which of its feet moves first. Previously I'd have either given these attacks different names or just omitted the difference entirely, but I realized I could add small distinguishers just to the combo chart: Two boxes, one labeled 'Axe Stab (lifts right leg)', the other labeled 'Axe Stab x3' (steps with right leg)'. [https://staging.cohostcdn.org/attachment/feb806f4-bb5a-49d8-8461-c327b1ff94a7/axe-stab-distinguishers.jpg] This way players can tell which combo is going to happen but I don't necessarily need to pollute the list of attacks. It's obviously limited by how much text is reasonable to include in a single node, but it's still a very useful new tool in my toolbox.

Natalie on cohost
Cemetery Shade has simple combos but a really complex and interesting way of managing when and how it uses its characteristic teleportation movement https://cohost.org/nex3/post/39001-cemetery-shade-ai-de
Cemetery Shade AI Deep Dive

For an enemy that feels so relentless on the battlefield, Cemetery Shade's AI looks quite simple when you chart it out: [https://cohost.org/api/v1/attachments/30d9b211-05fb-4c98-869f-9d203125c66a] [https://cohost.org/api/v1/attachments/30d9b211-05fb-4c98-869f-9d203125c66a] But the code itself actually has a lot going on that gets elided by my chart-making process. This chunk of code at the beginning of its idle logic, for example: ---------------------------------------- local random = nil if actor:GetNumber(5) >= 60 then random = actor:GetRandam_Int(10, 120) elseif actor:GetNumber(5) >= 40 then random = actor:GetRandam_Int(10, 100) elseif actor:GetNumber(5) >= 30 then random = actor:GetRandam_Int(10, 80) elseif actor:GetNumber(5) >= 20 then random = actor:GetRandam_Int(10, 45) elseif actor:GetNumber(5) >= 12 then random = actor:GetRandam_Int(10, 30) else random = actor:GetRandam_Int(1, 10) end if random >= 20 then probabilities[20] = 100 else -- Setting probabilities for other attacks end The whole AI virtual machine seems to be cleared out between frames, so the actor:GetNumber() function (and its dual, actor:SetNumber()) is a way for AI code to store state that's accessible over time. One of the first parts of learning how an AI works is looking at its numbers and figuring out what they represent in terms of the actual battle. In this case, the number I refer to as "n5" in my notes gets incremented by 4 every time the shade does one of its opener attacks. The higher this counter gets, the more likely the shade is to forego an attack and run its Act20 function: function TombShadow_366400_Act20(actor, goals, _) actor:SetNumber(5, 4) goals:AddSubGoal(GOAL_COMMON_SpinStep, 5, 6001, TARGET_ENE_0, 0, AI_DIR_TYPE_B, 3) local random0 = actor:GetRandam_Int(1, 100) local random1 = actor:GetRandam_Float(4, 6) if random0 > 85 then goals:AddSubGoal(GOAL_COMMON_ApproachAround, random1, TARGET_ENE_0, 0, TARGET_SELF, true, -1, AI_DIR_TYPE_ToBL, actor:GetRandam_Int(6, 10)) elseif random0 > 70 then goals:AddSubGoal(GOAL_COMMON_ApproachAround, random1, TARGET_ENE_0, 0, TARGET_SELF, true, -1, AI_DIR_TYPE_ToBR, actor:GetRandam_Int(6, 10)) elseif random0 > 35 then goals:AddSubGoal(GOAL_COMMON_ApproachAround, random1, TARGET_ENE_0, 0, TARGET_SELF, true, -1, AI_DIR_TYPE_ToL, actor:GetRandam_Int(8, 12)) else goals:AddSubGoal(GOAL_COMMON_ApproachAround, random1, TARGET_ENE_0, 0, TARGET_SELF, true, -1, AI_DIR_TYPE_ToR, actor:GetRandam_Int(8, 12)) end end This action resets n5 (interestingly to 4 rather than all the way back to 0) and queues up a couple actions. The first one teleports backwards (animation 6001) and the second make it pace a bit in a randomly-determined direction. Put this all together and you start to see the meaning behind the code: Cemetery Shade's ability to teleport quickly and unpredictably combined with its heavy damage output risk putting too much pressure on the player, so n5 acts as a release valve. The more intensely the Shade attacks, the more likely it'll be to back off and give the player space once its current combo finishes. This enemy is full of logic like this, with six actively used state numbers and two timers, almost exclusively controlling the details of when and how it teleports. It would have been easy to have the boss's movement be as straightforward as its attacks, but the extra care that's put into making sure it feels scary without feeling unfair is what makes these games great.

Natalie on cohost
For Scaly Misbegotten, I talk about the fingerprints individual designers leave on the AI code they write https://cohost.org/nex3/post/41062-scaly-misbegotten
Scaly Misbegotten

Scaly Misbegotten is another early mob-cum-boss with a dead simple AI: Scaly Misbegotten combo chart [https://cohost.org/api/v1/attachments/b40a0320-549f-4097-a849-315fd60dfb82] [https://cohost.org/api/v1/attachments/b40a0320-549f-4097-a849-315fd60dfb82] There are no fancy tricks lurking in its code; it's just 260 lines of totally straightforward Lua code. The coolest thing about it is that, after charting out a dozen or so bosses, I've started to be able to tell who made each one. I can track similarities and differences across different AI files and tell that two use the same, or clearly different, styles. Scaly Misbegotten, for example, looks like it was made by the same person as Leonine Misbegotten. They both rely heavily on queuing up multiple attacks in the original AI action where other AIs tend to use special effect IDs to chain attacks or even shove them into the same animation. When they do need special effect IDs, they add observers only for their specific needs rather than copy-pasting a large block across every action or activating them all when it's in its idle state. Of course, nothing's ever that simple and I'm sure most AIs had multiple hands on them at various points. But the clear parallels and differences between them, the way Black Knife Assassin [https://cohost.org/nex3/post/15365-i-ve-been-diving-int] and Margit [https://cohost.org/nex3/post/8880-margit-s-actually-un] seem to be closely related but Cemetery Shade [https://cohost.org/nex3/post/39001-cemetery-shade-ai-de] looks like it's written by someone I've never seen before, are very cool. This isn't just a product that sprung into being from a corporate gestalt; it's the product of individual artists who each have their own way of shaping the projects they work on.

Natalie on cohost
Crucible Knight's AI confirms what many suspected: Elden Ring bosses do read your inputs and react specifically to you drinking your flask https://cohost.org/nex3/post/52849-crucible-knight-ai-d
Crucible Knight AI Deep Dive

Ah, Crucible Knight. A relentless armored foe, by far the most prevalent non-respawning enemy in Elden Ring, and one of the earliest genuinely difficult bosses most players will beat in their playthroughs. Experienced Elden Ring players will know that there are actually two types of Crucible Knights, one with a sword and shield and one with a spear. But few people would guess that there are actually four separate AI scripts for them. These knights, it turns out, differ in more than just their choice of weaponry. In their second phase, which they enter once they're below 60% health, they get an extra suite of attacks involving holy energy. All knights can grow magical wings, but the specific additional attacks depends on the specific knight in question. Some sword-wielding knights (like the one in the Stormhill Evergaol which serves as an introduction to the enemy type) can do a circular attack with a magical tail, while others can breathe fire. Some spear-wielding knights can impale you on a magical arm-horn, while others can dash towards you with shoulder-horns instead. ---------------------------------------- Each of these combinations has its own bespoke AI, although it's clear that they share a common ancestor. Most of the core logic is the same across both knights with a given weapon, and you can even see the remnants of special effect ID checks which were at one point used to switch between behaviors for different types within the same file. I speculate that they eventually decided to make the knights feel a little more different by tweaking some attack probabilities, and at that point it became easier to just copy the files wholesale. But the underlying logic of combos is largely unchanged except where it specifically relates to the limited Phase 2 attacks. This is fortunate for me, because it means I only need to create two combo charts, one for the sword-wielders: [https://cohost.org/api/v1/attachments/3a06b0d6-6ff0-40cb-82f2-7d8cb0e20bc9] [https://cohost.org/api/v1/attachments/3a06b0d6-6ff0-40cb-82f2-7d8cb0e20bc9] ...and another for the spear-wielders: [https://cohost.org/api/v1/attachments/b7afe83d-e844-4588-8214-bf4198bbdef4] [https://cohost.org/api/v1/attachments/b7afe83d-e844-4588-8214-bf4198bbdef4] (As a side note, it took a lot of massaging to get those charts as readable as they are now. Crucible Knights have a nasty habit of being able to combo any given attack into many other attacks but not enough to provide a pattern I could use to simplify the charts.) Like Erdtree Burial Watchdogs [https://cohost.org/nex3/post/29515-erdtree-burial-watch], Crucible Knights have no intrinsic limit to their combo, so as long as you're within range they'll just keep swinging. This—combined with their immunity to staggering—is why they feel so relentless, especially to new players who haven't yet learned to dodge forward, parry, or push for stance breaks. In Phase 1, there isn't a single attack that's guaranteed to end a combo—your only real opportunity to land hits is in the gaps between swings. This is also the first AI I've investigated that has explicit combo logic for reacting to a player using an item. Everyone who bemoaned Elden Ring bosses input-reading heals? They were right. If you take a sip, the knight will often combo straight into a running attack to punish you. This isn't guaranteed, though: the Knights will actually ignore your item use while they're in the midst of an existing attack animation, including the portion where they choose a different combo, which means that they'll only input-read you if you're positioned so that their combo would stop naturally otherwise. This also means that the use-item triggers are more delayed than a standard combo, so there's a little bit of grace there. It remains to be seen whether that grace applies to other notorious input-readers, though! One final fun fact: if you look closely at the spear combo chart above, you may notice that it's technically possible to get these knights to do their otherwise-Phase-2-only Siluria's Woe attack in Phase 1 by using an item when you're far enough away. I was so surprised by this that I actually booted up the game and verified it myself. I assume this must be an oversight, since every other way to activate that attack only works in Phase 2, but it is kind of fun to play around with.

Natalie on cohost
There's a lot going on with the AI for Night's Cavalry! From mounting and dismounting to its unusual economy of logic, I think this is the longest analysis I've written yet https://cohost.org/nex3/post/57598-night-s-cavalry-ai-d
Night's Cavalry AI Deep Dive

Night's Cavalry is the only mounted boss in Elden Ring. Tree Sentinel, Loretta, and Radahn have horses as part of their models, but the game considers the horse and rider to be a single entity. The Night's Cavalry rider, by contrast, is a totally separate enemy from its horse with separate stats and a separate healthbar. Kill its horse, and you can fight the rider on foot for a time, until it summons and remounts its steed. The Night's Cavalry mount without a rider on a green background doing its walk animation. [https://staging.cohostcdn.org/attachment/b6001683-7396-4509-bd44-2b0aaadc93bd/nights-cavalry-mount.gif]The Night's Cavalry rider without a mount on a green background doing its ride animation. [https://staging.cohostcdn.org/attachment/920bc707-0667-4970-9fb7-6d04ff63c325/nights-cavalry-rider.gif] ---------------------------------------- It's pretty surprising that there aren't more bosses like this. Elden Ring's design philosophy is predicated on milking every asset for all it's worth in order to fill its massive open world despite being a relatively small company, so it's not like the designers to limit a mechanic like this to only one type of boss. On the other hand, a mounted boss like Night's Cavalry has two separate movesets, one on its horse and one when it's knocked to the ground, so perhaps the effort necessary to design both just isn't worth the trouble. It certainly makes Night's Cavalry's AI code intriguing, though. Since it can also wield two different weapons—Nightrider Glaive [https://eldenring.wiki.fextralife.com/Nightrider+Glaive] or Nightrider Flail [https://eldenring.wiki.fextralife.com/Nightrider+Flail]—it has four separate states it can be in (mounted/dismounted × Glaive/Flail). Despite this, the AI is shockingly parsimonious, using only a single file and (uniquely as far as I've seen so far) using the exact same logic for both weapons. Remember, Crucible Knights [https://cohost.org/nex3/post/52849-crucible-knight-ai-d], had four separate AI files each with tweaked logic for its variants! Let's take a look at the mounted combos for Night's Cavalry: [https://staging.cohostcdn.org/attachment/ac11606a-6103-4696-819b-56183d3fa4ea/nights-cavalry-mounted-combo-chart.svg] [https://staging.cohostcdn.org/attachment/ac11606a-6103-4696-819b-56183d3fa4ea/nights-cavalry-mounted-combo-chart.svg] The first thing to notice is that there are very few differences between Glaive- and Flail-wielders. As I mentioned, the logic code is exactly the same—although the special effect IDs do exist for the AI to distinguish between them, it never does. The only difference is that they're configured to use different model flags and animation sets. So why is there any difference in the logic? That has to do with how animations work in Elden Ring. An attack animation file isn't just information about how the model should move; it also contains mechanical information like hitboxes, attack behaviors, parry timings, and even special effect IDs that get activated at various points in the attack. Here's a chunk of the animation timeline for the Grinding Strafe attack, as visualized by DSAnimStudio [https://github.com/Meowmaritus/DSAnimStudio]: [https://staging.cohostcdn.org/attachment/37931c6d-c8dc-4859-8f6c-bb5f1bff8b68/animation-data.png] [https://staging.cohostcdn.org/attachment/37931c6d-c8dc-4859-8f6c-bb5f1bff8b68/animation-data.png] In addition, each animation has a two-part ID, like 3_3005. The first part (3) is the animation set, and the second part (3005) is the animation ID. The AI code says which animation IDs to run at which time, but which animation set they come from depends on how each individual enemy is configured—specifically, whether it has any special effects that say "add N to the animation set". Glaive-wielding Night's Cavalry have a special effect that gives +0 to their animation set and Flail-wielders have +1, so when the AI says "run animation 3005" it'll run animation 3_3005 for Glaive-wielders and 4_3005 for Flail-wielders. The Night's Cavalry rider drags its halberd beside it before lifting it off the ground. [https://staging.cohostcdn.org/attachment/830af657-cf0d-4fca-8fbb-76b132f85b47/grinding-strafe.gif]Animation 3_3005, Grinding StrafeThe Night's Cavalry rider twirls its flail beside it three times. [https://staging.cohostcdn.org/attachment/b4c06677-d155-4846-b1b7-3996a9b09166/twirling-strafe.gif]Animation 4_3005, Twirling Strafe Thus one rider can use Grinding Strafe and another can use Twirling Strafe from the same AI. What's more, the Grinding Strafe animation activates special effect ID 5030 before the glaive swings up, and the AI watches for that ID, allowing it to combo into Rearing Slam earlier than its Twirling Strafe counterpart can do. This same trick of changing up the animation information allows the grounded AI to have surprisingly different combos between the two weapons, given how simple it is on the whole: [https://cohost.org/api/v1/attachments/ddc7533a-ead5-47e4-97d5-315d1e2a46f8] [https://cohost.org/api/v1/attachments/ddc7533a-ead5-47e4-97d5-315d1e2a46f8] As I mentioned earlier, Night's Cavalry only has one AI file, which includes the dismounted form. As long as it's mounted, it has a special effect that gives +3 to its animation set—which is why its mounted attacks start with 3_ and 4_! When it's on the ground, it uses animation sets 0_ for Glaive and 1_ for Flail. There are no animations in set 2_, which leads me to wonder if they might have been saving it for a third type of weapon they never got around to adding. The coolest thing about the dismounted form is how it gets back on its mount. There's a special attack animation, 3020, which does an area-of-effect burst and resummons the horse, but in order to ensure that the rider doesn't immediately remount there are some limits on when it can be used: * Every time it does an attack from idle, it increments a counter. The higher the counter goes, the more likely it is to remount with its next attack. There's a 50% chance it'll remount after the fourth increment, and it goes up from there. * If it's choosing an attack from idle and you're more than 8 meters away from it, there's a 96% chance it'll remount. * If 20-25 seconds have passed since it last used attack 3020, then it'll usually combo into its remount attack. This last condition is particularly bizarre, since it almost certainly takes more than twenty-five seconds to kill its horse after it remounts. In practice, what it probably actually means is that its remount speed depends on how quickly it used its mounted attack with animation 3020—a shoulder bash from the horse that's totally unrelated to mounting. This is such odd logic that I have to assume that it's an oversight. Maybe at some point the horse was much weaker, or the dismounted animation 3020 was unrelated to remounting. Maybe the rider is actually supposed to take a lot longer to get back on its horse than it does in practice! Or possibly, the logic is accidental but the end result is desired and the designers just never went back and rechecked the code.

Natalie on cohost
I knew Elemer of the Briar was similar to Bell Bearing Hunter, but I didn't realize he was _literally identical_! not only that, he has a really cool way of gaining power throughout the fight https://cohost.org/nex3/post/62571-elemer-of-the-briar
Elemer of the Briar AI Deep Dive

The first thing I noticed about Elemer of the Briar's AI is that there's absolutely no difference between it and the AI for Bell Bearing Hunters. Anyone who's faced both these enemies can tell that they're the same kind of guy, but I expected Elemer himself to have something more going on than the rest. After all, not only is he a named boss, he's the final boss of a standalone dungeon! We saw with Black Knife Assassins [https://cohost.org/nex3/post/15365-i-ve-been-diving-int] and Trolls [https://cohost.org/nex3/post/33774-troll-ai-deep-dive] that FromSoft has many tools at their disposal to scale the complexity of the same basic fight throughout the game. Even Runebears, which are so straightforward I didn't bother writing about them, have a late-game variant with a few extra attacks and combos. But Elemer really is just a Bell Bearing Hunter (and not even the strongest one of those). Which raises the question: why? ---------------------------------------- Elden Ring is an incredibly ambitious game for a relatively small developer like FromSoftware to make, especially as their first foray into open world games, especially building on an engine that's been in place since at least Demon's Souls (2009). Any game will inevitably have some aspects planned out and later dropped for time, but there's substantial evidence that Elden Ring's development was particularly hurried towards the end. My suspicion is that Elemer is a result of that. Here's what I speculate: Bell Bearing Hunter came first, as a design for a roving bandit boss to make the shopkeepers scattered throughout the Lands Between feel more like part of a living world. When they designed the Shaded Castle, Elemer's home, they intended it to be a legacy dungeon with as distinctive a final boss as all the rest. But designing a new boss from scratch is expensive, the clock kept ticking, and eventually they had to make some hard choices and this was the least painful to cut. So, down to the wire on time, they just copied this Hunter boss and wrote some flavor text connecting him to the Shaded Castle. Sometimes that's just how it goes! Despite being the same across all instances, his AI is quite interesting. Let's take a look: Elemer of the Briar combo chart [https://cohost.org/api/v1/attachments/86e44e51-7e64-4ee2-872c-1baf362cfccd] [https://cohost.org/api/v1/attachments/86e44e51-7e64-4ee2-872c-1baf362cfccd] The first thing to note here is that the entire lower-left chunk of the chart is just various combos related to his Dancing Blade attack. It turns out when your sword can end up halfway across the boss arena, you need a lot of logic to react to wherever the player ends up! Elemer performing the Dancing Blade attack [https://staging.cohostcdn.org/attachment/40d3a1d4-c704-4674-bbea-f8fe36a66557/dancing-blade.gif] The most interesting thing about this AI, though, is something that doesn't show up on the chart. Attack animations, you may recall [https://cohost.org/nex3/post/57598-night-s-cavalry-ai-d], mark particular special effect IDs at various frames which AIs can listen for in order to queue up additional attacks. Most AIs either listen to all the special effect IDs all the time, so that attacks always trigger combo logic; or they choose whether to listen to a given special effect ID before invoking an attack and then stop listening once it triggers, so that they can use the same animation in different combos; or a combination of the two. At first glance, Elemer's AI seems to take the latter approach—some parts of the logic will start listening for special effect IDs immediately before invoking an attack, while others will choose not to do so thus ending the combo. However, unlike any other AI I've seen, once it starts listening for a special effect ID it never stops. This seems like the sort of thing that's probably an oversight, but it has a really interesting practical effect. Elemer's combos will get progressively more complex over the course of a battle, not in one grand phase change but fluidly as he exercises more of his moveset. Once he reaches the chunk of logic that triggers a combo for a particular animation, that combo is now active no matter how he reaches that animation again. This kind of fluid ramping up of difficulty is something I'd really love to see FromSoft explore more overtly in the future.

Natalie on cohost
Tree Sentinel's AI was so complicated I had to come up with some new techniques just to make its combo chart comprehensible https://cohost.org/nex3/post/75568-ai-deep-dive-tree-s
AI Deep Dive: Tree Sentinel

Tree Sentinel's combo patterns may be the most complex and difficult to graph of any boss I've analyzed at so far. Take a look: Tree Sentinel combo chart [https://cohost.org/api/v1/attachments/8cbbe119-a80c-4d5f-9cb6-b1599f7b6871] [https://cohost.org/api/v1/attachments/8cbbe119-a80c-4d5f-9cb6-b1599f7b6871] While this may not look as gnarly as Margit's combo chart [https://cohost.org/nex3/post/8880-margit-s-actually-un], that's only because I had to break out some techniques to make it comprehensible that I'd never used before. ---------------------------------------- TECHNIQUE 1: LIE I admit it: the chart above is not entirely accurate. It's a fib. A falsehood in the service of truth. Here's the thing that makes Tree Sentinel's AI so frustrating to chart out in any comprehensible way: it simply isn't consistent. There are lots of paths through its moveset that do almost the same thing, but differ slightly in how they can chain into further combos. Look at the three ways it can combo into Rearing Swing, for example: they combo into almost the exact same attacks, except one of them doesn't combo into Horse Bash and they combo into different 180°-turn Side Swings in Phase 2. Why is this? I don't know. Maybe it has to do with which side of the boss the player is likely to be on at that point in the combo. But it certainly makes it harder to chart out. But Rearing Swing isn't the lie. The lie is the little cluster of attacks in the lower left of the image: [https://cohost.org/api/v1/attachments/8cbbe119-a80c-4d5f-9cb6-b1599f7b6871] In the chart, tons of attacks can lead into this little finale combo. But actually, in the underlying AI code, each of those attacks leads into a different subset. Some of them can't do the rightward Rearing Slam; some can't combo directly into the forward Rearing Slam but can combo into it through Side Swing; some can't do Side Swing at all. But representing exactly how each attack finished up would have doubled the size of the combo chart, so instead I told a little white lie and said they all follow the same combo. The thing is, since any attack follows some path in the finale combo it's not entirely false. I've already resigned myself to not encapsulating a boss's full decision-making process in these charts; in theory I know exactly how far you have to be on which side of a boss to trigger each attack, but there's just no way to represent that in an image and still have it be comprehensible. So in some sense this is just another situation where I'm eliding information about when exactly a boss will choose one attack over another. The real irony here is that, for most players, these combos won't even matter. Most people fight Tree Sentinel on horseback and ride out of range of most attacks, and most of those who don't will either go for a combo-interrupting parry strategy or will simply get a bunch of distance after attacking. Although Tree Sentinel can easily do an 8-attack combo, in practice players will often only see two or three attacks in a row, and since this section comes at the end it's almost free to edit it a bit for the sake of clarity. TECHNIQUE 2: MANUAL EDITS Prior to Tree Sentinel, I made all my combo charts exclusively with Graphviz [https://graphviz.org/]. Graphviz is excellent for sketching out a chart, since I can write out and edit all the relations in plain text and the program will handle all the layout for me. The problem is, once the graph is complex enough, the output can get funky. This is what Tree Sentinel's combo chart looks like using only Graphviz: Tree Sentinel combo chart (Graphviz version) [https://cohost.org/api/v1/attachments/c74e13bc-7338-433c-918e-d37ce69640dc] [https://cohost.org/api/v1/attachments/c74e13bc-7338-433c-918e-d37ce69640dc] The biggest problem with Graphviz is that the mechanisms it provides for manually controlling its layout are few and unreliable. It took until Tree Sentinel for me to finally get fed up enough with this to break down and write a little script to convert Graphviz's layout into a draw.io [https://app.diagrams.net/] file which I could then manually edit in the web app. This allowed by to rearrange a few attacks, smooth out some awkward lines, and make the Idle attacks all use orthogonal lines to make them easier to track and identify. OTHER FUN FACTS * Tree Sentinel has two phases, marked by special effect IDs 13770 and 13771. However, there are also some apparently-unused references to 13772, indicating that there may once have been something like a third phase. * The Tree Sentinel with a torch on the stairs to Leyndell mostly has the same attack patterns, but since it doesn't have a shield it doesn't have a Phase 2. However, it does have similar patterns to the normal Sentinel's phase 2—they just end in a Torch Slam instead. * In practice, the torch Tree Sentinel uses the same rearing-up starting move as the one with the shield. But there's another unused starting animation in the data where it raises its torch above its head.

Natalie on cohost
Tibia Mariner had some mysteries I needed to enlist @[email protected] to help solve https://cohost.org/nex3/post/102552-tibia-mariner-ai-dee
Tibia Mariner AI Deep Dive

Tibia Mariner's AI is extremely simple. It attacks slowly and, for the most part, thoughtlessly with only one set of moves that could charitably be described as a combo. Tibia Mariner combo chart [https://cohost.org/api/v1/attachments/16a2fcdd-a49b-46fd-9638-69b6ce0b5583] [https://cohost.org/api/v1/attachments/16a2fcdd-a49b-46fd-9638-69b6ce0b5583] Despite this, it posed some unique challenges in determining how it worked. This is the first boss I've looked into that uses magic heavily, and one of the major downsides of the DS Animation Viewer tool I use is that it can't even visualize magic, let alone provide clear insights on what it does. ---------------------------------------- Tibia Mariner had two magical attacks in particular that I found puzzling: one where it sets its horn on the prow of the ship and blows, and another where it blows the horn at a forty-five degree angle up into the air. I strongly suspected that these were connected in some way to its ability to summon skeletons to aid it in battle, but precisely how was unclear. To solve this mystery, I enlisted the aid of my brilliant and talented wife @JhoiraArtificer, who had already been helping me out with some wildlife photography [https://cohost.org/JhoiraArtificer/post/93708-stream-announcement]. I asked her to travel around to the four Tibia Mariners scattered across the map and try to figure out how they worked—and particularly if they worked differently from one another. The first thing she realized was that only the first two Mariners you encounter, in Limgrave and Liurnia, actually summon Skeletal Militiamen [https://eldenring.wiki.fextralife.com/Skeletal+Militiaman]—and it does so using its low-horn attack. Although there are Skeletal Militiamen around the Mariner in Altus Platea, they're just features of the area itself and aren't resummoned by the Mariner if it's killed. Instead, it uses the high-horn attack to summon a single giant skeleton to emerge from the ground and attack you. The final Mariner in Mountaintops of the Giants is even stranger. It's surrounded by giant skeletons much like the one in Altus, but these skeletons are more autonomous—they don't wait for the high-horn signal to attack at all. But it spawns in a little nook where the skeletons can't reach! So all in all it's probably the easiest to defeat. Once we figured this out and jotted down the meaning of each of the horn positions, @JhoiraArtificer and I ran another experiment. Normally it's very difficult to kill the giant skeleton summoned in Altus, because it emerges from the ground briefly in an unpredictable location and is quite dangerous while it's visible, so it's hard to land more than a hit or two. But I'd hacked the game to give Liz's character (among other useful tools) an ivory sickle that instantly kills anything it hits. So what happens if you kill this skeleton? It turns out that after it dies, the Tibia Mariner does a low-horn, and then is able to call on the skeleton again with further high-horns. Now I understood how they worked: each Mariner has, hard-coded somewhere I never found, a list of skeletons it specifically summons every time it does a low-horn. The Altus Mariner's list is one entry: the giant skeleton. That skeleton then spends most of its time under the map, until it hears the high-horn and lunges out to attack. But fundamentally, it's the same system as the first two Mariners: if your allies are dead, summon them again, otherwise just focus on attacking!

Natalie on cohost
back on my AI bullshit with Deathbird and Death Rite Bird https://cohost.org/nex3/post/124217-death-rite-bird-ai
Death (Rite) Bird AI Deep Dive

For bosses that are easy to miss and (at least in the case of Deathbirds) relatively easy to defeat, these birds have a lot going on in their heads. Enough that it took me a month to fully compile their combo charts (although part of that was also getting distracted by my Sekiro SL1 run [https://cohost.org/nex3/post/118487-owl-2-is-dead-in-sl1])! Part of it is just that they have a lot of different moves that they can do in a lot of different combinations. Here's the combo chart for the standard Deathbird: Deathbird combo chart [https://staging.cohostcdn.org/attachment/4b32c937-dda6-4203-b66d-a58370ca3a81/deathbird-combo-chart.svg] [https://staging.cohostcdn.org/attachment/4b32c937-dda6-4203-b66d-a58370ca3a81/deathbird-combo-chart.svg] Even getting it this tidy was a lot of work, between choosing which shared moves to duplicate or re-use and using draw.io to manually edit the layout as I did with Tree Sentinel [https://cohost.org/nex3/post/75568-tree-sentinel-ai-dee]. But the real sticking point was a difference in one particular cluster of attacks between Deathbird and Death Rite Bird. ---------------------------------------- First, let me back up a bit and explain some more about my process. When I'm looking at an enemy's AI script, all the references to attacks are just raw numbers indicating animation IDs. These IDs also encompass non-attack animations like walking or sidestepping, but typically anything in the 3xxx range is an attack and those are what I focus on. Fortunately I can look up these attacks in a tool called DS Animation Studio to see what they look like and details about how they work, what they can combo into, and so on. DS Animation Studio isn't perfect, though—for Elden Ring in particular it still lacks the ability to display most visual effects that aren't part of the enemy's model itself. For this reason, and just to double-check my work, I'll usually also load up some videos of the boss in question on YouTube and try to match up its moves there with the AI script. This turned out to be particularly important for Death Rite Bird. Check out its combo chart: Deathbird combo chart [https://staging.cohostcdn.org/attachment/54c33864-51a0-4336-81df-07c0ca994604/death-rite-bird-combo-chart.svg] [https://staging.cohostcdn.org/attachment/54c33864-51a0-4336-81df-07c0ca994604/death-rite-bird-combo-chart.svg] Note in particular that it has a number of additional attacks that it does from the Idle state that match actual spells in the game, such as Explosive Ghostflame, Spearcall Ritual, and Ancient Death Rancor. These are primarily identifiable by their visual effects, so I really needed the YouTube videos to match up the boss's actions to the particular spell it was using. But while I was watching them, I noticed something strange. There was one particular move the Death Rite Bird did that puzzled me. It would create a ball of black flame and then send it shooting forward as a wave towards the player: Death Rite Bird's Shockwave Swing attack [https://staging.cohostcdn.org/attachment/e83713b2-0a82-421f-bffc-7bc8b5a97c50/death-rite-bird-shockwave-swing.gif] I could tell that this was composed of a combination of attacks I could see in my data: a stab or jab that seemed to create the orb, and a swipe attack that seemed to send it flying. But these animations were also used by the standard Deathbird, which is distinguished by its lack of magical aptitude! What's more, I had never seen a pair of attacks that did something substantially different in conjunction than they did in isolation. I had to figure out the details of how these attacks combined and interacted, which meant breaking new ground: I needed to hack the AI itself to get it to do exactly the attacks I wanted in the sequence I wanted. I knew how to do this in principle, but the process is laborious, so most of the month delay between updates has just been me procrastinating on this particular task. This weekend, though, I finally broke out my tools and reprogrammed both birds (who share a single AI file, despite being substantially more dissimilar than, say, different types of Crucible Knight [https://cohost.org/nex3/post/52849-crucible-knight-ai-d]). First, I had them just do the Swing attack and confirmed that neither one produced a shockwave from this alone. Then I had them just do the Jab, and verified that for the Death Rite Bird alone it created an orb of ghostflame—but this orb quickly vanished. Finally, I had them do the Jab followed by the Swing, which produced the shockwave I was looking for in the Death Rite Bird and nothing in particular of note in the normal Deathbird. I still don't fully understand what it is in the bowels of the game's code that makes this happen. I'm sure it must have something to do with the bullet system that's used for all projectiles and even things like shockwaves, but specifically what is unclear to me. Perhaps, since it also involves striking an existing projectile, it works similarly to the Carian Retaliation [https://eldenring.wiki.fextralife.com/Carian+Retaliation] skill which allows players to parry certain spells—but at this point, that's just guesswork. Fortunately all I really needed to know was how it behaves in this instance. That discovered, I was able to finish up my combo charts by listing the combined move as a distinct "Shockwave Swing" and finally allow myself to write this article.

Natalie on cohost
Ancient Hero of Zamor has some surprisingly deep lessons about the design of multi-phase bosses https://cohost.org/nex3/post/128279-ancient-hero-of-zamo
Erdtree Avatar is only the latest entry in a long and storied line of From Software bosses https://cohost.org/nex3/post/130146-erdtree-avatar-ai-de
Godrick the Grafted handles his phase transition in some unusual ways https://cohost.org/nex3/post/132372-godrick-the-grafted
the Flying Dragons form a whole lineage that use similar, but not idencial, AI and infrastructure https://cohost.org/nex3/post/135672-flying-dragons-ai-de
why do Dragonkin Soldiers violate the traditional structure of evolving boss design over time? https://cohost.org/nex3/post/137284-dragonkin-soldier-ai
Crystalians are somehow the most reactive boss I've examined so far https://cohost.org/nex3/post/139341-ai-deep-dive-crysta
Cleanrot Knight has a unique "guarding" state that totally changes its AI https://cohost.org/nex3/post/140735-ai-deep-dive-cleanr
Royal Revenant may be simple to right but it's got a lot of animations crammed in there https://cohost.org/nex3/post/141318-royal-revenant-may-b
Red Wolf of Radagon is a lot more complex than I expected https://cohost.org/nex3/post/141982-red-wolf-of-radagon
Grafted Scion led me down a path that ended with me writing a program to analyze every one of Elden Ring's map tiles https://cohost.org/nex3/post/152866-grafted-scion-ai-dee
Loretta has yet another wacky way to handle a state change
https://cohost.org/nex3/post/167934-loretta-ai-deep-dive
Regal Ancestor Spirit has a massive amount of complexity that's almost totally hidden from the experience of fighting it https://cohost.org/nex3/post/187213-regal-ancestor-spiri
Nox Priest has a neat little state shift and Nox Swordstress knows to keep out of the way https://cohost.org/nex3/post/216200-nox-swordstress-no
Magma Wyrm was originally going to switch back and forth between standing and crawling https://cohost.org/nex3/post/406096-magma-wyrm-ai-deep-d