Factional Alignment system: The maths

Factional Alignment system: The maths

Postby Keldaryth » 20 Jun 2010, 10:10

As has been requested, I am attempting to post a mathematical explanation of the Factional Alignment system as it currently stands. You can also find a spreadsheet containing the system here, which you may find useful as all the formulae are found in the relevant calculation cell. This thread will be a multi-part explanation because there's a lot to get through and explain, and I will try my hardest to do so in a concise and organised fashion (good luck to me).

The initial posting is now complete - questions and discussion is welcome to commence :)

The mathematical system is currently built to take into account a number of things:

1) How many creature types are currently available to enter the dungeon?
2) What is the player's current factional mix of creatures?
3) How does each creature type feel about the player's current factional mix?
4) What is the player's current alignment?
5) How does each creature type feel about the player's current alignment mix?

The big formula can be written as this:

Probability of Creature Appearance = Base Probability + Factional Modifier + Alignment Modifier

In the 2 alignment system the formula can be written as:

P = [1/n] + [Cfh(Fh) + Cfc(Fc) + Cfu(Fu) + Cfg(Fg) + Cfd(Fd)] + [Calc(Alc) + Cage(Age)]

In the 3 alignment system the formula can be written as:

P = [1/n] + [Cfh(Fh) + Cfc(Fc) + Cfu(Fu) + Cfg(Fg) + Cfd(Fd)] + [Caae(Aae) + Caoc(Aoc) + Capv(Apv)]

Where:

P = Probability of creature appearance
n = Total number of creature types currently available for recruitment (i.e. threshold conditions have been met)
Cfh = Creature Faction Coefficient for Humans
Cfc = Creature Faction Coefficient for Corpars
Cfu = Creature Faction Coefficient for Undead
Cfg = Creature Faction Coefficient for Constructs (Golems)
Cfd = Creature Faction Coefficient for Denizens
Fh = Human proportion of player creature population
Fc = Corpar proportion of player creature population
Fu = Undead proportion of player creature population
Fg = Construct proportion of player creature population
Fd = Denizen proportion of player creature population
Calc = Creature Alignment Coefficient for Law-Chaos continuum
Cage = Creature Alignment Coefficient for Good-Evil continuum
Alc = Player alignment on Law-Chaos continuum
Age = Player alignment on Good-Evil continuum
Caae = Creature Alignment Coefficient for Altruism-Egotism continuum
Caoc = Creature Alignment Coefficient for Order-Chaos continuum
Capv = Creature Alignment Coefficient for Peace-Violence continuum
Aae = Player alignment on Altruism-Egotism continuum
Aoc = Player alignment on Order-Chaos continuum
Apv = Player alignment on Peace-Violence continuum
Last edited by Keldaryth on 20 Jun 2010, 16:46, edited 6 times in total.
Keldaryth
 
Posts: 92
Joined: 15 Jun 2010, 23:51

Re: Factional Alignment system: The maths

Postby Keldaryth » 20 Jun 2010, 10:40

Base Probability: How many creature types are are currently available to enter the dungeon

The basic premise of this system is that each available creature type has an equal base chance of entering a player's dungeon. Therefore this chance is 1/n where n is the total number of available creature types.

So if there are 5 available creature types, each creature has a base of 1/5 = 0.2 (or 20%) chance of entering a players dungeon. If there's only 2 types of available creature then each type has a 1/2 = 0.5 (or 50%) base chance of entering the dungeon.

Note that the system of HOW a creature type becomes flagged as 'available' has not yet been set. Currently I envision a system similar to Dungeon Keeper 2 where each creature has a trigger threshold and an available population. This would mean that for a Wizard to enter a player's dungeon the Wizard's trigger threshold must be reached (such as by building a library). Under DK2, the first threshold is always a room, and the number of room tiles equals the maximum number of that creature type a room can attract, so if there were 9 library tiles, 9 wizards could be attracted. If the threshold condition for a creature is not met, then the probability of it appearing (P) would be set to zero.

However, for this to happen 9 wizards would need to be available in the creature pool available to the player (as set by the scenario builder). The creature pool concept allows the scenario builder to limit the number of available creatures irrespective of the dungeon built by the player, which is useful. If no wizards are available (or all available wizards have already been recruited) then the probability of a wizard appearing (Pwizard) would be set to zero.

