User Tag List

Results 1 to 5 of 5

Thread: Twisted Metal kind of AI ideas?

  1. #1
    Clicker Fusion 2.5 DeveloperHTML5 Export ModuleiOS Export Module
    Emerson3's Avatar
    Join Date
    Apr 2014
    Location
    Lafayette, Louisiana
    Posts
    721
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Question Twisted Metal kind of AI ideas?

    Hey Clickteam,

    I made 2 levels of a racing game. It has 1 player and 3 opponents. It works great but now for the third level I want to mix it up. I want to make a level like twisted metal, where the object is to shoot and destroy the opponents. How could I have the opponent cars drive around the screen and shoot the nearest opponent or player. If you have any ideas or old MFA's that I can view and learn, please share! Thanks.

  2. #2
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export Module
    jn2002dk's Avatar
    Join Date
    Mar 2014
    Posts
    217
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If we're talking a normal race track couldn't you just add range checks for the enemies and fire if within range?

    If you're talking open levels like in Twisted Metal i'm not sure, maybe look into finite state machines

  3. #3
    Clicker Fusion 2.5 DeveloperHTML5 Export ModuleiOS Export Module
    Emerson3's Avatar
    Join Date
    Apr 2014
    Location
    Lafayette, Louisiana
    Posts
    721
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    I'm thinking more open like Twisted Metal where its a crash car derby arena, open level with spikes and contraptions. If you don't mind jn2002dk, what is "finite state machines?"

  4. #4
    Clicker Fusion 2.5 DeveloperiOS Export ModuleSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)
    Sumo's Avatar
    Join Date
    Jul 2008
    Posts
    642
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Basically create different "states" for your AI. Such as searching for enemy, following enemy, running away, roaming, etc. You code each of these "states" separately and try to mesh them together in a cohesive AI unit. For example your AI could start off in "search mode". It will try to roam around and find the closest car to ram into. Once it find a car, you can set it "state" to chase mode. Then the AI would try to follow the car using bouncing ball movement / pathfinding etc. Maybe if other cars are chasing the AI, it could go into escape/run away state. It really depends on how your game is coded. A lot of trial and error. I would suggest starting off small and trying to code each state separately, then add them together in the end.


    So for your game you could use this distance formula to test the distance in pixels between your car and the other enemies. If your car comes within a certain range (less than 600 pixels for example) of another AI and the AI is facing your direction (test the angle of the car) then have the AI start chasing you. Check out Line of Sight examples to see if the AI can "see" your player. If there's a ton of obstacles in the way, you may need to have a simple pathfinding system with nodes so the AI can try to move around the obstacles in the way. If its an open area then it'll probably be a bit easier.

  5. #5
    Clicker Fusion 2.5 DeveloperHTML5 Export ModuleiOS Export Module
    Emerson3's Avatar
    Join Date
    Apr 2014
    Location
    Lafayette, Louisiana
    Posts
    721
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Dang Sumo,

    Thanks for the info. That makes sense to work on the AI separately and fire them off in order. I'm going to work on this all weekend and post. Thanks Sumo!

Similar Threads

  1. Kind-of 3D
    By Sebaceous in forum Extension Development
    Replies: 4
    Last Post: 20th August 2009, 05:11 AM
  2. Beeper Example like a Metal Dtector
    By LB in forum File Archive
    Replies: 1
    Last Post: 24th January 2009, 03:01 PM
  3. Another kind of Rotation
    By dragonguy in forum File Archive
    Replies: 3
    Last Post: 21st October 2008, 08:54 AM
  4. Tutorial : IA type Metal Gear Solid
    By BenjaminG in forum File Archive
    Replies: 2
    Last Post: 8th June 2007, 05:31 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
  •