Fleet AI Primary Key bug
Posted: Thu Jun 16, 2022 10:35 am
Found something interesting
The Primary Key for fleet.txt is the COUNTRY_ID and the first GOAL_POSITION
If two events fire with the same IDs then both get ignored. I did this test with the German starting ships and ran into this issue as I was trying to move the Deutschland and the Sub next to it back to Germany.
Would suggest a change to the primary key so that you can have multiple points hit the same GOAL_POSITION
Would suggest changing it to
COUNTRY_ID
UNIT_ID
first GOAL_POSITION
first FRIENDLY_POSITION
This would then allow you to (for example) tell the AI to move ships from Egypt back to the UK and at the same time tell them to move ships from Canada to the same exact spot in the UK.
Sure their is a work around by choosing one hex over as a GOAL_POSITION but this creates a situation where you have only a certain amount of events you can code to area. With the change it then becomes unlimited.
Adding UNIT_ID will let you have events with the same start and end point for specific ships. So you can tell the USA AI to move all its CARRIERS and LIGHT CARRIERS from the Atlantic to the Pacific and have them go to the same points
OR
You can support more than one UNIT_ID in an event.
The Primary Key for fleet.txt is the COUNTRY_ID and the first GOAL_POSITION
If two events fire with the same IDs then both get ignored. I did this test with the German starting ships and ran into this issue as I was trying to move the Deutschland and the Sub next to it back to Germany.
Would suggest a change to the primary key so that you can have multiple points hit the same GOAL_POSITION
Would suggest changing it to
COUNTRY_ID
UNIT_ID
first GOAL_POSITION
first FRIENDLY_POSITION
This would then allow you to (for example) tell the AI to move ships from Egypt back to the UK and at the same time tell them to move ships from Canada to the same exact spot in the UK.
Sure their is a work around by choosing one hex over as a GOAL_POSITION but this creates a situation where you have only a certain amount of events you can code to area. With the change it then becomes unlimited.
Adding UNIT_ID will let you have events with the same start and end point for specific ships. So you can tell the USA AI to move all its CARRIERS and LIGHT CARRIERS from the Atlantic to the Pacific and have them go to the same points
OR
You can support more than one UNIT_ID in an event.