
Last month I said I wanted to get a few enemies done to flesh out these early areas. I also said, somewhat optimistically, that I thought I might be able to do them all in a week – this turned out, unsurprisingly, not to be the case, but for largely positive reasons. While it did, in the end, take me more like two or three weeks to get my planned enemy types created (sort of – partway through I decided one didn’t really work and replaced it with another idea, then added a few more), much of that time was also spent improving and revising existing enemy types and the base enemy type they were all derived from. Instead of merely disappearing when defeated enemies now leave behind corpses, and blood effects are created on hit, which in general makes combat feel better.
I created six new enemy types – in addition to the three I already had I have a total of nine enemy types for this first section of the game. I wouldn’t mind having one or two more, particularly as one of these doesn’t actually become aggressive until later on in the game, and I’ll try to keep an eye out for opportunities to develop additions – but I think these will work well for the time being. Let’s look at them each in turn, in order of development:

Spider
This is the first enemy type I developed, which turned out to be kind of a mistake. A spider seemed like an obvious presentation for the classic Metroid enemy type that crawls around the edges of platforms, particularly within a horror game – and, while I dislike video game spider enemies maligning a generally benign animal, sometimes the pieces just fit. That being said, this was probably a bad choice for a first enemy to develop as this behavior, while simple enough to explain, is a tad tricky to program. They’re still, appropriately enough, a little buggy, but work well enough for the time being. Something perhaps worth noting is that they only attack the player if the player overlaps the face region – this is, in general, the approach I’m using for static enemy attacks, a compromise between the simplicity of enemies hurting on touch and the labor-intensiveness of every enemy needing individually animated attacks.

Ghoul
After the headache that was the spider enemy type, I wanted something dead simple – or undead simple. I decided that an enemy type that just walked back and forth would fit the bill, and something like a zombie seemed to match that and the presentation. Still, just because it’s simple doesn’t mean it has to be boring – the ghoul has a couple of quirks which I find quite interesting. First, like the spider, its static attack only extends across the hands, so as long as you stay clear of that you can get right up behind them safely. Second, rather than slow steady movement, they move by short bursts of speed, individual steps, synced up to the animation. Third, they are what will probably be one of very few enemy types that has a negative knockback value on hit – that is, while most enemies send the player flying on hit, the ghouls will instead pull them closer. Of course, you have a moment of invulnerability afterwards to escape with, but I think this will interact very interestingly with other combat elements.

Fly
This was the last enemy I developed for the one-month prototype version – and was the first enemy type to actually have some awareness of the player. This turns out to be a very simple thing to implement, requiring only a collider representing the vision cone that sends a message back when it overlaps with the player’s collider along with a few ray casts to ensure that no interceding terrain is blocking its vision. The fly slowly flies in circles, looking back and forth based on its current movement direction, and if it sees the player slowly moves towards them. It immediately gives up when it loses sight, which is increasingly likely the closer it gets. This results in a kind of strange and indirect attack which isn’t extremely directly threatening but provides a tricky obstacle to movement. This enemy type may be prone to revision, both because its behavior feels a bit flat and, as well, somewhat un-fly-like – a rather fast and reactive animal, quite unlike these sluggish aggressive air-worms.

Dog
I don’t really like how many games have you killing dogs, but… they’re an animal which is plausible to encounter in an urban environment, and are also potentially very threatening, so again sometimes the pieces just fit. The first task at hand was figuring out how to do pathfinding – this is a non-trivial task in a 2d platformer, particularly accounting for things like momentum and variable jump-heights, but after looking into it I found that in actuality I didn’t want to do it. After reflecting on it for some time I realized that, you know, dogs really aren’t that smart, and considering the structure of the levels they are unlikely to be able to see the player from far enough away to actually need to do sophisticated pathfinding. In the end, I implemented something similar to the way shopkeepers behave in Spelunky: Run towards the player, jump if they’re above you or if there’s a gap in the floor in front of you. It’s not flawless, but it feels pretty good, and they’re still an extremely persistent and aggressive enemy and, under most circumstances, will be able to navigate to you. Of course, that aggressive behavior is only part of the puzzle! When not actively attacking, dogs will wander around, sniffing at random pieces of ground – or, given the ambiguity in animation, perhaps eating something off of it. There are some other fine-tuned bits of behavior, but I’ll get into those later.

