RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
[VXA REQUEST] Eventing obstacle avoidance

0 Members and 1 Guest are viewing this topic.

****
Rep:
Level 84
3...2...1...
So...I've evented a stealth system that is pretty darn perfect in my opinion, minus a couple bugs: one being the enemy getting stuck while chasing you.

I've got the enemy so that he chases me, but I'm able to block him in corners with barrels and such and he just stands there. I'm trying to get him to "detect" the object in front of him and move around it so that he can continue his pursuit of the player. I have it so that obstacles that the enemy cannot walk through are painted with a region tile. So I've been detecting impassabilities based on what the tile in front of him's region ID is.

Does anyone have any ideas on how to do this?

*
Rep:
Level 85
I solve practical problems.
For taking arms in the name of your breakfast.
Perhaps instead of looking at region tiles you could:

-maintain a set of variables pertaining to the x and y coordinates of all objects you can block the enemy with
-when the enemy is trapped for a set period of time, have him check if the tiles in his vicinity are the x and y coordinates of the objects, try to find an open space
-then give him a new move route to hopefully move around the obstacles

Obstacle detection is a form of AI, so you need to figure out what the enemy needs to do in as many cases as possible. A script may help, I recall seeing one about move routes. I can elaborate if needed, I tend to not make sense if I write a lot.

EDIT-Here it is!
« Last Edit: June 01, 2013, 02:52:44 PM by Captain America »

****
Rep:
Level 84
3...2...1...
I was really hoping to not use scripts for this, but I may have to.

I am pretty much doing what you've suggested, except for avoiding regions because I don't want to have an x and y variable for every single mapped obstacle (dozens of them for each map). I have him check, and then try to have him move away from them, but then he just moves back into the blocked path.