However, once it is determined that at least 1 wizard is available, the mechanics here determine the chance of a wizard being the next creature to enter the dungeon via the as yet undesigned creature portal.
Keldaryth
 
Posts: 92
Joined: 15 Jun 2010, 23:51

Re: Factional Alignment system: The maths

Postby Keldaryth » 20 Jun 2010, 11:30

What is the player's factional mix of creatures?

A players factional mix is the proportion of creatures from each faction

Fi = SUM(KIi-KIn)/n

Where:
Fi = Factional proportion being calculated (i.e. Fh, Fu, Fg, Fc and Fd as in the above main formula)
KIi = Appropriate faction attribute of creature 1 in the faction being calculated
KIn = Appropriate faction attribute of creature n in the faction being calculated
n = number of creatures in the dungeon

So to calculate Fh the formula would be:

Fh = SUM(KHi-KHn)/n

Example
Assume a dungeon of the following 8 creatures, which the following factional attributes:
1) Archer (Human 1)
2) Cleric (Human 1)
3) Ghoul (Undead 1)
4) Goblin (Child of the Deep 0.8, Construct 0.2)
5) Gold Golem (Construct 1)
6) Naga (Child of the Deep 1)
7) Vampire (Human 0.5, Undead 0.5)
8) Warrior (Human 1)

To find Fh, we start by finding SUM(KHi-KHn). To do this we go through each of the eight creatures and add up their human faction attribute (where unlisted it defaults to zero).
SUM(KHi-KHn)= 1+1+0+0+0+0+0.5+1 = 3.5

And we do the same for the other parts of the formula:
SUM(KCi-KCn) = 0+0+0+0.8+0+1+0+0 = 1.8
SUM(KGi-KGn) = 0+0+0+0.2+1+0+0+0 = 1.2
SUM(KUi-KUn) = 0+0+1+0+0+0+0.5+0 = 1.5
SUM(KDi-KDn) = 0+0+0+0+0+0+0+0 = 0

So:
Fh = 3.5/8 = 0.4375
Fc = 1.8/8 = 0.225
Fu = 1.5/8 = 0.1875
Fg = 1.2/8 = 0.15
Fd = 0/8 = 0

This generally works, however, each player has 3 kobolds which can add to 'n', or the number of creatures and skew the results. It is therefore suggested that 'n' be 'n-3' to take this into account, or simply be defined as 'creatures in the dungeon excluding kobolds'.

What this means is that the Keeper has a Human Faction Population Proportion of 0.4375, a Children of the Deep Faction Population Proportion of 0.225, an Undead Population Proportion of 0.1875, a Construct Faction Population Proportion of 0.15 and a Denizen Faction Population Proportion of 0.

For shorthand I refer to this as a Faction Attribute: Human Attribute: 0.4375, Corpar Attribute 0.225, Undead Attribute of 0.1875, Construct Attribute of 0.15, Denizen Attribute of 0.
Keldaryth
 
Posts: 92
Joined: 15 Jun 2010, 23:51

Re: Factional Alignment system: The maths

Postby Keldaryth » 20 Jun 2010, 13:53

Factional Modifier: How does each creature type feel about the player's current factional mix?

The fundamental idea is that each creature has both a faction (or set of faction) attribute, and an attitude towards each faction, including the one(s) it is part of.

Depending on how a creature feels about the factions present in a player's dungeon, it will be more or less willing to join it.

The attraction modifier(s) form this next part of the formula: Cfh(Fh) + Cfc(Fc) + Cfu(Fu) + Cfg(Fg) + Cfd(Fd)
Where:
Cfh = Creature Faction Coefficient for Humans
Cfc = Creature Faction Coefficient for Corpars
Cfu = Creature Faction Coefficient for Undead
Cfg = Creature Faction Coefficient for Constructs (Golems)
Cfd = Creature Faction Coefficient for Denizens
Fh = Human proportion of player creature population
Fc = Corpar proportion of player creature population
Fu = Undead proportion of player creature population
Fg = Construct proportion of player creature population
Fd = Denizen proportion of player creature population

Let's take a sample creature to work through this:
Warrior
Faction Coefficients: Humans 1, Children -0.5, Constructs 0, Undead -1

So what does this mean?

