User Tag List

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 11

Thread: sports game -need AI

  1. #1
    No Products Registered

    Join Date
    Sep 2006
    Location
    Greece
    Posts
    45
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    sports game -need AI

    er.. hi
    this is my first post.

    I'm making a remake of Ballistix, an old game by Psygnosis.
    You control a pointer that shoots ammo towards a ball. The purpose is to score a goal against a slightly tilted game board.

    Here's the file
    http://www.filefactory.com/file/edbd2d/

    I was wondering if anyone has any ideas/links/logical diagrams for a suitable AI; an enemy pointer that shoots ammo trying to score a goal as well. I'm guessing top-down soccer AI would be a good start.

    thank you in advance.
    christina

    P.S. let me know if this game is crap.

  2. #2
    Forum Moderator Fusion 2.5 DeveloperHTML5 Export ModuleiOS Export ModuleSWF Export Module
    DavidN's Avatar
    Join Date
    Jun 2006
    Location
    Boston, MA, USA
    Posts
    4,044
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: sports game -need AI

    It's an interesting idea - I think it could benefit from using a movement extension, as you really need to be able to shoot in more than 32 directions. Having the trigger and the movement on different controllers felt awkward - I would move the fire button to the left mouse button.

    As for AI, I'm really not sure... the Pathfinder object may help, as you would need to be able to find the shortest reasonable path to the top of the level. The difficulty is getting the enemy pointer to be able to shoot the ball to try and follow this path.

  3. #3
    No Products Registered

    Join Date
    Sep 2006
    Location
    Greece
    Posts
    45
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: sports game -need AI

    ah yes I forgot.
    cursor keys -movement
    space - trigger

    I will definitely include a redefine option, plus mouse control, thanks a lot!

    I'm not sure I want more than the 8 directions I've currently set it to shoot towards (original game). I'm afraid it will subtract from the predictability. I'll give it a shot though, thanks! I've already worked out the trigonometry for 32 directions, so it should be a breeze.

    I think the enemy pointer doesn't need to get to the bottom of the level. Instead it needs to move in a way that will give it lots of lines of sight towards the player's goalpost at the bottom. hmmm

    anyhow thanks a lot!

  4. #4
    No Products Registered

    Join Date
    Sep 2006
    Location
    Greece
    Posts
    45
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: sports game -need AI

    any more ideas?

  5. #5
    No Products Registered

    Join Date
    Aug 2006
    Location
    Spryfield, Nova Scotia, Canada
    Posts
    85
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: sports game -need AI

    The only thing I can say about AI is that you have to understand the sport and you have to think like the computer, in terms of cause and effect, or stimulus and action.

  6. #6
    No Products Registered

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

    Re: sports game -need AI

    The common approach to doing this would be to model each player as a Finite State Machine (FSM).

    Each player would have their current state, and rules to transition from their current state to other states.

    A better explaination can be found at AI Junkie

  7. #7
    No Products Registered

    Join Date
    Sep 2006
    Location
    Greece
    Posts
    45
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: sports game -need AI

    thanks alistairF and thanks a million vortex2, for the link!
    It's exactly what I wanted.

    here's my effort at AI before reading about FSM:

    http://www.filefactory.com/file/ddccd5/

    kisses,
    christina

  8. #8
    No Products Registered

    Join Date
    Sep 2006
    Location
    Greece
    Posts
    45
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: sports game -need AI

    ok I need help!

    Assuming the enemy arrow has
    1.a targeting phase
    2. a shooting phase

    I want my targeting phase to be like this:

    A test object ("Scout") that revolves around the ball like a satellite, with a radius of R. This object tests all positions around the ball for perfect linear alignment of: the "Scout", the "Ball" and the "Goalpost". Essentially it attempts to find the perfect line of sight from the Scout to the Goalpost, including the Ball.

    I was thinking I could do it with 1-pixel ActiveObjects ("Particle") shot from the Scout towards the Ball. Everytime a "Particle" collides with the Goalpost, the X/Y coordinates of the position where it was shot from, are stored as a desirable position, and the Enemy Arrow attempts to go near it.

    Also, the Scout will try other radii around the ball (R plus/minus 100 pixels), effectively testing all (or most) points around the Ball.

    Is there any way MMF2 can check all of these points using only math? Is there any other line-of-sight algorithm I can use, without having to rely on shooting particles?

    I'd appreciate an example, or a link to an article..

    kisses

  9. #9
    No Products Registered

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

    Re: sports game -need AI

    Say you had two points P (Your player) and G (your goal post).

    You want to find in between values from P to G.

    To do that you can do : I.X=P.X+(G.X-P.*(Step/100.0) I.Y=P.Y+(G.Y-P.Y)*(Step/100.0) where step ranges from 0-100.

    If you then set an object to I.X and I.Y and adjust the step between the 0-100 range you can get points between P and G :P. By then testing collisions for this object, you can tell if you have a clear line between P and G. If you get a collision then you know you have an obstacle in the way and it is not a clear line of sight.

  10. #10
    No Products Registered

    Join Date
    Sep 2006
    Location
    Greece
    Posts
    45
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: sports game -need AI

    vortex2 so this is essentially the same as shooting a DetectorParticle, only it doesn't have to pass from each and every point in its trajectory, because I can control the step. Do I get it right?

    It's a splendid idea! Let's see how it goes.

    Thanks!

Page 1 of 2 1 2 LastLast

Similar Threads

  1. YWHTG: You Will Hate This Game [Flash] Skill / Avoidance game
    By FGRaptor in forum Released Games & Apps in Flash
    Replies: 2
    Last Post: 2nd May 2016, 03:14 AM
  2. Donkey Kong JR Game & Watch cloned into arcade game some MMF2 technical problems.
    By daryuss in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 9th June 2013, 09:17 PM
  3. Open exported html doc, game doesnt load. When opening raw SWF, game fits screen!
    By Oreo in forum SWF/Flash Export Module Version 2.0
    Replies: 5
    Last Post: 19th November 2012, 03:16 PM
  4. Flash Game Screen Size Game Site Preferences
    By Rolando in forum SWF/Flash Export Module Version 2.0
    Replies: 1
    Last Post: 4th January 2012, 04:04 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
  •