From the feral beasts of Bloodborne to Dark Souls' assorted grotesques, FromSoftware has a habit of infusing its work with horror. Its latest game, Sekiro may have swapped out gothic spires and dungeons for silvergrass and sakura, but there's still darkness festering beneath the surface. Game director Hidetaka Miyazaki once explained "it's important to have that sense of fear and terror" in order for players to go onto overcome it.

One of these encounters with terror can happen early on in Sekiro. A little way past the Chained Ogre - one of the first signs that not all is well in the land of Ashina - is a small shrine clinging to a cliffside. Posted to one of its walls is a warning: "turn back if you value your life." If you choose to advance, using your grappling hook to swing round the cliffside and down into a cave below, you'll be rewarded with a confrontation with one of From's most disturbing enemy designs yet - as well as a quick death.

THERE MAY BE SPOILERS AHEAD.

Inside the cave where the wind groans squats a Headless. This is one of several decapitated warriors that hide out in the dark, waiting to slice you into ribbons with their giant glowing katanas. Alongside several other monsters in the game, the Headless cause a build-up of Terror. When it reaches critical mass (the status bar filling up completely), you die instantly.

The most dramatic of the Headless' abilities is its unblockable grab attack. The creature turns invisible, before appearing suddenly to grapple you from behind. It's here a particularly distressing animation plays out. Seizing you, the Headless wrenches a pale clump from your rear-end, holds it in the air victoriously, and finally reaches back behind its own arse to devour whatever it is it just removed. Accompanying the animation are various meaty groans and fleshy pulsations.

The blades belonging to the Headless have a purple tinge. As in Europe, purple often implies nobility and extravagance. Due to the expense of the dye, it's likely only high level officials or members of the ruling samurai class could afford to wear the colour.

The act isn't just gruesomely disturbing, it's also intensely unusual - so odd it'd be hard to conceive of originally, recalling that famous adage: "truth is often stranger than fiction." Sekiro is steeped in Japanese folklore and mythology. Several creatures from its bestiary - such as the long-armed centipede, giant serpent and hate-filled demon - are directly inspired by a group of creatures called yōkai. Matt Alt, one of the authors of Yōkai Attack!: The Japanese Monster Survival Guide, and a video game localiser, tells me yōkai are "the things that go bump in Japan's night".

"They come in an astounding variety of shapes and sizes, ranging from human or animal-like to haunted objects and personifications of natural phenomena," Matt says. "There's actually a saying, yaoyorozu-no-kamigami, which means eight million gods. While the yōkai aren't deities per se, they are part of a richly polytheistic and animistic system of traditional Japanese beliefs."

