This is a spin-off and hopefully more fleshed-out and coherent expansion onto a couple of posts I made
here.
The basic premise is that the current systems- in which entities are treated as
objects- is essentially the wrong way to look at the DF world, even if the computer will have to look at entities as objects when it gets down to moving the bits around. I argue in this thread that the correct way, and a more flexible and interesting way, to look at social and political interactions in Dwarf Fortress is in terms of
sets.
This is a long post but a good one, so bear with me.
The Set in Dwarf FortressA Dwarf Fortress set is anything that can contain other sets or objects. In this post all examples of objects will be creatures, both sapient and non-sapient, and all examples of sets will be framed in terms of the relationships that creatures have. Although you could certainly use a similar framework for stone or mugs or prepared meals, the framework I am attempting to construct will, as you will see, have very little to do with the sort of thing stone or mugs can do. While mathematical sets are defined by common
properties, DF sets will simply be defined as "whomever DF wants to group together," and are only kept together by their
constitutions (see below). They are not defined by common properties in the same way that the set of all odd numbers is defined by the property of not being divisible by two.
Now, all interactions will be much easier to code if they are between sets,
not objects. The simplest set, then- let us call it an
alpha set- is the set that every creature exists in. Basically, although dwarves or elves or badgers are coded as objects, they are the sole members of their alpha sets. Alpha sets are coded in such a way that they can contain and interact with the creature they are linked to.
All other sets, no matter how large or small, are framed as
beta sets. Beta sets are different because they can only contain sets, and cannot contain objects. To clarify: sets don't just contain things; they contain other sets. Alpha sets are a special framework that can only contain things, but with beta sets, the sky's the limit. For example, a marriage might be an example of the simplest beta set, because it contains two alphas- the wife and the husband. But more complex beta sets will contain smaller beta sets, so that as the world grows and complex political structures are defined, beta sets can become quite massive indeed: a civilization might contain hundreds and hundreds of parliaments, towns, councils, monarchs and nobles that all have their own separate role.
All beta sets are defined in essence by what I have termed
constitutions. (Alpha sets will have a constitution too, sort of, but it'll be hardcoded and nothing like the constitution of a beta set). Originally, this proposal was to deal with entities and other organized groups, which will of course have to have constitutions written or unwritten so that they can work. However, as it became clear that sets could be used as a framework in which to term
all relationships between creatures and the structures they create, it became clear that even the most seemingly disorganized sets will have constitutions.
Constitutions will basically have four parts to them:
inclusion terms,
expulsion terms,
internal organization and
external affairs- these last two can be basically lumped together, as we shall see.
Inclusion termsAll sets must have inclusion terms. Inclusion terms are, in essence, rules attached to the set that state who can join the set and what needs to happen for them to join.
One of the first things that needs to be remembered is that although many sets are
conscious, like entities, in that they are "aware" of their status as a set and of their internal organization and external affairs, many are not. Conscious sets will have the framework to change their own constitutions; unconscious ones will not, or will not in the same way. A constitution is simply how the computer handles the set.
Here's a good example of an extremely simple beta set: a herd of badgers. A herd of badgers does not have much of an internal structure- no hierarchy to speak of, really, except maybe a "head" badger (we'll get to that in the
organization section). The herd's inclusion term is probably as simple as "being born into the herd."
Or, another set, possibly even simpler: all the children in a fortress. The inclusion term? Be born, be a dwarf, be in the fortress.
Or the set of all mechanics in a fortress (not the same as a mechanic's guild): be at least dabbling in mechanics.
If some of these sets seem to be self-evident and not worth presenting as sets, they are! The set of mechanics in a fortress is exactly that. But they need to be defined for the computer to deal with them.
Likewise, there are
expulsion terms. The badger is shot by a hunter, or the child turns 12; the game expels them from the badger herd or the set of children. Expulsion is just a blanket term. It could be a crime against the set that the member committed- in conscious sets, mostly- but most of the time it won't be.
For both inclusion and expulsion, remember that beta sets contain both beta sets and alpha sets, and that it's
sets that are expelled- not
objects or
creatures. Alpha sets are not beta sets; they are a set that contains the creature and only the creature, and as such do not have inclusion or expulsion terms. When a creature is born, an alpha set is created for it; the alpha set never really disappears, since the creature will always be buried and be remembered in Legends. (Well, sapient ones will. I doubt ravens or badgers are kept in memory once they've been chopped up, so their alpha sets might act differently.) Because they do not have internal organization, they do not have expulsion, inclusion or internal hierarchy. However, they interact with their supersets the same way beta sets do. Just as alpha sets containing individual members can be expelled, so too can beta sets; for example, a group of countries that had signed a treaty might choose to kick out an entity for acting up too much.
This may run into difficulty when combined with zombification- a living raven will have its own alpha set, but an undead raven head might need a different one from the rest of the resurrected raven. However, we can consider that a minor kink for this discussion, which is mainly a proof of concept.
Now onto the really fun part- set interaction. This can be seen in terms of
subsets- in other words, how a set's subsets interact with each other- or
supersets- how the set interacts with other sets. Both are equally valid analyses.
This can give rise to hierarchies, especially in conscious sets. One of the tempting possibilities here is to use a version of fuzzy set theory. In fuzzy set theory, the idea of "either you're in set X or not in set X and there are no other possibilities" is thrown out, and every member of the set has a number between 0 and 1 attached to it, which can be seen as basically a percentage of membership. Member A is 25% a member of set X, member B two-thirds a member of set X, you get the idea.
It's tempting to use fuzzy set theory to define set hierarchies. For example, a mason's guild might have a rule that any member receives a tomb and burial at the guild's expense. But, surely, the corpse isn't really a member anymore. So you could say that a deceased member of the guild is a 20% member, while, say, starting apprentices are at least 30%.
The problem with this is that it doesn't accurately take into account real hierarchies. It's perfectly fine in a simple set to say that the 70% members have this authority over the 30% members, but in more complex sets different subsets will have dominance over others in different ways- and if you're going to assign them all numbers, you're basically just creating numbered subsets anyway. What's more realistic is to say "OK, here are the subsets of the mason's guild: the head mason, the master masons, the apprentice masons, and oh yeah the dead guys that the guild provides maintenance for." These subsets will have their own constitutions which will be referenced by the higher constitution of the guild, specifying what duties, benefits, authority and status apply to each subset.
Remember, in this case, that
all beta sets are created equal. Or, at least, their framework is. In other words, the set of master masons has its own constitution that has the potential to be just as complex as that of the mason's guild- it has its own rules for inclusion and expulsion, its own rules about how it interacts with other sets and how its members interact. It is probably wise to invoke an adapted version of the 10th Amendment: a set's constitution may invoke any powers that are not expressly delegated to or prohibited by any of its supersets. As an example: the mason's guild in fortress A might make a mandate for rock blocks to be made at least once a month, assuming its head mason (or whatever) liked blocks and its constitution (and the constitution of the guild's supersets) allowed its constitution the power to include the equivalent of a mandate clause. In Fortress B, the head mason also likes blocks, but the constitution of some superset of the guild bans guilds from making mandates more than twice a season. In Fortress C, meanwhile, guilds can't make mandates at all.
This is not to say constitutions can't change, especially in conscious sets, it should be noted. For example, if the king of a civilization dies without an heir, a civil war would create new subsets and conflicts.
-------------------------------------------------------------
So, uh, that's sets. The question remains:
what can we do with sets?Well, a hell of a lot, I think.
-Obviously,
entities can be framed as sets, since they can contain subsets- "king," "monarch," "parliament", etc.- which can easily be used to create a government system, a social hierarchy and obligations between sets. Taxation is just payment from set to set! This can be expanded to create free-er or less free society (a caste system like India's would be quite easy to set up, for example), or societies with more or less organization; consider Earth's hunter-gatherer bands versus its petty chiefdoms, wide-ranging tribal societies, and states.
-Likewise, any
group of creatures can be framed as a set. Not just entities- this includes guilds, clubs, families, households, marriages, lover pairs, bandit gangs, your band in adventurer mode, or even just groups that the computer finds it convenient to keep track of, like all the legendary dwarves in the fortress, all the dwarves in the fortress that have used up their strange mood, or all dwarves that have died.
-
Laws and
agreements can be framed as sets, because of the aforementioned 10th Amendment. A treaty between two warring entities is actually a set, and can be made to act like a set! When two entities sign a treaty, they construct a set of which they are the members and of which the treaty comprises the constitution. Thus, the terms of the treaty overrides the desires of the nations to go to war- however, since it is a conscious set, that is not to say, as I noted above, that the treaty cannot be broken- the game just needs to figure out how that would happen; perhaps the treaty would have a "line" past which incidents between the entities would override the treaty.
-This extends to
wars as well as to
conflicts. Two entities at war are in a "war" set. Likewise, so are two armies at battle- since armies are sets- and possibly two soldiers fighting.
-
Castes can simply be framed as subsets of a species.
-
Ethics,
behavior and
professions, and the like, can simply be written into the constitutions of their appropriate sets. This allows for more diverse species, for example: one human civilization might find it acceptable to cremate the dead; another might find it unthinkable.
-
Modding will become much more versatile with sets. In essence, all Toady would need to do in the raws is to create a standard set of tags which, together, make up a set's constitution, once he's decided what a constitution can define- ethics and hierarchies would be a good start, but as development continued he could add in more possibilities for constitutions. Certainly, some sets it would be useful to hardcode, but others would be in the raws, and modders could create subsets or supersets of these as they saw fit. The constitutions must be similar enough to be universally applied, but versatile enough to create very different sets. This will scrap the current caste, entity and even species system by allowing modders to create sets out of thin air. It is likely that alpha sets, at least, will be hardcoded. It will be up to Toady which beta sets will be hardcoded and which will be in the raws, allowing the players to screw with them. Later today I might give some more thought to what a constitution in the raws might look like, perhaps write up a sample constitution for a simple set like a badger herd.
Comments, constructive criticism and musings about my proposal are much appreciated.