Hi all,
I am not too sure if this is the right place to post this, but its the most relevant I could find.
I made a web game called Arc Length, it is a grappling hook runner.
It has gotten way more support than I ever expected but the biggest complaint/request is for more game modes.
I want to make 2 game modes, one where you are being chased and one as the chaser. But i need to make steering AI for the opponent. I really want it to also use the grappling hook, instead of just a floating dot but the steering and navigational AI for this is bothering me a lot.
I honestly have no starting point on how to figure this one out. Could anyone give me some ideas about how to tackle this? Not asking for actual or psuedo code, just a direction I could try heading in.
Check out the game to see how the grapple works and feels at:
Wow I wanted to make this exact game a few months back… but I just didn’t realize. I love it, it’s a lot of fun. You should really pat yourself on the back for that!
To your issues… man this is a hard game to think of AI and I’m not very good at AI to start with.
Assuming there is no bottom or top (it didn’t seem like it while I played) there is only speed and collisions.
I would start with those.
The two questions for the ai are … am I going to collide with something and am I going fast enough?
First, I need to know what kind of arc I’m moving in. I’d create an equation which shows this (might take a bit of research and guessing to get it right). Then draw the arc on the screen so I can debug the ai.
Now, I need to check the arc to see if I’m going to collide with anything. If I’m not going to collide with something I would start worrying about speed.
If I’m going to collide with something then I need to change how I’m behaving.
I need to fire off a grappler at probably a 45 degree angle, releasing it if I approach a 0 degree angle with the rope (the rope is horizontal) … you’ll have to check for the position where the rope is wrapping around a block rather than the origin of the rope.
When my arc is going to move me through a path with no collisions and with maximum speed I would release.
Good luck I’ll have to keep an eye out for your progress! You need to bring it to ios and android… it’s better than most small games I’ve seen. The gameplay is there :>
@fox4snce Thanks for the message and the support there. About the game quickly: Im glad you like it, it was a one day project that turned out WAY better than I imagined haha. My plan is to basically do testing and modifications on the web and once I’m happy with everything I do actually plan on putting it on ios or andriod
About the AI stuff: Yeah it is a pretty messy problem hey I’ve done very very little with AI before too so that makes it even more ‘fun’
I appreciate the input there, gives some decent starters.
But it makes me wonder about the collisions. If you have a list of all nearby blocks and calculate the trajectory if grappled on, then sort each option by will this put me into a collision and will this put me closer to my target then choose the best.
You only grapple if you aren’t going fast enough or if you are going to crash into an obstacle
You release when you are grappling and going to run into an obstacle or the angle between you and the rope pivot point is becoming 0 or you are slowing down too much.
Also, I was just trying to give you a starting point. The ai, if it can do all of these things, should be able to go some distance before the game ends, better than a player.