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

Get help using Construct 2

Post » Mon Nov 28, 2016 7:07 am

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
Last edited by tarek2 on Mon Dec 05, 2016 1:48 pm, edited 2 times in total.
B
39
S
22
G
77
Posts: 289
Reputation: 42,694

Post » Mon Nov 28, 2016 12:16 pm

Only a fast idea, maybe that helps you a little. Its only two objects without walls:
https://drive.google.com/file/d/0B5FlDY ... sp=sharing
B
24
S
3
G
1
Posts: 451
Reputation: 2,165

Post » Mon Nov 28, 2016 10:08 pm

Asmodean wrote:Only a fast idea, maybe that helps you a little. Its only two objects without walls:
https://drive.google.com/file/d/0B5FlDY ... sp=sharing



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
B
39
S
22
G
77
Posts: 289
Reputation: 42,694


Return to How do I....?

Who is online

Users browsing this forum: TRMG and 35 guests