Results 1 to 11 of 11

Thread: Editing Vices & Virtues

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Squirrel Watcher Member Sinner's Avatar
    Join Date
    Aug 2004
    Posts
    390

    Default Editing Vices & Virtues

    Perhaps a little late considering that RTW will (hopefully) be here soon, but I finally got curious about the common problem of favored generals and royalty suddenly becoming inbred and perverts, a cruel outcome for a carefully groomed general.

    So with a little bit of mental judo, a hex editor & too much time on my hands I've discovered how to edit V & Vs. So far my method is a bit of a kludge, having to manually search for the hex values of the general's/royalty's V & Vs, then making a change to see that I've found the correct guy.

    The hex values for each V & V are fairly easy to work out, starting with Great Warrior with a value of 0100h, Natural Leader is 0400h, Killer Instinct is 0800h, etc. I did it the hard & boring way, editing a single unit again & again until I had the full list, although I believe it follows the same order as the list of V & V descriptions in events.txt.

    The first V & V for each general/royalty will generally start at hex address nnn2h, where nnn is the rest of the address, eg. 442h or 1A6D2h. There is a quirk where a prince will instead have his V & Vs start at nnn4h - in these cases I suspect that the value that is at nnn2h is linked to tracking the prince's place in the royal family tree, ie. so the system knows when to make the prince a normal general after a nephew becomes king, dropping the prince from the royal line. There is then space for about a dozen V & Vs, but only the first 10 will be displayed when you view the general, although the others will still have an effect. As an example, if you wanted to go way over the top & have a Legendary Leader/Specialist Attacker/Field Defense Specialist/Specialist Sieger/Unbribable Jedi Master, you'd overwrite the current values with 0700 3600 3900 3C00 8400 starting at address nnn2h.

    There is another quirk that I haven't worked out yet where the values 0010h, 0020h or 0030h are added to the hex value of a V & V but it still works correctly, eg. Brave Beyond Belief is normally 2101h, but can occasionally be 2111h, 2121h, etc. I haven't fully investigated, but I would speculate this tracks something like marriage status or maybe the increased/decreased likelyhood of the V & V progressing up the chain, ie. Natural Leader to Legendary Leader - I'm just guessing really, trying to think of possible reasons.

    Another oddity is that in the space to add V & Vs, instead of the usual null value of 0000h, you'll occasionally see 0004h. I'm not 100% sure about these values, but I'm beginning to suspect that they're markers for the system to add 'random' vices to that general as some form of 'game balance' when certain triggers are reached in the campaign - of course it could just be that I'm suspicious & paranoid.

    As far as I can tell editing V & Vs has immediate effects on most, maybe all, traits except for the definite exception of valour, which is tracked independantly for each warrior in the unit. Command, Piety, Accumen, etc definitely change, but I haven't investigated Happiness, trade income, etc.

    I also found how to edit valour & unit type, but it's now lunchtime so that explanation will have to wait... besides that, my boss does expect me to do some work today, which is most inconsiderate of him!

  2. #2
    Squirrel Watcher Member Sinner's Avatar
    Join Date
    Aug 2004
    Posts
    390

    Default Re: Editing Vices & Virtues

    Ooops, my bad, I forgot one potentially important bit of information: the file I'm editing. It's maybe obvious, but the file to edit is your campaign savefile.

    Oh well, at least I get to say sorry like a proper noob. Should I LOL now????/

  3. #3

    Default Re: Editing Vices & Virtues

    *reading thread*


    moderators, can't you promote this guy so he can post in the dungeon??? I think he deserves it.

    edit: oh, and welcome to the org.

  4. #4
    Squirrel Watcher Member Sinner's Avatar
    Join Date
    Aug 2004
    Posts
    390

    Default Re: Editing Vices & Virtues

    Thanks for the welcome cutepuppy

    OK, just worked out how to edit Loyalty/Influence, Piety, Dread, Command & Accumen, although again it's a real pain to describe, but I'll try my best...

    It might be easier if I use a simple example, so here I have a Joms Viking unit with 2 men (created like this as a starting unit in my test campaign's startpos file) at Valour 9 (including Command effects), with the leader having a Loyalty of 3, Piety of 8, Dread of 4, Command of 7 and Acumen of 5 plus the V & Vs of Skilled Risky Attacker (4600h).

    Opening up my campaign savefile & searching for the hex value of 4600 - it tends to be easier the more V & Vs you search for or if looking for odd ones like Secret Incest - I find my general & his single subordinate, highlighting the virtue here in bold...

    (Address in hex: Data in hex)

    C00: FFFF 0700 FE60 0000 00B6 0258 31D3 01B8
    C10: B36E 0300 0000 0001 0000 0000 0000 FFFF
    C20: FFFF 5E00 0000 0000 0000 FFFF FFFF 0000
    C30: 0903 0100 1101 0000 E700 0000 002A 5F00
    C40: 0000 5E00 0000 0000 0000 6100 0000 8000
    C50: 0603 0300 5408 0000 E700 0140 002A FFFF
    C60: FFFF 4600 0004 0000 0000 0000 0000 0000

    OK, here we go...

    I want my general to be more loyal, so I want to up his Loyalty from 3 to 6. The loyalty is held at the address 10h less than the start of the general's V & Vs, in this case here...

    C50: 0603 0300 5408 0000 E700 0140 002A FFFF

    To give him the required loyalty I change the 3 to a 6...

    C50: 0603 0600 5408 0000 E700 0140 002A FFFF

    I also want my general to be a more imposing, less pious thug, although I'm happy with his smarts. Acumen, Dread & Piety are held as a composite value with the format of AD0Ph where A, D & P are the appropriate traits, so for my general with Piety of 8, Dread of 4 and Acumen of 5 the value is 5408h...

    C50: 0603 0600 5408 0000 E700 0140 002A FFFF

    I think I prefer a Piety of 3 & a Dread of 7, so my edited file now reads...

    C50: 0603 0600 5703 0000 E700 0140 002A FFFF

    Next, I want to give him Command 8, so that I have the maximum bonus but still have something to aim for during play. Command is held as the number of victorious battles, with 32 wins (hex 20h) for Command 6, 64 wins (hex 40h) for Command 7, etc. My general has won 64 battles so far & I need to change that to 128 (hex 80h).

    C50: 0603 0600 5703 0000 E700 0140 002A FFFF becomes...

    C50: 0603 0600 5703 0000 E700 0180 002A FFFF

    OK, now on to Valour, which is similar to Command, but tracks kills instead of victories - so Valour 4 requires 8 kills (hex 8h). Valour is normally a real pain since every warrior has it tracked seperately, but since I only have a 2-man unit in my example it's not difficult to demonstrate...

    C00: FFFF 0700 FE60 0000 00B6 0258 31D3 01B8
    C10: B36E 0300 0000 0001 0000 0000 0000 FFFF
    C20: FFFF 5E00 0000 0000 0000 FFFF FFFF 0000
    C30: 0903 0100 1101 0000 E700 0000 002A 5F00
    C40: 0000 5E00 0000 0000 0000 6100 0000 8000
    C50: 0603 0600 5703 0000 E700 0180 002A FFFF
    C60: FFFF 4600 0004 0000 0000 0000 0000 0000

    In this case the subordinate has 0 kills & the general has 128 kills, giving an average of 64 kills or Valour 7. Adding in the Command bonus Valour this gives the unit a Valour of 10, although it only displays as 9 on the campaign map. Feeling moderately evil, I decide that I want both a Jedi general and his Padawan, so I'll edit them to Valour 16 & 10 respectively (32768 & 512 kills), giving an average unit Valour of 15 before Command effects.

    C00: FFFF 0700 FE60 0000 00B6 0258 31D3 01B8
    C10: B36E 0300 0000 0001 0000 0000 0000 FFFF
    C20: FFFF 5E00 0000 0000 0000 FFFF FFFF 0002
    C30: 0903 0100 1101 0000 E700 0000 002A 5F00
    C40: 0000 5E00 0000 0000 0000 6100 0000 0080
    C50: 0603 0600 5703 0000 E700 0180 002A FFFF
    C60: FFFF 4600 0004 0000 0000 0000 0000 0000

    Next on to V & Vs, where this all started...

    I don't want the Skilled Risky Attacker so that can go, being replaced with Legendary Leader (which will raise his loyalty from 6 to 9), Expert Sieger, Unbribable & Charismatic Leader, or 0700h, 3C00h, 8400h & 2101h respectively (Note: In my first post I said the value for Brave Beyond Belief was 2101h, but I'd mis-remembered, it's actually 2A01h)

    I need to edit this...

    C60: FFFF 4600 0004 0000 0000 0000 0000 0000

    to this...

    C60: FFFF 0700 3C00 8400 2101 0000 0000 0000

    Note that I overwrote both the Skilled Risky Attacker and that odd value of 0004h that I mentioned in my first post. There doesn't seem to be any effect in doing this & since I'm paranoid I want it gone.

    Finally ("At last!" you gasp) I'm going to change the unit from Joms Vikings to Viking Huscarles. The value can easily be found from the unit production file for the campaign, being the row number: Joms Vikings are on the 182nd row (hex B6h) & Viking Huscarles are the 177th row (hex B1h).

    Before change...

    C00: FFFF 0700 FE60 0000 00B6 0258 31D3 01B8

    After change...

    C00: FFFF 0700 FE60 0000 00B1 0258 31D3 01B8

    So my final data looks like this, with all changes highlighted...

    C00: FFFF 0700 FE60 0000 00B1 0258 31D3 01B8
    C10: B36E 0300 0000 0001 0000 0000 0000 FFFF
    C20: FFFF 5E00 0000 0000 0000 FFFF FFFF 0002
    C30: 0903 0100 1101 0000 E700 0000 002A 5F00
    C40: 0000 5E00 0000 0000 0000 6100 0000 0080
    C50: 0603 0600 5703 0000 E700 0180 002A FFFF
    C60: FFFF 0700 3C00 8400 2101 0000 0000 0000

    The end result giving me a unit of 2 Viking Huscarles with a battlefield Valour of 19 (displays 9 on the campaign map), led by a general with Loyalty 9, Piety 3, Dread 7, Command 8 & Acumen 5 including all V & V effects, with the virtues of Legendary Leader, Expert Sieger, Unbribable & Charismatic Leader - he also knits socks in his spare time.

    A King's stats work in a slightly similar way, but their details aren't held with bodyguard unit, just to make life more exciting. The lines of data with the king's Influence, Piety, Valour, etc are also seperate from his V & Vs. For example the Viking king's stats are held as follows in my test campaign:

    120h: 0000 2100 0000 0000 0000 2000 0000 0400 (Valour 3)
    130h: F702 0400 3102 0000 E700 0301 002A FFFF (
    Influence 4, Acumen 3, Dread 1, Piety 2, Command 1)

    440h: FFFF 9900 0000 0000 0000 0000 0000 0000 (Magnificent Steward)

    You can come out from behind the couch now, I've finished. ~:p

  5. #5
    Squirrel Watcher Member Sinner's Avatar
    Join Date
    Aug 2004
    Posts
    390

    Default Re: Editing Vices & Virtues

    A last addition for the day: Attack, Armour & Morale bonuses from buildings...

    Using my previous example again, I've highlighted the appropriate field:

    C00: FFFF 0700 FE60 0000 00B1 0258 31D3 01B8
    C10: B36E 0300 0000 0001 0000 0000 0000 FFFF
    C20: FFFF 5E00 0000 0000 0000 FFFF FFFF 0002
    C30: 0903 0100 1101 0000 E700 0000 002A 5F00
    C40: 0000 5E00 0000 0000 0000 6100 0000 0080
    C50: 0603 0600 5703 0000 E700 0180 002A FFFF
    C60: FFFF 0700 3C00 8400 2101 0000 0000 0000

    The Armour values run from 01h to 04h for a +1 to +4 bonus.
    The Attack values are 08h, 10h, 18h & 24h for a +1 to +4 bonus.
    The Morale values are 40h, 80h & C0h for a +1 to +3 bonus.

    To work out the value for a particular combination of bonuses, simply add them together, so +3 Armour, +1 Attack & +2 Morale would be 03h + 08h + 80h giving 8Bh...

    C00: FFFF 078B FE60 0000 00B1 0258 31D3 01B8
    C10: B36E 0300 0000 0001 0000 0000 0000 FFFF
    C20: FFFF 5E00 0000 0000 0000 FFFF FFFF 0002
    C30: 0903 0100 1101 0000 E700 0000 002A 5F00
    C40: 0000 5E00 0000 0000 0000 6100 0000 0080
    C50: 0603 0600 5703 0000 E700 0180 002A FFFF
    C60: FFFF 0700 3C00 8400 2101 0000 0000 0000

  6. #6

    Default Re: Editing Vices & Virtues

    That really is rather impressive. Great job, it must have taken an age of trial and error to work out which values where what! (Unless there's a more cunning tactic?)

    Very nice work. Now anyone wishing to create the ultimate unit in SP can frolic in hex to their heart's content.

    Perhaps we can put this somewhere as a guide/sticky, dear moderators?

  7. #7
    Squirrel Watcher Member Sinner's Avatar
    Join Date
    Aug 2004
    Posts
    390

    Default Re: Editing Vices & Virtues

    Quote Originally Posted by Sinner
    The Attack values are 08h, 10h, 18h & 24h for a +1 to +4 bonus.
    Oops, my bad, spotted a mistake... that should be 08h, 10h, 18h & 20h for +1 to +4 attack respectively.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Single Sign On provided by vBSSO