In version 1 I kept different metrics for guarding the empire, colonising new asteroids, and building up a force ready to attack. In this new version, I plan to combine all of these metrics into one. Therefore, one metric array will be used per empire.
It's funny looking back at this now. When I was actually coding the metric system, I realised that it would be possible to just use a single array to keep track of the metrics for all asteroids, and
The trick is that asteroids only take notice of neighbouring asteroids' metrics if they are owned by the same empire. :>
I guess it makes things a bit more efficient. Less data structures are needed, the code is less confusing, etc.
The asteroid will also make a list (array) of all a) friendly or empty asteroids, b) a list of enemy neighbouring asteroids or empty asteroids with enemy seedlings on them that are within its send distance.
This was one of the concepts listed in the first post in this thread. But actually, I combined those 2 arrays into one as well. It's called "neighbours", and it's simply a list which is created on each cycle of which asteroids are within the send distance of the one being checked.
The various seed-sending code in the "Actions" section takes care of whether a particular neighbour is a friend or an enemy. This is a much simpler system than maintaining 2 different arrays.
The entire engine contains just 2 arrays: metric, and neighbours.