Faction coefficients (like all coefficients) range between -1 and 1. A negative coefficient means that a creature dislikes creatures of that faction, a positive coefficient means that a creature likes creatures of that faction, with the size of the absolute value describing how much, so a human coefficient value of 1 means that the creature loves being around humans, and thus it makes sense that the more humans there are in the dungeon the more this creature would be willing to join - and the reverse is true for creatures of a faction where this creature has a coefficient of -1, like the undead.

Now let's assume that this warrior is one of the creatures thinking of coming into the sample dungeon we used above.

Just to recap, with 8 creatures in the dungeon, the player's factional attributes are as follows:
Human Attribute: 0.4375, Corpar Attribute 0.225, Undead Attribute of 0.1875, Construct Attribute of 0.15, Denizen Attribute of 0.

So the Warrior's factional modifier to his probability of appearance is:
Cfh(Fh) + Cfc(Fc) + Cfu(Fu) + Cfg(Fg) + Cfd(Fd) = 1(0.4375) + -0.5(0.225) + -1(0.1875) + 0(0.15) + 0(0) = 0.4375 - 0.1125 -0.1875 + 0 + 0 = 0.1375

This would be done for every creature that is available for recruitment.
Keldaryth
 
Posts: 92
Joined: 15 Jun 2010, 23:51

Re: Factional Alignment system: The maths

Postby Keldaryth » 20 Jun 2010, 14:54

Determining the Players Current Alignment

The player's current alignment is (currently) based the alignment mix of his or her population. This is true of both alignment systems currently being explored.

In the two continuum (axis) model a player has two alignment attributes: a Law-Chaos attribute and a Good-Evil attribute.

In the three continuum (axis) model, a player has three alignment attributes: an Altruism-Egotism attribute, an Order-Chaos attribute and a Peace-Violence Attribute.

The formula to calculate each of these is essentially the same: SUM(Ai-An)/n

Where:
Ai is the measured alignment attribute of the first creature in the dungeon
An is the measured alignment attribute of the last creature in the dungeon
n is the number of creatures in the dungeon (possibly the number of creatures in the dungeon excluding kobolds as discussed here).

So revisiting Sample Dungeon we have the following creatures with the following alignment attributes:
1) Archer (LC 0.8, GE 0.4 | AE -0.6, OC 0.8, PV -0.9)
2) Cleric (LC 1, GE 1 | AE 0.9, OC 1, PV 0)
3) Ghoul (LC 0, GE -1 | AE -0.6, OC -0.4, PV -1)
4) Goblin (LC -0.6, GE 0 | AE -0.2, OC -0.6, PV 0.4)
5) Gold Golem (LC 1, GE 0 | AE 0, OC 1, PV 0)
6) Naga (LC -0.2, GE 0 | AE -0.6, OC -0.2, PV 0)
7) Vampire (LC -0.3, GE -0.2 | AE -0.8, OC -0.8, PV -0.3)
8) Warrior (LC 0.8, GE 0.4 | AE -0.6, OC 0.8, PV -0.9)

Under the two Alignment system a player's Law-Chaos Alignment attribute is calculated as follows:

SUM(Alci-Alcn)/n = (0.8 + 1 + 0 + -0.6 +1 + -0.2 + -0.3 + 0.8)/8 = 2.5/8 = 0.3125

The player's Good-Evil Alignment attribute is calculated as follows:

SUM(Agei-Agen)/n = (0.4 + 1 + -1 + 0 + 0 + 0 + -0.2 + 0.4)/8 = 0.6/8 = 0.075

The Three alignment system calculates it's alignment attributes in exactly the same way

Altruism-Egotism: SUM(Aaei-Aaen)/n = (-0.6 + 0.9 + -0.6 + -0.2 + 0 + -0.6 + -0.8 + -0.6)/8 = -2.5/8 = -0.3125
Order-Chaos: SUM(Aoci-Aocn)/n = (0.8 + 1 + -0.4 + -0.6 + 1 + -0.2 + -0.8 + 0.8)/8 = 1.6/8 = 0.2
Peace-Violence: SUM(Aoci-Aocn)/n = (-0.9 + 0 + -1 + 0.4 + 0 + 0 + -0.3 + -0.9)/8 = -2.7/8 = -0.3375

