User Tag List

Results 1 to 6 of 6

Thread: intelligent enemy

  1. #1
    Clicker Fusion 2.5SWF Export Module
    videogiochi's Avatar
    Join Date
    Jun 2010
    Location
    italy
    Posts
    152
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    intelligent enemy

    ciao.
    I have a maze with the main character and one (or more) enemy.
    the enemy should run after the main character through the maze.
    for the enemy's movement I used "bouncing ball" movement setting its directions ALWAYS to the player.
    the result is that the enemy bouncing for all the screen.
    how can I get what I'm looking for?

    I took a look at ARTIFICIAL INTELLIGENCE tutorial but I did not understand how it works.

    please, help me!

    Alex

  2. #2
    No Products Registered

    Join Date
    Jul 2010
    Location
    Australia
    Posts
    98
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: intelligent enemy

    This is one of the hardest things to accomplish in games -- it's called "Pathfinding" and I'm not that good at it...

    What you may want to experiment with in the meantime (before everyone else comes up with better answers), is changing "Always" to "Every half a second" (50 hundredths)

    That way, the enemy will be less likely to just bounce everywhere, but it is only a very basic and temporary "fix".

    I guess other guys will have better answers though.

  3. #3
    Clicker Fusion 2.5SWF Export Module
    videogiochi's Avatar
    Join Date
    Jun 2010
    Location
    italy
    Posts
    152
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: intelligent enemy

    Hello.
    I tried, but the result does not change much compared to the method I've tried it.
    thanks anyway
    any other suggestions?

    alex


  4. #4
    Clicker Fusion 2.5SWF Export Module
    videogiochi's Avatar
    Join Date
    Jun 2010
    Location
    italy
    Posts
    152
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: intelligent enemy

    any other suggestions?

  5. #5
    No Products Registered

    Join Date
    Aug 2010
    Posts
    343
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: intelligent enemy

    Nivram has an example - basictowerdefenceexample.mfa - that shows how multiple objects can be set to recognise the player when proximate. Once you have the loop set, the enemy will 'see' the player. Then it is a matter of setting that particular enemy to (re)position relative to, in the direction of, the player. I am not sure if you can do this using 'boucing ball'. You may need to set your own random movement.

  6. #6
    Clicker Fusion 2.5

    Join Date
    Dec 2009
    Posts
    64
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: intelligent enemy

    I suggest you create your own movement engine rather than use the standard 'bouncing ball' movement.

    Since you're making a maze game where the enemy chases the player, you need to (1) consider the enemy's position in relation to the player, and (2) consider the enemy's position relating to obstacles, like a maze wall.
    Point 1: Easy enough to check the position of the player - check every few seconds (or use a counter set to a random value if you want to make it less predictable). Adjust the enemy direction accordingly.

    Point 2: I use 4 invisible sprites positioned to form a box around the enemy and use them to detect collisions (collision sensors) with walls and other objects. If you use the standard bounce movement without collision sensors, at some point your enemy will 'bounce' through a wall - not good!

    If you update the enemy direction relating to the player only when colliding with a wall, you can mimic path finding reasonably well.
    Example: Enemy is moving right and the right collision sensor collides with a vertical wall then check if player is higher or lower than enemy and then set enemy moving up or down as required.
    You can also use invisible objects to trigger checks for pathfinding - very useful in a maze when the enemy reaches a T-junction or a crossroad.
    Here's a link to a Pacman-style game I made a few years ago, I don't have the source code anymore but I used the methods I've described here for the enemy movement - take a look if you like, might give you some ideas.
    Link: http://www.graemesfreegames.com/html/maze_muncher_-_single_switch.html

    Hope this helps you out a little . . .

Similar Threads

  1. enemy ai example
    By TheCrimsonTaco in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 13th August 2012, 11:19 PM
  2. following Enemy
    By Droggelbecher in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 24th July 2012, 12:06 AM
  3. Strange thing: If Enemy Alterable Value A = Enemy Alterable Value B
    By King_Cool in forum Multimedia Fusion 2 - Technical Support
    Replies: 11
    Last Post: 26th March 2012, 06:29 PM
  4. Enemy
    By Taceo in forum Multimedia Fusion 2 - Technical Support
    Replies: 12
    Last Post: 26th July 2010, 10:47 AM
  5. Rebond intelligent pour casse-brique
    By Gawen in forum File Archive
    Replies: 0
    Last Post: 12th February 2008, 06:48 PM

Posting Permissions

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