Jump to content

Code Dissection -- Munchkin Style


Slarti

Recommended Posts

I'm again doing a bit of dissection of the code for Jeff's open source release of BoE, mainly for use in playing BoE as well as the Exile Trilogy -- most, though not all of it, we can safely assume applies to the preceding games, with obvious exceptions for the stuff that was added in E3 or E2.

 

This installment deals with races and traits, and experience level. The amazing thing here, given what we've gotten used to from SW over the last decade, is that pretty much every race and trait does exactly what the in-game description says, and nothing more.

 

Race determines:

- First two items in starting inventory

- Sliths get +2 Str, +1 Int on creation

- Nephils get +2 Dex on creation

- Sliths get +10% to hit with polearms

- Nephils get +10% to hit with missiles

 

Recuperation:

- 1 in 11 chance of healing 2 HP each turn.

 

Chronic Disease:

- 1 in 111 chance of getting 4 levels of disease each turn.

 

Cave Lore and Woodsman:

- 1 in 13 chance of getting 2-12 food each turn when in appropriate terrain.

- Activates the appropriate checks.

 

Nimble Fingers:

- +6% chance to disarm traps

- +6% chance to apply poison well

- +8% to pick locks

 

Ambidextrous:

- Negates -25% penalties for dual-wielding

 

Good Constitution:

- 5/9 chance of additional reduction to poison level each time you take poison damage

- Appears to do nothing vs disease due to a bug

 

Exceptional Strength:

- Carry 30 extra pounds

- +1 to skill bonus for Strength (damage, bashing down doors)

 

Bad Back:

- Carry 50 pounds less

 

Frail:

- Will usually get 1 extra level of poison or disease, when so afflicted

 

Alertness:

- Will get 1 less level of sleep, when slept; NOT cumulative with Hyperactivity status

 

Magically Apt:

- +1 to skill bonus for Intelligence (most spell effects)

 

Toughness:

- Reduces most damage by 1

 

Sluggish:

- Reduces base AP by 1

 

Magically Inept:

- Can't use magic items

 

 

Basically, as we have known for ages, several of the advantages are REALLY good:

- Toughness

- Magically Apt

- Exceptional Strength

 

The rest are okay, but not so critical. Races and Ambidextrous are useful at the start, but not necessary in the later game.

 

The only reason not to take other advantages, would be to get a higher level sooner. Well, what does level do, aside from giving skill points and HP? It does:

 

- Affects treasure drops in some way (this part isn't spaghetti code, it's couscous code -- I can't even tell if it's a positive or negative impact)

