Notice: fwrite(): Write of 38 bytes failed with errno=28 No space left on device in /home/rmrk/domains/rmrk.net/public_html/Sources/Cache/APIs/FileBased.php on line 96

Notice: fwrite(): Write of 59 bytes failed with errno=28 No space left on device in /home/rmrk/domains/rmrk.net/public_html/Sources/Cache/APIs/FileBased.php on line 96

Notice: fwrite(): Write of 1714 bytes failed with errno=28 No space left on device in /home/rmrk/domains/rmrk.net/public_html/Sources/Cache/APIs/FileBased.php on line 96

Notice: fwrite(): Write of 44 bytes failed with errno=28 No space left on device in /home/rmrk/domains/rmrk.net/public_html/Sources/Cache/APIs/FileBased.php on line 96

Notice: fwrite(): Write of 8192 bytes failed with errno=28 No space left on device in /home/rmrk/domains/rmrk.net/public_html/Sources/Cache/APIs/FileBased.php on line 96
Print Page - [VXA REQUEST] Eventing obstacle avoidance

The RPG Maker Resource Kit

RMRK RPG Maker Creation => VX Ace => Topic started by: Countdown on June 01, 2013, 03:13:04 AM

Title: [VXA REQUEST] Eventing obstacle avoidance
Post by: Countdown on June 01, 2013, 03:13:04 AM
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?
Title: Re: [VXA REQUEST] Eventing obstacle avoidance
Post by: IAMFORTE on June 01, 2013, 02:50:11 PM
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! (http://rmrk.net/index.php/topic,44740.0.html)
Title: Re: [VXA REQUEST] Eventing obstacle avoidance
Post by: Countdown on June 01, 2013, 04:39:54 PM
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.