Aller au contenu

Photo

Reputation - Faction and Personal


  • Veuillez vous connecter pour répondre
32 réponses à ce sujet

#1
henesua

henesua
  • Members
  • 3 863 messages
 I am confused about how Reputation and Factions work, but for a number of things I am doing in my module, I need to have a firm understanding. So here are a few questions:

(1) If you change the faction of an NPC, what happens to all the personal reputation information that the NPC has? Does it simply forget how it treated other individuals and take on the defaults of the new faction?
(2) How do you adjust the personal reputation of an individual towards another individual?  (AdjustReputation - adjusts an individual's reputation with an entire faction)
(3) If a PC switches parties, what happens to their personal reputation? For example, I have a system which enables a PC to join an NPC faction. Via script I AdjustReputation for the PC onClientEnter. Do I need to AdjustReputation again?
(4) If you adjust an PCs reputation with a faction, then later spawn some creatures in that faction, do the recent spawns pick up on the PCs changed reputation or does AdjustReputation only work for creatures presently spawned?

#2
henesua

henesua
  • Members
  • 3 863 messages
Alrighty then. I guess I'll need to figure this out the hard way: in game tests.

#3
Lightfoot8

Lightfoot8
  • Members
  • 2 535 messages
I do not know if anybody knows the answers to the questions you are asking.  With the flaws in the adjust rep functions I do not even know if it is worth trying to figure out.  

You may want to take a look at  Script issue with adjust reputation to get an Idea of what you are facing.

#4
henesua

henesua
  • Members
  • 3 863 messages
Thanks lightfoot, I was trying to find that thread earlier today but didn't.

#5
Lightfoot8

Lightfoot8
  • Members
  • 2 535 messages

henesua wrote...

Thanks lightfoot, I was trying to find that thread earlier today but didn't.


The only reason I found it is that I still have it bookmarked.

#6
henesua

henesua
  • Members
  • 3 863 messages
Is reputation stored on the NPC who is affected by it? Meaning that if NPC A has a -10 Reputation with NPC B, is this information stored on NPC B?

I assume that the answer is yes.

So with this in mind I suspect that if you store this instance of NPC B in the database, that the reputation adjustment towards NPC A is also stored. BUT I bet NPC A is actually an object reference, and so when NPC B is recalled from the DB, if the server has been reset this could be problematic.

Anything wrong with my thinking so far?

So assuming all the above is true, I propose that the solution is to clear reputation on an NPC restored from the DB, if the server has been reset since the NPC was committed to the DB. However how do you do this? ClearPersonalReputation is focused on a specific target. Can you zero out all personal reputation by switching factions?

And if no one knows he answer to these questions, can you suggest a good way to test this? I have my own ideas, but am interested on other ideas as well.

#7
ffbj

ffbj
  • Members
  • 593 messages
I use Vendalus personal reputation and reaction, with some modifications.    Then I combine that with a notoriety system that simply keeps tracks of the exploits, of the PC: bounties, quests completed, etc...But that is seperate from factional issues though it can influnence faction with certain Npc's. But you know that system,PRR much better than I do, so the esoteric parts of the stuff you are doing, such making the PC an Npc faction, I have no clue about that.
I would guess that the reputation between individual npc's remains the same, even if the factions have changed, though change could effect and influence your overall reputation/personal history with that individual.

Modifié par ffbj, 07 novembre 2012 - 02:55 .


#8
henesua

henesua
  • Members
  • 3 863 messages
I use PRR too, but it isn't quite the same thing here. Its more of a parallel system as far as I understand it, and doesn't affect whether the creature is hostile or friendly. Can it affect actual personal reputation? If so I've completely missed that and am using it incorrectly.

Anyway, my issue here is that I am committing special NPCs to the database. That way they are not spawned from the palette, but retrieved from the DB. This has all kinds of benefits. BUT I am concerned that a PC retrieved from the DB will still hold the same grudges.

I have not tested it yet, but will need to so that I can avoid the pitfalls. Having a cleared reputation upon spawn is a nice reset given how messed up the faction system is in NWN. And if I can't do that with NPCs stored in a DB, then I have hit a major stumbling block.

Modifié par henesua, 07 novembre 2012 - 02:51 .


#9
ffbj

ffbj
  • Members
  • 593 messages
Ok I think I get it. You should be able to do that, by adding something to the npc's onspawn that clears all reputation, right but since no target exists in the onspawn. Hmm well you could write an executable or onperception that clears personal reputation with any perceived object but only once. Sort of clunky. Is it all reputations or just with PC's? I know what you are getting at now. You want the npc's to have a clean slate regarding reputation when they are spawned from the database.

#10
henesua

henesua
  • Members
  • 3 863 messages
Exactly. First I need to test it out. Then if there is a problem and I understand it I'll assess as to whether I can solve it.

#11
henesua

henesua
  • Members
  • 3 863 messages
[FYI: Found the Bioware documentation on Faction related things online.]

I just investigated a HAK on the vault that I had previously overlooked.
Neutral Faction Hak

The beauty of this HAK is that it defines a new faction in both repute.2da and Repute.fac. I had not previously considered editing these files (and I don't know if editing repute.2da does anything as editing it alone does not change the module). Why I like this is that it enables you to define new parent factions. New factions in Vanilla NWN derive from one of the standard 4: Hostile, Commoner, Defender, Merchant. But apparently this can be expanded. I think adding a few more parent factions will make things easier for builders.
  • One downside is that I'll likely have to remake all of my factions. If I'm going to do this the time is now, before I build up a database full of faction information only to have to dump it. Remaking my factions will be a ton of work, but I need to get on this and do factions right.
  • Another downside is that factions created by 2da appear to default to global settings. I'll have to carefully consider how I make use of this as I have heard of faction problems arising from behavior that appears to be global, even when a faction is not set to global. I suspect that a faction bug has the potential to creep up the chain to the parent faction. Is this true?
Another interesting 2da I've been tinkering with is repadjust.2da .   There are four types of occurences defined by that file which adjust reputation: Attack, Theft, Kill, and Help. The part that I am not so clear on are relations the various columns describe. For witnesses of the event, there are three different kinds of subcategories (A, B, and C)  for the categories Friend, Neutral, and Enemy. The link I provided at the top of the page explains what a b or c means, but some of the explanation appears redundant to me, so i think I am missing something.

In anycase, I've been tinkering with this. The thought is that perhaps it would be cool if attacking and stealing didn't lead to as a dramatic of a reputation change as killing does. I also think that giving small rep adjustments for helping others might be interesting. Its worth trying anyway.

#12
ffbj

ffbj
  • Members
  • 593 messages
I suspect that a faction bug has the potential to creep up the chain to the parent faction. Is this true?

I think this is the case. I believe your are talking about faction creep...i.e. whatever your current faction relationship with a particular parent faction when altered it will tend to creep back up/down to it's intial setting. Good find on all that info btw. I think the smaller adjustments for less virulent criminal activity are warranted. I mean saying I saw a guy creeping around is not the same as saying I saw a guy shove his sword upto the hilt in xyz's belly. I think Axe did a crime witness system, that was maybe solicited by another player. That might be of some interest.

#13
henesua

henesua
  • Members
  • 3 863 messages
Faction Creep. Thanks for the term. I hope creating new parent factions solves the bug.
That Crime witness System.. did you mean this (http://nwvault.ign.c....detail&id=3583)?
Its not by Axe so i suspect you have something else in mind. Please share the link if you manage to dig it up. I am interested.

#14
ffbj

ffbj
  • Members
  • 593 messages
Crime Witnessing by Mathew F:
http://nwvault.ign.c....Detail&id=3583
Yeah that was it. I think Axe was involved in the discussion that led up to that script.

On an amusing sidenote, using Vendalus's PRR I had situations where a group fled some monsters, there where three of us. We headed for an area controlled by the Red Feather.  A few starting raining arrows in our direction which surprised me, but one of our group did a quick turn and headed away from the archers.  He had previously turned in proof of kill amulets to an opposing tribal group, so he had bad faction with the Red Feather.
So it could, and did happen, that different party members had different reations from the various groups in the world.  So the effort you are making is well worth it, imo.  It makes for a much more dynamic and believable world faction system.

Modifié par ffbj, 12 novembre 2012 - 11:30 .


#15
DM_Vecna

DM_Vecna
  • Members
  • 280 messages
Glad to see there is still interest here. I am going to be digging back into this for my pw again. I will post some great notes I got from Axe Murderer regarding reputation when joining a party.

#16
henesua

henesua
  • Members
  • 3 863 messages
There is definitely interest. I await those notes on reputation with interest. This weekend I'll also be running my own tests on whether personal reputation is stored on a creature committed to the DB.

If it is, I'll need to find an efficient way to clear personal reputation. I also hope there is an efficient way to restore some aspects of personal reputation.

The whole thing is a big black box to me right now.

#17
meaglyn

meaglyn
  • Members
  • 807 messages
Looking at the neutral hak a bit I think there are some issues using it as a hak.
I'm not sure it's going to work very well. Putting Repute.fac in a hak effectively
clobbers all the factions you create in the toolset. Hak files override module files.

You could maybe add your new parent factions to the 2da. But repute is part of the module
that gets modifed when you update the factions. You may need to make a new starting
version of it with the new parents in it... I don't know if that all gets generated from the 2da
at new module creation time or not.

#18
henesua

henesua
  • Members
  • 3 863 messages
Meaglyn, I'm not sure how that works with other custom content. The take home message for me however was not to use the HAK but that you can hand edit the faction file and create parent factions.

Re repute.2da: I still haven't figured out if the 2da actually does anything. So far all my tests have come up negative.

So anyway I'm hand editing the faction file in a GFF editor and then dropping it into my module's temp folder, then saving. I did a test for this and it appears to be working fine.

Modifié par henesua, 16 novembre 2012 - 08:54 .


#19
henesua

henesua
  • Members
  • 3 863 messages
Hmmm.... this from Bioware's documentation. It looks like I should do some tests to see if creating new parent factions will cause any unforeseen problems.

This from the Facion System documentation:

FactionParentID       DWORD
  • Index into the Top Level Struct's  FactionList specifying the Faction from which this Faction was derived.
  • The first four standard factions (PC, Hostile,  Commoner, and Merchant) have no parents, and use 0xFFFFFFFF as their FactionParentID. No other Factions can use this value.


#20
henesua

henesua
  • Members
  • 3 863 messages
 Some good news. Reputation appears to be saved in the TURD rather than on the character which means that it is reset with server reset.


Table 4.4b: Fields in a Personal Reputation Struct (StructID 47787)
              Label       Type       Description
  • TURD_PR_Amount  INT  Reputation with the faction
  • TURD_PR_Day  DWORD  -
  • TURD_PR_Decays  BYTE  boolean
  • TURD_PR_Duration  INT  Measured in seconds
  • TURD_PR_ObjId  DWORD  ObjectID of creature that is considering the owner of this Personal Reputation element
  • TURD_PR_Time  DWORD  -

This means that I can store creatures in the database without being concerned about storing irrelevant reputation information because this data is not stored on the creature.

#21
Lightfoot8

Lightfoot8
  • Members
  • 2 535 messages

henesua wrote...

 Some good news. Reputation appears to be saved in the TURD rather than on the character which means that it is reset with server reset.


Table 4.4b: Fields in a Personal Reputation Struct (StructID 47787)
              Label       Type       Description

  • TURD_PR_Amount  INT  Reputation with the faction

  • TURD_PR_Day  DWORD  -

  • TURD_PR_Decays  BYTE  boolean

  • TURD_PR_Duration  INT  Measured in seconds

  • TURD_PR_ObjId  DWORD  ObjectID of creature that is considering the owner of this Personal Reputation element

  • TURD_PR_Time  DWORD  -

This means that I can store creatures in the database without being concerned about storing irrelevant reputation information because this data is not stored on the creature.


I am not 100% on the answer you have given here.   Are you sure that the TURD holds all Personal Reputation and not just the Personal Reputation in relation to PC's.     It is just a question.  I am not sure that the Personal Reputation of NPC1 towards NPC2 is stored in the TURD.

#22
henesua

henesua
  • Members
  • 3 863 messages
I'm not 100% certain about this, but I suspect that it is the case.

#23
Lightfoot8

Lightfoot8
  • Members
  • 2 535 messages
Well after looking at the functions, I do not see any that work on just two creatures except
ClearPersonalReputation
SetIsEnemy
SetIsTemporaryEnemy
SetIsTemporaryFriend
SetIsTemporaryNeutral


Did I miss any?

Modifié par Lightfoot8, 01 décembre 2012 - 04:33 .


#24
henesua

henesua
  • Members
  • 3 863 messages
That is all that I had found.

#25
DM_Vecna

DM_Vecna
  • Members
  • 280 messages
As I indicated I was able to finally dig up the notes that Axe Murderer Sent me. These are his learns not mine and I take no credit for the testing. :)


General Overview (very general):
=================================================
The basic idea behind factions is to organize NPCs into like-minded groups. Each faction is given a number, from 0-100, to relate it to each other faction, and one for PCs. The number is used to indicate how they react when they encounter a creature from one of the other factions, or a PC. It is a one-way measure of reputation between members of two factions. 0 indicates hostility, 100 indicates friendly, 50 indicates indifference. The borderline between hostility and indifference is about 10 and between indifference and friendship is about 90. Faction reactions are not two-way. In other words, you can have all the commoners hating all the merchants but all the merchant neutral or even friendly towards commoners. Members of the same faction are always friendly (100) to each other. If there is a hostile reaction, they will attack on sight. If they are neutral, they will ignore and will not help if they see an attack taking place.
If they are friendly, they will defend their friends when their friends are attacked by somebody they see as either neutral or hostile, but will do nothing if they see a friend from one faction attacking a friend from another faction. Attacking a friendly or neutral creature causes its faction members to switch to be hostile towards the attacker. I can't think of any action one can take to change a faction's reaction towards the friendly end of the scale. Faction changes are permanent by default, but they can be scripted to whatever you want when some game event happens.

The toolset has a faction editor (Tools Menu) that allows you to adjust how factions initially align with each other and with PCs. You should go in there to check out how they are set up by default. You can also use it to create new custom factions. PCs don't have a faction of their own, but they do have a reputation with every other faction. PCs in the same party abide by the repuation that the party's leader has with all the NPC factions. PCs have both a personal reputation with each faction member as well as a faction reputation with the entire faction. They are related but different so it is possible for every member of a faction to like a PC except one guy and vice-versa. However a difference like that usually won't last very long because an action like attacking that changes faction-wide reputation will affect personal reputation of each member as well.

Factions have a global setting you can turn ON and OFF (in the Faction Editor). When it is OFF, actions that change a faction's repuatation with another faction will only affect the faction members in the area where the action takes place. When ON, all faction members module-wide are affected.

Faction reactions to repuation changes take effect immediately but they are tied to perception. For a creature to realize that his faction's reputation with another creature from a different faction has changed, the creatures must re-perceive each other. So if Bob and Bill are from different factions and are friendly to each other and Bob walks into Bill's perception range, they will perceive each other. Now if their faction repuatations change to hostile, they won't react until they split apart, lose perception of each other, and then move back towards each other and get re-perceived again. However you can use a script to make them go hostile immediately when the reputation changes (i.e. force them to immediately attack each other).

Secondary to factions are individual reputations. They control reaction between individuals independent of faction, sort of. Normally they are the same as their faction dictates. That's the initial condition. But game actions can cause them to change. For example, if you script two members of the same faction to fight each other, each will gain a hostile personal reputation with each other. This will cause the engine to treat them as enemies, which will in turn keep the combat between them continuing. Faction reputation changes typically will reset personal reputations back to their initial states with members of the other faction. So, say you have 2 factions neutral to each other in both directions. A member of one faction attacks a member of the other. The faction reputation shifts for both factions to hostility due to the action. Now all members of both factions are hostile towards each other, faction wise. Now I beleive all their particular personal reputation differences, that were in place before the attack commenced, are discarded...but I'm not positive about that. There's also some wierdness with hostility I was never able to put my finger on. It manifests in a general tendency for all creatures to want to become hostile. It is usually easier to get two creatures fighting than it is to get them to stop. I found personal reputation the most effective way to do it most every time. Clear actions and clear personal rep and they'll very likely stop. Though a re-perception of each other in the future, when faction reputation is potentially hostile, could start them going again. So clearing the faction rep as well, when appropriate, will ensure the peace endures.

As you can see there are numerous ways the personal rep is tied into the faction rep, and changes to it. So personal rep is not entirely independent of faction rep. And faction rep seems to have the priority in general situations, while personal rep does in more specific situations. Thus any "general" faction rep changing event that occurs, which by the way includes all actions taken in "specific" engagements, will typically have precendence and drive the reactions actually seen in the game. This is why the global faction flag can be important.

One of the biggest problems with the faction system for modules that are not campaign style, like most online servers out there are, is that all PCs are treated as belonging to one giant faction. They cannot be easily separated out into like-minded groups. The faction and reputation system is completely useless for PC vs PC, since all PCs are human controlled. PCs actually have no faction at all. You cannot make a PC become a member of the commoner faction like you can do with a member of the hostile or merchant faction. So, although the game may track both faction and personal reputation for a PC, it can never control the reactions taken. The engine won't make all PCs start attacking the merchants when the merchant faction becomes hostile to a PC. But the change will certainly make all merchants hostile to all PCs. What you end up with is relative ease getting NPCs to react according to their reputations with PCs as a group, but great difficulty in getting PCs to react, and perceive, NPCs accoring to any reputation with any group. So you have to script what you need, usually tidbits at a time scattered all over the place.

I concluded finally that faction and personal reps are only useful for getting NPCs to behave a particular way, in response to PC actions. Or for automatic reactions between NPCs, e.g. hunter faction hunts deer faction, to create natural ambiance in the world and consistently across the world. It is a system best suited for single player or single party campaign style modules. So a PC or Party's action can affect the direction of the story, by controlling which group or groups of NPCs become friendlies or hostiles. Having many many factions is better than big groups covering large portions of the world...exception possibly merchants and/or defenders, and of course hostiles. I prefer to call the Hostile faction the Mindless Hostile faction. Because that's what you get out of using it. Great for creatures with no intelligence, act on instinct, always hostile behavior. Most every discerning NPC players encounter should probably be a member of some custom faction. And the scope of each faction ought to be considered thoroughly and planned out well. Especially for a story driven module, or a region driven module.

What would have been best is if party's had their own faction somehow. Bioware appears to have conceived this, because when you join a party, whether you are PC on NPC, your faction and personal reps all get reset to whatever the party leader has. But that is the extent to which they took it. There is nothing done when you leave the party. Haven't looked at NWNX is a long long time, but if there is a way to hook events to create an OnPCJoinParty and OnPCLeaveParty, then you could add in the custom code necessary to handle PC vs NPC as well as PC vs PC, Party vs NPC, Party vs Party, etc. type reactions and reputations. For PCs all you get is the Like/Dislike setting to record it.

A last consideration with all this stuff are racial and class biases...since there are a few. Not being much of a racist, I never got into that end much whatsoever. When I needed it I simply used a custom faction and some code in the perception and combat events to recognize according to race or class in coordination with faction...basically by using personal reputation and scripting reactions. Or I'd simply fool the engine by using a different race, only works for race not class, and modifying the appearance and faction preferences to get what I wanted. Player still sees everything the same, but scripting and control over race reaction is maintained easier. So you gotta consider there are some automatic reactions which take place due to race and class. They can be difficult to control, both trying to induce them as well as trying to prevent them. Sometimes they simply get in the way frankly. You can get wonderful faction behavior all working, then populate your faction with the wrong race or class of creatures, or locate them physically in the world near the wrong class or race community, and screw everything to hell. All of a sudden you lose control of the whole faction's behavior, often both factions. You can get a huge cascading effect of control loss faction after faction down some chain of relationships. This is one of the reasons why you really need to plan out your factions ahead of time. Make the faction definition fitting to its members natural tendencies as well as the story, and their relative locations in the world.
You'll have to figure out the race and class bias yourself. I never even tried. I simply dealt with it when I saw it come up, and tried to plan around it ahead of time.