Not every yōkai is dangerous or malevolent. The term doesn't simply translate to monster or demon, both of which have intensely negative connotations. One of the most famous yōkai, Tofu Boy, is literally just a kid walking around with a block of tofu on a plate. While there's this playful nature to many of the creatures, some of them have darker origins. One of the most well-known yōkai is the kappa, sometimes translated as "river goblin". These creatures have a list of peculiarities: a turtle-like shell, a depression atop their heads filled with water which when spilt weakens or kills them, as well as a love for cucumbers and sumo wrestling. Matt tells me they're "prodigious and powerful farters". "There's an idiom still used today, 'he no kappa' (a kappa's fart) that is used to refer to something easy, like 'a piece of cake'."

Bowels of steal.

The kappa relate to bums in more ways than one. These yōkai are the source of many an ancient horror tale. Matt tells me they're known to "emerge from the depths to drown swimmers or passer-bys for their shirikodama (literally 'small anus ball')".

"The shirikodama is a mysterious organ said to reside in the human colon, and kappa love to extract them from unwary swimmers the hard way: by hand. Or claw." Matt tells me that in times of old kappa were often blamed for drownings. It wasn't uncommon for drowned bodies to be found with prolapsed anuses. When drowning our bodies attempt to expel water, initially by coughing, but later in the struggle, through vomiting and expelling gastric content. If a body has been submerged in water long enough, there's also the possibility of aquatic life having fed on softer areas of the body like the anus. "This is where rumours of kappa ripping swimmer's bowels out through their rectums came from."

Here we see a fisherman using his own behind as bait. The kappa seems to adapt to the situation, sucking the shirikodama out rather than extracting it by hand.

While Sekiro's hulking, headless humanoids don't look much like Japan's cheeky, tortoisey river goblins (for a more literal interpretation, see that other mythological ninja game, Nioh), they do have a connection to water. Late in the game, after attaining the Mibu Breathing Technique, you can go back and explore several underwater areas. It's in these submerged depths you find several more Headless, their bodies pale and bloated. Like their cave-dwelling counterparts, they also wrestle you from behind in order to steal your shirikodama. The mythical anus-ball is rumoured to be the physically-hardened soul, and when the Headless raise it in the air and devour it via their own backside (it's version of a mouth), it suggests it's sapped some of our hero's vital energy. An ancient beast powering up on anus-orbs. Or perhaps the shirikodama is simply a tasty delicacy.

"The funny thing is, we don't really know what kappa do with the shirikodama," Matt explains, "that's the thing about folklore. It's fluid and ambiguous, an oral storytelling tradition, with countless regional variations and local modifications. Today it is very difficult to separate what's real (in the sense of traditional or historic) from embellishments or customisations created after the fact."

Being a game localiser by trade (working on Nioh, Ninja Gaiden and others), Matt can see games like Sekiro playing a part in that embellishment process. "As you can see in the many different ways that yōkai are portrayed in anime, manga and games, it's precisely that ambiguity that makes them so adaptable and entertaining even among modern audiences."

FromSoftware has certainly built on the myths of the predatory kappa and its anus-ball snatching ways in order to create a horrible, hybrid cocktail. Alongside the anxiety of having our souls plucked from our buttocks are the many cultural associations of beheading.

End-game spoiler: there's a great little detail in Sekiro's Shura ending, where after you've defeated Isshin, your adopted father Owl turns up. If you look closely you can see in his hand what appears to be the decapitated head of Genichiro, kept as a trophy.

The Headless are a group of defeated samurai. Once legendary warriors, each are associated with a particular skill (attack, defence, stealth, vitality and... more attack). The monks of Senpou temple produced blessed sugars in their name - Ako, Gokan, Gachiin, Ungo and Yashariku - each granting an appropriate buff. Defeating the Headless grants you a permanent version of these sugars. The description on the item reads: "Headless are the ruined form of corrupted heroes who once fought for their country."

Set in the midst of Japan's tumultuous Sengoku period, decapitations would have been common, with many samurais headhunting and presenting their trophies to superiors in order to attain gold and glory. Sekiro's Headless are a result of this process, although taken to the most ritually impure extreme: bodies dumped in dark places, their heads used as currency and then lost forever. Decapitated heads also feature in many Japanese folk tales. Matt speaks of the "real-life warlord Tairo no Masakado," whose severed head was buried in a cursed plot of land, as well as the oni (a particularly devilish yōkai) "Shuten-dōji", who when decapitated by samurai continued to fight on as a floating head. Sekiro's Headless are an inverted version of this: undead bodies that persist no matter the cost.

In many ways the Headless are the most FromSoft enemy in Sekiro. They remind me of that oft-quoted Miyazaki mantra that sets out his desire to convey the "deep sorrow of magnificent beasts doomed to a slow and possibly endless descent into ruin" (Dark Souls: Design Works). The Headless are certainly a sorrowful bunch - forgotten war-heroes chucked into pits and lakes and left to rot. But the terror they produce has everything to do with the folklore that influenced their design. While the loremasters will try their damnedest to work it all out, I don't think we'll ever really know what the Headless want with our small anus balls.