- Allows you to assassinate monsters of your level or lower (your Assassination skill also needs to be higher than half their level, so this is unlikely to be relevant until late game; also note that this is just a check and not a roll, so there's no advantage from being extra high level)

- Increases the power of many spells (often every other level; more for Kill, Death Arrows, Charm, Bless, Stealth, Unlock Doors, Dispel Barrier; less for a lot of others)

- Increases resistance to petrification, dumbfounding, disease, sleep

- Reduces XP gained. This is not done relative to monster level, it is a FLAT reduction of all incoming XP. You actually earn 150% at levels 1-2 and just 15% (with an increasing chance of an additional -1 XP) above level 40. In actuality, this is a VERY gentle curve compared with most games, including the Avernums.

 

Conclusion: level is not tremendously important, unless I am underestimating its impact on spell damage. So advantages can be piled on with a clear conscience... as we have known forever smile

Link to comment
Share on other sites

Part 2: Spell Damage, # of Targets, Walls

 

This took a bit to figure out, but here it is.

 

Note that most magical damage is subject to a saving throw for half damage, and enemies that resist it take half again... so you will rarely see maximum damage. This is also why Wall of Blades (and the walls in general) are so amazing. Also, exception: Wound can't be resisted. I've listed max achievable damage for easy comparison, when damage varies that formula comes after -- but do note that max damage listed may cap it.

 

Code:
Spell	Damage on castingFire Barrier	6-21Force Barrier	14-49Spark	2-8Ice Bolt	20-80	(Level Bonus + Int Bonus)d4Flame Arrows	2-8Smite	2-10Wound	7-28	(Level/4 + Int Bonus + 2)d4Flame	10-60	(Level/6 + Int Bonus + 1)d6Fireball	10-60	(Level/3 + Int Bonus + 1)Firestorm	14-84	(Level/3 + Int Bonus + 1) * 14/10Kill	140-70	40-70 + Level*2Death Arrows	101	0-30 + Level + Int Bonus*3Turn Undead	2-28	??Dispel Undead	6-84	??Ravage Demon	15-165	(8 + Int Bonus*2)d11 (note: you also get a flat +25 bonus if you are in the Anama!)Wall	Damage	Chance of fading each turnIce Wall	3-18	1 in 6Force Wall	3-18	1 in 6Fire Wall	2-12	1 in 4Blade Wall	6-48	1 in 5Quickfire	2-16	---TARGETSYou get one target for every X levels, and every Y points of Int BonusSPELL	Poss	Level	BonusSmite	1-8	@ 4	@ 2Sticks to Snakes	1-8	@ 5	@ 2Summon Host	5	--	--Flame Arrows	1-8	@ 4	@ 2Venom Arrows	1-8	@ 5	@ 2Paralysis	1-8	@ 8	@ 3Death Arrows	1-8	@ 8	@ 3Spray Fields	1-8	@ 5	@ 2Summon 1	1-7	@ 4	@ 2Summon 2	1-6	@ 6	@ 2Summon 3	1-5	@ 8	@ 2

 

Int Bonus ranges from -3 to 5 according to Int, you get +1 for Magically Apt or for Micah's Gloves.

Link to comment
Share on other sites

That is correct, thanks for clarifying that CM.

 

Today's installment is a lot of random stuff that I don't have time to make look pretty. There's some pretty neat info in here though that I at least haven't heard before. Defense bonuses and Rings of Resistance are hugely overpowered!

 

 

PICK LOCKS:

 

5,30,35,42,48,

55,63,69,75,77,

78,80,82,84,86,

88,90,92,94,96,98

 

2.0 steps @ Dex Bonus

1.0 steps @ Pick Locks

0.5 steps @ Luck

Flat +6% @ Nimble Fingers

 

 

HIT CHANCE

 

20,30,40,45,50,

55,60,65,69,73,

77,81,84,87,90,

92,94,96,97,98,99

 

1.0 steps @ Appropriate Weapon Skill (Raw Dex is used for bare-handed attacks)

 

 

 

ASSASSINATION = double base damage, need Assassination Skill of at least half the target's level, also need to be at, above, or exactly 1 XP level below the target.

 

Chance of Assassinating:

 

1.0 steps on Hit Chance table @ Assassination

-1% @ level of the target

 

 

STRENGTH

Carry an extra 15 pounds per point of Strength

 

RAW STRENGTH BONUS

Affects HP gained at each level. HP will never go down on level up.

 

Levels 2-25: 2-6 HP plus (or minus) Raw Str Bonus

Levels 26-50: Raw Str Bonus

 

 

ITEM LORE

0,10,15,20,25,

30,35,39,43,47,

51,55,59,63,67,

71,73,75,77,79,81

 

Chance of identifying a non-boring item when it is created.

1.0 steps @ total of Item Lore skill in the party

 

 

DEFENSE REDUCTION TO ENCUMBRANCE

 

Use the Hit Chance table. Do this process for EACH encumbering item.

 

If the encumbrance value is exactly 1, roll a random number from 0-130; if it's less than the lookup value for Defense skill, reduce that value by 1.

 

If the encumbrance value is greater than 1, roll a random number from 0-70; if it's less than the lookup value for Defense skill, reduce that value by 1.

 

Unfortunately, this means that Defense skill can never guarantee being able to cast mage spells if you are wearing more than 1 piece of encumbering equipment, or 1 piece of equipment that has 3 or more points of encumbrance. 10 Defense Skill can however guarantee mage spells with 1 piece of 2-encumbrance equipment.

 

 

LUCK

Total party luck positively affects item drops in some way

 

POISON APPLICATION CHANCE

40,72,81,85,88,

89,90,91,92,93,

94,94,95,95,96,

97,98,100,100,100,100

 

Two rolls. One to put the poison on well -- if it fails, its strength is halved. Nimble Fingers gives +6% to that roll. A second roll with a 10% bonus (but no NF bonus) to avoid nicking yourself; if it fails, you're poisoned. As you can see, this skill is totally useless and even if you like using item poison, there's no need for more than 2-4 points.

 

MINDDUELING

 

Roll a random number from 0 to 100. Do this 10 times but stop if a participant is killed. Adjust by:

+1 @ PC Level / 2

+1 @ PC Raw Int / 2

+35 @ each Ring of Will equipped

-2 @ Monster Level

+5 @ level of Monster being dumbfounded

-5 @ level of PC being dumbfounded

-5 @ each time this turn the PC has won a mini-duel

+5 @ each time this turn the PC has lost a mini-duel

 

Each time you get a result, do the following before rolling again:

 

0-30:

-- Drain 1-6 SP from PC (to monster)

-- If PC is already at 0 SP, add 2 levels of dumbfounding

-- If PC then has 8 or more levels of dumbfounding, kill her!

 

31-69:

-- Nothing

 

70+:

-- Drain 1-6 SP from monster (to PC; can go over max SP)

-- If monster is already at 0 SP, add 2 levels of dumbfounding

-- If monster then has 8 or more levels of dumbfounding, kill it!

 

Thus, a single Mindduel spell can theoretically result in the exchange of up to 60 SP, although this is very, very unlikely.

 

 

ALCHEMY FAILURE CHANCE

 

50,40,30,20,10,

8,6,4,2,0,

 

Alchemy skill above 9 has no effect on failure chance. There is an additional modifer to failure chance based on potion difficulty; this goes as high as -20.

 

If your alchemy skill is at least 5 higher than the potion difficulty, you get an extra charge. If it's at least 11 higher, you get two extra charges instead.

 

 

ARMOR AND DAMAGE

 

Armor with defense rating X reduces all physical damage taken by a random number between 1 and X.

Armor with defense bonus Y reduces it by a random number between 1 and Y, PLUS HALF OF Y.

Non-armor items with a protection rating reduce damage just like armor defense rating, 1dX.

 

Defense skill has a chance to reduce damage by 1 using the Hit Chance table with a 20% penalty.

Luck has a chance to reduce damage by 1 double the Hit Chance table value, with an undoubled 20% penalty -- this reaches 100% at 6 Luck.

 

Parry reduces damage by 25% of its evasion value (see below).

 

 

MAGIC DAMAGE

 

Onyx Charm reduces energy damage by 50%.

Ruby Charm and Ring of Fire Res. reduce fire damage by 50%, or by 75% if two or more are worn.

Ring of Warmth (NOT Iceshield -- bug) reduces ice damage by 50%, or by 75% if two are worn.

Ring of Resistance is AMAZING -- it reduces fire, cold, energy and poison damage all by 75% and is cumulative with other rings and effects!

Magic Resistance status reduce fire and cold damage by 50%.

 

 

LUCK SAVING LIFE

 

It uses the Hit Chance table, so you can't actually be 100% immortal... just 99% immortal. This means that a mere 1 point of Luck gives you a 30% chance to stay alive... you do need at least 1 Luck for this check to take place.

 

 

PARRY ("WAIT") BONUS TO EVASION:

 

0.25 * (2 + Dex Bonus + Defense) @ Remaining AP

 

Practical range: 0.5% per AP to 6.75% per AP

 

 

PICK LOCKS

Just a flat +5% bonus per point, no table lookup.

Link to comment
Share on other sites

Great, someone doing what i couldn't find the time to do, an all purpose guide to BoE stats (not to mention making easier the mac and windows codes comparison);)

 

A few precisions to the otherwise correct previous posts :

 

Originally Posted By: CRISIS on INFINITE SLARTIES
Chronic Disease:

- 1 in 111 chance of getting 4 levels of disease each turn.

There's some adjustments inside the "disease" function : (that's what happens for any disease put on a pc)

  • There's a (2* pc_level /101) chance that 2 levels of disease are not applied (to the 4 levels for chronic disease, for example)
  • If the no level of disease are now to be applied, the pc is saved.
  • Else, if an item with Protection from Disease is equipped, (item_ability_strengh / 2) is substract to the remaining level of disease to put.
  • Finally, if the character is "Frail", plus one level of disease to add, and if there's only one level of disease to apply a 1/2 chance to add another. (you mentioned that further in the first post)

