Tool to edit faction relationships in saved games

A forum for the discussion and development of programs to assist working on or playing with the Vegastrike engine and data sets.
Post Reply
pht
Trader
Trader
Posts: 17
Joined: Sat May 17, 2008 8:13 am

Tool to edit faction relationships in saved games

Post by pht »

This little hack allows you to edit your messed up relations with other factions (or generally any to any faction). The basic modus operandi is:

Code: Select all

vega-relations.pl [-s num|-d] [-f fac] [-u] savegame
Basically it displays a faction's relationship (default: privateer) towards all others (symetrically) or sets it to a given value (-s) or to defaults (-d). These defaults are hard coded for now and only for the privateer faction - i.e. no factions.xml parsing. The -u option restores a "1" on diagonal i.e. the relationship of each faction towards itself (seems to help sometimes). Original savegame file is backed up as "savegame~".

Usually if you're attacked the moment you leave dock in an otherwise friendly sector, -d -u should fix it.

I guess this script could be useful for developers too.

Feel free to improve and share at will. And remember to back up your savegames before messing with them.
You do not have the required permissions to view the files attached to this post.
loki1950
The Shepherd
Posts: 5841
Joined: Fri May 13, 2005 8:37 pm
Location: Ottawa
Contact:

Post by loki1950 »

Welcome pht hope the save game format doesn't change to much also is it useful to windows types as i see it's written in Perl which most windows users have no clue about :wink:

Enjoy the Choice :)
my box::HP Envy i5-6400 @2Q70GHzx4 8 Gb ram/1 Tb(Win10 64)/3 Tb Mint 19.2/GTX745 4Gb acer S243HL K222HQL
Q8200/Asus P5QDLX/8 Gb ram/WD 2Tb 2-500 G HD/GF GT640 2Gb Mint 17.3 64 bit Win 10 32 bit acer and Lenovo ideapad 320-15ARB Win 10/Mint 19.2
bgaskey
Elite Venturer
Elite Venturer
Posts: 718
Joined: Wed Mar 07, 2007 9:05 pm
Location: Rimward of Eden

Post by bgaskey »

Thanks. People have had to restart because they messed up faction relations and had the confed navy chasing after them. :wink:
pht
Trader
Trader
Posts: 17
Joined: Sat May 17, 2008 8:13 am

Post by pht »

loki1950 wrote:Welcome pht hope the save game format doesn't change to much also is it useful to windows types as i see it's written in Perl which most windows users have no clue about :wink:
As I said, it's a hack ... and you can hack it more.

In Windows, you can install activeperl (google it) and run the script from cmd.exe with

Code: Select all

perl vega-relations.pl params
pht
Trader
Trader
Posts: 17
Joined: Sat May 17, 2008 8:13 am

Post by pht »

Seems a typo got into the program, rendering the -d mode useless.

As for the savegame versions - this program works for 0.5.0 savegames and probably will be updated on request.
You do not have the required permissions to view the files attached to this post.
ace123
Lead Network Developer
Lead Network Developer
Posts: 2560
Joined: Sun Jan 12, 2003 9:13 am
Location: Palo Alto CA
Contact:

Post by ace123 »

You'll still need this for 0.5.0 but I'm working on fixing up the way in which faction relationships work in the code...

It will store a delta from the original relations in your savegame file--and that delta applies only to your relation with another faction, not between factions... also it will remove that ugly-looking and easily corrupted table at the end of the savegame file.
pht
Trader
Trader
Posts: 17
Joined: Sat May 17, 2008 8:13 am

Post by pht »

ace123 wrote: It will store a delta from the original relations in your savegame file--and that delta applies only to your relation with another faction, not between factions... also it will remove that ugly-looking and easily corrupted table at the end of the savegame file.
That would imply that either other factions will have constant relations to each other or that the changes would be lost on reload ...
ace123
Lead Network Developer
Lead Network Developer
Posts: 2560
Joined: Sun Jan 12, 2003 9:13 am
Location: Palo Alto CA
Contact:

Post by ace123 »

That's true--I'm still thinking about the specifics.

I think there are only a few cases where global relationships will change--that is, inside of campaigns and major news events.

So maybe it needs a global delta in the savegame for each pair of factions.
pht
Trader
Trader
Posts: 17
Joined: Sat May 17, 2008 8:13 am

Post by pht »

Hmm, I was giving it some thought and here goes:

Maybe the relations could change on more than a few ocassions - adding more dynamics to the play. I agree that the matrix representation is crappy and can easily become unbalanced. I am thinking of an alternative way to represent the relations:

1. for each faction, store a vector of 'attitudes' towards different problems
2. compute relations dynamically as a dot product (or similar function) of their 'attitude' vectors

If, for example, we have the 'additude' vector consisting of only one element - the great war, we could give the areans an attitude of -1 and the confed +1, making them -1 . +1 = -1 enemies. On the other hand, if we give a negative attitude to any other faction, we make them allies with areans and enemies of the confed, and vice versa. Factions with an attitude of 0 would instantly become neutral towards all other factions.

We can extend this vector with attitudes towards piracy, politics, etc. We could even give rise to multiple local-scale wars between a small number of factions that would be ignored by the rest of the galaxy.

The current matrix system can probably support all that, but my guess is that it has to be maintained more or less manually. By using something like the proposed idea, the relations can be automatically computed on the fly given various (perhaps even dynamic) galactic problems, similarly to how it works in the real world.

Also this system would give rise to something that was discussed in other threads - if I attack a vessel due to mission, it might shift my military alignment but not political, if I kill someone who tries to steal my cargo, it might not necessarily kill my relations with that faction, etc.

Last and not least, it would be possible to display the ongoing galactic problems and the aligment of different factions to the player, which would instantly give him the clues of who, why and what.
Post Reply