Ouch, dude if you can mod this I give you props. However I bet you 5 dollars that from those actions you just listed my computer would explode in 3 seconds. (This is what I understand)It would be entirely possible to program a proper simulation, especially with the environment Starmade provides, as it would be a few equations on the global scale. Random encounters would be based on a few factors, as follows below:
Faction1's need (in this case, ore, if attacked, will be full of ore)I would use those factors to determine an appropriate encounter involving faction1.
Closest faction trading ore (faction2)
Direction between borders
Overall threat level of path (determines escort that comes with it)
Threat level of sector found (determines if there are pirates, and the quality of the pirate attack)
If Schine doesn't decide to implement this into the vanilla game, then as soon as the API is released, I'll make my own mod of all of this.
You gave ship "A" an action; "move to destination". Now from what your asking the AI needs to calculate overall threat level of path and overall threat level of sector while determining what ships and how many should escort it (not to mention how those ships would interact with each other and what it encounters). Thats currently 3+ things its trying to calculate (not including the galaxy calculation of ship speed, block count, etc.) and finally 1 passive action its trying to complete once it reaches its destination; "to mine".
Now comes the hard part, having the AI capable to understand what it should mine.... Okay now you need to determine how far it can venture to find asteroids (since thats where you'll get ore). So lets say you've got all that; it's beginning to mine. You've now got a mining action, ship escorts, how those ships interact with each other, how they interact with other entities, speed/distance calculations between objects, and finally threat level adjustments. Lets not even think about what would happen when this small fleet goes into combat. You can use starmades basic code to understand the combat but, they usually fly around aimlessly then eventually disappear.
Okay the ship is full of resources finally. Now it must go to destination B and complete its new action. Now because this is all supposed to be a "Dynamic Galaxy" the AI should be able to do this on its own without you interfering. So you request that it pick the closest destination to complete said task; lets say sell wares at trade port (lets not think about planets).
As you can see having the trade guild and pirates and maybe a couple other factions are fine but, unless you somehow know how to obscure all other actions unless player is there your computer will fry in a matter of a few minutes. Theres just way too many things for it to try and understand on its own while the player is doing his own thing of galaxy wide domination.
You can see what I mean when a player (on a server) takes a hulk of a salvager and tries to eat up a planet... Thats just one ship with probably a hundred beams. Now if this was just with one galaxy in starmade or a few planets I might see a completely dynamic galaxy working. But at the moment you'd be lucky to add in 3 neutral factions with little interaction that won't make your computer shoot itself.