Bird
These are a very direct riff on the bird-type enemies in Symphony of the Night (unsurprisingly one of the biggest inspirations for this project, and my design aesthetic in general). They lurk on a perch, and when they see the player immediately try to move somewhere above them – exactly where varies a bit, but generally right out of reach of normal player attacks. At irregular intervals, once they reach this height, they’ll try to divebomb the player by moving directly into them, and after recovering from this try to move back to their old position. If they lose sight of the player they give up and find a new perch. This feels very obnoxious in exactly the right way for this enemy to be – fortunately they’re fragile, if you can catch them. Similar to the ghouls, the birds are given much more life and personality by giving them an idiosyncratic movement style – rather than smoothly gliding where they want to go, they have to gain altitude with individual wing-flaps, so they struggle for a little while to get above the player, giving an opportunity to strike them down.

Corpse
These aren’t actually enemies, but it’s important to talk about them now anyway because they interact deeply with the enemy system. Each enemy leaves behind a corpse when it dies: This was originally something created primarily for aesthetic effect, but as I worked on the system more I started considering ramifications beyond the aesthetic. Are corpses flammable? Do they take damage? Do enemies notice them, and if so what do they do about that?

Rat
Well one enemy type that would definitely take notice of corpses are rats. This is actually an enemy I had the idea of for a special encounter later on, but they also make sense as a frequent encounter – and will be particularly so once I start developing the underground sections, after this slice of the game is complete. The immediate question, though, was how is a rat going to be anything other than a smaller, slower, more annoying to hit dog? It could have been that I suppose, but instead I took a page from Dishonored’s book: One rat is harmless, and will run away. Two rats, as well, are harmless – but once there are three rats near each other, they turn aggressive and will start to pursue the player. When they’re not doing that, though, they run to any corpse that they can see and start nibbling away at it – largely an aesthetic touch at this point, except it means you’re more likely to encounter dangerous congregations of rats instead of individual wanderers.
Once I introduced this idea, though, I realized – well, dogs are also scavenging, so they should have the same behavior, right? It was easy enough to implement, so I immediately made the dogs seek out corpses when idling. But then this created a strange situation where dogs were ignoring rats to nibble on nothing on the ground – surely this wasn’t right? A few hours later, dogs were updated to hunt and kill rats while scavenging. I haven’t yet gotten to the point where rats also group together to hunt dogs, creating rat-dog wars for the player to stumble across – I mean, it’s the city, it makes sense if rats have learned to be way more scared of dogs than they are of people. Still, these sorts of interactions can be intoxicating to play with: There’s no knowing how far you could take it. Similarly, it feels a bit odd that flies and birds, two animals famously interested in carrion, currently don’t notice corpses – this is something I’ll have to consider and iterate on.

Flinger
Now I have the game’s first projectile-based enemy. These creatures come with pre-existing props – garbage cans, boxes, piles of corpses, which they search through looking for, I dunno, something. All of these props count as corpses, since scavenger-type enemies will be interested in them for the same reasons, but as far as the Flinger goes it is completely static once placed. If the player comes near, it looks up and grunts, and if they don’t back off starts frantically throwing garbage at them. The model of this enemy type is the classic Castlevania skeleton, but I wanted projectiles with a more concrete existence in the world (the Castlevania skeleton throws bones that ignore all terrain), and a creature hunting through the trash made sense in terms of having a bunch of things to throw. I steered away from my original intent of making this a different variety of ghoul, since having something basically human-looking digging through trash be an enemy seemed loaded and hamfisted, and instead made a sort of masked hunched creature. I’m not sure what the Lore is here, and that may be something I need to ponder more – however, in terms of gameplay, I really like the feel of it. The Flinger actually throws one of four random projectiles, and each of these has unique properties:
- Can: The baseline projectile
- Bone: Bouncier and lighter
- Rock: Heavier, less bouncy, and has more knockback
- Bottle: Lighter, explodes instead of bouncing

