• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

AI Help

Status
Not open for further replies.
Level 13
Joined
Oct 16, 2010
Messages
737
Right... For my Pokemon map I'm trying to make an AI system for players that leave the game. Currently I've made it so that they have their Pokemon (Heroes) changed to the AI player, and the AI currently makes all AI controlled units run around to follow where players go, this bit is fine to my liking. However, this map involves a lot of running backwards and forwards to get healed at the Pokecentres, but I don't know how to make a unit run to the nearest Pokecentre, I was guessing it was something to do with a real comparison of distances? I don't really know.... I'm guessing completely...
 
Level 20
Joined
Feb 24, 2009
Messages
2,999
To check the nearest pokemon centre yeah, or you could pick a random unit in the unit group owned by player (owner of pokemon centres) and order them to move to/follow that. It depends on how 'clever' you want them to be, the above would work with a below certain health event and be stupidly simple and easy to implement but may make the ai do dumb things and run to furthest centres right through enemies or hazards etc.

A comparison of reals and (loop?) to find the nearest one would make them slightly smarter, reducing the chance of them encountering hostile forces in their commute (and decreasing its time).
 
Status
Not open for further replies.
Top