This gives the keeper:
A 2 continuum alignment of LC 0.3125 GE 0.075
A 3 continuum alignment of AE -0.3125 OC 0.2 PV -0.375

As an interpretation the 2 continuum alignment can be interpreted as a population that likes a small amount of order and is tending towards good, and the 3 continuum alignment can be interpreted as a population that tends to be mostly self centred, liking a small amount of order, and is often ready to use violence as a solution to its problems.
Keldaryth
 
Posts: 92
Joined: 15 Jun 2010, 23:51

Re: Factional Alignment system: The maths

Postby Keldaryth » 20 Jun 2010, 15:29

Alignment Modifier: How does each creature type feel about the player's current alignment mix

The principle idea here is that each creature likes living in a society with a certain alignment - note that the alignment the creature prefers may not be the same alignment that the creature holds.

Just like the factional modifier calculation the idea is that depending on how a creature feels about the average alignment in a player's dungeon (as represented by the player's alignment), it will be more or less willing to join it.

The alignment based modifiers to the the creature's attraction to the player's dungeon are found at the tail end of the main formula.

For a two axis system: Calc(Alc) + Cage(Age)
For a three axis system: Caae(Aae) + Caoc(Aoc) + Capv(Apv)

Where:
Calc = Creature Alignment Coefficient for Law-Chaos continuum
Cage = Creature Alignment Coefficient for Good-Evil continuum
Alc = Player alignment on Law-Chaos continuum
Age = Player alignment on Good-Evil continuum
Caae = Creature Alignment Coefficient for Altruism-Egotism continuum
Caoc = Creature Alignment Coefficient for Order-Chaos continuum
Capv = Creature Alignment Coefficient for Peace-Violence continuum
Aae = Player alignment on Altruism-Egotism continuum
Aoc = Player alignment on Order-Chaos continuum
Apv = Player alignment on Peace-Violence continuum

Let's return to our Warrior looking to join the player's dungeon:

Warrior
Alignment Coefficients
2 Continuum (Axis): LC 0.8, GE 0.8
3 Continuum (Axis): AE: 0.6, OC 0.8, PV -0.1

These coefficients work exactly the same way as the factional coefficients above - just obviously on a keeper's alignment attributes.

Once again assuming this warrior is considering joining the player's sample dungeon:

To recap the player in the sample dungeon has alignment attributes as follows:
A 2 continuum alignment of LC 0.3125 GE 0.075
A 3 continuum alignment of AE -0.3125 OC 0.2 PV -0.375

The modifiers are:

Under the 2 Continuum Alignment system:

Calc(Alc) + Cage(Age) = 0.8(0.3125) + 0.8(0.075) = 0.31

Under the 3 Continuum Alignment system:

Caae(Aae) + Caoc(Aoc) + Capv(Apv) = 0.6(-0.3125) + 0.8(0.2) + -0.1(-0.375) = 0.01

Again, this calculation is done for every available creature type.
Keldaryth
 
Posts: 92
Joined: 15 Jun 2010, 23:51

Re: Factional Alignment system: The maths

Postby Keldaryth » 20 Jun 2010, 15:53

Bringing it all together

So now you should be able to see how the formula's components are calculated and now they need to be put together in the big formula:

2 Continuum alignment system

P = [1/n] + [Cfh(Fh) + Cfc(Fc) + Cfu(Fu) + Cfg(Fg) + Cfd(Fd)] + [Calc(Alc) + Cage(Age)]

and 3 continuum alignment system

P = [1/n] + [Cfh(Fh) + Cfc(Fc) + Cfu(Fu) + Cfg(Fg) + Cfd(Fd)] + [Caae(Aae) + Caoc(Aoc) + Capv(Apv)]

Assuming for the moment that the warrior is one of 25 creature types available so that n=25

The Warrior's probability from the 2 alignment system becomes:

P = 0.04 + 0.1375 + 0.31 = 0.4875

In the 3 alignment system the probability is:

P = 0.04 + 0.1375 + 0.01 = 0.1875

So under the 2 alignment system a warrior would have a 48.75% chance of appearing in the player's dungeon and under the 3 alignment system, a warrior would have an 18.75% chance of appearing.
Keldaryth
 
Posts: 92
Joined: 15 Jun 2010, 23:51

Re: Factional Alignment system: The maths

Postby Keldaryth » 20 Jun 2010, 16:46

