First of all: Hello everyone!
I've been reading on these forums for quite a while and I guess I finally decided to participate^^
Anyways on to the point: If I remember the pertinent dev logs correctly, I think LTs AI already has algorithms similar to what jimhsu proposed incorporated in its code. But as Cornflakes pointed out, it's difficult to have the AI estimate things it has never done before and has no information about (like exploring a new system).
So how about this:
Why not tie behavioral options in closer with the AI's personality? I'm assuming we already have "aggression" as a personality trait. What is different about an aggressive approach (e.g. robbing people) compared to a small trade approach (e.g. mining and/or trading)? While the station you are selling to might not allow you to make good or any profits for any specific run, you will be relatively safer (from law enforcement or other NPCs) in regards to survival whereas if you rob people those people might just blast you to kingdom come with crazy-strong missiles you didn't know they had or call their mighty friends or the police on you.
Exploration is similar to this: you can't know for sure whether there will be a clan of war-mongering, throat-cutting AI in the next system or simply nothing of value at all.
Since self-preservation should be one the AIs main goals, why not implement a personality-related
threshold for risky behavior? Most AI would not be great risk-seekers (as with us humans
) and therefore stay in the same system and do the same things (like mine and trade); if they are successful, why do something else? Their high-risk personality traits (like "aggression" and "exploratory drive") would not be high enough to exceed this "threshold" and therefore would not even be considered.
Now, if they are not making any money this way and/or someone else just robbed them because there isn't enough ore for all or for whatever reason, this "traumatic experience" could cause the AI to alter its personality traits by a bit, thus increasing the "aggression" or "exploratory drive" traits, which in turn could cause one of them to exceed the threshold and become an option. Since both exploration and aggressive behavior are things that require long term planning and some experience if they are to have a decent chance to be successful, maybe they shouldn't be
constantly compared to other activities in terms of monetary influx, but rather have a certain amount of time "reserved" for them; i.e. the NPC will periodically "roll" a die whether to pursue risk seeking behavior like aggression or exploration. If both traits are below the threshold, the result will always be zero and the NPC will never do this, but if the traits have larger values associated with them, there will be a chance to usher in a period of aggressiveness or exploration for the NPC, after which it will evaluate its success and increase or decrease the pertinent personality-trait-value accordingly. After that it can continue with non-risk behavior until it "rolls the die again" or an opportunity presents itself (since now the NPC has experience with risky behavior and can estimate returns).
Some more things that should be incorporated alongside this: the length of this time interval will be inversely proportional to the magnitude of the risky-personality-trait-values. That way a major war lord will tend to wage war a lot more if he is successful with that strategy. In the non-risk phases he will hire more ships or trade or build more weapons for himself OR.....CONTINUE RAIDING
since now that he has some experience in that matter why not keep on doing it? That means AI should be able to conduct risky operations outside the "risky intervals"
but only if they have experience in that field. Assigning monetary value to such an operation will become easier then, since the AI now has experience to base estimations on. Lastly, having lots of success / trading partners in the area could raise the "risk-threshold" to discourage losing them.
Bear in mind that "aggression" should not dictate an NPCs willingness to defend itself! It might have an influence on the extend to which the NPC will fight back or rather flee but if it is much slower than its attacker then it should fight back even when it has very low aggression (self preservation has to be the main goal).
TL;DR
Anyways, this is just an idea to avoid setting arbitrary values for exploration and raiding by periodically having a chance to engage in them for a while based on personality traits.
Most NPCs wouldn't do this; a "traumatic experience" can cause them to "consider" the option (when they roll a die periodically).
If they did these things before (i.e. have experience) they can consider them as part of their normal routine as well, since it is now possible to estimate the monetary gain based on previous exploits.