• Welcome to the new COTI server. We've moved the Citizens to a new server. Please let us know in the COTI Website issue forum if you find any problems.

Allegiance Generator...

Flynn

SOC-14 1K
Good afternoon, All,

I am in the process of designing an allegiance generator for creating polities from newly generated or regenerated sector files. Below, I've provided a simple overview of the logic I'm considering. I am posting it here for the review of my peers, that your suggestions may help me streamline this process or in some other way better implement it.

* * * * *
Overview of Allegiance Generator process:

1. Read in UWPs from source file, store as an array of world data. In the process, change all allegiance codes to "Na".

2. Iterate through original array of world data, and create a new array using only those worlds that meet the minimum requirement for supporting an interstellar polity. This new array will be referred to going forward as the PolityWorlds array.

* This criteria is currently TL9+, Pop5+, Starport A or B.

3. Sort the PolityWorlds array in the following manner: Highest TL, followed by Highest Starport, followed by Population. Give each world a unique allegiance code (using an incremental counter).

* Additional criteria, such as habitability of the world, may be utilized if weird ties give unexpected errors during the testing phase, to get a proper order.

4. Iterate through the PolityWorlds array, comparing it to worlds found in the PolityWorlds array, looking for worlds close enough to be within, say, three months travel of one another. (Calculate this by determining distance, then divide by the size of the other world's Jump rating based on TL. Assume that a result of 6 jumps or less indicates the world is within three months travel.) In the event of a tie, choose the closest world by actual distance. For worlds that are within three months travel of one another, change the allegiance code of the weaker one to match that of the stronger one.

5. Iterate through the original world array, comparing it to the PolityWorlds array, looking for worlds within three months travel of one of the PolityWorlds. For inhabited worlds that are within three months travel of a PolityWorld, change the allegiance code of the world to match that of the PolityWorld.

* NOTE: At this point, I might add some random chance that worlds along the periphery (outer 10-25%) may or may not be included in the polity, to give a little chance for some irregular, non-circular, regions. This random feature would be weighted toward the inclusion of higher population worlds.

6. After the array has been updated, write a new source file containing the final output of the Allegiance Generator.

* At this point, I can review the data via either Galactic or sec2pdf, and modify allegiance codes by hand as needed to provide the final version of the sector file.

* * * * *

Thanks in advance for your time,
Flynn
 
Back
Top