Originally Posted By: CRISIS on INFINITE SLARTIES
Cave Lore and Woodsman:

- 1 in 13 chance of getting 2-12 food each turn when in appropriate terrain.

- Activates the appropriate checks.

Cave Lore also gives a 1/2 chance to fall waterfalls without losing food (else you lose food everytime).

Also, the food giving part of Woodsman has apparently mysteriously disappeared from the Windows code ...

Thanks, i'll put it back.

 

Originally Posted By: CRISIS on INFINITE SLARTIES
Good Constitution:

[...]

- Appears to do nothing vs disease due to a bug

Good catch, there indeed a bug (present in the original code, preventing it from working : a random number was recomputed instead of using the previously adusjted one). This is fixed : 1/8 chance to lose a level of disease without the trait, 3/8 with the trait. Note that a "protect from disease" equipped item automatically removes the level. (Edit : Fixed)

 

Originally Posted By: CRISIS on INFINITE SLARTIES
Frail:

- Will usually get 1 extra level of poison or disease, when so afflicted

The mechanism for poison is exactly the same as for disease (see above).

 

Originally Posted By: CRISIS on INFINITE SLARTIES
Conclusion: level is not tremendously important, unless I am underestimating its impact on spell damage.

Level is essential for spell casting as most effect are relying on it. Paralysis resistance is also affected by level.

 

Originally Posted By: CRISIS on INFINITE SLARTIES
Fire Barrier 6-21

In the Windows code, the damage are 2-20.

Originally Posted By: CRISIS on INFINITE SLARTIES
Force Barrier 14-49

As far as i know, the Force Barriers don't do damage, just preventing a space from being entered.

Force Barriers indeed does damage if on the same square, and the damages are indeed 14-49.

 

Walls are more forgiving to the pc :

Ice Wall 2-12 1 in 6

Force Wall 2-12 1 in 6

Fire Wall 1-6 1 in 4

Blade Wall 4-32 1 in 5

 

Originally Posted By: CRISIS on INFINITE SLARTIES
Ice Bolt 20-80 (Level Bonus + Int Bonus)d4

Indeed, it's the max of those two values (idem when it has two values in the second post table).

Except that you've applied the initial (at the begin of the function) level is 1 + level /2 convention to the Wound and Flame spells; so for sake of consistency the correct value should be :

Ice Bolt 20-80 (Level / 2 + Int Bonus)d4

 

Idem with Kill : 40-70 + Level

and Death Arrows : 0-30 + Level / 2 + Int Bonus*3

 

Originally Posted By: CRISIS on INFINITE SLARTIES
Fireball 10-60 (Level/3 + Int Bonus + 1)

Firestorm 14-84 (Level/3 + Int Bonus + 1) * 14/10

These are tricky to put out :

Fireball = min(10 , (Level/3 + Int Bonus + 2))*d6

Flamestrike = min(10 , (Level/3 + Int Bonus + 2) * 14/10))*d6

(by the way, the spell 141 is not Fire Storm but Flamestrike)

 

The Firestorm damages are : min(14,3 + (level * 2) / 3 + bonus))*d6

 

The Divine Thud is missing, it's damages are : min(18,(level * 7) / 20 + 2 * bonus)*d6 (using the level / 2 convention)

 

Originally Posted By: CRISIS on INFINITE SLARTIES
Turn Undead 2-28 ??

Dispel Undead 6-84 ??

Absolutely correct.

 

Originally Posted By: CRISIS on INFINITE SLARTIES
Ravage Demon 15-165 (8 + Int Bonus*2)d11 (note: you also get a flat +25 bonus if you are in the Anama!)

Ravage Demon does indeed (8 + Int Bonus*2)d11 damages.

For information, the Anama thing is not longer present in BoE, but should be accurate for Exile 3.

 

Originally Posted By: Celtic Minstrel
If I recall correctly, monsters have totally separate code for their spells, so the above presumably applies only to PC spells.

Absolutely :

Code:
Spells Damages(if apply)Wrack 2-8StumbleBlessesCurseWound 4-14Summon Spirit/Guardian/HostDiseaseHoly Scourge (slow + curse)Smite 6-26Sticks to SnakesMartyr's ShieldCurse AllPestilenceVarious healsBless AllRevive AllFlamestrike (4 + monster_level / 2)Holy Ravaging 4-32 (slow + poison)AvatarDivine Thud ((monster_level * 3) / 4 + 5)

 

Originally Posted By: CRISIS on INFINITE SLARTIES
PICK LOCKS:

 

5,30,35,42,48,

55,63,69,75,77,

78,80,82,84,86,

88,90,92,94,96,98

 

2.0 steps @ Dex Bonus

1.0 steps @ Pick Locks Disarm Trap

0.5 steps @ Luck

Flat +6% @ Nimble Fingers

No, that's Disarm Trap. Aside from that it's correct smile

Note : 1.0 step @ (equipped thieving item ability strength /2 ) * 2

 

Originally Posted By: CRISIS on INFINITE SLARTIES
ASSASSINATION = [...]

Note that you can't assassinate Splitters.

 

Originally Posted By: CRISIS on INFINITE SLARTIES
Chance of identifying a non-boring item when it is created.

1.0 steps @ total of Item Lore skill in the party

In fact, the check is done for every pc instead of the whole party, so the item lore is not summed.

 

Originally Posted By: CRISIS on INFINITE SLARTIES
Use the Hit Chance table. Do this process for EACH encumbering item.

Oddly, i've just noticed that the last 8 items are not checked in this process (that's undoubtly a leftover of Exile 2 when pc could only have 16 items ... i bet it's present in Exile 3 as well).

I should fix that, i think ...

 

Originally Posted By: CRISIS on INFINITE SLARTIES
LUCK SAVING LIFE

 

It uses the Hit Chance table, so you can't actually be 100% immortal... just 99% immortal. This means that a mere 1 point of Luck gives you a 30% chance to stay alive... you do need at least 1 Luck for this check to take place.

