Sign in to follow this  
Marscaleb

Basic enemy design

Recommended Posts

Does anyone have a link to an article or something about enemy design?

 

As I put the rubber to the road, I begin to realize how I've been taking this topic for granted.  I feel like I could really use a well-written article to give some pointers on how I should go about designing the enemies to put in my game.

Especially if it has a good focus on how to properly balance them; most of the ideas that come to my mind are patterns that are really easy to read and present no challenge to the player.

 

I'm building a 2D Platformer, but really any general advice will do.

Share this post


Link to post
Share on other sites

Do you have anything in particular in mind as an inspiration? The reason that I ask is that many platformers have very simple enemy behavior. If there's a focus on speed or precision (e.g. jumping, dodging moving hazards, etc) then you may not want to cognitively overload the player. Simple enemies can lead to good flow if the rest of the level is appropriately challenging. For me, more complex enemies only make sense as bosses or in similar circumstances (e.g. not too many enemies, not too much environmental challenge).

Share this post


Link to post
Share on other sites


I'm building a 2D Platformer, but really any general advice will do.

 

It actually matters. the concept of 'enemy' or 'adversity' in a game is intimately tied to the gameplay and objectives.

Since you've mentioned enemies, I will refrain from covering other gameplay ingredients (obstacles such as spikes, etc.)

 

In a classic platformer where the player has a set number of lives and possible sudden death situations related to the level (holes), enemies come in various shapes and forms, but they almost always serve one of these objectives:

- Push the player (hopefully towards a sudden death or another enemy)

