I'm working on a game that follows the life of a powerful magician as she lives, dies, and reincarnates dozens of times across hundreds of years. Meanwhile, empires rise and fall around her--she can influence them by killing their kings or even becoming their leader, but even without her they will go about their business, fighting wars with other factions and appointing new leaders.
The problem is this: how do I store all those faction relationships? Currently, I have a class Faction, which has an enemy list, a ally list, and a controlled list (the Government of Rezla controls the Army of Rezla, etc). However, simply using lists like these limit me to a binary ally/not-ally, enemy/not-enemy deal.
I suppose I could get around that to some degree by using a list of lists, so RezlaGovt.allies contains
[[AzosGovt, 2],[JupaGovt, 4]], where the first value in the sublist stores the name of the ally and the second value stores the current reputation, but that seems inelegant (and I don't really understand how to manage it properly in code). It also makes it much more difficult to later add tags to the relationships, like
What data structure do other complex strategy games use to handle faction relationships?
I will have around 10 main factions for the world governments, each with subfactions and subsubfactions (and maybe even subsubsubfactions!), so a system that deals well with large datasets is a plus.
Not all factions need to be simulated all the time: the Fighter's Guild in a distant city might be completely ignored until the player does something in the area, at which point I can randomly generate some "history" for it, to make it seem like it's been doing stuff.