User Tag List

Results 1 to 7 of 7

Thread: AI

  1. #1
    No Products Registered

    Join Date
    Oct 2007
    Location
    Norway, Oslo
    Posts
    379
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    AI

    How can I create that enemy following the player everywhere. Not like Pac Man, using bouncing ball movement on enemy, but like Loderunner on C64 where enemy also have a platform movement.

  2. #2
    Clicker Multimedia Fusion 2SWF Export Module
    Jacob's Avatar
    Join Date
    Jul 2007
    Location
    Second pixel to the right
    Posts
    3,208
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: AI

    Have your enemy use default platform movement on player 4 and use the event:

    +Always
    --Player 4 control ignore
    --(enemy)look at 0,0 from player
    --(enemy) set speed to "(somevalue)"


  3. #3
    No Products Registered

    Join Date
    Feb 2007
    Location
    Sydney, Australia
    Posts
    1,654
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: AI

    hmmm...I never knew that darkwing. The only problem is the CPU seems to sort of Float to the player. It is very good though.

  4. #4
    Clicker Fusion 2.5 DeveloperSWF Export Module

    Join Date
    Jun 2006
    Location
    Turku, Finland
    Posts
    1,023
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: AI

    If you want to make it follow the player in platformer games, it will be a tad difficult and you need to learn how to use MMF 2 better before jumping into such a difficult task. Besides, this forums is just for posting files

  5. #5
    Clicker Fusion 2.5

    Join Date
    Jun 2006
    Location
    Stockholm, Sweden
    Posts
    1,529
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: AI

    Well I guess Darkwings method will propably work better on a top down game, than a platform game.

  6. #6
    Clicker Multimedia Fusion 2

    Join Date
    Sep 2006
    Location
    Britain, South Coast
    Posts
    1,030
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: AI

    Your best bet, I believe, is using a custom movement for EVERYTHING (insert evil laugh here).

    Investigate the Platform Movement Object. It's heavenly, because it does all the hard work for you, but still allows you to determine what keys will perform a movement, and when.


    You create TWO PMObjects, one for player, one for follower. You copy the movement you made for the player, and this time apply it to the follower.

    Next, in the follower's events, you replace all the control conditions eg( 'Player presses left', 'player presses Jump' etc).

    Instead of being triggered by a key-press, they'll be triggered by a condition. For instance, if the player is to the right of the follower, it makes sense to run the 'Move right' action for the follower's PMObject.

    For more complex routines, it's harder. You want the bad guy to follow loosely enough so that he doesn't imitate your every step and twitch. But when you do a complex, precision manouever, you want him to imitate you exactly.

    The best bet is to have two modes, a kind of 'precision record' mode, and a 'loose seek' mode.

    I use Precision Record mode for jumps. When your player jumps, he leaves a small detector behind him. When he lands (after a jump), the jump detector is 'finalised'.

    Until a Jump Detector is finalised (basically, until a flag is switched inside the detector), it must ALWAYS record the keystates of the player (in an alterable string in the detector).

    So every frame, it will check the left/right keys and record a value:

    0 = no keys pressed, or both keys pressed. In other words, this makes the follower do nothing.
    1 = left key pressed
    2 = right key pressed.

    These get recorded as a long string, like '11221100000001212111'.

    When the follower touches a jump detector, he'll stop. Once that detector is finalised, he can position himself exactly where you were stood when you made your jump, then follow the record exactly. This will make him perform a pixel-perfect imitation jump, just like yours.


    I may make an example, when I can get it a little less buggy. That's the theory I use anyway.

  7. #7
    Clicker Multimedia Fusion 2 DeveloperSWF Export Module

    Join Date
    Jul 2006
    Location
    Pittsburgh, PA, USA
    Posts
    777
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: AI

    I made an example. You can find it at www.flufferfluff.com/Bob Example.mfa

Posting Permissions

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