Ideas for faction relations

More
18 years 1 month ago #14924 by GrandpaTrout
I should disclaimer a little bit. I cannot promise to code any of this yet. And it is hard to say what will or will not make the Unstable Space release, cause we are short on time and long on features.

That said, here is an idea - related to differing responses within a faction. This time not by ship class, but by Fleet Operation within a faction. Essentially, each Fleet Operation stores its own relationship to the player. So if you fight it out with a group of raiders, they remember you. And perhaps if you fight it out with a group of police, they just keep trying to track you down, long after their owning faction does not care.

This might be a way to implement Shane's idea for fast hostility in small groups, and slow hostility in large groups. Essentially, individual fleets of ships have the fast memory. But the faction as a whole moves slower.

A player could essentially form relationships with specific fleet operations. Some of them might want to hurt the player, and just keep showing up until the player finally finishes them off. And some (possibly rescued ones) could get a high standing with the player and be willing to answer distress calls the parent faction would never answer.

It might be possible to do something similar with stations. If you attack a station, they remember you. And when you try to purchase stuff, they take the lower of your two faction standings. This would give us a method of representing "Independents". Essentially those stations that are on thier own with no real faction wide organization.

Remembering the faction relation with the player is easy. Thinking up how that relation impacts the game, or gets modified by player behavior is harder.

Please Log in or Create an account to join the conversation.

More
18 years 1 month ago #14927 by mdvalley
How does this sound for an implementation of Shane’s idea?

Imagine a faction with four fleets: A, B, C, and D. The player makes fleet A hostile and runs away. As time passes, fleet A tells the other fleets about the player, handing out virtual “hostility points�. Fleets B through D gain hostility to the player. At the same time, the low hostility of those fleets push fleet A’s hostility down, until the fleets are each 1/4th hostile, at which point (assuming the player lays low) regression towards the mean takes over and the faction forgets entirely.

Contrast this with a major faction, with fleets A through Y. When fleet A gets hostile, its “hostility points� get spread much thinner, and the other fleets barely notice. At the same time, the overwhelming pressure of all those other fleets makes fleet A lose hostility fast.

An analogy would be like cups of water with little pipes between them. The more cups there are, the faster one drains and the less the others fill. Every fleet remembers its “water level� of hostility and passes the juice around. But if you keep filling a cup, they will all fill eventually and you will have a lot of water to deal with. But the cups have these little holes in the bottom, so it will drain someday.

The rate that word spreads about you (and the rate that the hostility drains) can vary from faction to faction.

I suppose this could work with making friends as well. You could help a particular fleet by doing little missions for them (from recon to fighting) and the faction standing could drift up in this way.

Please Log in or Create an account to join the conversation.

More
18 years 1 month ago #14928 by Shane
Replied by Shane on topic Ideas for faction relations

Originally posted by GrandpaTrout
Essentially, each Fleet Operation stores its own relationship to the player. So if you fight it out with a group of raiders, they remember you. And perhaps if you fight it out with a group of police, they just keep trying to track you down, long after their owning faction does not care.

This might be a way to implement Shane's idea for fast hostility in small groups, and slow hostility in large groups. Essentially, individual fleets of ships have the fast memory. But the faction as a whole moves slower.

That's very near to what I consider the Holy Grail of current-ability space sim AI. Factions composed of smaller groups with similar (but not exact) feelings and memory. Nice. [8D]

Edit: (MdValley posted while I typed.) MD, that idea would be amazing! Is it possible? I've got to dig into the Fleet Operations code when I get a chance. Sounds like powerful stuff.

Please Log in or Create an account to join the conversation.

More
18 years 1 month ago #14931 by mdvalley
Well sure. Every fleet has a variable containing its hostility. On every tick (say, a day), we do something like this:

Define temporary variable (obj property) “oldhostscore� (set to hostility factor) on all fleets.

