AI vs Human

freighters and war

So I finally got a game past year three, and have fleets of Scorpion class attack flyers (two Stinger-IV each). They kick some serious tail.

So I've been attacking shipping lanes, taking out my neighboring enemy's economy. But he just keeps sending new freighters to replace the ones I shot down.

The AI could be a bit smarter on that. I ended up by stationing a security force on his trade routes, and waiting for his replacements.

If it were me playing in the AI's shoes, I would not send freighters into enemy territory during a war; I would send replacement freighters to an alternate destination.

As in potential value of trade route is minus a million if it crosses into a warring enemy's territory.
6,837 views 11 replies
Reply #1 Top
The A.I has been improved to another level since beta5 according to the designer.The A.I in the last beta5 was pants in the military strategy side.

I am curious if the A.I has a separate code for attacking or defending trade networks.I don't recall any of the A.I journals mentioning it.

There was another exploit of destroying an enemy resource bass,putting a fighter on guard by the resource and then waiting for another expensive constructor to come and then take it out,wasting valuable enemy resources.The A.I would send a constructor back to the guarded resource every time.
Reply #2 Top
Intelligent maneuvers 101:
"Doctor, doctor, it hurts when I go like THIS"
"Then don't go like that."
Yeppers, would be good to learn from the pain.

For instance, fleet up an escourt vessel or two with the next constructor/freighter. IF the escourt could defeat whatever killed the predecessor. Or send an attack squadron to clear the AO. Or reroute to greener pastures.
Reply #3 Top
So I've been attacking shipping lanes, taking out my neighboring enemy's economy. But he just keeps sending new freighters to replace the ones I shot down.

If I understand correctly, you are killing the freighters that are along a trade route. Its behavior is automated (ie works the same for you): if the freighter is killed, another one start the route. But if there are too much casualties, the trade route will be cancelling since it would be too risky.

In short: the AI don't send the freighter on the same route. It is the game mechanisms that is responsible for that.
Reply #4 Top

Just as Peace Phoenix says, freighters are outside the control of the player.  You were, in effect, blockading that player.

Reply #5 Top
[image unavailable]


In the above image, several red trade routes are set up to travel into my (blue) territory. The freighters currently assigned the route are doomed, and that is the blockade discussed above.



What I saw was unassigned freighters, travelling across this border into my territory, presumably to re-establish a route with one of the minor races within my border.
Reply #6 Top
Ah ok.  Well, I hate to say it but unless you're playing at a very high difficulty, the AI probably won't do much to avoid that.  It's a very CPU intensive analysis.
Reply #7 Top
From the University of Technology in Melbourne, Australia: Determining if a point lies within a polygon might be useful during the moment when the AI is choosing a destination for it's freshly minted freighter, or whenever a freighter captain must assess if there is a risk to the trade route.

But that assumes the borders are polygons, and that such a construct would be accessible, and perhaps a bajillion other things as well.
Reply #8 Top

Another way would be to take advantage of the coordinate numbering system - either:


1. Determine the path the freighter would take (in GC1 it was diagonal then either horizonal or verical) and if any of the coordinates match an enemy territory boundary (you only need 1 match) send it somewhere else. These boundary coordinates are already calculated for the display lines on the map.


2. Do 2 checks - a. Is the destination within an enemy territory, if so abort.


b. For freighters only, recalc the flight path assuming the territory boundary of the enemy (plus maybe a margin) is a solid barrier so it will go around the danger zone. Re-aligning flight paths upon war declaration or peace breaking out would be nice.


I suspect either case would require a fair amount of reprogramming. Setting up escort protocols could possibly be handled below the player's direct intervention (other than a decison point) by reducing the value of the trade route and giving the freighter some net firepower/enhanced defense. Maybe a switch could be located on the trade screen? (Gee - sounds like an adaptation of one of the UP proposals from GC1.)

Reply #9 Top
Noticed the same thing - I'm currently at war with the Arceans and they are sending dozens of freighters through my territory to rebuild their trade with some minor races. I'm hoping that in gamma/release this will be better.

Hm, I think checking wether a trade route will go through/near my space should'nt be to CPU-intensive. Take a straight line from the starting planet to the target planet (to make it a bit easier) and
a) check wether it intersects with one of my borders, if you have them as polygons - hm, the borders can be quite complex, especially on huge maps, and thus composed of many sides, don't know how much of an performance hit it will be. Maybe simpler
b) calculate the distance from that line to my planets - if the closest distance is smaller than x (could be a fixed value or based about what the AI knows about the range of my ships), it should be considered to dangerous.
That doesn't seem to CPU intensive for me, but of couse I maybe overlooking something. Next question, of couse, is to decide what to do - sending some warships along, or 'forget about it', or choosing and alternate route... yeah, especially the last option would be pretty tricky, I guess.

Anyway, I hope you find a working solution., because this really is a huge disadvantage for the AI which, apart from that, is allready quite impressive in beta.

(btw - will it be technicaly possible to write and own AI for GalCiv or modify the existing ones?)
Reply #10 Top
1. Determine the path the freighter would take (in GC1 it was diagonal then either horizonal or verical) and if any of the coordinates match an enemy territory boundary

Now that is very, very tricky since there isn't in GC II anything like territority boundary. Influence boundary yes, but no territory boundary.
Reply #11 Top
Good point, Phoenix. Well, the influence boundary still gives an indication about where enemy territory is (since it is centered around the colonies), but would be rather unprecise because influential races would be percieved as a larger threat, even if their military is weak.
So, just checking how close the route comes to enemy planets probably would be more accurate.