Posted June 22, 2010
I positively hate the way characters are generated in RoA1, so I decided to try to hex edit my characters. While investigating I also figured out some mechanisms which were not entirely clear to me before. Much of this probably already has been documented by others, but I wasted a lot of time on this (I never actually looked at hex editing before this, I got the idea because it was mentioned here somewhere as a fix for the baby faces bug in RoA2) so I thought I'd share the result :)
First of all, always wondered how the base AT/PA value is calculated? The manual says it depends on CR/AG/ST for AT and IN/AG/ST for PA. Well, RoA1 uses only one value for AT/PA, and it's based on IN/AG/ST. CR doesn't do a thing here. The formula is:
((IN-1)+(AG-1)+(ST-1))/5+1.
Magic resistance has a similar mechanism. The formula is (((CR-1)+(WD-1))/3+1)-(2*SN)+class modifier (+3 for elves,+0 for hunters and warriors, -2 for thorwelians, +2 for the rest).
I wanted to figure this out because I wanted to create most of my characters by giving them an interesting/balanced attribute spread by hex editing the .CHR files instead of hours of generating random values (now I spent hours staring at hex values :p), but base attack values and MR aren't calculated dynamically, so changing the attribute values would not change these. Other values you'll have to change manually are the AT/PA values and the God Bonus.
List of God Bonuses:
Praios: +1CR
Rondra: +1 Swords (and AT or PA Swords)
Efferd: +1 Swim
Travia: +1 Treat Poison
Boron: +1 Human Nature
Hesinde: +1 Alchemy
Firun: +1 Missile, Track
Tsa: +1 CH
Phex: +1 Stealth, Pickpocket
Peraine: +1 Treat Disease, Treat Wounds
Ingerimm: +1 Tactics
Rahja: +1 Dance, Seduce, Instrument
I chose to edit the .CHR files because my goal was to remove the annoyance of character creation (as such, I have not included equipment/inventory, which is not used in the .CHR files, but I assume a lot of the empty space in the .CHR file will function as the inventory in the save file). If you want to edit characters in-game, you'll have to edit the save file instead, which includes the information from the .CHR files. I think the .CHR files are only used to add characters to a new game (or perhaps when a character is added to a game for the first time). The absolute addresses won't be correct anymore in the save file, obviously, but the relative addresses should still be valid. I think.
What follows is an exact specification of every value in the .CHR file when viewed in hex. There are only two values I'm not entirely sure about. An interesting fact is that the portrait is in here as well, at the end. So if you want to make a female druid but hate their portraits, just copy the portrait part out of, say, an elf, and replace the portrait section in your druid's .CHR.
Another Fun fact: the game shows height in foot/inch (like 6'7"), but it stores the height in cm! This caused me some trouble :D
Negative values, when appropriate, are given by Fx (the value is -16+x) or Ex (-32+x). For example, FE=-2 and ED=-19.
Large values (Money, weight, XP) are distributed over several values. The get the decimal value, convert the hexvalue formed by concatenating the entries in reverse order to decimal. For example, 10 09 forms 0910, which is 2320 in decimal.
For easy conversion between hex and decimal use the windows calculator (at least, the 7 calculator does it).
00000000:NAME
00000010:NAME
00000020:
1:TYPE(00:null, 01:Jester, 02:Hunter, 03:Warrior, 04:Rogue, 05:Thorwalian, 06:Dwarves, 07:Warlock, 08:Druid, 09:Magician, 0A:Green Elf, 0B:Ice Elf, 0C:Sylvan Elf)
2:GENDER(00:male,01:female)
3:HEIGHT (in cm!)
4-5:WEIGHT
6:GOD(01:Praios, 02:Rondra, 03:Efferd, 04:Travia, 05:Boron, 06:Hesinde, 07:Firun, 08:Tsa, 09:Phex, 0a:Peraine, 0b:Ingerimm, 0c:Rahja, 0d:Swafnir, 0e:Ifirn)
7:LEVEL
8-b:XP
c-d:MONEY
//POSITIVE ATTRIBUTES (current-base)
00000030:
4-5:CR
7-8:WD
a-b:CH
d-e:DX
00000040:
0-1:AG
3-4:IN
6-7:ST
//NEGATIVE ATTRIBUTES (current-base)
9-a:SN
c-d:AC
f:CL
00000050:
0:CL
2-3:AV
5-6:NE
8-9:CU
b-c:VT
//LP,AP,MR (current-base)
e:LP (25(19) for Warlock, Mage, Elf, 40(28) for Dwarf, 30(1E) otherwise)
00000060:
0:LP
2:AP (Magician 30(1E) or 35(23), other spellcasters 25(19), others 0(00))
4:AP
6:MR ((CR+WD-2)/3+1)-2xSN)
7:BASE VALUE (=(AG+IN+ST-3)/5+1)
8:AT UNARMED
9:AT CUTTING
a:AT POINTED
b:AT SWORDS
c:AT AXES
d:AT POLE ARMS
e:AT 2-HND SWORDS
f:PA UNARMED
00000070:
0:PA CUTTING
1:PA POINTED
2:PA SWORDS
3:PA AXES
4:PA POLE ARMS
5:PA 2-HND SWORDS
00000080:
8:ALIVE?(not sure what this is)
//SKILLS
00000100:
//COMBATE
8:UNARMED
9:CUTTING
a:POINTED
b:SWORDS
c:AXES
d:POLE ARMS
e:2-HND SWORDS
f:MISSILE
00000110:
0:THROWN
//BODY
1:ACROBATICS
2:CLIMB
3:PHYS. CONTROL
4:RIDE
5:STEALTH
6:SWIM
7:SELF CONTROL
8:DANCE
9:HIDE
a:CAROUSE
//SOCIAL
b:CONVERT
c:SEDUCE
d:HAGGLE
e:STREETWISE
f:LIE
00000120:
0:HUMAN NATURE
1:EVALUATE
//NATURE
2:TRACK
3:BIND
4:ORIENTATION
5:HERB LORE
6:ANIMAL LORE
7:SURVIVAL
//LORE
8:ALCHEMY
9:ANC. TONGUES
a:GEOGRAPHY
b:HISTORY
c:RITUAL
d:TACTICS
e:READ/WRITE
f:ARCANE LORE
00000130:
0:TONGUES
//CRAFTSMANSHIP
1:TRAIN ANIMALS
2:DRIVE
3:CHEAT
4:TREAT POISON
5:TREAT DISEASE
6:TREAT WOUNDS
7:INSTRUMENT
8:LOCKS
9:PICKPOCKER
//INTUITION:
a:DANGER SENSE
b:PERCEPTION
c:SKILL INCREASE ATTEMPTS LEFT
//MAGIC SKILLS
//DISPELL
e:DOMINATION
f:DESTRUCTION
00000140:
0:GARDIANUM
1:ILLUSIONS
2:TRANSFORMATION
//DOMINATION
3:BALL AND CHAIN
4:BAMBALADAM
5:EVIL EYE
6:GREAT NEED
7:CONFUSION
8:MASTER ANIMALS
9:HORRIPHOBUS
a:ASTRAL THEFT
b:RESPONDAMI
c:MEEKNESS
d:SOMNIGRAVIS
e:DANCE!
//DEMONOLOGY
f:BLOOD AND F.
00000150:
0:BANISH SPIRITS
1:CONJ. SPIRITS
2:HEPTAGON
3:SUMMON CROWS
4:SKELETARIUS
//ELEMENTS
5:CONJ. ELEMENTAL
6:NIHILATIO
7:SOLIDIRID
//MOVEMENT
8:ACCELERATUS
9:FORAMEN
a:MOTORICUS
b:WITHOUT TRACE
c:TRANSVERSALIS
d:WALK ON ICE
//HEALING
e:BALM
f:WITCH SPIT
00000160:
0:PURE AND CLEAR
1:REST THE BODY
2:HEAL ANIMAL
//CLAIRVOYANCE
3:EAGLE'S EYE
4:ANALYZE
5:ATTRIBUTES
6:EXPOSAMI
7:ODEM ARCANUM
8:PENETRATING
9:SENSIBAL
//ILLUSION
a:CHAMELEONY
b:DUPLICATION
c:CAMOUFLAGE
d:WITCH'S KNOT
//COMBAT
e:LIGHTNING
f:DARKNESS' POWER
00000170:
0:IRON RUST
1:FULMINICTUS
2:IGNIFACTUS
3:PLUMBUMBARUM
4:TERROR BROOM
5:TERROR POWER
6:ACCURATE EYE
//COMMUNICATION
7:WITCH'S EYE
8:NECROPATHIA
//TRANSFORMATION
9:EAGLE, WOLF
a:ARCANO
b:MAGIC ARMOR
c:INCREASE CH
d:FIRE'S BANE
e:INCREASE DX
f:INCREASE AG
00000180
0:INCREASE IN
1:INCREASE ST
2:INCREASE WD
3:INCREASE CR
4:MUTABILI
5:PARALYZE
6:SALOTHER
7:OCEAN'S FLOOR
8:VISIBLI
/TRANSMUTATION
9:ABVENENUM
a:AEOLITUS
b:BURN
c:CLAUDIBUS
d:DARKNESS
e:FREEZE SOFT
f:FIAT LUX
00000190
0:MELT THE SOLID
1:SILENTIUM
2:CALM THE STORM
3:SPELL INCREASE ATTEMPS LEFT
4:MAGICIAN SCHOOL(00:DISPEL, 01:DOMINATION, 02:DEMONOLOGY, 03:MOVEMENT, 04:HEALING, 05:CLAIRVOYANCE, 06:COMBAT, 07:TRANSFORMATION, 08:TRANSMUTATION)
5:MAGICIAN WAND LEVEL?(not tested)
000002d0:
a:begin portrait (Every entry is a pixel with one of 256 colors)
000006d0:
9:end portrait (last of 1024 pixels (the portrait is 32x32))
First of all, always wondered how the base AT/PA value is calculated? The manual says it depends on CR/AG/ST for AT and IN/AG/ST for PA. Well, RoA1 uses only one value for AT/PA, and it's based on IN/AG/ST. CR doesn't do a thing here. The formula is:
((IN-1)+(AG-1)+(ST-1))/5+1.
Magic resistance has a similar mechanism. The formula is (((CR-1)+(WD-1))/3+1)-(2*SN)+class modifier (+3 for elves,+0 for hunters and warriors, -2 for thorwelians, +2 for the rest).
I wanted to figure this out because I wanted to create most of my characters by giving them an interesting/balanced attribute spread by hex editing the .CHR files instead of hours of generating random values (now I spent hours staring at hex values :p), but base attack values and MR aren't calculated dynamically, so changing the attribute values would not change these. Other values you'll have to change manually are the AT/PA values and the God Bonus.
List of God Bonuses:
Praios: +1CR
Rondra: +1 Swords (and AT or PA Swords)
Efferd: +1 Swim
Travia: +1 Treat Poison
Boron: +1 Human Nature
Hesinde: +1 Alchemy
Firun: +1 Missile, Track
Tsa: +1 CH
Phex: +1 Stealth, Pickpocket
Peraine: +1 Treat Disease, Treat Wounds
Ingerimm: +1 Tactics
Rahja: +1 Dance, Seduce, Instrument
I chose to edit the .CHR files because my goal was to remove the annoyance of character creation (as such, I have not included equipment/inventory, which is not used in the .CHR files, but I assume a lot of the empty space in the .CHR file will function as the inventory in the save file). If you want to edit characters in-game, you'll have to edit the save file instead, which includes the information from the .CHR files. I think the .CHR files are only used to add characters to a new game (or perhaps when a character is added to a game for the first time). The absolute addresses won't be correct anymore in the save file, obviously, but the relative addresses should still be valid. I think.
What follows is an exact specification of every value in the .CHR file when viewed in hex. There are only two values I'm not entirely sure about. An interesting fact is that the portrait is in here as well, at the end. So if you want to make a female druid but hate their portraits, just copy the portrait part out of, say, an elf, and replace the portrait section in your druid's .CHR.
Another Fun fact: the game shows height in foot/inch (like 6'7"), but it stores the height in cm! This caused me some trouble :D
Negative values, when appropriate, are given by Fx (the value is -16+x) or Ex (-32+x). For example, FE=-2 and ED=-19.
Large values (Money, weight, XP) are distributed over several values. The get the decimal value, convert the hexvalue formed by concatenating the entries in reverse order to decimal. For example, 10 09 forms 0910, which is 2320 in decimal.
For easy conversion between hex and decimal use the windows calculator (at least, the 7 calculator does it).
00000000:NAME
00000010:NAME
00000020:
1:TYPE(00:null, 01:Jester, 02:Hunter, 03:Warrior, 04:Rogue, 05:Thorwalian, 06:Dwarves, 07:Warlock, 08:Druid, 09:Magician, 0A:Green Elf, 0B:Ice Elf, 0C:Sylvan Elf)
2:GENDER(00:male,01:female)
3:HEIGHT (in cm!)
4-5:WEIGHT
6:GOD(01:Praios, 02:Rondra, 03:Efferd, 04:Travia, 05:Boron, 06:Hesinde, 07:Firun, 08:Tsa, 09:Phex, 0a:Peraine, 0b:Ingerimm, 0c:Rahja, 0d:Swafnir, 0e:Ifirn)
7:LEVEL
8-b:XP
c-d:MONEY
//POSITIVE ATTRIBUTES (current-base)
00000030:
4-5:CR
7-8:WD
a-b:CH
d-e:DX
00000040:
0-1:AG
3-4:IN
6-7:ST
//NEGATIVE ATTRIBUTES (current-base)
9-a:SN
c-d:AC
f:CL
00000050:
0:CL
2-3:AV
5-6:NE
8-9:CU
b-c:VT
//LP,AP,MR (current-base)
e:LP (25(19) for Warlock, Mage, Elf, 40(28) for Dwarf, 30(1E) otherwise)
00000060:
0:LP
2:AP (Magician 30(1E) or 35(23), other spellcasters 25(19), others 0(00))
4:AP
6:MR ((CR+WD-2)/3+1)-2xSN)
7:BASE VALUE (=(AG+IN+ST-3)/5+1)
8:AT UNARMED
9:AT CUTTING
a:AT POINTED
b:AT SWORDS
c:AT AXES
d:AT POLE ARMS
e:AT 2-HND SWORDS
f:PA UNARMED
00000070:
0:PA CUTTING
1:PA POINTED
2:PA SWORDS
3:PA AXES
4:PA POLE ARMS
5:PA 2-HND SWORDS
00000080:
8:ALIVE?(not sure what this is)
//SKILLS
00000100:
//COMBATE
8:UNARMED
9:CUTTING
a:POINTED
b:SWORDS
c:AXES
d:POLE ARMS
e:2-HND SWORDS
f:MISSILE
00000110:
0:THROWN
//BODY
1:ACROBATICS
2:CLIMB
3:PHYS. CONTROL
4:RIDE
5:STEALTH
6:SWIM
7:SELF CONTROL
8:DANCE
9:HIDE
a:CAROUSE
//SOCIAL
b:CONVERT
c:SEDUCE
d:HAGGLE
e:STREETWISE
f:LIE
00000120:
0:HUMAN NATURE
1:EVALUATE
//NATURE
2:TRACK
3:BIND
4:ORIENTATION
5:HERB LORE
6:ANIMAL LORE
7:SURVIVAL
//LORE
8:ALCHEMY
9:ANC. TONGUES
a:GEOGRAPHY
b:HISTORY
c:RITUAL
d:TACTICS
e:READ/WRITE
f:ARCANE LORE
00000130:
0:TONGUES
//CRAFTSMANSHIP
1:TRAIN ANIMALS
2:DRIVE
3:CHEAT
4:TREAT POISON
5:TREAT DISEASE
6:TREAT WOUNDS
7:INSTRUMENT
8:LOCKS
9:PICKPOCKER
//INTUITION:
a:DANGER SENSE
b:PERCEPTION
c:SKILL INCREASE ATTEMPTS LEFT
//MAGIC SKILLS
//DISPELL
e:DOMINATION
f:DESTRUCTION
00000140:
0:GARDIANUM
1:ILLUSIONS
2:TRANSFORMATION
//DOMINATION
3:BALL AND CHAIN
4:BAMBALADAM
5:EVIL EYE
6:GREAT NEED
7:CONFUSION
8:MASTER ANIMALS
9:HORRIPHOBUS
a:ASTRAL THEFT
b:RESPONDAMI
c:MEEKNESS
d:SOMNIGRAVIS
e:DANCE!
//DEMONOLOGY
f:BLOOD AND F.
00000150:
0:BANISH SPIRITS
1:CONJ. SPIRITS
2:HEPTAGON
3:SUMMON CROWS
4:SKELETARIUS
//ELEMENTS
5:CONJ. ELEMENTAL
6:NIHILATIO
7:SOLIDIRID
//MOVEMENT
8:ACCELERATUS
9:FORAMEN
a:MOTORICUS
b:WITHOUT TRACE
c:TRANSVERSALIS
d:WALK ON ICE
//HEALING
e:BALM
f:WITCH SPIT
00000160:
0:PURE AND CLEAR
1:REST THE BODY
2:HEAL ANIMAL
//CLAIRVOYANCE
3:EAGLE'S EYE
4:ANALYZE
5:ATTRIBUTES
6:EXPOSAMI
7:ODEM ARCANUM
8:PENETRATING
9:SENSIBAL
//ILLUSION
a:CHAMELEONY
b:DUPLICATION
c:CAMOUFLAGE
d:WITCH'S KNOT
//COMBAT
e:LIGHTNING
f:DARKNESS' POWER
00000170:
0:IRON RUST
1:FULMINICTUS
2:IGNIFACTUS
3:PLUMBUMBARUM
4:TERROR BROOM
5:TERROR POWER
6:ACCURATE EYE
//COMMUNICATION
7:WITCH'S EYE
8:NECROPATHIA
//TRANSFORMATION
9:EAGLE, WOLF
a:ARCANO
b:MAGIC ARMOR
c:INCREASE CH
d:FIRE'S BANE
e:INCREASE DX
f:INCREASE AG
00000180
0:INCREASE IN
1:INCREASE ST
2:INCREASE WD
3:INCREASE CR
4:MUTABILI
5:PARALYZE
6:SALOTHER
7:OCEAN'S FLOOR
8:VISIBLI
/TRANSMUTATION
9:ABVENENUM
a:AEOLITUS
b:BURN
c:CLAUDIBUS
d:DARKNESS
e:FREEZE SOFT
f:FIAT LUX
00000190
0:MELT THE SOLID
1:SILENTIUM
2:CALM THE STORM
3:SPELL INCREASE ATTEMPS LEFT
4:MAGICIAN SCHOOL(00:DISPEL, 01:DOMINATION, 02:DEMONOLOGY, 03:MOVEMENT, 04:HEALING, 05:CLAIRVOYANCE, 06:COMBAT, 07:TRANSFORMATION, 08:TRANSMUTATION)
5:MAGICIAN WAND LEVEL?(not tested)
000002d0:
a:begin portrait (Every entry is a pixel with one of 256 colors)
000006d0:
9:end portrait (last of 1024 pixels (the portrait is 32x32))
Post edited June 24, 2010 by LordCinnamon