Actually 100/101 immortal ... unless the damage type is set to bypass the luck check wink

 

Originally Posted By: CRISIS on INFINITE SLARTIES
Parry reduces damage by 25% of its evasion value (see below).

Only on weapon and fire damages.

 

Originally Posted By: CRISIS on INFINITE SLARTIES
Defense skill has a chance to reduce damage by 1 using the Hit Chance table with a 20% penalty.

For each armor item worn.

 

Originally Posted By: CRISIS on INFINITE SLARTIES
MAGIC DAMAGE

 

Onyx Charm reduces energy damage by 50%.

Ruby Charm and Ring of Fire Res. reduce fire damage by 50%, or by 75% if two or more are worn.

Ring of Warmth (NOT Iceshield -- bug) reduces ice damage by 50%, or by 75% if two are worn.

Ring of Resistance is AMAZING -- it reduces fire, cold, energy and poison damage all by 75% and is cumulative with other rings and effects!

Magic Resistance status reduce fire and cold damage by 50%.

Seems a bit off there ...

If the damage type is X and the wearer has a "X Protection" item, the amount of damage is reduced by 50% if the ability strength of the item is < 7 and by 75%, if >= 7.

Replace X by magic, fire and cold.

If the victim actually has magic resistance activated, fire and cold damages are reduced by 50%.

For Magic, Poison, Fire and Cold damages, a "Full Protection" item reduced (even further) the damages by 50 % if ability is < 7 and 75 % if >=7.

 

Originally Posted By: CRISIS on INFINITE SLARTIES
PICK LOCKS

Just a flat +5% bonus per point, no table lookup.

Yup, for every lock picking point. There's more modifiers though : lockpicks quality, dexterity, thieving items, nimble fingers, etc (difficulty also in the new format).

 

Chokboyz

Link to comment
Share on other sites

Thanks for the clarifications & corrections! I am a bit embarassed by how many errors my summary had -- guess I shouldn't do this stuff after I stay up all night ^_^

 

Originally Posted By: Chokboyz
Originally Posted By: CRISIS on INFINITE SLARTIES
Fire Barrier 6-21

In the Windows code, the damage are 2-20.

Originally Posted By: CRISIS on INFINITE SLARTIES
Force Barrier 14-49

As far as i know, the Force Barriers don't do damage, just preventing a space from being entered.

The code appears to deal this damage to anything in the square when the barrier is cast. I know from experience that barriers definitely do damage when cast, just as the damaging walls do, but the mechanism appears to be different. I'm going to paste the code because this is actually one of the cleanest bits of it:

Code:
			case 42: // Fire barrier				play_sound(68);				r1 = get_ran(3,2,7);				hit_space(target,r1,1,TRUE,TRUE);				make_fire_barrier(target.x,target.y);				if (is_fire_barrier(target.x,target.y))					add_string_to_buf("  You create the barrier.              ");					else add_string_to_buf("  Failed.");				break;		

 

Quote:
Originally Posted By: CRISIS on INFINITE SLARTIES
Ravage Demon 15-165 (8 + Int Bonus*2)d11 (note: you also get a flat +25 bonus if you are in the Anama!)

Ravage Demon does indeed (8 + Int Bonus*2)d11 damages.

For information, the Anama thing is not longer present in BoE, but should be accurate for Exile 3.

The bonus is definitely present in the Mac BoE code, although it is not possible to join the Anama in BoE so it's irrelevant.

 

Quote:
Originally Posted By: CRISIS on INFINITE SLARTIES
Use the Hit Chance table. Do this process for EACH encumbering item.

Oddly, i've just noticed that the last 8 items are not checked in this process (that's undoubtly a leftover of Exile 2 when pc could only have 16 items ... i bet it's present in Exile 3 as well).

I should fix that, i think ...

It isn't possible to have items 17-24 equipped, is it?

LH, RH, Bow, Ammo, Cloak, Helmet, Armor, Pants, Boots, Gloves, Ring, Ring, Necklace, Lockpicks... I can only get to 14.

 

Quote:
Originally Posted By: CRISIS on INFINITE SLARTIES
Defense skill has a chance to reduce damage by 1 using the Hit Chance table with a 20% penalty.

For each armor item worn.

Whoa -- you're right! I missed that, and WOW does that make Defense skill more useful. You can easily knock off 6-10 damage per attack with a high Defense.

 

Quote:
Seems a bit off there ...

If the damage type is X and the wearer has a "X Protection" item, the amount of damage is reduced by 50% if the ability strength of the item is < 7 and by 75%, if >= 7.

Whoops, I thought get_prot_level summed all the scores for some reason. It doesn't.

Link to comment
Share on other sites

Originally Posted By: CRISIS on INFINITE SLARTIES
Thanks for the clarifications & corrections! I am a bit embarassed by how many errors my summary had -- guess I shouldn't do this stuff after I stay up all night ^_^

No problem, the code is pretty hard to read correctly (even more if it's a part that uses non-human readable constants wink ) in current state ...
Your work has definitely been useful though : 2 bugs and a discrepancy in the Windows code have been found, plus i've changed constants to human-readable ones (see classes/consts.h) when checking the code, making it much clearer ... smile

Originally Posted By: CRISIS on INFINITE SLARTIES
The code appears to deal this damage to anything in the square when the barrier is cast. I know from experience that barriers definitely do damage when cast, just as the damaging walls do, but the mechanism appears to be different.

I was suspecting something like that ...
Double-checking the code, it seems like my also-tired-eyes skipped the hit_space line : your force barrier entry is definitely right.

Originally Posted By: CRISIS on INFINITE SLARTIES
The bonus is definitely present in the Mac BoE code, although it is not possible to join the Anama in BoE so it's irrelevant.

Yup, the Mac code is somewhat behind in term of bugfixes, whereas the Windows one is lacking the "new engine" contents (trims, roads drawing, etc). When the multiplatform code will be finished (working on it, time is hard to find this month ...), both those problems will be history.

Originally Posted By: CRISIS on INFINITE SLARTIES
It isn't possible to have items 17-24 equipped, is it?
LH, RH, Bow, Ammo, Cloak, Helmet, Armor, Pants, Boots, Gloves, Ring, Ring, Necklace, Lockpicks... I can only get to 14.

I'm not speaking about the item types here (there's 26 of them, with shield being redundantly listed two times, see classes/consts.h for a list).
The inventory of a character can hold up to 24 items, whereas in Exile I and II, it was limited to 16 items.
The get_encumberance() function is checking every equipped item and summed the awkward value to get the total encumberance. (Un)fortunalety the function seems to have not been updated when the inventory passed from 16 to 24 items in Exile III, so the encumberance of the 8 last object are not taken into account, only the 16 first being checked.
Hope, i'm clearer smile