Mannequin
While I had a set of enemies that felt at home in the first residential apartment area (humanoids and scavengers), and I had some enemies that felt at home in the second forested park area (animals), it seemed like none of the enemies felt very suited to the third section, the dark creepy hotel. While certain enemies, like spiders and flies, would gain new prominence in this section, they didn’t really have a unique identity, being things you’d likely frequently encounter elsewhere as well. I decided that a more overtly horrific enemy would work well in this environment, and came up with the idea of some sort of puppet enemy, something truly unnatural by definition. It wouldn’t move in the normal sense – unlike other enemies so far, which walked or flew around, these would teleport a few tiles at a time suddenly towards the player – but only when the player moved themself. Additionally, they would only attack when the player attacked – making them fairly trivial to deal with individually, but extremely dangerous in combination with other enemies. The idea with this was to emulate the reactive style of the Goriya enemies in Zelda, who mirror the player’s movement, as well as the Boo enemies from the Mario series who only move in to strike when the player’s back is turned. Having an enemy who is effectively controlled by the player ratchets up tension and adds a sense of deliberate planning to the player’s approach, forcing them to slow down and consider things a bit more carefully – which works well for conveying, however slightly, a sense of dread.

Maggot
Finally (so far), I realized that while all of these nuanced and distinctive enemies were great, sometimes you do just want something simple – and that, for a simple enough enemy, the time to completion would be much faster. With that in mind, I made the simplest (and, perhaps, grossest) enemy possible: a maggot. Maggots don’t actually have much offensive apparatus to make them dangerous, so these are, for whatever reason, explosive – maybe they’re just overfilled, or have some sort of ongoing chemical process, but if they’re touched or attacked by the player they just pop and do damage. In practice, these aren’t much different from spikes, but they certainly provide many opportunities to be used later for scripted events and for other enemies’ attacks. If nothing else, they provide another force pushing the player to slow down – and to consider where they’re stepping.
After constructing all these enemy sprites and behaviors, I then had to give them all sound effects. There are two challenges to this: First, generating the sound effect itself, and second finding the right way to control how and when sound effects play. Almost all enemies had sound effects for taking damage and dying: Many also had sounds for performing attacks. The trickiest, though, were the sounds like rats squeaking, which needed to happen frequently enough that you could tell there was a rat, but couldn’t happen too often or predictably without seeming obnoxious and mechanical. There’s still room for improvement in these audio triggers, but I generally think the sound design on these creatures is in a good place right now.
I also put some time into generally making the combat feel better. I’m tweaking animations here and there to make the character motion more satisfying – as well as taking a closer look at the power of post-processing effects. I abstracted several effects – noise, chromatic aberration, and a pixelated vignette – behind one basic “intensity” value. Every room has a base value, and events like low health and nearby dangers can increase this. As well, there are additive intensity pulses created for special events, like receiving damage. This makes every bit of damage received more impactful – but also creates a subtle form of feedback on nearby dangers which might be hidden by lack of light. Additionally, there’s a brief temporal warp on hit, where time stops for a moment before returning to normal, giving the player slightly more opportunity to recover from mistakes. This all, naturally, will be tested and retested and polished many times over the course of developing – still, after just putting a few days into these effects, the results are very encouraging.
Here’s a video of many of these enemy types and intensity effects in action:
All of that took the better part of the month, but here and there in between I pondered what exactly I was trying to do with the narrative component of this project, and what my approach to it should be. My concept of the narrative is an in-depth version of the Dark Souls NPC quests – You meet characters in the world, most of them several times, and based on what items and information you give them and how you speak to them their story progresses, for good or bad. The difference is in the degree of divergence and number of characters. Given the style of the game, I can easily implement as many characters as I need – sprites and portraits take a little while, but that’s not going to be a major burden on this project – but figuring out what each character is about, how you can engage with them, and what can happen to them is just a huge tangled ball of story to tackle. Initially I was very focused on figuring out how to do this branching narrative work from an implementation angle – and, sure, implementation is important, but now I feel that the real challenge is just keeping track of what needs to happen. I still don’t feel like I have a strong grasp of this challenge, but I’m at least starting to get a feel for its dimensions – and, fortunately, there’s a lot of good writing out there on how to do interactive fiction, even if little of it is focused on the exact model I have in mind.
Alright, that was a lot to get through! Now that the enemies are in working order, I’ll be placing them throughout the world and making sure save points work, getting the heal ability working, and getting the core flow of this slice of game set up from start to finish. I’m going to start trying to get these character stories started – particularly now that I’m finally fairly caught up on the writing I need to do for the blog – and I’m going to start designing this boss. With that and some work on the UI, I’ll be extremely close to completion of this slice. Completion before the end of the year is starting to seem feasible – though, as always, it seems to retreat gradually further away the closer I get.