Scaling up: Looking at probabilities of multiple creature types

The example above is all well and good, but it gets tricky when you look at multiple creatures. If you plug this example dungeon into the example dungeon spreadsheet, you'll get a list of unmodified probabilities that are shown below:

2 Continuum (axis) probabilities
Archer 0.4875
Cleric 0.40875
Diamond Golem 0.00875
Ghoul 0.20125
Goblin -0.4275
Gold Golem 0.00875
Knight 0.35375
Maiden 0.3225
Miner 0.46625
Minotaur -0.1125
Minotaur Warlord -0.1125
Monk 0.4825
Naga -0.435
Necromancer 0.13
Orc Berzerker -0.66375
Rogue -0.66375
Steel Construct 0.00875
Stone Golem 0.00875
Troll Shaman -0.12875
Troll Stone Priest -0.12875
Vampire 0.3225
Warrior 0.4875
Wight -0.4725
Wizard 0.1775
Wraith 0.21125

Under the 3 axis system
Archer 0.18375
Cleric 0.09125
Diamond Golem -0.26
Ghoul 0.79375
Goblin -0.5625
Gold Golem -0.26
Knight -0.065
Maiden -0.4125
Miner -0.11
Minotaur 0.11375
Minotaur Warlord 0.11375
Monk -0.11125
Naga -0.435
Necromancer 0.38875
Orc Berzerker -0.25875
Rogue -0.18
Steel Construct -0.26
Stone Golem -0.26
Troll Shaman -0.185
Troll Stone Priest -0.185
Vampire 0.6075
Warrior 0.18375
Wight 0.185
Wizard -0.05125
Wraith 0.4525

The first thing I would like to draw your attention to is that some creature types have a negative probability of appearing. This isn't possible logically, and is simply a result of the mathematical equation we have used to calculate appearance probabilities - where the negative modifiers from faction and alignment attitudes have outweighed the positives and the base probability of appearance.

So the first thing that needs to be done is to go through and change every negative probability to zero.

Note also that the maths here is the same for either dataset (from the 2 or 3 continuum alignment systems), and so I will use the dataset from the 3 continuum alignment system, as it has more negative probabilities which will give us less data to work with in the long run, which is good for this example.

Changing the negative probabilities to zero gives the following data list:

Under the 3 axis system
Archer 0.18375
Cleric 0.09125
Diamond Golem 0
Ghoul 0.79375
Goblin 0
Gold Golem 0
Knight 0
Maiden 0
Miner 0
Minotaur 0.11375
Minotaur Warlord 0.11375
Monk 0
Naga 0
Necromancer 0.38875
Orc Berzerker 0
Rogue 0
Steel Construct 0
Stone Golem 0
Troll Shaman 0
Troll Stone Priest 0
Vampire 0.6075
Warrior 0.18375
Wight 0.185
Wizard 0
Wraith 0.4525

We then sum up all the probabilities to find the total probability and we get:

0.18375 + 0.09125+ 0.79375 + 0.11375 + 0.11375 + 0.38875 + 0.6075 + 0.18375 + 0.185 + 0.4525 = 3.11375

As a formula you could write this as follows:

Parcher + Pcleric + Pghoul + Pminotaur + Pminotaurwarlord + Pnecromancer + Pvampire + Pwarrior + Pwight + Pwraith = Ptotal

Now as you probably know, it isn't possible to have a probability greater than 1 because a probability of 1 indicates absolute certainty - in this case that it is absolutely certain that a creature will come into the dungeon. Again, the total probability being greater than 1 is a result of the mathematical calculations we have undertaken. However, the important thing is the probability attributed to the appearance of any one creature as a proportion of the total probabilities we have calculated (to use the term 'probability' both loosely and a little incorrectly).

To make things simple and comparable we can then rescale this all so that Ptotal is equal to 1, as it should, and we get:

(Parcher/Ptotal) + (Pcleric/Ptotal) + (Pghoul/Ptotal) + (Pminotaur/Ptotal) + (Pminotaurwarlord/Ptotal) + (Pnecromancer/Ptotal) + (Pvampire/Ptotal) + (Pwarrior/Ptotal) + (Pwight/Ptotal) + (Pwraith/Ptotal) = 1