Originally Posted By: CRISIS on INFINITE SLARTIES
Whoa -- you're right! I missed that, and WOW does that make Defense skill more useful. You can easily knock off 6-10 damage per attack with a high Defense.

Indeed, it's definitely a useful skill.

Originally Posted By: CRISIS on INFINITE SLARTIES
Whoops, I thought get_prot_level summed all the scores for some reason. It doesn't.

Actually, the item checking code is pretty straight forward (if it founds an corresponding item, it keeps it, even if an item with the same ability but higher ability strength is equipped after in the list).
Checking (and correcting) the code for Giant's Strength and Skill ability (http://code.google.com/p/openexile/issues/detail?id=16), the issue arose and we're comtempling possibles solutions :
1)keep the item with the higher ability strength (so having two items with the same ability equipped would give no more benefit)
2)somehow summing up the items' ability, so that having two items with the same ability grants a bonus.

Chokboyz

Edit : Oh, i now remember why the Cave lore and Woodsman food gathering function was left of the Windows code : it's because they were never actually called anywhere. Putting it back wouldn't requires much effort though smile
Link to comment
Share on other sites

HOLY WHOA.

 

HOLY BROKEN INCONSISTENCY, BATMAN!

 

I don't know if some of this was known before. I mean, we all knew that Bless was really, really good in Exile. But did we realize quite how good it was?

 

After looking closely at how the source code handles Bless, I have to say that Bless is broken and grossly abusable.

 

I think most of us concluded that Bless caps at plus or minus 8 just by seeing the effect on the PC status screen max out at +8/+40%. And that's accurate as far as the PC's attacks go. It's also accurate for NPC's defending against PC melee attacks. A few other potential scenarios have different numbers though. For example, when an NPC attacks somebody with a missle, the cap is +10/+50%.

 

However, the really interesting caps are the caps on defensive bless action. When a PC is attacked by an NPC using a melee attack or a missile attack (or a gaze attack), there is NO CAP for the impact of bless on dodging. For melee attacks there isn't a cap for the impact of bless on damage absorption either.

 

But wait, you say. Surely bless is just capped at 8 when you cast it, right? Well, it's capped at 8 if you cast Avatar, or if you're a monster and you cast any spell other than Strength. But for PC's casting the other 5 blessing spells, NO CAP IS APPLIED.

 

But wait, aren't bless spells inefficient if you want really high bless values? Most of them are... the plain old Bless spell, however, gives you (0.75 * exp_level + 1 + spellcasting_bonus) levels of bless for 2 SP. For my current Exile 3 singleton, at level 24 and with 19 Intelligence, that means 24 levels of bless. Cast Bless 3 or 4 times and I literally CANNOT be touched with any physical attack for a lot longer than Invulnerability lasts.

 

Is this a bug or just the result of Jeff's strong opinions on Bless spells needing to be useful when he wrote Exile 1? Who knows. What I have to guess IS a bug, though, is that the first 5 levels of damage reduction from bless when a PC is attacked by a monster in melee, count double. That's right -- bless damage reduction is applied twice, once in the attack routine and once in the taking damage routine; the first time it isn't capped and the second time it's capped at +/-5.

 

Code:
ATTACKING BONUSES:Att	Def	Typ	Dam		HitPC	NPC	MEL	-8	+8	-40%	+40%PC	NPC	MIS	-8	+8	-40%	+40%NPC	PC	MEL	-Inf	+8	-Inf	+40%NPC	PC	MIS	-Inf	+10	-Inf	+50%NPC	NPC	MEL	-Inf	+10	-Inf	+50%NPC	NPC	MIS	-Inf	+10	-Inf	+50%DEFENDING BONUSES:Att	Def	Typ	Dam		HitPC	NPC	MEL	+8	-8	+40%	-40%PC	NPC	MIS	0	0	0	0NPC	PC	MEL	+Inf*	-Inf*	+Inf	-InfNPC	PC	MIS	+5	-5	+Inf	-InfNPC	NPC	MEL	+Inf	-Inf	+Inf	-InfNPC	NPC	MIS	0	0	+Inf	-InfNPC	ANY	GAZ	--	--	+Inf	-Inf*First +5 or -5 to damage counts twice.BLESSING SPELL EFFECTSCast	Spell	Cap	EffectNPC	Str	--	+3NPC	Maj.	8	+3d4NPC	Min.	8	+3NPC	B.	8	+5NPC	Pty.	8	+2d4NPC	Avat	8	=8PC	Str	--	+3PC	Maj.	--	+4PC	Min.	--	+2PC	B.	--	+(0.75*level)+1+bonusPC	Pty.	--	+(0.33*level)PC	Avat	8	=8
Link to comment
Share on other sites

Originally Posted By: Chokboyz
The inventory of a character can hold up to 24 items, whereas in Exile I and II, it was limited to 16 items.

Also, just noticed this. In Exile I it was actually limited to just 12 items, so it was apparently updated for E2, but not E3.
Link to comment
Share on other sites

Originally Posted By: CRISIS on INFINITE SLARTIES
But wait, you say. Surely bless is just capped at 8 when you cast it, right? Well, it's capped at 8 if you cast Avatar, or if you're a monster and you cast any spell other than Strength. But for PC's casting the other 5 blessing spells, NO CAP IS APPLIED.


Slarties, does this mean repeatedly casting Avatar will have no cumulative blessed effect but repeatedly casting good old regular bless will? Or do you have to cast one of each blessing spells to get the most benefit?
Link to comment
Share on other sites

We knew that about the unlimited defensive blessing effect, yeah. It's wonderfully abusable when beating high-level scenarios with a low-level party.

 

