0 Favourites

(SOLVED)How to Make AI to Auto Avoid continuously an object

  • Hi, Im making a game that is base most of it in objects avoiding objects in automatic mode, basically all are enemies of each other, but i spent abut 2 weeks trying to make the AI to work for the Auto Avoid enemies but i have no luck, i read all the tutorials that i found that can help on this but i havent found any that exactly shows this what i need, i saw just plataform AI.

    So my question is how do you make AI to make objects avoid other objects in automode? any help will much apreciated

    i add a capx to show and to make it easier to understand i use the MoveTo behaivor from rex

    -the objects will be moving all the time none stop

    -i will have the blue walls with solid all the time, but i deactivated now because they get stack to the walls when the objects are close to it

    -the AI i need is when the object blue are close to the one hunting him wich is object green, make the blue object move to a ramdom angles avoiding the green object at all the time and if is posible with out getting closer to the walls because other way they get stack to them.

    I manage to make something closer to what i want with the movements but still not good enough the green one catch up quick with the blue object,

    What i was thinking is check the enemies angle when is following him and make the blue object switch to the best diagonal that doesnt get catch and swell another movement will be make the blue object go around or half around the green object and switch directions

    thanks a lot in advance if you can point me in the right direction I will be very gratefully

    Capx: https://www.dropbox.com/s/agyl50csvuw8vrq/AvoidObjects.capx?dl=0

  • Only a fast idea, maybe that helps you a little. Its only two objects without walls:

  • Construct 3

    Buy Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Buy Now Construct 3 users don't see these ads
  • Only a fast idea, maybe that helps you a little. Its only two objects without walls:

    Thank you very much Asmodean is really good example and really nice ideas there, however I have some code already set up using moveTo behavior, were i can adjust the speed etc.... plus i can move the objects with out rotating the objects as i need them to look at the same angle. I will see if I can use and mix some of your Ideas with what i need to accomplish. definitely will be useful if is not for this game will for another.

    Thanks a lot m8

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)