Admittedly you could write it more simply, but this will do for our discussion, because at the end of the day, we want to know the individual Pcreature probabilities i.e. solve for Parcher. It should be noted that technically, the formula incorporates all 25 creatures:

Parcher + Pcleric + Pdiamondgolem + Pghoul + Pgoblin + Pgoldgolem + Pknight + Pmaiden + Pminer + Pminotaur + Pminotaurwarlord + Pmonk + Pnaga + Pnecromancer + Porcberzerker + Progue + Psteelconstruct + Pstonegolem + Ptrollshaman + Ptrollstonepriest + Pvampire + Pwarrior + Pwight + Pwizard + Pwraith = Ptotal

Essential Pcreature/Ptotal = Pmodified which is the modified (rescaled between 0 and 1) probability that a creature will appear in a player's dungeon.

This gives the final list (rounded to 2 dp):

Archer 0.06
Cleric 0.03
Diamond Golem 0
Ghoul 0.25
Goblin 0
Gold Golem 0
Knight 0
Maiden 0
Miner 0
Minotaur 0.0.4
Minotaur Warlord 0.04
Monk 0
Naga 0
Necromancer 0.12
Orc Berzerker 0
Rogue 0
Steel Construct 0
Stone Golem 0
Troll Shaman 0
Troll Stone Priest 0
Vampire 0.20
Warrior 0.06
Wight 0.06
Wizard 0
Wraith 0.15

And that's the system.

I hope that explanation helps.
Keldaryth
 
Posts: 92
Joined: 15 Jun 2010, 23:51

Re: Factional Alignment system: The maths

Postby Keldaryth » 20 Jun 2010, 16:47

I believe I have now finished the explanation I wanted to post so feel free to discuss and question and otherwise poke and probe at it.
Keldaryth
 
Posts: 92
Joined: 15 Jun 2010, 23:51

Re: Factional Alignment system: The maths

Postby andrewbuck » 20 Jun 2010, 17:07

This series of posts really helped me understand the process better. I noticed that you mentioned the possibility of having a creature who likes living in a good dungeon but is themselves evil. I think this is a neat idea and could be a good way of limiting the number of certain creatures. You could also do the same thing with the factions component of the probability, e.g. a creature who is classified as human but hates being around other humans.

I think this really adds to the realism of the mix you get since every society has members who actually oppose the social norms of the society they live in, this helps prevent the formation of a monoculture and allows the society to adapt to changing circumstances.

-Buck
andrewbuck
OD Moderator
 
Posts: 563
Joined: 20 Dec 2009, 01:42

Re: Factional Alignment system: The maths

Postby Keldaryth » 20 Jun 2010, 18:09

andrewbuck {l Wrote}:This series of posts really helped me understand the process better. I noticed that you mentioned the possibility of having a creature who likes living in a good dungeon but is themselves evil. I think this is a neat idea and could be a good way of limiting the number of certain creatures. You could also do the same thing with the factions component of the probability, e.g. a creature who is classified as human but hates being around other humans.

I think this really adds to the realism of the mix you get since every society has members who actually oppose the social norms of the society they live in, this helps prevent the formation of a monoculture and allows the society to adapt to changing circumstances.

-Buck


Thanks Buck - that's the exact idea. It's the reason why the rogue never poked up in my example dungeons- he can show, but has a low probability of showing in most of the societies generated here - most got too orderly or too violent. It's also the reason why the undead showed up in the human founded lists but humans didn't show up in the undead founded lists. Of course, there are other ways to limit creature numbers - simply setting the creature pool for their type to zero or one for instance.

I think this system lends itself to running inter creature interactions at a basic level as well - take a basic attitude of '0' and adjust up and down using Creature A's coefficients with Creature B's attributes and you'll end up with a figure that represents how much a creature likes or dislikes another creatures (and vice versa), which you could then link to a basic set of interaction commands for all creatures like 'make happier' or 'make unhappier' to 'attack' or 'converse' or 'prank'. Of course, it would then be possible to program specific intercreature actions on top of those, but it would mean that every creature added to the game, through a mod or otherwise (once the game goes full release and open source) will have a basic set of interactions with every other creature in game by virtue of the basic attraction mechanics that all creatures would need.