Originally Posted By: JSMany
Slarties, does this mean repeatedly casting Avatar will have no cumulative blessed effect but repeatedly casting good old regular bless will? Or do you have to cast one of each blessing spells to get the most benefit?

 

Repeatedly casting any blessing spell other than Avatar will work fine. Bless just happens to have the strongest single-target blessing effect.

Link to comment
Share on other sites

Originally Posted By: JSMany
Slarties,

I love this. No, seriously. I wish everyone would address me us in the plural!

(On second thought, I can't start using first person plural when I type. That would be a lot worse than the plurality of third person singular gimmicks currently running around.)

—Slarties, who are borrowing this signature form just to emphasize the point. Address me in the plural, O ye singularities!
Link to comment
Share on other sites

Originally Posted By: CRISIS on INFINITE SLARTIES
Originally Posted By: JSMany
Slarties,

I love this. No, seriously. I wish everyone would address me us in the plural!

(On second thought, I can't start using first person plural when I type. That would be a lot worse than the plurality of third person singular gimmicks currently running around.)

—Slarties, who are borrowing this signature form just to emphasize the point. Address me in the plural, O ye singularities!


Sure, Slarties. Whatever makes you guys happy in there. =) Also good to know about the blessing spells.
Link to comment
Share on other sites

  • 4 years later...

Hi, I am working on speedrunning exile 1. I really like the game and beat it a long time ago. i've been trying to figure out the best, fastest ways to play through it. it's a big game so i'm still looking around, though i have the early game pretty optimized. i like the 3 win conditions, too, so i'll have to make 3 routes and try them all to see what's fastest. i'm also considering trying to beat the game with no reloading (still caring about time, not just completely overleveling everything).

 

i've been looking at this info and the blades source code and done some testing about what applies to exile 1. it's really helpful to understand things like hp gain from leveling formula, how main attributes work, and how base hit chance works based on your weapon skill. and i looked at how a bunch of spells calculate stuff, like it's great to know how minor bless is a fixed 2 levels of bless even if you have 1 int, while bless is much better at higher level with good int. i already kinda knew that from playing but it's clearer now. haste works similar but is capped at 8 levels of haste which is why casting a bunch of haste before a fight wouldn't make me totally immune to slow, while bless is uncapped so it will often stay on much better even if they caste curses.

 

i wanted to ask a question.

 

one thing i really want to know is how the Silver Gauntlets work in exile 1. unfortunately i searched for them and they don't exist in the blades source code. i don't suppose anyone has exile 1 code they can check?

 

they say they offer "Protection", they don't have an item level, and they are usable in combat. but using them has no visible effect. does anyone know exactly what Silver Gauntlets do?

Link to comment
Share on other sites

here's some additions from looking at the code:

 

light heal, heal, major heal: no scaling, average 5, 20, 35 healing

 

light heal all, heal all, revive all: 3, 6, 7 base d4 of healing. plus your bonus (like from int). after rolling, if it's revive all, double it. level irrelevant.

 

i think major heal and heal all are pretty much useless.

 

i also looked into where you end up when you end combat. it finds a random alive PC and uses that location. looks impossible to manipulate.

 

haste is 8 stacks max. bless can raise or lower your damage by 8 max. i think the limited haste stacks is why pre-hasting isn't nearly as effective against slows as pre-blessing is vs curses.

 

protection invulnerability duration is: 2 + bonus + 2d2 (2 to 4)

 

the general idea with minor bless/haste is it adds 2 stacks, and then the regular spell factors in your bonus and your level divided by something, and has a minimum of 2. so use the minor spells early and just stack plenty of them, and switch later on.

 

i've tested a lot of this stuff in exile 1. not many differences. i suspect heal and revive all have 1d4 less of base healing in e1.

 

here is the skill bonus table, it's very important:

 

short skill_bonus[21] = {-3,-3,-2,-1,0,0,1,1,1,2,

2,2,3,3,3,3,4,4,4,5,5};

 

it's saying your bonus from an attribute. the first number is for 0. you get a +1 bonus at 6 str/dex/int. +2 at 9, +3 at 12, +4 at 16, and +5 at 19.

 

 

major haste stacks:

 

1 + level / 8 + bonus

 

major blessing stacks:

haste: 3 + bonus

bless: 4

 

slow group:

5+bonus

 

ravage enemy mage slow/curse aoe spell (exile 1/2 only): 5+bonus slow, 3+bonus curse

 

haste stacks from items (like helm of speed): item level / 2

 

minor haste: 2 stacks

haste: level/2 + bonus (or 2 minimum)

 

i think bless party is level/3 stacks

 

i think minor bless is 2 stacks and bless is level*3/4 + 1 + bonus (2 minimum)

 

i think that means bless is so amazingly good that it may be more useful than bless party. like suppose you are level 20 and have 9 int (+2 bonus), bless party would give 6 stacks per person. minor bless would give 2 stacks. bless would give 18 stacks. that's so huge i'm wondering if it actually works that way in exile 1 (the game i've been playing lately).

 

in that scenario, if you have 3 people who are doing combat, you could bless them each once for the same stacks, and with the same AP, as casting 3 bless party. for 40% of the mana cost.

Link to comment
Share on other sites

you lose 1 stack of bless and haste every 4 rounds (not 4 rounds based on when you cast it. there's just one timer, may be started when combat starts or you enter the town or something, not sure). if your bless or haste is negative then you're losing a stack of curse or slow instead, it moves towards 0 over time.

 

also i found Strength. it gives 3 stacks of bless. so it's 50% better than minor bless!!

 

also using the duration information, i tested bless stacks in exile 1. minor bless is indeed 2 stacks, strength 3, and bless is indeed level * 3/4 +1 +bonus. my level 19 priest with +2 in bonus is giving 17 stacks with one cast of bless (exactly 68 stand ready for it to expire). my level 9 priest with +0 int gets 7 stacks (28 duration). then i cast 3 blesses on one guy for 17+7+7 stacks. those 31 stacks should last 124 rounds. i left combat, did 40-move wait 3 times, then stood still twice and it ended exactly as predicted. (to get the stacks, round the duration up to the closest multiple of 4. you lose 0-3 rounds of duration based on when you cast it vs the global timer). i also tested bless party and it was level/3. (btw everything rounds down, it's integer math. so level 8 = 2 stacks from bless party).

 

so then i tested haste. it is level/2 + bonus in exile 1, based on duration. major blessing really was 3+bonus haste and 4 bless. minor haste is 2 stacks.

 

slows use the same global timer as bless/haste durations. when the timer is an even number, slowed heroes skip their turn.

 

haste from items doesn't check for 8 stacks of haste max (i figure this is a bug, though not very important). the 4 mage haste spells all do cap at 8 stacks in the boe code. however in testing in e1, haste stacks are not capped. that must have been added later. i just gave a guy 60 haste stacks and it lasted over 200 rounds. i think i underestimated the power of haste because the group haste spells give low stacks.

 

if you are level 20 with 12 int then the haste spells give:

minor: 2

haste: 13

major haste: 6

major blessing: 6

 

or with 4 int the stacks are : 2, 10, 3, 3 (bigger difference). haste is the only one which benefits a lot from level. once you level up pretty well, you can get really huge haste stacks with it. i had been overestimating party buffs before.

 

though with an 8 stack haste cap in boe, all you need is 6int for a +1 bonus and then you can use 2x major blessing to hit the haste cap. alternatively, get to level 8 and get 9 int and then 2 casts of major haste would hit the cap. however in boe you should still strongly consider using the haste spell if you get slowed. if you are at 0, you can only get 8 stacks. but if you were at -8 haste (worse possible), then a single cast of haste from a level 32 mage with 4int would get you straight up up to +8.

 

8 or more stacks of haste gives you triple action points, 1 to 7 stacks gives you double action points, according to the boe code. (exile 1 is different with 6+ stacks giving triple action points, and 1-5 being double). when i play exile 2 or 3 again, i'll definitely have to test the haste stacking rules using minor haste.

 

 

i tried to look at how luck effects drops. it's super confusing, but it adds up the luck of your whole party then does 2 things with it:

 

1) seems to add 1% better chance per luck to a loot check of some kind

2) seems to add 1 level to some dropped items per 3 luck

 

it's very hard to tell but my best guess is that this is good. if i try a game with my 20luck guy idea, maybe i'll be able to notice a difference, maybe not. (plus it could be different in exile 1, who knows :D)

Link to comment
Share on other sites

  • 4 months later...

tested only in exile 1 so far: protection spells stack.

 

maybe i shouldn't be surprised, but i'd kinda of assumed that would be OP and it wouldn't work that way. well it does. cast protection 3 times on the same guy, get triple duration invulnerability. there's no diminishing returns.

 

and 80 gold mana potions give 15 mana, enough to cast protection twice. and protection is available at the start of the game for a mere 8 mage lore.

 

so for a really cheap potion you can get around 10 rounds of invulnerability on a character, assuming only 4 int. 12 rounds with 6 int, 14 with 9, 20 with 19int.

 

i already knew protection was ridiculously OP, but i didn't know you could prebuff it a bunch of times before a fight. i thought it had to be monitored during fights because of the short duration, instead of just stacked up to last a whole fight and not worry about it. i was always trying to wait until it ran out before recasting Protection in the past. this will make fighting grah-hoth easier.

Link to comment
Share on other sites

  • 2 months later...

Awesome info. I love this kinda 'how it works' stuff. :) One addition though, the Chronic Disease disadvantages' description is inaccurate where it says a "minor disease." I built I hopeless char with no advantages, and all the disadvantages just to see what would happen like, and the Chronic Disease becomes poison which will kill it, so while you may not die from the "chronic disease" you do die from its' effects. So it's not really a minor disease at all. If you don't have a priest who enjoys curing it every time it crops up, you'll die because of it.

Link to comment
Share on other sites

Awesome info. I love this kinda 'how it works' stuff. :) One addition though, the Chronic Disease disadvantages' description is inaccurate where it says a "minor disease." I built I hopeless char with no advantages, and all the disadvantages just to see what would happen like, and the Chronic Disease becomes poison which will kill it, so while you may not die from the "chronic disease" you do die from its' effects. So it's not really a minor disease at all. If you don't have a priest who enjoys curing it every time it crops up, you'll die because of it.

 