- Hit the player (either through contact, or with the use of projectiles, most platformers give them the advantage in close contact unless attacked from a specific angle (upwards in mario, some back attacks in Rogue Legacy, etc.)

- Manipulate the field (change the scenery on the fly to prevent the player from progressing smoothly).

 

With regards to Sunandshadow's "movement", note the progression of movement patterns. In Mario 1 for example, some monsters will not fall of a ledge, whereas others will. Also, there is a progression through movement to increase difficulty (a flying turtle is harder to dodge due to the more complex movement pattern)

A more general point can be made about AI movement in many different types of games. In Raptor: Call of the shadows, most enemy ships come vertically, while a few (mainly ships) come horizontally. One particularly annoying enemy works in pairs to make twin diagonal attacks. Though it is particularly easy to kill, it makes it unpredictable and keeps the game engaging. Breaking non-existent rules that all other enemies seem to be observing is often a means to make an enemy memorable.

 

If, for example, your game engine allows for double-jumping enemies, but that, as a general rule of thumb, none of your enemies use it, tossing an enemy that has the option of double jumping can emulate the feeling of discovery and helm with pacing.

Share this post


Link to post
Share on other sites

What's the theme of the game? Can the player do things other than jumping on platforms? An important part of designing enemies is how the player interacts with those enemies. If the player has a sword or a gun (or I guess any attack), the enemy might have a shield that blocks the attack. But you need a way to beat it, so the player could jump over the enemy and hit it from behind, or the enemy could switch to an attacking stance, vulnerable to take damage, or maybe the player has another attack that can go through a weak shield? It's all about making interesting interactions between the player and the enemy. By making the enemies simple, but different from eachother, you can get a good variety with different combinations of enemies.

Share this post


Link to post
Share on other sites

I just played Super Crate Box for the first time, and it got me thinking again about this topic. I don't know if the game adds more enemies later, but what I played had 3 enemy types. A simple enemy that walks until they hit a wall then turns around, eventually falling down enough platforms to get to the bottom. This returns them to the top, where they're angry and move faster. Sometimes 3 of them spawn in a row. There's a big enemy that behaves the same, but has double life and is tougher to jump over. And there's a floating skull thing that flies around somewhat unpredictably, and tries to land on your head. You have guns to kill the enemies, but if they touch you, you die.

 

Just these three enemies are enough to make the game challenging. Without the floating skull enemy you could stand against a wall firing a decent gun, and never worry about the enemies. But the skull comes at you from above where you can't shoot. It's not that powerful, but it's just enough to force you to move around more.

Share this post


Link to post
Share on other sites

The logic for the enemies or the art?

 

I needed some logic for my enemies and I pretty much did what sundandshadow suggested. If a player collides with an enemy it does damage. I also made the enemies continuously move towards the player, and I used a timer(with random values) to make computer attack. It worked pretty well for a retro style boxing game I made. 

 

If you want artificial intelligence, there are plenty of ways to go. I am interested in fuzzy logic myself. 

Share this post


Link to post
Share on other sites

What's the theme of the game? Can the player do things other than jumping on platforms? An important part of designing enemies is how the player interacts with those enemies. If the player has a sword or a gun (or I guess any attack), the enemy might have a shield that blocks the attack. But you need a way to beat it, so the player could jump over the enemy and hit it from behind, or the enemy could switch to an attacking stance, vulnerable to take damage, or maybe the player has another attack that can go through a weak shield? It's all about making interesting interactions between the player and the enemy. By making the enemies simple, but different from eachother, you can get a good variety with different combinations of enemies.

 

This is one of the things that has been particularly bothering me.  When I was planning a lot of this game, it was largely inspired by Mario, and so my first thoughts for enemies were very very simple ones, like in Mario.
But before long I realized I had a problem.  I'm using mid-ranged attacks in my game, shooting projectiles with limited distance.  But Mario revolves around having to jump on enemies to beat them, so it can do so much more because you HAVE to get close to the enemies.  If you don't jump on them just right you'll land in front of them and get hurt, or they could be in tricky spots that require expert jumping to get to, etcetera.  They got away with really simple patterns because of those mechanics.  They can get away with a short list of enemy types and rely on unique level designs to incorporate new challenges.
But if I can just shoot those guys from a distance, then there is no challenge, no matter what the level design.

Now, I've also been strongly considering having the player only able to take one or two hits before dying.  The only platformers I can think of that do that and have ranged weapons are the Ghosts and Goblins series and Karnov.  G&G is purposefully made extremely challenging, so it's hard to emulate a lot of what they do, because there isn't much that I can scale back into a lesser challenge and still have it work; and Karnov relies on rapid-fire and inventory, (and just has poor enemy design anyway,) so neither of those titles *really* have much I can reverse engineer to understand what I need to do in my game.

 

The logic for the enemies or the art?

 

Honestly, I intentionally left my original post ambiguous because I want to try working over from scratch.  My fundamental concern is with the gameplay design of my enemies, but I will take advice for things like designing a proper look because I could use that too.  Especially for the game's main villain; that's a critical role and you really need someone who looks fantastically villainous (unless you're going for a story focus, which I'm not.)  I'm not really happy with any of the ideas and designs I've come up with so far.

Likewise, I think part of my problem could be that I have not established enough of my world/setting to be able to devise the enemy designs I need.  I might be struggling because my design ideas are too ambiguous, and so I can't work out what an enemy should either look or behave like because I don't have my guidelines set well-enough.  So yeah, I'm open to advice about art or other concepts so I can put my design in a more concrete set of guidelines, and maybe that will help.

 

***

 

Since everyone is so focused on the particulars, I'll give a few.  I'm doing a lighthearted theme, with a somewhat silly and cartoony nature.  Everything else about the setting is pretty open and subject to change.  I'm looking at a lot of diversity with my areas; the normal slough of everything form forests to deserts to underwater to mountains.  I keep going back and forth on what sort of technology level (or magic level) I want the world to have, partially because I want it to be freely open, and partly because I don't want it to matter.  Like when you look at the Mario series, they establish very little so they are free to do a lot.  I'd really like to capture that freedom and originality, but I'm having a hard time doing it.
Although I suppose that's really different from the discussion on enemies.

Share this post


Link to post
Share on other sites

If you're doing a lighthearted an silly approach, you might not want standard terrain types.  Instead you might want to use stronger themes for your areas, like: land of candy and desserts.

 

Do you have any kind of story concept?  If the main character is supposed to be a pirate or a ninja or a frog or whatever, that is a good place to start thinking about the main villain as either the worst possible match-up for the main character or an evil version of the main character.

Share this post


Link to post
Share on other sites

If your player character has a medium-range attack, you might consider having enemies with medium- to long- range attacks, allowing them to challenge the player by requiring that the player evade their attacks while getting close enough to hit them.

 

This doesn't necessitate terribly complex enemies, however, I believe. For a few examples, you might have:

  • An enemy that performs its attack on a strict timer, regardless of the player's presence or absence.
  • An enemy with a simple linear patrol, walking left some distance, then right some distance, then repeating. If the player is located in the direction in which the enemy is facing, the enemy stops patrolling; if the player is also within attack range, the enemy attacks.
  • An enemy that patrols, as in the second example above, but which always knows when the player is nearby and turns to attack.
  • An enemy that lobs grenade-like projectiles with an arcing trajectory, but with limited range; its behaviour might fit any of the examples above.
  • An enemy that acts as in one of the examples above, but which has an erratic firing interval, calling for the player to react to each shot rather than just adjusting to a fixed timing.

Of course, it might still be worth having some melee-only enemies, whether weak, and thus providing some easy foes, or one or more of agile, tough and fast, making for a challenging change of pace from the usual enemies.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this