I've found in the past that the problem with mods from multiple sources in some games (NPC mods in BG2 was a good example of this) is that while they'd interact wonderfully with the original game content, they wouldn't interact with each other. A creature interaction system riding on the back of this would at least go some way to solving that issue.
Keldaryth
 
Posts: 92
Joined: 15 Jun 2010, 23:51

Re: Factional Alignment system: The maths

Postby svenskmand » 20 Jun 2010, 20:40

Keldaryth {l Wrote}:... once the game goes full release and open source ...

You know that we are releasing all the time, and that the source for everything is completely open all the time right?
andrewbuck {l Wrote}:This series of posts really helped me understand the process better.

Ditto.
Keldaryth {l Wrote}:I think this system lends itself to running inter creature interactions at a basic level as well - take a basic attitude of '0' and adjust up and down using Creature A's coefficients with Creature B's attributes and you'll end up with a figure that represents how much a creature likes or dislikes another creatures (and vice versa), which you could then link to a basic set of interaction commands for all creatures like 'make happier' or 'make unhappier' to 'attack' or 'converse' or 'prank'. Of course, it would then be possible to program specific intercreature actions on top of those, but it would mean that every creature added to the game, through a mod or otherwise (once the game goes full release and open source) will have a basic set of interactions with every other creature in game by virtue of the basic attraction mechanics that all creatures would need.

Could you explain this in a little more detail, I do not understand?
Jamendo.com - The best music store on the net, uses CC licenses.
User avatar
svenskmand
OD Moderator
 
Posts: 1850
Joined: 09 Dec 2009, 00:07
Location: Denmark

Re: Factional Alignment system: The maths

Postby Keldaryth » 21 Jun 2010, 04:47

svenskmand {l Wrote}:
Keldaryth {l Wrote}:... once the game goes full release and open source ...

You know that we are releasing all the time, and that the source for everything is completely open all the time right?


What I mean is once we pass the alpha and beta stages and get to the point where it's a complete game (version 1.0) other people will start coming out of the woodwork and using this game as a basis for their own spin off mods and such. I've seen it happen a lot with the really successful Civ Mods and the like

Keldaryth {l Wrote}:I think this system lends itself to running inter creature interactions at a basic level as well - take a basic attitude of '0' and adjust up and down using Creature A's coefficients with Creature B's attributes and you'll end up with a figure that represents how much a creature likes or dislikes another creatures (and vice versa), which you could then link to a basic set of interaction commands for all creatures like 'make happier' or 'make unhappier' to 'attack' or 'converse' or 'prank'. Of course, it would then be possible to program specific intercreature actions on top of those, but it would mean that every creature added to the game, through a mod or otherwise (once the game goes full release and open source) will have a basic set of interactions with every other creature in game by virtue of the basic attraction mechanics that all creatures would need.

Could you explain this in a little more detail, I do not understand?[/quote]

Yes I can - and yes I will... Let me organise my thoughts a bit and I'll do a post and stuff. ;)
Keldaryth
 
Posts: 92
Joined: 15 Jun 2010, 23:51

Re: Factional Alignment system: The maths

Postby svenskmand » 17 Jul 2010, 00:09

I have begun to fill in your math in the wiki, and have also implemented you system in Java to do some experiments, and I have also made a proposal of my own. And when doing that I thought about what is it we want to achieve in the alignment system? I came up with two overall goals:

1) A player wishing to get a certain alignment should be able to get it.
2) A player who wants to get some specific creatures should be able to change his alignment to get the wanted creatures.
3) A certain style of play should give a certain alignment.

I was not able to get property 1) with either Keldaryths or my own proposal for the alignment system. Property 2) I got easily with my own proposal, but not with Keldaryths. And property 3) I have not really tested that much as I need a definition of a "certain style of play". Also I want to hear what all of you thing about these goals, and if you have other goals to add, or a further detailing of some of them as they are pretty rough.

I think it is important that we set up some goals for what we want from the alignment system, so we can design it to get these properties. Also I think that we should also have a Creature Mood System, which applies to creatures in you dungeon, so we also need to specify where to draw the line between these two systems.
Jamendo.com - The best music store on the net, uses CC licenses.
User avatar
svenskmand
OD Moderator
 
Posts: 1850
Joined: 09 Dec 2009, 00:07
Location: Denmark

Re: Factional Alignment system: The maths

Postby Bodsda » 04 Aug 2010, 21:54

