Hey guys so I am at the last stage of my game. I am making a clone like Super Crate Box and this last enemy ai is completely different to the other ones. Basically from what I see the enemy floats around the map and as the player goes in another direction it follows, but it also seems to float around alot not sure if there are some random elements involved. How should I go to approach this problem? I tried code decomposition so far not helping too much. Not sure if I should use a tutorial sorta feels like cheating or if I should just figure it out.
Need advice on making enemy ai
Page 1 of 19 Replies - 955 Views - Last Post: 13 April 2017 - 09:22 AM
Replies To: Need advice on making enemy ai
#2
Re: Need advice on making enemy ai
Posted 12 April 2017 - 10:12 PM
Do you have a default positioning property?
#3
Re: Need advice on making enemy ai
Posted 12 April 2017 - 10:27 PM
Don't believe so. I am not asking for code or anything I am currently doing some research now I think I need the mathf.sin function from the looks. I don't use any complicated maths in Unity any courses or anything I should take on the maths aspect?
#4
Re: Need advice on making enemy ai
Posted 12 April 2017 - 10:31 PM
Wow, beat me too it. I'm not often great in this area, but my thoughts were not precise positioning values. Also, might be a good idea to have a default rest position. Hope I helped a little, kudos on not wanting code and wanting a small push so you can find the solution yourself.
This post has been edited by nstrydom: 12 April 2017 - 10:31 PM
#6
Re: Need advice on making enemy ai
Posted 13 April 2017 - 04:05 AM
Moving to game programming...
#7
Re: Need advice on making enemy ai
Posted 13 April 2017 - 05:06 AM
#8
#9
Re: Need advice on making enemy ai
Posted 13 April 2017 - 05:40 AM
Dialupp, on 13 April 2017 - 08:17 AM, said:
I moved this topic to the Game Development subforum because your question was not C# specific, and that you will likely get better traction in this forum where there are more game programming focused folks.
Good idea looking into the math functions. My approach for this would have been to let the enemy compute a basic vector towards the player, and then add in a smaller vector which simulates the "floating" effect. The smaller vector is simply rotated around a unit circle and scaled appropriately. The rotation is controlled by timer.
#10
Re: Need advice on making enemy ai
Posted 13 April 2017 - 09:22 AM
My approach would be have the 'move towards enemy' bit slighlty fuzzy ie wander towards the enemy but dont make a direct vector towards the enemy.
I would use a Sigmoid function for the fuzzy bit.
https://en.wikipedia...igmoid_function
I would use a Sigmoid function for the fuzzy bit.
https://en.wikipedia...igmoid_function
Page 1 of 1