Factory entrances

Factory entrances

Here is where ideas can be collected for the skirmish AI in development

Moderators: hoijui, Moderators

Post Reply
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Factory entrances

Post by AF »

How would I determine programmatically what edges of a footprint are factory exits?
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Post by Tobi »

Guess you should use a mini pathfinder over the YardMap (Dijkstra's algorithm over this small kind of area can be implemented in very little code I think). Just find a path / the paths from the middle to "the outside" for open YardMap state.

Though I don't think factories really *have* to create their units in their center, I dont recall seeing any factories in any mods which didn't, plus it's impossible to access the model data / COB stuff through the AI anyway, AFAIK. So starting at the center seems a good approximation.
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6242
Joined: 29 Apr 2005, 01:14

Post by FLOZi »

Just as a matter of setting you straight; few S44 factories have the units created in the middle.
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Post by Tobi »

Just realised a true mini pathfinder isn't even needed, a smart scan of the edge of the YardMap plus some silly heuristics should be able to get you your answer (to check that it isn't e.g. an open corner not connected to the middle / wherever the units are produced).
Post Reply

Return to “AI”