svenskmand {l Wrote}:I have begun to fill in your math in the wiki, and have also implemented you system in Java to do some experiments, and I have also made a proposal of my own. And when doing that I thought about what is it we want to achieve in the alignment system? I came up with two overall goals:

1) A player wishing to get a certain alignment should be able to get it.
2) A player who wants to get some specific creatures should be able to change his alignment to get the wanted creatures.
3) A certain style of play should give a certain alignment.

I was not able to get property 1) with either Keldaryths or my own proposal for the alignment system. Property 2) I got easily with my own proposal, but not with Keldaryths. And property 3) I have not really tested that much as I need a definition of a "certain style of play". Also I want to hear what all of you thing about these goals, and if you have other goals to add, or a further detailing of some of them as they are pretty rough.

I think it is important that we set up some goals for what we want from the alignment system, so we can design it to get these properties. Also I think that we should also have a Creature Mood System, which applies to creatures in you dungeon, so we also need to specify where to draw the line between these two systems.


I should probably start by saying that I havent read the math, but I like the idea.

I agree with point 1 and 3, and I have mixed thoughts about point 2. I believe that the player should be able to change his mind, but not at the flick of a switch. If I have 'left wing' creatures and I turn 'right wing', I would expect those creatures to rebel.

As for the creature mood system, an entire game series was dedicated to this; Black and White. It would be extremely complex to implement a sophisticated system, but a simple, 'get lost, I'm tired' system should be relatively simple.

Bodsda
User avatar
Bodsda
OD Moderator
 
Posts: 195
Joined: 18 Feb 2010, 08:19

Re: Factional Alignment system: The maths

Postby svenskmand » 05 Aug 2010, 15:36

My own proposal actually works very well and fulfills all three goals above, check it out in this thread, and read the section about it in the wiki. Also notice that I have not implemented the room requirements on creatures yet, that is the function w(c) in this section will always return 1, but I will do that later. Also I will make the same availability system for spells and traps as I have for the rooms, that is if their alignment are within a certain distance to the keepers alignment, which depends on the spell or trap, then the keeper has access to them.

When I have implemented all the above I will make a jar so people can easily try it out.
Jamendo.com - The best music store on the net, uses CC licenses.
User avatar
svenskmand
OD Moderator
 
Posts: 1850
Joined: 09 Dec 2009, 00:07
Location: Denmark

Re: Factional Alignment system: The maths

Postby xahodo » 08 May 2012, 18:36

Can rooms (specifically: the total number of tiles occupied by the room type), to make spawning particular creature types more likely?
xahodo
 
Posts: 61
Joined: 23 Mar 2010, 15:11

Re: Factional Alignment system: The maths

Postby svenskmand » 08 May 2012, 20:11

xahodo {l Wrote}:Can rooms (specifically: the total number of tiles occupied by the room type), to make spawning particular creature types more likely?

Can you rephrase the question, I have no idea what you are asking about?
Jamendo.com - The best music store on the net, uses CC licenses.
User avatar
svenskmand
OD Moderator
 
Posts: 1850
Joined: 09 Dec 2009, 00:07
Location: Denmark

Re: Factional Alignment system: The maths

Postby Danimal » 09 May 2012, 09:57

He means that in dk1, if you had a very big lair and hatchery vile demons would flood you, big library = lots of warlocks, big treasure rooms = lots of dragons . Meaning that the chance to get a creature depends on what you had built rather than a ramdon roll.
User avatar
Danimal
OD Moderator
 
Posts: 1407
Joined: 23 Nov 2010, 13:50

Re: Factional Alignment system: The maths

Postby xahodo » 09 May 2012, 15:50

Danimal is spot on about what I mean. However, I would prefer random chance to still play a role.
xahodo
 
Posts: 61
Joined: 23 Mar 2010, 15:11

Re: Factional Alignment system: The maths

Postby svenskmand » 09 May 2012, 18:00

Ok. The probability that a specific creature will spawn from the portal is influenced by what you build, yes. This was also how it was done in DK and DK2
Jamendo.com - The best music store on the net, uses CC licenses.
User avatar
svenskmand
OD Moderator
 
Posts: 1850
Joined: 09 Dec 2009, 00:07
Location: Denmark

Who is online

Users browsing this forum: No registered users and 0 guests