Rydygier 1317 Posted February 10, 2015 Like in the title. One of the old problems, I was usually avoided, but now I'm curious, if there are any known solutions, or should I try myself to invent something heavy and ugly? May be useful for dynamic missions on the maps with such troublemaking elements as archipelagos or "rivers". To know, if waypoints, my script sets for the group will make it swim, or would they find a dry way. Share this post Link to post Share on other sites
dreadedentity 278 Posted February 10, 2015 I'm unaware of any already-created solutions, but perhaps you could do something with the surfaceIsWater and surfaceType commands? I'm imagining a system that calculates whether units will be in the water by checking every few meters along the most direct path towards the waypoint, then if surfaceIsWater returns true the system will search in all directions for land and place "helper" waypoints to "help" the AI reach the original waypoint. Btw, I loved Pilgrimage. I think I've said that before. It was impossible to beat, of course, but I loved it. Share this post Link to post Share on other sites
zapat 56 Posted February 10, 2015 I started to do something like it myself, but gave it up, since it turned out to be unnecessar for me. My idea was the same DreadedEntity said: I shot a ray from currentpos to target, and check for water surface every 10 meters. If it returned true, I turned the ray until it returned false, then I tried to turn the ray to face target again, and do the turning thing until the bay is passed. It was rough and could get into nasty situations. I couldn't really tell when I should terminate a fruitless path if it wasn't a bay or an island. Share this post Link to post Share on other sites
Rydygier 1317 Posted February 10, 2015 Right, finding simplier and exact alternative may be difficult if possible at all (possibly even vanilla AI pathfinding works somehow like this - this topic, pathfinding, seems to be very well studied classic of coding, as needed in so many games). But perhaps would be still valuable to find some solution returning truth if not always, then at least often enough? Share this post Link to post Share on other sites
zapat 56 Posted February 10, 2015 (edited) Yes, I can't stop thinking either. I wish I was at the university again where this was what .... I should have done, lol. My other idea was the following (I started to do this with forests. I wanted to check if I should deploy tanks in a warzone, whether they could reach the other end of the zone or not without going into forests) Create a matrix of nodes, like every 50 meters. Then the water(forest) nodes would be 0, ground nodes would be 1. Then I needed to check if there is a "line", where there is no connection (the gaps are all bigger than 70 meters) between any two 1 nodes. This is on hold now, but I use the idea in determining town size (finding houses without too much gap between them) Edited February 10, 2015 by zapat Share this post Link to post Share on other sites