Unending Galaxy : Factions

Here is another development post regarding my Unending Galaxy project that will mostly focus on Faction related mechanics and on the recent additions to the AI. Enjoy!

In UG,  each faction will have a global artificial intelligence (or AI, loose term) that  will manage ships, plant stations, expand across the map, declare war and so on. More to the point, they will have to manage their funds, as they will have to buy those costly ships and stations. It is important to note that the player is considered as a faction and as such will be submitted to basically the same rules (ability to claim sectors, declare war, sue for peace and so on). The AI will follow settings defined in the Faction Editor I made for the game (click on images to enlarge):

 

factionsetThis is the first panel, here can be set the logo, color, name and description of the faction. In other words, the cosmetic stuff.

 

factionbehaviorsThe behavior panel is more interesting (and more settings will probably be added here):

  • Aggression : How likely a faction is to choose an aggressive path (declare war) to solve an issue.
  • Expansion : How often a faction will try to increase its territory.
  • Trade : How likely a faction is to trade with other races
  • Diplomacy : How convincing a race is at making treaties with others
  • Xenophobia : How resistant a race to diplomacy
  • Stubbornness : How long a race will continue a war when things look grim.

Here I can also set if a faction is in perpetual war with everyone (like the Xenons and Khaaks in the X-Universe). Its ability to use military bases, and to invade 3rd party sectors.

 

factionassetsIn this tab can be set the stations used by the selected faction for specific roles. The Faction HQ is the central shipyard from which military bases will buy ships and from which constructor ships and military fleets will be managed. Military Bases are used to defend key sectors with a fleet of fighters. Trading stations are what you expect them to be, the main location in a sector where people can buy and sell stuff. I can also force the faction to use only ships and stations designed by itself, or allow it to use those from the common pool too.

 

factionlawsThis is the Law panel. This is where specific wares can be set as illegal (smuggler will be attacked by patrol ships) and where specific behaviors can enforced or banned like mining asteroids, piracy acts, or simply being foreign. Here again, this panel is probably not a definitive version.

 

There’s no hard-coded limit on how many factions the game can handle. It wouldn’t be very hard to add randomly generated ones to the code base too. I am not sure how many factions the base game will feature yet. So far there is two relatively standard factions (Human and Sirak), a robotic faction at war with everyone (Core), and of course, a Pirate faction. But that’s a story for another time when most of those mechanics have been implemented in the actual game.

 

In other news, I added several new commands to ships, the most important one being the ability for ships to detect foes and patrol sectors. As a result, I was able to make a very basic version of my X3 ADS plugin for military bases.

dockcombatWhen enemy ships are in the sector (I spawned a Core capital ship as an example) the military base launch its docked fighters to patrol the area and destroy the threat. When done, the fighters return home. It will get more complex (using wings and better targeting) when more commands are added, but so far it does its job well enough.