Hello, I’m working on a Top Down 2D game and I’ve started to dive into AI for the enemies. I’m having some trouble figuring out how to get an enemy to circle strafe the player relative to the direction its Looking. I currently have it so the enemy will look at the player and chase them within a certain range, but i want to add some more dynamic movement. I’m not exactly good at math, so I was wondering if anyone has any ideas on how this could work. I’ll leave some details about how im currently doing things in case it will help.
if (distance_to_enemy < threshold) //threshold is distance you want circle strafing to start
{
//then we now need to move “around” the target rather than at it
movement_direction = direction_to_target + 90 degrees //counterclockwise circle strafe
}
Does that help? I can give you the actual algebra if this isn’t enough.
The Like button exists specifically for thanking or showing appreciation for a post. You don’t need to necropost in order for a topic to remain visible/accessible (after all, you found this one!).
Pointless necroposting is against the rules (see 1i), and there are some good reasons for that. When you revive a long-dead thread just to say “Thanks!” it adds unnecessary clutter to the list of recent topics. It can also create confusion because not everyone who opens said thread will realize it’s a necropost. I’ve seen it happen numerous times where someone comes in and bumps a 10+ year old thread, and next thing you know you’ve got people quoting decade-old posts, speaking directly to the people who made those posts without even realizing how old those posts really are. It can really turn into a mess.
I’m not trying to play hall monitor or pretend I’m a moderator myself. I’m just trying to clarify why it’s a good idea to use the Like button instead of necroposting. Don’t take it personally! (And yes, I realize there’s some irony in that by making this post, I myself am contributing to the necromancy. :p)
I’m glad it helped you but when it helped you is irrelevant and isn’t the definition of a necropost. Despite the many reasons for doing it (which you included in your deleted post above) those are the rules and they are there for a reason. So you understand, the forums are here for you as long as you follow the rules so don’t take it personally, the rules apply to everyone here including myself. Look, now I’m adding to the necro too!
Weird, you’d think by me DELETING that reply, you’d almost be able to infer that I “understood that regardless of whether or not it’s stupid, or laughable that this is something energy is being spent on over in an OFFICIAL CAPACITY, it’s not worth arguing about it, and I should leave it alone.”
And yet you went ahead and had to call it out. Almost as if…this whole thing… isnt REALLY about “uh, like, the forums are crowded.” Mysterious. I suppose we’ll never know.