Direct relationships between chars?
Direct relationships between chars?
Hello, picked this asset up the other day and so far I'm loving it! I do have one question though. Is it possible to have faction-level relationships, as well as separate relationships between members of two different factions?
In my game, there are many "nations". Some nations are grouped together into larger factions, while others are not. I can obviously track the relationship between the factions, but sometimes, nations will need to have separate relationships with members of another faction (or sort of an "independent faction", if that makes any sense.
The only way that I can sort of see it working now would be to have two faction managers - one for the larger game factions, and a separate one where every nation is in its own faction. Would that be the preferred or recommended approach?
Thanks in advance for any thoughts or ideas!
Cheers.
In my game, there are many "nations". Some nations are grouped together into larger factions, while others are not. I can obviously track the relationship between the factions, but sometimes, nations will need to have separate relationships with members of another faction (or sort of an "independent faction", if that makes any sense.
The only way that I can sort of see it working now would be to have two faction managers - one for the larger game factions, and a separate one where every nation is in its own faction. Would that be the preferred or recommended approach?
Thanks in advance for any thoughts or ideas!
Cheers.
Re: Direct relationships between chars?
Hi,
Thanks for using Love/Hate!
If I understand your intent correctly, you can use a single faction database and faction manager.
Let's take a concrete (albeit historically inaccurate) example with these factions:
Factions:
Relationships:
Relationships:
Relationships:
Thanks for using Love/Hate!
If I understand your intent correctly, you can use a single faction database and faction manager.
Let's take a concrete (albeit historically inaccurate) example with these factions:
Factions:
- Rome: nation
- Marc Antony: member of Rome
- Egypt: nation
- Cleopatra: member of Egypt
Relationships:
- Rome: Egypt=-80
- Egypt: Rome=-80
Relationships:
- Rome: Egypt=-80
- Marc Antony: Egypt=-50, Cleopatra=+80
- Egypt: Rome=-80
- Cleopatra: Marc Antony=+80
Relationships:
- Rome: Egypt=-80, Marc Antony=+60, Cleopatra=+40
- Marc Antony: Egypt=-50, Cleopatra=+80 (inherited/default: Rome=+100)
- Egypt: Rome=-80, Marc Antony=-100 (inherited/default: Cleopatra=+100 as member of Egypt)
- Cleopatra: Marc Antony=+80 (inherited/default: Egypt=+100, Rome=-80 as member of Egypt)
Re: Direct relationships between chars?
Hey - thanks for the informative response!
Yes, it does make sense. Just trying now to figure out how to do this via the API, since my factions are largely dynamic. I've no problem managing the affinity between factions, just not sure how to do it between faction members directly. I will research some more tonight and see where it leads me.
Cheers.
Yes, it does make sense. Just trying now to figure out how to do this via the API, since my factions are largely dynamic. I've no problem managing the affinity between factions, just not sure how to do it between faction members directly. I will research some more tonight and see where it leads me.
Cheers.
Re: Direct relationships between chars?
I think I discovered the trick ...
Didn't see this the first time through the code. Looks like I can call this directly from a FactionMember object and set their relationship to faction independently from the relationship their current faction has with the subject faction.
But still, since it needs a factionID as the first argument, I would need to have each nation have it's own separate faction away from the larger grouped factions - unless I am missing an API call somewhere that would allow me to set a FactionMember's affinity directly with some other FactionMember object.
Cheers.
Code: Select all
SetPersonalAffinity(int subjectFactionID, float affinity);
But still, since it needs a factionID as the first argument, I would need to have each nation have it's own separate faction away from the larger grouped factions - unless I am missing an API call somewhere that would allow me to set a FactionMember's affinity directly with some other FactionMember object.
Cheers.
Re: Direct relationships between chars?
Each nation needs its own faction. Relationships are defined between factions. Any entity (a character, a nation, or a group of nations) that is in a relationship needs a unique faction.
Faction members belong to a faction. If the faction has a relationship to another faction, then all faction members have that relationship. When you're defining factions, it's usually best to define a unique faction for every unique character (faction member) and set up parents.
If a set of NPCs are interchangeable, they can share the same faction. For example, it probably isn't worthwhile to maintain unique sets of relationships for every single cannon fodder goblin in a dungeon. Just assign their faction members to the same Goblins faction. The Goblin King, however, might merit its own faction if its interactions with other factions have the potential to be different from other goblins. The parent of the Goblin King's faction would be Goblins.
Building on the previous Marc Antony/Cleopatra example, let's say there are several Germanic tribes: Vandals, Ostrogoths, and Visigoths. As a whole, they are Germania. You'd define the factions like this:
Here's how Love/Hate determines how Marc Antony feels about Segeric:
I hope that helps. If I can provide any more details, please let me know.
Here are some helpful scripting links:
Faction members belong to a faction. If the faction has a relationship to another faction, then all faction members have that relationship. When you're defining factions, it's usually best to define a unique faction for every unique character (faction member) and set up parents.
If a set of NPCs are interchangeable, they can share the same faction. For example, it probably isn't worthwhile to maintain unique sets of relationships for every single cannon fodder goblin in a dungeon. Just assign their faction members to the same Goblins faction. The Goblin King, however, might merit its own faction if its interactions with other factions have the potential to be different from other goblins. The parent of the Goblin King's faction would be Goblins.
Building on the previous Marc Antony/Cleopatra example, let's say there are several Germanic tribes: Vandals, Ostrogoths, and Visigoths. As a whole, they are Germania. You'd define the factions like this:
- Germania
- Vandals: parents=Germania
- Ostrogoths: parents=Germania
- Visigoths: parents=Germania
- Rome: Germania=-60
Here's how Love/Hate determines how Marc Antony feels about Segeric:
- Marc Antony doesn't have a personal relationship to Segeric.
- Next, he checks his parents (and grandparent factions, etc.) for a personal relationship to Segeric. None exists.
- Next, he checks his own faction and his parents for personal relationships to any of Segeric's parents. Here, he finds that his parent faction (Rome) has a relationship to Segeric's grandparent faction (Segeric > Visigoths > Germania). So Marc Antony has -60 affinity to Segeric.
I hope that helps. If I can provide any more details, please let me know.
Here are some helpful scripting links:
Re: Direct relationships between chars?
Yep that helps quite a bit! Thanks for the incredibly informative and substantive replies in this thread!
Cheers.
Cheers.
Re: Direct relationships between chars?
On a related note, I'm curious how you would model the countries involved in say, World War I? You had x number of countries in the Central Powers, y number of countries in the Allied Powers, and a whole ton of "neutral" countries. Obviously the Central and Allied factions would dislike each other extremely.
Would you make a "Neutral" faction as the parent, and plop all the neutral countries into their own factions under that? And have a Central Alliance faction, with the participating members of that faction under that in their own unique factions? Same for Allied, etc.
Examples:
Germany hates England - and vice-versa.
England loves the USA - and vice versa.
Denmark is a neutral country. Other neutral countries may like/dislike them, and the same for the members of the 2 primary factions. But likewise, they don't have the same relationship with every other neutral country.
Cheers.
Would you make a "Neutral" faction as the parent, and plop all the neutral countries into their own factions under that? And have a Central Alliance faction, with the participating members of that faction under that in their own unique factions? Same for Allied, etc.
Examples:
Germany hates England - and vice-versa.
England loves the USA - and vice versa.
Denmark is a neutral country. Other neutral countries may like/dislike them, and the same for the members of the 2 primary factions. But likewise, they don't have the same relationship with every other neutral country.
Cheers.
Re: Direct relationships between chars?
That's a good question, and I think it depends on what you're trying to model.
Unless it's important that all neutral countries share some specific traits and/or relationships, I'd probably leave all neutral countries unparented. If some of them formed their own group, you could create a new faction (e.g., Olive-Producing Countries) at runtime and set it as their parent. Or if Denmark decided to join the Allies, you could set Allied Powers as its parent.
Or you could define factions for groupings that aren't specific to the World War I powers, such as a Nordic Countries faction.
A faction can have multiple parents, too, so Sweden could be a member of Nordic Countries and Central Powers.
I didn't mention this previously, but when a faction has multiple parents and no personal relationship to a target, it averages the parents' relationships to the target.
Unless it's important that all neutral countries share some specific traits and/or relationships, I'd probably leave all neutral countries unparented. If some of them formed their own group, you could create a new faction (e.g., Olive-Producing Countries) at runtime and set it as their parent. Or if Denmark decided to join the Allies, you could set Allied Powers as its parent.
Or you could define factions for groupings that aren't specific to the World War I powers, such as a Nordic Countries faction.
A faction can have multiple parents, too, so Sweden could be a member of Nordic Countries and Central Powers.
I didn't mention this previously, but when a faction has multiple parents and no personal relationship to a target, it averages the parents' relationships to the target.
Re: Direct relationships between chars?
Perfect! Thanks so much!
Cheers.
Cheers.
Re: Direct relationships between chars?
Ok, not quite done haha!
So I have things set up currently with the Axis and Allied factions, and all other countries just in their unique/unparented factions. The Axis and Allied nations all have unique factions underneath the two main factions. Check!
When I do this, as a quick test:
between 2 members of say, the Allied faction, it returns 0. According to the class reference, GetAffinity() should check the parents, no? I would think it would return 100 or what not. Do I need to explicitly set the initial affinity level (not personal affinity)?
So I have things set up currently with the Axis and Allied factions, and all other countries just in their unique/unparented factions. The Axis and Allied nations all have unique factions underneath the two main factions. Check!
When I do this, as a quick test:
Code: Select all
factionManager.GetAffinity( judgeFactionName, subjectFactionName );