It's "minor" in the sense that it only gives you 4 levels of the disease status out of a possible maximum of 8. As you've noticed, it's still a pain: the effect hangs around for a long time if not cured by magic, and among other things it can drain your experience points. Even if you do have a priest and plenty of spell points, the sheer annoyance value of having to drop everything to cure it all the time makes it more trouble than it's worth.

Link to comment
Share on other sites

When disease takes its toll, it causes one of several random effects, of which poison is just one. I think there's something like six possible effects from disease. So, while it's certainly possible to die from the chronic disease, it's not guaranteed and may not even be likely.

Link to comment
Share on other sites

About the code overall, have read about some seemingly major bugs in the game. Like Archery skill not being checked for 'to hit' calculations. Seems an easy fix so I'm surprised this is the first company not to have a patches section (just looked.) Granted, it's an old game and all but still. Seems an overabundance of code monkies here I'm surprised no one's thought to do one unofficially or not. And other things like the 'Good Constitution' advantage not having the promised Disease resistance. Admtitedly we've all played through such hardships and done well as-is so a patch's overall value is mainly aesthetic, but still. One of those times ignorance was bliss not knowing about these things, but now that I've read through the forums a little bit they're like flashing neon signs along a roadway. ...At night! :) Is there an unofficial patch somewhere?

Link to comment
Share on other sites

I'm again doing a bit of dissection of the code for Jeff's open source release of BoE, mainly for use in playing BoE as well as the Exile Trilogy -- most, though not all of it, we can safely assume applies to the preceding games, with obvious exceptions for the stuff that was added in E3 or E2.

 

This installment deals with races and traits, and experience level. The amazing thing here, given what we've gotten used to from SW over the last decade, is that pretty much every race and trait does exactly what the in-game description says, and nothing more.

 

Race determines:

- First two items in starting inventory

- Sliths get +2 Str, +1 Int on creation

- Nephils get +2 Dex on creation

- Sliths get +10% to hit with polearms

