User Tag List

Results 1 to 4 of 4

Thread: Simple sky-view AI

  1. #1
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Aug 2007
    Posts
    143
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Simple sky-view AI

    [size:20pt][color:#009900]AI Rocks!![/color][/size]

    Why does it rock? Isn't it obvious? No? Well maybe? If you don't think so then don't read this article.

    [size:14pt]What is AI?[/size]

    Most people already know this, but what is it in MMF? its the way an object sees another object and then follows it around.
    In this article you'll find out how to Make an object follow you when you get too close, make the object stop following you when it can't see you anymore, and making the object able to shoot you while following you.

    [size:14pt]Starting with AI[/size]

    Ok to get started, create 2 active objects. Put one of them in the "Bouncing Ball" movement, have it in a speed of 10. The other needs to either be the "Eight Directions" Movement or a custom movement. Create one more active object and call it "Notice".

    The "Notice" object needs to be bigger than the player and a wide enough range to be a good detector. We'll be using the "notice" Object to alert the enemy and make him follow you.


    [size:14pt]Now for our Feature presentation[/size]

    Ok now we can actually get into the fun part right? I’m pretty sure.

    To start put in these events: [color:#6600CC]<[/color] = condition [color:#33CC00]->[/color] = action

    [color:#6600CC]<[/color] Always
    [color:#33CC00]->[/color] set position of "notice" at (0,0) from player.
    [color:#33CC00]->[/color] Make "notice Invisible
    [color:#6600CC]<[/color] Collision between "Notice" and Enemy
    [color:#33CC00]->[/color] Set alterable value A of enemy to 1

    [color:#6666CC]<[/color] Alterable value A of enemy = 1
    [color:#33CC00]->[/color] Enemy; Look in the direction of (0,0) from Player


    What’s happening? Well the "notice" is under the player at all times so if the "notice" Hits the Enemy the enemy's alterable value A will go on. If the Enemy's alterable value A is on it will move in the player direction.

    Its not natural for a person to see someone 100 miles away and know exactly where they are. There is a way we can fix this though.

    Enter these events:

    [color:#6666CC]<[/color] X position of enemy = 100+X("Player")
    [color:#33CC00]->[/color]Set alterable value A of enemy to 0

    [color:#6666CC]<[/color] Y position of enemy = 100+Y("Player")
    [color:#33CC00]->[/color]Set alterable value A of enemy to 0

    [color:#6666CC]<[/color] X position of enemy = 100-X("Player")
    [color:#33CC00]->[/color]Set alterable value A of enemy to 0

    [color:#6666CC]<[/color] Y position of enemy = 100-Y("Player")
    [color:#33CC00]->[/color]Set alterable value A of enemy to 0

    Now when the player gets 100 pixels away from the enemy the enemy won't see him anymore because alterable value A is 0.

    [size:14pt]Just some extra stuff[/size]

    I don't know if your game is a shooting game or not. If you don't want to or already know how to do this then skip this section.

    To create a way to have an enemy shoot you while following you create an active object named "bullet", then use these events:
    [color:#6666CC]<[/color] Every 1 seconds (or any time)
    [color:#6666CC]<[/color] Alterable value A of enemy = 1
    [color:#33CC00]->[/color] Enemy; Shoot "bullet" at (0,0) from Player

    [color:#CC33CC][size:20pt]You’re Done[/size][/color]

    I hope your journey of learning simple AI helps you. Of Course You can do thousands of things with AI, these are just the basics
    in creating a very realistic game.

    I hope some people are helped by this article. :grin:

    If you had any trouble understanding this article I have attached an example file.
    Attached files Attached files

  2. #2
    No Products Registered

    Join Date
    Feb 2008
    Location
    uk
    Posts
    367
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Simple sky-view AI

    hi, is there a way to do this GREAT stuff in paint shop pro?

  3. #3
    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: Simple sky-view AI

    Quote Originally Posted by fish20
    [color:#6600CC]<[/color] Always
    [color:#33CC00]->[/color] set position of "notice" at (0,0) from player.
    [color:#33CC00]->[/color] Make "notice Invisible
    [color:#6600CC]<[/color] Collision between "Notice" and Enemy
    [color:#33CC00]->[/color] Set alterable value A of enemy to 1

    [color:#6666CC]<[/color] Alterable value A of enemy = 1
    [color:#33CC00]->[/color] Enemy; Look in the direction of (0,0) from Player
    Why bother using an alterable value? Couldn't you just:

    [color:#6600CC]<[/color] Always
    [color:#33CC00]->[/color] set position of "notice" at (0,0) from player.
    [color:#33CC00]->[/color] Make "notice Invisible


    [color:#6666CC]<[/color] Enemy is overlapping "notice"
    [color:#33CC00]->[/color] Enemy; Look in the direction of (0,0) from Player

  4. #4
    No Products Registered

    Join Date
    Feb 2009
    Location
    CA, USA
    Posts
    110
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Simple sky-view AI

    YOu should make the notice a circle so that it is more accurate.

Similar Threads

  1. Icon View Bug?
    By Blood_Wist in forum Multimedia Fusion 2 - Technical Support
    Replies: 6
    Last Post: 23rd May 2009, 04:31 PM
  2. Icon View Bug
    By Blood_Wist in forum File Archive
    Replies: 0
    Last Post: 22nd May 2009, 09:37 PM
  3. List View and Icon View
    By LIJI in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 4th July 2007, 03:45 PM
  4. IconList View
    By Andrew in forum Multimedia Fusion 2 - Technical Support
    Replies: 15
    Last Post: 13th September 2006, 04:44 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
  •