Okay, here's a real first pass at things. All the tuning/balance should in theory be doable in the XML now (specifically ExternalConstants/Dyson_Constants.xml).
The primary difference with the previous pass are that the ship spawns are done in C# now. At the moment I think the Dyson Sphere is perhaps underpowered. It definitely should be incapable of freeing itself from the AI and wrecking havoc on the galaxy without human aid, but I think it could become a powerful ally. Unfortunately I don't have any saved games far enough in to check how powerful it will feel.
Here's how it works right now. The Dyson Sphere spawns ships with the BaseDysonSpawn tag.
The actual ship creation is done in C# so there's more fine-grained control over what's happening.
The Dyson sphere spawns ships at different rates depending on who owns the planet.
The Dyson Sphere spawns ships slowly when it's on an AI planet.
If the humans liberate the sphere then the Dyson Sphere will spawn faster to help against the AI.
If the humans capture the planets then the Sphere will spawn units very quickly to get rid of the humans.
The above spawn rates are tunable in the XML.
Sometimes the Dyson sphere will do a "Big Spawn", where it will spawn a bunch of ships instead of just 1.
The rate and size of these larger spawns is tunable in the XML.
Once a ship is created it will Patrol the planet it's on for a while; this time is tunable in the XML.
When the ship decides to move, it will examine its neighbors and choose where to go. The chance of moving to a given planet is tunable in the XML. If a "patrol friendly factions only" behaviour is desired, for example, then change the percentMoveFriendly to 100. Here is the algorithm for how it picks the planet to move to.
First, if the ship is next to a Friendly planet that is under attack, always go there.
Then check if it wants to go to a friendly planet.
If it doesn't want to go to a friendly planet, check if it wants to go to a Neutral planet.
If it doesn't want to go to a neutral planet, check if it wants to go to a weakly defended Hostile planet.
If it doesn't want to do that, pick a planet at random.
Note there are some changes in Nanocaust files because I track "Last time a ship was spawned" in ExternalData and use the same code for the Nanocaust. The nanocaust C# spawning code isn't sufficiently polished to hand over yet though.