dcsimg
A Flash Developer Resource Site

Results 1 to 18 of 18

Thread: [DISC] Types of AI in platform games

  1. #1
    2D/3D Artist & Programmer Dominicaninja's Avatar
    Join Date
    Jun 2005
    Location
    NY
    Posts
    159

    [DISC] Types of AI in platform games

    Hi all, I'd like to hear the types of AI that people have seen in platform games over the years. When you list one, try to mention the game where you have seen this AI. I think a list like this can be helpful to those designing simple AI for their Flash platform games. Here's some that I've seen:

    *Super Mario Bros. (contact w/ enemy causes death)
    -moves in one direction until falls off platform or touches a wall.
    if touches a wall, change direction
    -jumps in one direction until falls off platform or touches a wall.
    if touches a wall, change direction
    -moves in one direction until touch an edge or a wall.
    if touches edge / wall, change direction

    *Metal Slug (contact w/ enemy fire or melee causes death)
    -holds position until player approaches, then:
    -walks in one direction until next to player.
    melee attack player when next to him.
    -walks in one direction, throwing grenades at player.
    melee attack player when next to him.
    -holds position and fires in all directions at player
    -jumps and fires a homing missile at player, then dives back into water

    *Castlevania series (contact w/ enemy or enemy fire causes damage)
    -flies in a wavy oscillating pattern from one side of screen to other.
    respawns centered to player's _y coord and repeats.
    -walks in one direction, jumping over any gaps until within firing range
    of player. begins throwing falling projectiles upward toward player.
    maintains _x distance from player while throwing falling projectiles.
    -walks slowly in one direction toward player

    ...more to come...
    If only we could be as productive as we are imaginative...

  2. #2
    Patron Saint of Beatings WilloughbyJackson's Avatar
    Join Date
    Nov 2000
    Location
    Ro-cha-cha-cha, New York
    Posts
    1,992
    Rush N' Attack
    - Enemies spawn off screen and chase after the player. They spawn from both sides. If the player is stationary, more enemies spawn. Enemies attack when close.

    - Same as above, exact enemies jump attack went near.

    - Enemies generate at a set location in the scroll, once they are visible, they fire at the player.

    SHEER COMEDY: Bullets are only a slight bit faster than you and you can almost outwalk them.

  3. #3
    2D/3D Artist & Programmer Dominicaninja's Avatar
    Join Date
    Jun 2005
    Location
    NY
    Posts
    159
    Quote Originally Posted by WilloughbyJackson
    SHEER COMEDY: Bullets are only a slight bit faster than you and you can almost outwalk them.
    Haha, actually I've seen that in a few games. Robocop Vs. Terminator first level. Those little bullets are easily outwalkable (robocop is not much of a runner). Good stuff. Keep 'em coming.
    If only we could be as productive as we are imaginative...

  4. #4
    Senior Member tonypa's Avatar
    Join Date
    Jul 2001
    Location
    Estonia
    Posts
    8,227
    My Starrunner game has enemies not mentioned here. They can climb ladders and chase you around, fly and drop bombs at you.

  5. #5
    Style Through Simplicity alillm's Avatar
    Join Date
    Mar 2004
    Location
    Wales
    Posts
    1,988
    I think N has some nice examples

    - move around randomly untill they see the player then they fly towards him at a faster speed

    - those wierd explosive things that shoot towards you when you land on the same platform as them

    Ali

  6. #6
    A very senior man mrpauly99's Avatar
    Join Date
    Feb 2002
    Location
    Cool Britania
    Posts
    429
    i loved the old enemies with no ai. old games like manic miner where the baddies just moved back/forward/up/down. learning their movement patterns makes for a completely different style of play than with clever evil sprites.

  7. #7
    2D/3D Artist & Programmer Dominicaninja's Avatar
    Join Date
    Jun 2005
    Location
    NY
    Posts
    159
    Quote Originally Posted by alillm
    I think N has some nice examples
    - move around randomly untill they see the player then they fly towards him at a faster speed
    I finally got a chance to try out N. Yea those flying security bots, or whatever they are, can be a pain but in a good way since it's not too hard to avoid them.
    Tonypa: I gotta check out your Starrunner game, sounds interesting.
    MrPauly: I was surprised at how many games used that simple kind of AI. Move back and forward and that's about it. Even games like Contra and other big hits like that had some enemies that literally just ran across the screen. If you think about it, if every enemy was a challenge, the game probably wouldn't be too fun. When playing Metal Slug again, I was surprised to see how most of the enemies didn't shoot! Most were melee attackers. Here's some other enemy AI I've seen:

    *Robocop Vs. Terminator
    -walk to player and fire three shots, breathe for two seconds, repeat.
    if take damage, crouch and fire three shots

    -hide in background. when player approaches, come out and
    fire three shots. if fired three shots or take damage, hide again.

    -move to player, climbing any ladders and jumping if necessary.
    fire at player when in range.

    -use shield to block all shots. when player looks away, fire a couple of
    shots then resume blocking.

    *Shinobi
    -walk to player and melee attack low

    -crouch and wait for player. stand and slowly fire 4-5 shots then
    crouch again. repeat.

    -stand and block all shots while slowly inching toward player.
    when player stops shooting, throw boomerang projectile at player.
    if close, melee attack.

    -climb down wall slowly toward player. when near, jump down and attack.
    (I forgot if he just stays there when he misses or if he jumps back up
    to wall)
    If only we could be as productive as we are imaginative...

  8. #8
    Senior Member Ray Beez's Avatar
    Join Date
    Jun 2000
    Posts
    2,796
    Some classic types of "AI" are not really AI...

    Left-Right guy: Stands and walks on a surface. Walks until it gets to the edge or an obstacle. Turns around and heads in other direction. Does this infinitely.

    Pattern Guy: Follows a particular pattern and repeats it.

    Homing guy: Always moves directly towards the player. (with object detection if applicable)

    Homing guy with range: Similar to the Homing Guy above, but the homing AI doesn't kick in until either the player is within a certain range, or is within a line of sight. Until then, this guy can act like Pattern guy or Left-Right guy, or...

  9. #9
    2D/3D Artist & Programmer Dominicaninja's Avatar
    Join Date
    Jun 2005
    Location
    NY
    Posts
    159
    Quote Originally Posted by Ray Beez
    Some classic types of "AI" are not really AI...

    Left-Right guy: Stands and walks on a surface. Walks until it gets to the edge or an obstacle. Turns around and heads in other direction. Does this infinitely.

    Pattern Guy: Follows a particular pattern and repeats it.

    Homing guy: Always moves directly towards the player. (with object detection if applicable)

    Homing guy with range: Similar to the Homing Guy above, but the homing AI doesn't kick in until either the player is within a certain range, or is within a line of sight. Until then, this guy can act like Pattern guy or Left-Right guy, or...
    Hehe, yea I think you described just about every platformer AI in a nutshell. Funny how even with similar AI, all these games were still fun in a different way. I think it's all in the way its presented to the player. You can have an enemy coming at you from the same direction with the same AI over and over again, but that will get boring fast. If you mix in different enemies with different AI's and have an interesting environment (hills, barricades, etc), I think that's when things get interesting. All of a sudden, an enemy coming at you from one direction can seem like he's assisting the enemy throwing grenades at you from a distance. I think usually you'll see smarter AI in boss characters since the focus is on taking that one enemy down.
    If only we could be as productive as we are imaginative...

  10. #10
    Patron Saint of Beatings WilloughbyJackson's Avatar
    Join Date
    Nov 2000
    Location
    Ro-cha-cha-cha, New York
    Posts
    1,992
    All of these facts could probably be seperate into the different charactersitics of the enemy AI. Something like:

    1) SPAWNING
    1. Timed (If enemy count is less than X...new enemy spawned)
    2. Fixed Position Spawn (When scroll reaches X, enemy appears)


    2) MOVEMENT
    1. Forward until hit a wall, then reverse (or back and forward on platform)
    2. Move towards hero
    3. Randomly move
    4. Not moving
    5. If spot hero, chase him, otherwise move towards hero


    3) ATTACKING
    1. Walk into hero
    2. Attack hero (punching or kicking)
    3. Shoot hero with bullet weapon


    Something like that...

  11. #11
    Senior Member
    Join Date
    Feb 2005
    Posts
    1,808
    Platform games haven't stopped. They've just got a bit more complicated. To mention my favorite gaming console game "Super Smash Brothers". Preferably the second version "Melee". It would be difficult to second guess some of the ai's that they use. It's really good.
    .

  12. #12
    PlayerForever adi4x's Avatar
    Join Date
    Feb 2005
    Posts
    753
    my "Mad Pac" enemies
    - following you at maximum speed on both x & y axes
    - getting tired ... slowing speed at 1/2 ...
    - sleeping ... no harm for you
    Card Games - play many card games free
    Free Games many free online games

  13. #13
    2D/3D Artist & Programmer Dominicaninja's Avatar
    Join Date
    Jun 2005
    Location
    NY
    Posts
    159
    Tonypa: I played your StarRunner game. I love the graphics and simplicity of it. I didn't get far enough to see the enemies that fly and drop bombs though, but I did get killed by the ladder climbing robots a couple of times

    Willoughby: About spawning, did you ever play the original Ninja Gaiden? The same enemy would respawn from a location every time you passed by it. So even if you just killed him/it, the enemy would reappear if you were to walk away and come back. I think this was the case with the original Megaman games too. I found that annoying, especially when some of those respawned enemies in Ninja Gaiden would move really fast, knocking you down into a pit.

    swak: Yea I know what you mean about the AI in Smash Bros. On the hardest setting they can be really annoying since anything you throw or shoot at them will get reflected back to you. I think that's why some people say coding a fighting game can be really hard, since there are so many moves that you have to account for and you don't want the computer countering every move you do. It's not always easy finding that balance.

    adi4x: I gotta play around with MadPac more, I only took had a glance at it yesterday.
    If only we could be as productive as we are imaginative...

  14. #14
    Patron Saint of Beatings WilloughbyJackson's Avatar
    Join Date
    Nov 2000
    Location
    Ro-cha-cha-cha, New York
    Posts
    1,992
    Quote Originally Posted by Dominicaninja
    About spawning, did you ever play the original Ninja Gaiden? The same enemy would respawn from a location every time you passed by it. So even if you just killed him/it, the enemy would reappear if you were to walk away and come back. I think this was the case with the original Megaman games too. I found that annoying, especially when some of those respawned enemies in Ninja Gaiden would move really fast, knocking you down into a pit.
    That's pretty traditional in older games. It took up a lot more memory to remember which enemies were dead or alive, then just have them comeback.

    If you think that is annoying, you should play Valis VI for PC-Engine CD-ROM, specifically, the last level. It is composed of a series of platforms over a deep pit (instant death) with enemies on every platform. If you accidently hit any of the enemies, the hit animation would more than likely knock you into one of the pits. However, there are several places where you MUST jump on certain enemies in order to cross from platform to platform. The hit animation knockback in the air could take you farther than jump alone if timed correctly. And since there were no health ups in the level, you had to be absolutely perfect or you wouldn't have enough health to make it to the next level and the final boss. My patience wore thin and I never solved that game.
    Last edited by WilloughbyJackson; 03-15-2006 at 02:22 PM.

  15. #15
    2D/3D Artist & Programmer Dominicaninja's Avatar
    Join Date
    Jun 2005
    Location
    NY
    Posts
    159
    Quote Originally Posted by WilloughbyJackson
    If you think that is annoying, you should play Valis VI for PC-Engine CD-ROM, specifically, the last level. It is composed of a series of platforms over a deep pit (instant death) with enemies on every platform. If you accidently hit any of the enemies, the hit animation would more than likely knock you into one of the pits.
    That sounds like a nightmare! Sometimes I seriously think that some of these companies don't even play through their game before releasing it.

    Anyone know of any Flash games with AI not mentioned here? It would be cool to see a game with enemies that think outside of the box.
    If only we could be as productive as we are imaginative...

  16. #16
    Patron Saint of Beatings WilloughbyJackson's Avatar
    Join Date
    Nov 2000
    Location
    Ro-cha-cha-cha, New York
    Posts
    1,992
    Well, it depends on what you mean.

    I mean, the Doujinshi game ElePaper Action.

    Enemies spawn from certain locations once, and go after the player and shoot.

    HOWEVER, they block, they time shots to knock you out of the air if jump too much or shoot low if duck too much.

    Is this the kind of AI you are talking about? More like a one on one fight game AI type?

  17. #17
    2D/3D Artist & Programmer Dominicaninja's Avatar
    Join Date
    Jun 2005
    Location
    NY
    Posts
    159
    Yea that AI sounds interesting. That's actually what I'm trying to do with a game I'm working on right now, minus the "shoot player out of the air if jump too much" part. There's no Flash version of that is there? I only saw a few screenshots of it when I did a search.
    If only we could be as productive as we are imaginative...

  18. #18
    Patron Saint of Beatings WilloughbyJackson's Avatar
    Join Date
    Nov 2000
    Location
    Ro-cha-cha-cha, New York
    Posts
    1,992
    Nope. That game was programmed in C++...

    In all honesty, I can't think of any Flash games with really good enemy AI...

    I mean, I like this game:

    http://www.adultswim.com/games/samur...ght/index.html

    But the AI is pretty typical.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center