Platformer Enemy AI

Posted by Infinity_Plus on Sept. 3, 2010, 5:07 p.m.

Note: I apologize, I'm infamous for excessive typing. [=)]

Enemies that wander from one side of a platform to another has its advantages, the greatest one being simplicity in both programming and game play mechanics. My view, however, is that a Platformer with some sophisticated AI makes for a much more breath-taking experience.

With Ultimate Extreme Action PONG leaving me with little to work with in terms of AI (Up and Down…[=(]), I built a small Platform Engine, moderately reminiscent of Prince of Persia or Ninja Gaiden and have begun working on a bit of AI for the enemies, originally out of boredom, but currently due to interest.

The character I designed, while still only a walking Sprite Mask, carries a gun that rotates and aims in the direction of the player's mouse, and the player must fight the enemies using an arsenal of about 4-6 different weapons as they are acquired throughout the game (and possibly a few spell-like abilities or just regular ol' abilities).

This leads to a smidgen of a dilemma. Simple side-to-side AI won't suffice here; the enemy needs to be capable of taking cover, calling for backup, gauging his enemy (you) for combat awareness and ideal firing times, crouch when little cover is available, snipe if possible, throw grenades when the player is under cover, and other such concepts. The enemy needs to be able to think much like the player.

I guess I don't really have much of a question, but more of a brainstorming blog. Presently, I have several concepts on paper, with bits and pieces of code started, but haven't undergone any major coding, since the concepts are all still so early in development.

Presently, I have these enemies in concept:

Faction I

  • Scout - Spots Player, runs to other enemies to warn. Weak, Fast, short-mid range of fire.

  • Gang Member - Mid-range View, Average Life, Average Speed, Short-Mid Range Fire. No Grenades, usually come in groups. Will melee if player gets close.

  • Soldier - Mid-Long Range View, Average-Strong Life, Slow-Average Speed, Assault Weapon equipped, Mid-range Fire. Will close in for melee if player has slow-firing weapon or melee weapon equipped. Throws Grenades.

  • Commando - Mid-Range View, Strong Life, Average-Fast Speed, Assault Rifle/Pistol Available, Throws Grenades. Will go in for a melee if greater than 50% health remains.

  • Heavy - Short-Mid Range View, Strong Life, Immobile-Slow Movement, Heavy/Light Machine Gun Equipped, Wide range of Fire [can destroy environment]. Capable of smashing through walls. No Grenades. Will melee if player gets too close.

    There are three factions of enemies: Demons, Humans, and Angels. The list above is for Humans. I have no real concepts on Demons or Angels as of yet. The fun part of the enemies is some of them may have Action Sequences associated to their abilities. The player may have to repeatedly tap a certain key or sequence of keys to hurt or escape an enemy or enemy's attack.

    I guess, for the sake of the blog, if you've made it this far, is to ask what type of enemies you think would be interesting to see in a Platformer? I'm uploading a video to Youtube to display the progress on the Platform Engine that the AI will be present in, to give the readers/viewers here a better understanding how the player will have to fight said enemies.
  • Comments

    OBELISK 14 years, 3 months ago

    I need this, someone send me the code or some shit.

    death 14 years, 3 months ago

    ahh enemy A.I. oh what fun. i'm working on some horrifying code right now for enemy A.I. it's for my current project. a 4p battle game (platformer) the enemies have to be able to replace the characters if there aren't enough human players available… very tough to get A.I. up to human-level.

    i have a little experience with A.I. with my previous game but nothing at this level xD

    anyway good luck with your A.I. maybe we could exchange ideas sometime ^^

    Infinity_Plus 14 years, 3 months ago

    The AI isn't finished, or even really started, yet; I'm still working on conceptual design. The Player Engine is complete, aside from the Action Sequences, which are context sensitive, and must be programmed as the game progresses.

    Unless you needed the Engine for the Player Movement/Collisions. I have that, albeit the coding may be a bit messy.

    Lapixx 14 years, 3 months ago

    Quote:
    (…) some of them may have Action Sequences associated to their abilities

    They should, obviously. Types of enemies should strongly depend on the abilities (or, equipped items) of the enemy. "Abilities" could also be some sort of role, like the scout. He has a goal, other than just attack the player, and should act based on that goal.

    Also, it would be interesting to see more group-based actions. The scout is, again, an example of this. The individual enemies should have some sort of universal goal, probably making sure the player won't pass a certain border. When an enemy get's killed, another one could move to another position in order to guarantee a strong defense line.

    Or something like that :P

    Infinity_Plus 14 years, 3 months ago

    Quote: Lapixx
    The individual enemies should have some sort of universal goal, probably making sure the player won't pass a certain border. When an enemy get's killed, another one could move to another position in order to guarantee a strong defense line.

    This is the essence I'm hoping to capture. A sense of overwhelming is somewhat essential to convey my character and story. The annoying part to some players will be that, although your character is facing many enemies/very strong enemies, you are relatively weak. You have guns and can use melee weapons, but you can't sustain damage like the enemies you're fighting, especially when you start facing Demons/Angels. This is the style of gameplay I enjoy, but many players will disagree. [=P]

    Ferret 14 years, 3 months ago

    Your blog broke the front page.

    Also, forum page numbering broken, page 12 isn't being displayed, have to go to with with php.

    sirxemic 14 years, 3 months ago

    Quote:
    Your blog broke the front page.
    How?

    Quote:
    Also, forum page numbering broken, page 12 isn't being displayed, have to go to with with php.
    Working on it.

    Ferret 14 years, 3 months ago

    look how it lists his name and number of comments

    sirxemic 14 years, 3 months ago

    Quote:
    By Infinity_Plus - (8) Comments
    How is that odd?

    Ferret 14 years, 3 months ago

    image

    **fix'd