I’m making a 3d pengo clone. For those who don’t remember the game, it’s basically a maze with enemies, where the blocks can be moved by the player and destroyed by both the player OR the enemy Clearly, I can mark the walls as obstacles,make em dynamic so the grid updates as walls get moved and destroyed, and get the enemy to avoid them just fine, as long as I don’t mind that enemies can’t destroy walls. I’ve also gotten it to if i don’t bake in any obstacles, it just takes the shortest path, stopping to destroy walls along the way. What I want is for both. When the time it takes to go around is faster, it goes around, when it’s faster to go thru, it goes thru. The other option being it goes around until it gets within a certain distance, it starts going straight for the player. What is the best solution to do this? My thoughts so far:
- Two grid graphs, one for when you are far away, one got when you are close.Is there a way to switch whgich graph the enemy is using?
- The walls not necessarily being obstacles, but change the cost of crossing that space. That way it would still tend to avoid walls, unless it made sense to go thru.
- Scrap using this, roll my own method. I know I could do it w a lot of work, but I am not a fan of reinventing the wheel if I don’t have to
So, a little direction would be nice. Is one of the solutions viable If so, how, or is there a better way? Just started playing with this and I gotta say so far, awesome.