My Ai Works But For Some Odd Reason It Is Able To Go To Tiles Labeled As Obstructed Even Though They Shouldn’t Based On The Check On Line 274.
Here’s My Code: Code
Thanks For Reading.
My Ai Works But For Some Odd Reason It Is Able To Go To Tiles Labeled As Obstructed Even Though They Shouldn’t Based On The Check On Line 274.
Here’s My Code: Code
Thanks For Reading.
Hi @WilliamBoersma31! I’m not sure, but I think you mark a tile as obstructed based on if there is a player or enemy on it or not. If there is a player on the tile you mark the tile as obstructed, but at the same time if there is no enemy on the tile you mark the tile as not obstructed. So are you sure the tile is indeed marked as obstructed?
That’s A Great Observation I’ll Go Look In To That
[Update] I’ve Set Up Some Better Checks And It Still Didn’t Work So I Ran A Console.Log And It Told Me It Always Seems To Be False Which Has Perplexed Me.
[Further Update] I did a test where I made it so the ability to un mark an obstructed tile is gone and it worked but it had the issues not unchecking it would obviously cause. But that test made even more confused what exactly is causing it.
I think the same problem applies to the players and enemies themselves. For example, if a player is on the tile you mark the tile as obstructed, but if another player is not on the tile you mark the tile as not obstructed.
Hey @Albertos That’s A Great Point But I’m Not 100% Sure How I’d Fix That.
Do You Have Any Ideas On How To Fix That Issue?
[Update] I’ve Got It Working But In All These Tests I’ve Noticed That The Ai’s Are Ending Their Turns Early Which Is Quite Odd. @Albertos Any Ideas On How To Fix This?
[Final Update] Fixed It I Added Some Extra Logic To The End Turn Code And Now I Can Brutally Attacked By As Many Enemies As I See Fit.