How a typo in Terraria means this Skeleton can ignore dodges

You might remember that when 1.4.4 released, the Daytime Empress of Light suddenly got a lot harder. This is because in that update Re-Logic made the Daytime Empress’ attacks ignore dodging mechanics, meaning you could no longer cheat death using Hallowed Armor, Master Ninja Gear, or a Brain of Confusion. Instead of getting a free dodge every thirty seconds – which often meant several dodges through the fight – plus another 25% chance to dodge any other attack, you now had to true no-hit the Empress of Light – no funny business allowed – which is, of course, significantly harder. Although the Empress of Light is by far the most well-known and consequential example, Re-Logic made this apply to more than just the Empress. Their intention was to make any "insta-kill" enemy – like the Empress – bypass dodges, as you know, they should instakill. Due to this, other heavy hitters like Daytime Skeletron, Daytime Skeletron Prime, and the Dungeon Guardian were also brought along and made undodgable. However, if you actually go and check in game, you’ll realize this isn’t quite the case. The Empress is undodgeable, sure, and so is the Dungeon Guardian, but both Daytime Skeletron and Daytime Skeletron Prime are perfectly dodgeable, despite the patch notes saying otherwise? So, what gives? Well, let’s look at the method IsDamageDodgeable(), which controls whether an enemy can be dodged. First, let’s replace these bare NPC IDs with their readable names from the NPCID class. This is now what the code should’ve looked like to the developers before the compiler crushed it. In this switch statement, you can see that by default, enemies are dodgeable, which makes sense. Then, the Empress of Light is dodgeable when it is not day, which also makes sense. Meanwhile, the Dungeon Guardian is only dodgeable when ai[1] (which is one of its internal AI counters) is not equal to 2. Since the Dungeon Guardian’s internal counter is always set to 2, it’s always undodgeable. Still, this makes sense. Then, there’s this case. Since there’s no code for this case, it "falls through" to the next case, using its code if it triggers. This means that just like the Dungeon Guardian, Skeletron should also only be undodgeable if its internal counter is set to 2. Skeletron’s internal counter is set to 2 when he’s enraged during the day, so he should be undodgeable during the day just as intended. But, if you look closely, you’ll realize that this is actually code for the Skeleton, not Skeletron. So, yeah, that’s right, Terraria’s developers missed an "r" in their code, meaning daytime Skeletron is unintentionally dodgeable due to a typo. The effect of this is that Skeletron, even during daytime, is always dodgeable, since, well, there’s no exception for him in the code. However, this also means that the common, blue-shirted non-bone-throwing non-boss Skeleton can actually ignore dodges, if its AI counter is set to 2. While this is normally not the case, since fighter AI uses the ai[1] counter to track door breaking progress, it is possible to create an undodgeable Skeleton. If a Skeletron were to bang on a Tall Gate once, its counter should be set to 2 – and so if you run into it with a dodge, it will actually ignore your dodge. Just like that, a mere Skeleton can mirror the undodgeability of the Daytime Empress – and all because of a lost "r" in typing. Oh, and if you’re wondering, remember how we said Daytime Skeletron Prime is also unintentionally dodgeable? Well, he is, but not because of a typo or anything fancy. It’s just because the developers forgot about him. He’s not anywhere in the code. Just not there. Fat L for Prime, I guess. By the way, thank you to Amaboye for bringing this glitch to my attention. There’s no way I could’ve found it otherwise. Either way though, thank you for watching, and good day and good bye. See you next week.

How a typo in Terraria means this Skeleton can ignore dodges
it’s always the empress of light!
pointless dead discord: https://discord.com/invite/yJrCt9YFz5
Credit to Kellam Yoshikage (amaboye) in #video-suggestions for the idea!

Chapters:
0:00 Intro: the undodgeability mechanic
0:52 Uh oh, something’s wrong… why the hell are the daytime Skeletrons dodgeable?!
1:10 The code behind undodgeability (Empress & Dungeon Guardian, normal)
1:44 Skeletron’s code
2:04 Oops someone forgot an r
2:26 How the Skeleton can “steal” Skeletron’s mechanics and ignore a dodge
3:00 Oops someone forgot a prime
3:17 Outro

Music:
Terraria – Windy Day
Terraria – Underground

Mods and Packs:
Foundry & Alchemy (Pack) – https://steamcommunity.com/sharedfiles/filedetails/?id=2440505684
Stanberry Font (Pack) –
https://steamcommunity.com/sharedfiles/filedetails/?id=2559652586
Stormdark UI (Pack) –
https://steamcommunity.com/sharedfiles/filedetails/?id=2448259079
DragonLens (Cheat Mod) –
https://steamcommunity.com/sharedfiles/filedetails/?id=2939737748
Better Zoom (QoL) –
https://steamcommunity.com/sharedfiles/filedetails/?id=2562953970
Character Stats (QoL) –
https://steamcommunity.com/sharedfiles/filedetails/?id=3033200611

How a typo in Terraria means this Skeleton can ignore dodges

25 Comments

  1. I like that the existence of dodges based on random chance means that you can technically face tank any boss without instakill attacks forever without even wearing armor, you just need Dream’s luck mod to do it

  2. How do you find this out?? You would literally have to comb over all of terraria’s code to find this. Or you’re insanely mad, die to a skeleton and decide to check the code on why you didn’t dodge it (which literally should not be something you notice or care about this much lol)

  3. The daytime empress change will forever be my least favorite change relogic has ever done. Only for the fact that it just removes the option to use dodges entirely. I can and have nohit daytime empress easily i just see no reason why this option should be completely stripped from players when specing into dodging nerfs your potential damage output by a fair bit. You're prolonging the fight for some survivability which is a fair tradeoff in my eyes.

  4. My theory based on 0 evidence is that they had NPCID.SkeletonPrime or something in the original code, but because that's not something that exists, it got removed in the compiled version.

  5. Wow, that's actually crazy lol
    I don't even know how you can discover something like that. I'm assuming by looking through the code for some reason…?
    At the end of the video the person who discovered this issue mentioned that it will be parched. Does that mean the devs are aware of this or is that just speculation?

Leave A Reply