Define scoreadj as 25% of oldhostscore. (We can tweak that 25%).
Reduce fleet’s hostility by scoreadj.
Divide scoreadj by (number of fleets in the faction - 1).
Add score to every other fleet in the faction.
Repeat for all fleets.

Remove “oldhostscore� property. Apply regression towards the mean on all fleets.

I made a quick simulation of this in Excel. I noticed that the hostile fleet in the beginning loses hostility at the same rate, regardless of how many other fleets there are. But in a small faction, the rate of decrease slows considerably after a week or so, and the score stabilizes pretty fast.

In a large faction, the hostility just drops and drops, bottoming out very low.

Here are the numbers. Fleet A is in a small faction (4 fleets), Fleet B is in a big one (14 fleets). Next to them are the hostilities of the other fleets in the faction.
Code:
Day A Small Fac B Big Fac 0 1.000 0.000 1.000 0.000 1 0.750 0.083 0.750 0.019 2 0.583 0.139 0.567 0.033 3 0.472 0.176 0.434 0.044 4 0.398 0.201 0.336 0.051 5 0.349 0.217 0.265 0.057 6 0.316 0.228 0.213 0.061 7 0.294 0.235 0.175 0.063 8 0.279 0.240 0.147 0.066 9 0.270 0.243 0.127 0.067 10 0.263 0.246 0.112 0.068 11 0.259 0.247 0.101 0.069 12 0.256 0.248 0.093 0.070 13 0.254 0.249 0.087 0.070 14 0.253 0.249 0.083 0.071
Look good?

Please Log in or Create an account to join the conversation.

More
18 years 1 month ago #14934 by GrandpaTrout
There is a self preserve function that gets called when a ship is at 50% hit points (the percent is settable). And there is the death script function that gets called when a ship is killed.

When these functions are activated, we can check if the player (or a wingman) is the last attacker. If they are, we can add some Player Damage Points to a new "player_damage" property attached to the owning faction. The points can start out simple, and get as complex as needed. Say starting with 1 point for a self perserve call, and 10 points if the death script is called. (and maybe 100 points for nuking a station).

Then at the end of the day, the points are tallied and the players reputation is dropped. This part should be doable by modding the current PS traffic scripts and replacing the death scripts and the self preserve function. I believe Binishi did something similar in Unleashed.

If we rewrite the traffic, we can take this one step further and we can reward the player for helping out. Because we control the traffic, we know when the ships are doing harm to someone (we know when a ship belongs to a group of pirates making a raid on a cargo ship). We attach a property to the pirate ship Object.HandleProperty(ship, "intends_to_harm", target_faction);

Ok, now if the player blows up a ship with this intends_to_harm property, we credit the player with some points in target_faction. Because we know who the pirate was really trying to hurt, we can give the player credit with the right faction.

The reason this is all a code nightmare now, is that the functions that track who is shooting at who are unreliable. And it is impossible to sort the stray accidental shots from the intended ones. Which quickly makes a mess of the reputation system (as those of you who found a faction hostile for "no reason" can attest.)

Please Log in or Create an account to join the conversation.

More
18 years 1 month ago #14935 by Shane
Replied by Shane on topic Ideas for faction relations

And it is impossible to sort the stray accidental shots from the intended ones. Which quickly makes a mess of the reputation system (as those of you who found a faction hostile for "no reason" can attest.)

True, but friendly-fire doesn't (or at least shouldn't) happen that often. And the new wiggle room will absorb some of what does occur so that an entire faction doesn't become hostile with a single stray bolt.

If it does occur on a regular basis then the factions are right to take action against this loose cannon.

The reason this is all a code nightmare now, is that the functions that track who is shooting at who are unreliable.

Agreed... this inability to assign ownership to a bolt, missile, or beam is the principal roadblock to realistic AI response. And only magnified by the failure of the collision detection system to fully understand what hit what.

We need sectional ships! :D (joking... wouldn't relish taking on that job and not sure it's even possible with Flux.)

Please Log in or Create an account to join the conversation.