pioneerspacesim/pioneer — pull request #1675 by skapusniak (2012-11-04 16:01:17+00:00)
Title: Script for autogeneration of Factions

This is experimental and definitely needs a performance review especially from people with slower systems.

It generates a few less than 100 additional factions, that are the same for each game start

I was hoping I could do this just in Lua, but it turned out that without C++ changes to skip adding factions where the the home world didn't exist, you just get crashes. Also it doesn't work without the removing of the back-link from government type to Faction (you'd get the colour but not the actual allegiance) which I did as part of #1621, so that ended up being merged into the branch right at the start.

There are a bunch of variables in the script to tweak.

With the included settings, an interesting place to look at is Sector -17,2,9 where the Independent system of Ethed apparently lies within a debatable border region in which the Federation, Liberation Union, and United Systems, look to be competing for territory with the True Expanse.

Thanks to @brianetta for answering my questions about Engine.rand in Lua, and @robn for pointing me at util.hash_random when that didn't work out.