User Tag List

Page 1 of 4 1 2 3 ... LastLast
Results 1 to 10 of 36

Thread: (Complex?) AI?

  1. #1
    No Products Registered

    Join Date
    Jul 2006
    Location
    UK
    Posts
    58
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    (Complex?) AI?

    I'm trying to get units to respond to each other.

    There are 2 teams. Everyone in group A is in a qualifier of Good and in group B, a qualifier of Bad.

    What I want, is that when each person from A see's a person from B, he will stop and start shooting it. The same vice versa. I also want the unit to turn to face the object, not flick straight to facing it.

    And when there are no units in range, continue moving along by using some kind of pathfinder.

    Complicated!?

    Any ideas?

  2. #2
    No Products Registered

    Join Date
    Jul 2006
    Location
    UK
    Posts
    58
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    (Complex?) AI?

    I'm trying to get units to respond to each other.

    There are 2 teams. Everyone in group A is in a qualifier of Good and in group B, a qualifier of Bad.

    What I want, is that when each person from A see's a person from B, he will stop and start shooting it. The same vice versa. I also want the unit to turn to face the object, not flick straight to facing it.

    And when there are no units in range, continue moving along by using some kind of pathfinder.

    Complicated!?

    Any ideas?

  3. #3
    No Products Registered

    Join Date
    Jul 2006
    Location
    UK
    Posts
    58
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: (Complex?) AI?

    Also.. they fire with a 360 desgree bullet movement, which I forgot to mention

  4. #4
    No Products Registered

    Join Date
    Jul 2006
    Location
    UK
    Posts
    58
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: (Complex?) AI?

    Also.. they fire with a 360 desgree bullet movement, which I forgot to mention

  5. #5
    Clicker Fusion 2.5 Developer

    Join Date
    Jun 2006
    Location
    Hampshire, UK
    Posts
    963
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: (Complex?) AI?

    I imagine if you sat and thought about it, it wouldn't be too tricky.

    Using alterable value and flags should do the trick, eg a set of events where flag "enemy in range" is on, rotate to, then shoot enemy. When the flag is off, the events where the person moves around doing their other stuff.

  6. #6
    Clicker Fusion 2.5 Developer

    Join Date
    Jun 2006
    Location
    Hampshire, UK
    Posts
    963
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: (Complex?) AI?

    I imagine if you sat and thought about it, it wouldn't be too tricky.

    Using alterable value and flags should do the trick, eg a set of events where flag "enemy in range" is on, rotate to, then shoot enemy. When the flag is off, the events where the person moves around doing their other stuff.

  7. #7
    No Products Registered

    Join Date
    Jul 2006
    Location
    UK
    Posts
    58
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: (Complex?) AI?

    When I sit and think about it I go blank... I have a possibility in my mind which seems unlikely, I can't even properly figure it out, and it could involve up to 1000 loops running at a time!?

  8. #8
    No Products Registered

    Join Date
    Jul 2006
    Location
    UK
    Posts
    58
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: (Complex?) AI?

    When I sit and think about it I go blank... I have a possibility in my mind which seems unlikely, I can't even properly figure it out, and it could involve up to 1000 loops running at a time!?

  9. #9
    No Products Registered

    Join Date
    Jun 2006
    Location
    Texas
    Posts
    1,002
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: (Complex?) AI?

    Well in traditional AI practice (IE not in MMF) you would use something called a Finite State Machine (A construct that can only have one "state". It uses something called a "State transition table" to control the logic of your AI). As this approach isn't possible in MMF, you need to think of a different way (Just felt like sharing it).

    You will need to spread a value in each of your armies so you can tell them apart. You will also need to use a fast loop to iterate (loop through) all of your players and compare them to players from the other team.

    Something like:

    Start of frame->
    Spread Value 0 in Alterable value A of Group Good
    Spread Value 0 in Alterable value A of Group Bad

    Start of frame->
    Set Alterable Value B of Good Player to -1
    Set Alterable Value B of Bad Player to -1

    Always->
    Start Loop "Good" for Count of "GoodPlayers"

    On Loop "Good"->
    Start Loop "Bad" for Count of "BadPlayers"

    On Loop "Bad"+Compare two general values: sqr((badx-goodx) pow 2+(bady-goody) pow 2)<=distance->
    Set Alterable Value B to Alterable Value A of Good Player
    Set Alterable Value B to Alterable Value B of Bad Player
    Activate Group "TurnLogic"

    On Loop "Bad"+Compare two general values: sqr((badx-goodx) pow 2+(bady-goody) pow 2)>distance->
    &lto pathfinding here>

    Group "TurnLogic":

    Alterable Value B of Good Player=Alterable Value A of Good Player
    +
    Alterable Value B of Bad Player=Alterable Value A of Bad Player->
    <Your turning logic here>
    Set Alterable Value B of Good Player to -1
    Set Alterable Value B of Bad Player to -1


    There are probally better ways to do this, but I hope this gave you some ideas <img src="/center/images/graemlins/smile.gif" alt="" />.

    EDIT: Lol oops . Where I use "Alterable Value B" you could use a simple flag... my mind must be going <img src="/center/images/graemlins/laugh.gif" alt="" />.

  10. #10
    No Products Registered

    Join Date
    Jun 2006
    Location
    Texas
    Posts
    1,002
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: (Complex?) AI?

    Well in traditional AI practice (IE not in MMF) you would use something called a Finite State Machine (A construct that can only have one "state". It uses something called a "State transition table" to control the logic of your AI). As this approach isn't possible in MMF, you need to think of a different way (Just felt like sharing it).

    You will need to spread a value in each of your armies so you can tell them apart. You will also need to use a fast loop to iterate (loop through) all of your players and compare them to players from the other team.

    Something like:

    Start of frame-&gt;
    Spread Value 0 in Alterable value A of Group Good
    Spread Value 0 in Alterable value A of Group Bad

    Start of frame-&gt;
    Set Alterable Value B of Good Player to -1
    Set Alterable Value B of Bad Player to -1

    Always-&gt;
    Start Loop "Good" for Count of "GoodPlayers"

    On Loop "Good"-&gt;
    Start Loop "Bad" for Count of "BadPlayers"

    On Loop "Bad"+Compare two general values: sqr((badx-goodx) pow 2+(bady-goody) pow 2)&lt;=distance-&gt;
    Set Alterable Value B to Alterable Value A of Good Player
    Set Alterable Value B to Alterable Value B of Bad Player
    Activate Group "TurnLogic"

    On Loop "Bad"+Compare two general values: sqr((badx-goodx) pow 2+(bady-goody) pow 2)&gt;distance-&gt;
    &lto pathfinding here&gt;

    Group "TurnLogic":

    Alterable Value B of Good Player=Alterable Value A of Good Player
    +
    Alterable Value B of Bad Player=Alterable Value A of Bad Player-&gt;
    &lt;Your turning logic here&gt;
    Set Alterable Value B of Good Player to -1
    Set Alterable Value B of Bad Player to -1


    There are probally better ways to do this, but I hope this gave you some ideas <img src="/center/images/graemlins/smile.gif" alt="" />.

    EDIT: Lol oops . Where I use "Alterable Value B" you could use a simple flag... my mind must be going <img src="/center/images/graemlins/laugh.gif" alt="" />.

Page 1 of 4 1 2 3 ... LastLast

Similar Threads

  1. How complex can games be?
    By Snubs0952 in forum The Games Factory 2 - Technical Support
    Replies: 7
    Last Post: 16th May 2012, 06:43 PM
  2. Complex Shader and how to use it
    By ffomega in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 8th December 2010, 06:26 AM
  3. Expression too complex?
    By Tiles in forum Multimedia Fusion 2 - Technical Support
    Replies: 27
    Last Post: 11th January 2008, 04:52 PM
  4. Expression Too Complex
    By Sphax in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 28th July 2006, 01:08 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
  •