Ship design and default combat strategies. |
Is there a way to code it so that when a ship of a particular design is build, that it default to a particular strategy? I mean, the way the AI make it's ship, they always default to Optimal Range, and so far i did not see a way to script it so it's design based (ie a defense ship has defense strategies while an attack ship has very offensive strats by default). Right now how ships behave is really dependant on it's loadout, put a device that should not be there (like a gun on a Colony ship) and it screw the behavior of the ship. Of course i know WE CAN change it when WE design a ship, but i want the AI to use more advanced strategies and not just the default one...

Hard-coded?
None that I can find. It seems to be hard-coded - which it wasn't even in SE:IV...
-----
Race based
//------------------------------------------------------------------------
// Set_Race_State_Preference_Values
//------------------------------------------------------------------------
function Set_Race_State_Preference_Values returns boolean
vars
ai_state: long
begin
return TRUE
set ai_state := Sys_Get_AI_State(sys_long_Player_ID)
set lng_Fleet_Attack_Formation := Sys_Get_Fleet_Formation_With_Name("Diamond")
set lng_Fleet_Defense_Formation := Sys_Get_Fleet_Formation_With_Name("Spider")
set lng_Fleet_Task_Force_Attack_Strategy := Sys_Get_Strategy_With_Name(sys_long_Player_ID, "Optimal Firing Range")
set lng_Fleet_Task_Force_Defense_Strategy := Sys_Get_Strategy_With_Name(sys_long_Player_ID, "Optimal Firing Range")
set lng_Fleet_Task_Force_Attack_Formation := Sys_Get_Task_Force_Formation_With_Name("Bullet")
set lng_Fleet_Task_Force_Defense_Formation := Sys_Get_Task_Force_Formation_With_Name("Arrowhead")
case ai_state
AI_STATE_EXPLORE_AND_EXPAND:
set lng_Max_Explorers := 3
AI_STATE_INFRASTRUCTURE:
set lng_Max_Explorers := 1
AI_STATE_ATTACK:
set lng_Max_Explorers := 1
AI_STATE_DEFEND:
set lng_Max_Explorers := 1
AI_STATE_NOT_CONNECTED:
set lng_Max_Explorers := 2
endcase
end

Default design strategies, not fleet
Phoenix-D, I think he was talking about the default strategies set with design types - not with fleets.
-----

Need another function...
There is a system function to return the strategy's name, but I don't see anyway that one can be set for a design type. For some reason or another it never made it into the scripts.
-----

Should be easy to lobby for...
I think Aaron just needs a reminder to expose this part of the AI's workings. Anyhow I'd imagine once implemented it would be just a design type case structure with a specified default strategy name.
-----




Soooooo....
No one has any ideas?