- Nephils get +10% to hit with missiles

 

Recuperation:

- 1 in 11 chance of healing 2 HP each turn.

 

Chronic Disease:

- 1 in 111 chance of getting 4 levels of disease each turn.

 

Cave Lore and Woodsman:

- 1 in 13 chance of getting 2-12 food each turn when in appropriate terrain.

- Activates the appropriate checks.

 

Nimble Fingers:

- +6% chance to disarm traps

- +6% chance to apply poison well

- +8% to pick locks

 

Ambidextrous:

- Negates -25% penalties for dual-wielding

 

Good Constitution:

- 5/9 chance of additional reduction to poison level each time you take poison damage

- Appears to do nothing vs disease due to a bug

 

Exceptional Strength:

- Carry 30 extra pounds

- +1 to skill bonus for Strength (damage, bashing down doors)

 

Bad Back:

- Carry 50 pounds less

 

Frail:

- Will usually get 1 extra level of poison or disease, when so afflicted

 

Alertness:

- Will get 1 less level of sleep, when slept; NOT cumulative with Hyperactivity status

 

Magically Apt:

- +1 to skill bonus for Intelligence (most spell effects)

 

Toughness:

- Reduces most damage by 1

 

Sluggish:

- Reduces base AP by 1

 

Magically Inept:

- Can't use magic items

 

 

Basically, as we have known for ages, several of the advantages are REALLY good:

- Toughness

- Magically Apt

- Exceptional Strength

 

The rest are okay, but not so critical. Races and Ambidextrous are useful at the start, but not necessary in the later game.

 

The only reason not to take other advantages, would be to get a higher level sooner. Well, what does level do, aside from giving skill points and HP? It does:

 

- Affects treasure drops in some way (this part isn't spaghetti code, it's couscous code -- I can't even tell if it's a positive or negative impact)

- Allows you to assassinate monsters of your level or lower (your Assassination skill also needs to be higher than half their level, so this is unlikely to be relevant until late game; also note that this is just a check and not a roll, so there's no advantage from being extra high level)

- Increases the power of many spells (often every other level; more for Kill, Death Arrows, Charm, Bless, Stealth, Unlock Doors, Dispel Barrier; less for a lot of others)

- Increases resistance to petrification, dumbfounding, disease, sleep

- Reduces XP gained. This is not done relative to monster level, it is a FLAT reduction of all incoming XP. You actually earn 150% at levels 1-2 and just 15% (with an increasing chance of an additional -1 XP) above level 40. In actuality, this is a VERY gentle curve compared with most games, including the Avernums.

 

Conclusion: level is not tremendously important, unless I am underestimating its impact on spell damage. So advantages can be piled on with a clear conscience... as we have known forever smileold.gif

 

Great info, thanks. As to 'Exceptional Strength,' does its' damage mod apply to ranged attacks like Bows, Xbows, Slings, Thrown?

 

- Cave Lore and Woodsman: Have never seen Food go up having these. Did notice their usefulness in E3 when crossing swampy terrain and not being poisoned (knowing where not to step I figure hehe.) But this advantage is absent in Blades. Is the additional Food in that it gets used up slower as opposed to actually adding any? And is the usefulness only applied once from 1 character, or multiple times with howver many have it?

 

- Nimble Fingers, Magic Apt., and Stats maxxed at 20 AND items giving attributes like "Thieving," "Intelligence," or "Strength." Can you get the Nimble or Magical Apt bonus a second time from the gear with those attributes? Can Str, Dex, and Int go above 20 if wearing gear with those things? Wont show as above 20, but is it being calculated as such unseen?

Link to comment
Share on other sites

About the code overall, have read about some seemingly major bugs in the game. Like Archery skill not being checked for 'to hit' calculations.

Looking at the code, this appears to be fixed now in the OBoE version.

 

And other things like the 'Good Constitution' advantage not having the promised Disease resistance.
Good Constitution does give disease resistance, judging from the code, though perhaps it's not quite in the way you expected. It doesn't reduce the level of disease you receive, but disease wears off faster if you have Good Constitution.

 

Seems an overabundance of code monkies here I'm surprised no one's thought to do one unofficially or not. [...] Is there an unofficial patch somewhere?

Uh, have you completely missed this thread?

 

 

Link to comment
Share on other sites

Looking at the code, this appears to be fixed now in the OBoE version.

 

Good Constitution does give disease resistance, judging from the code, though perhaps it's not quite in the way you expected. It doesn't reduce the level of disease you receive, but disease wears off faster if you have Good Constitution.

 

Uh, have you completely missed this thread?

 

...What, the Alpha version of your re-work? I saw it. When you get something working you'd attach you name to let us all know. :)

Link to comment
Share on other sites

As far as I know, the "alpha version of my re-work", as you call it, works perfectly fine as far as I have been able to determine. Granted, I haven't done in-depth testing, and the scenario editor still can't save files, but I can start a game and wander around the Valley of Dying things scenario without crashing (usually), and everything seems to look as it should.

Link to comment
Share on other sites

I for one really appreciate all the time you've invested into this. As a former scenario designer, I can say I'm very thankful you and others are really moving this forward. As Slarty said, it's often a thankless job, but I am thankful and you should be proud in what you've accomplished!

Link to comment
Share on other sites

  • 1 month later...

This seems as good a thread to ask in as any: does anyone happen to know the exact success rate formula for Capture Soul?

I'm curious if scryable things such as morale and health factor into successful captures, i.e. does it actually help to beat the crap out of a monster before attempting Soul Capture? I always thought it did, but I'm not sure.

Link to comment
Share on other sites

The relevant place in the source is here.

 

Monsters that are larger than a single space, monsters that have the Splits special ability, and monsters with the Important race are immune.

 

To determine the chance of capturing, the game generates a random percentage, then multiplies by 0.7. It checks this against a reference chance based on half the monster's level (which is used as an index into an array) - the chances array is the same one used by the Charm spell and a few other effects.

 

Here's the array itself:

const short cCreature::charm_odds[21] = {90,90,85,80,78, 75,73,60,40,30, 20,10,4,1,0, 0,0,0,0,0, 0};

 

 

So, in short, the only factor is the monster's level.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...