User Tag List

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

Thread: How can I make an AI (artificial intelligence) for a platform game?

  1. #1
    Clicker Fusion 2.5 MacFusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    SergioAndre's Avatar
    Join Date
    Mar 2009
    Location
    Argentina
    Posts
    71
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question How can I make an AI (artificial intelligence) for a platform game?

    I need to know how can I make an artificial intelligence for a platform game like "Starbound" or "Terraria", where we have multiple instances of the same object and these interact individually.

    I want to do something like the example below, but with several objects (enemies) that interact with the player individually.


    Download AI-Example

    The example is just demonstrative.


    I really appreciate any help.


    (sorry for my english)

  2. #2
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export Module
    aenever's Avatar
    Join Date
    Jun 2013
    Posts
    1,413
    Mentioned
    14 Post(s)
    Tagged
    0 Thread(s)
    One easy / Lazy solution would be to clone your object and duplicate the code for each of them. I'm sure there are better ideas though.

  3. #3
    Clicker Fusion 2.5 DeveloperiOS Export ModuleSWF Export Module
    Sumo's Avatar
    Join Date
    Jul 2008
    Posts
    642
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    How can I make an AI (artificial intelligence) for a platform game?

    @arnever that's probably the worst way of doing it. You want the code to be flexible so that it can work will all enemy types even when adding new enemies into the game.

    You should probably use alterable values to differentiate between the copies of enemies. You can set an alterable value as an ID number. If you spread value in this variable, you can set each enemy with a different number, in case you need to specify certain enemies.

    Try to use Fusions object scope when it selects certain instances to narrow down which enemy it is effecting. An example of this would be if certain enemies are overlapping objects or comparing enemies health, etc. anything that differentiates one enemy from another.

    Usually the way I code AI, I write different "states" that the enemy can be in. Examples of these states include chasing, line of sight, searching, roaming. Try to code each section separately and use a reference number (alterable value) to switch between the states. So for example the line of sight state, it would only check enemies in a certain area around the player. That will lower the amount of enemies the game will check.

    If an enemy sees the player, you would switch the AI state to chasing. If the enemy loses the player, then it would switch the AI state to roaming. Something like that.




    Sent from my iPhone using Tapatalk

  4. #4
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export Module
    aenever's Avatar
    Join Date
    Jun 2013
    Posts
    1,413
    Mentioned
    14 Post(s)
    Tagged
    0 Thread(s)
    Ha ha I said it was lazy

  5. #5
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export Module
    aenever's Avatar
    Join Date
    Jun 2013
    Posts
    1,413
    Mentioned
    14 Post(s)
    Tagged
    0 Thread(s)
    I would also like to learn, can someone use the example mfa supplied by SergioAndre to spread 0 in an Alt value, to create an ID that could be used to have multiple characters with the same AI?

  6. #6
    Forum Moderator Fusion 2.5 DeveloperHTML5 Export Module
    Chaos's Avatar
    Join Date
    Aug 2006
    Location
    Burnsville, MN, USA
    Posts
    806
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    DynamicPMO2.mfa

    Here is an example made by Nifflas some time ago. It's quite a bit more complex, but offers pretty much exactly what you are trying to do. Hopefully this helps.

  7. #7
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export Module
    aenever's Avatar
    Join Date
    Jun 2013
    Posts
    1,413
    Mentioned
    14 Post(s)
    Tagged
    0 Thread(s)
    Thanks Chaos, any chance of a re-upload? The mfa downloads with 0 bytes and can't be opened

  8. #8
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export Module
    paobrasil's Avatar
    Join Date
    Apr 2012
    Location
    Rio de Janeiro, Brazil
    Posts
    1,149
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    it's empty this Mfa =/

  9. #9
    Clicker Fusion 2.5
    Del_Duio's Avatar
    Join Date
    Sep 2008
    Location
    Cygnus X-I
    Posts
    919
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Sumo View Post
    @arnever that's probably the worst way of doing it. You want the code to be flexible so that it can work will all enemy types even when adding new enemies into the game.

    You should probably use alterable values to differentiate between the copies of enemies. You can set an alterable value as an ID number. If you spread value in this variable, you can set each enemy with a different number, in case you need to specify certain enemies.

    Try to use Fusions object scope when it selects certain instances to narrow down which enemy it is effecting. An example of this would be if certain enemies are overlapping objects or comparing enemies health, etc. anything that differentiates one enemy from another.

    Usually the way I code AI, I write different "states" that the enemy can be in. Examples of these states include chasing, line of sight, searching, roaming. Try to code each section separately and use a reference number (alterable value) to switch between the states. So for example the line of sight state, it would only check enemies in a certain area around the player. That will lower the amount of enemies the game will check.

    If an enemy sees the player, you would switch the AI state to chasing. If the enemy loses the player, then it would switch the AI state to roaming. Something like that.




    Sent from my iPhone using Tapatalk

    I wish I could do stuff like this for my own games. It's by far my greatest weakness this side of 'the font is too small'

    There's a cool game I bought in Early Access on Steam called Vagante and it has really impressive enemy A.I. (IMO). Even the minor enemies will climb up ladders and do all kinds of crap to come and get you. Most of my enemies are stupid and just know how to move right and left, and occasionally turn around once they realize you're beating the crap out of them haha.

  10. #10
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export Module
    Fusion 2.5 (Steam)
    schrodinger's Avatar
    Join Date
    Nov 2014
    Posts
    3,155
    Mentioned
    27 Post(s)
    Tagged
    1 Thread(s)
    Here's the example above with multiple players:

    Platform-IA_multi.mfa

    PMO is a great object and gives smooth results and everything,
    but I find it a bit awkward, particularly for handling multiple instances..
    ..maybe I've really never used it much and I'm just a noob with it?
    (is it really needed -as it would seem- to have multiple copies of it to work with multiple objects??)

    I would maybe keep it for the main player and code enemies without it, as a personal preference

Page 1 of 2 1 2 LastLast

Similar Threads

  1. Artificial Intelligence
    By dogtar59 in forum Fusion 2.5
    Replies: 2
    Last Post: 2nd January 2015, 02:43 PM
  2. DringleTopia Artificial Intelligence Collection
    By CodeCannon in forum Extension Development
    Replies: 23
    Last Post: 21st August 2013, 03:23 AM
  3. Adv. Game Board - Artificial Intelligence
    By stevenart1988 in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 6th April 2013, 08:01 PM
  4. artificial intelligence by lucas junqueira
    By willow in forum Multimedia Fusion 2 - Technical Support
    Replies: 6
    Last Post: 15th February 2010, 03:16 PM
  5. [Request] Adding Artificial Intelligence
    By onewingedangel in forum The Games Factory 2 - Technical Support
    Replies: 6
    Last Post: 14th July 2008, 02:40 AM

Posting Permissions

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