It seems that you're using an outdated browser. Some things may not work as they should (or don't work at all).
We suggest you upgrade newer and better browser like: Chrome, Firefox, Internet Explorer or Opera

×
avatar
pocococo: any other ideas of things that ought to be logged, but aren't?
As someone who is trying to reverse-engine and understand the game, I'd like to see details of the calculations - hits, misses, damage calcs, damage reduction calcs, etc. I'd also like to see every skill throw - lore, lockpick, search, acrobat, swim, etc.

As a player, too much information can be annoying, and also can spoil the mystery of figuring out the game for myself. So I'd recommend that you put in an option for brief/verbose messaging.
For brief mode, I'd put messages in to describe what happened without giving away numbers or calculations. Stuff like:
You swing %weapon% at %target% and miss.
You swing %weapon% at %target% and connect.
You swing %weapon% at %target% and are blocked.

I'd avoid using actual numbers, but if you want to provide more information, come up with a scale and describe it verbally instead of just printing a value, this is how the existing system works.
For example, you could do something like this:
You swing %weapon% at %target% with %accuracy%.
Then come up with a scale for accuracy and index that into string block 6, #448-455. You could do the same for damage, armor, and defense, indexing into the appropriate string indexes.
avatar
grawlixster: As someone who is trying to reverse-engine and understand the game, I'd like to see details of the calculations - hits, misses, damage calcs, damage reduction calcs, etc. I'd also like to see every skill throw - lore, lockpick, search, acrobat, swim, etc.
those formulas and algorithms can all be figured out exactly by analyzing the disassembly of the relevant code in IDA (the disassembler i use in these projects, probably what most people use to reverse-engineer old DOS games like this). as with the rest here, i'm not sure when i would have time to go through and look through these details.

there are indeed trade-offs in how much information or detail to put in front of the player.

you mentioned how the game uses textual proxies for numeric bits of info in various places. i'm now thinking it might be worthwhile to (optionally) expose all of the raw numbers in those other places / types of messages, for players who want to see the numbers rather than merely textual approximations.

i could imagine two options: one to add log messages for attacks and other damage, and another to include actual numbers in log messages.
avatar
pocococo: i could imagine two options: one to add log messages for attacks and other damage, and another to include actual numbers in log messages.
I think just having a log would be fantastic.

I remember in one forum a player tested out how much damage he received with armor "of Toughness" and armor "of Protection" and figured out that "of Toughness" actually increases the AC of the armor, and "of Protection" reduces the likelihood of the armor getting damaged. That was NOT an intuitive thing.

In addition, there also might be diminishing returns in leveling up ATT or DEF depending upon your weapon and armor. For example, it may be useless to have a DEF of above x value if you have armor of Unsurpassed Toughness on every part of your body.
avatar
bliznik: I remember in one forum a player tested out how much damage he received with armor "of Toughness" and armor "of Protection" and figured out that "of Toughness" actually increases the AC of the armor, and "of Protection" reduces the likelihood of the armor getting damaged. That was NOT an intuitive thing.
so, another useful feature might be to display the numerical attributes of weapons and armor upon inspection (perhaps again on some "show me the numbers" option).
avatar
pocococo: those formulas and algorithms can all be figured out exactly by analyzing the disassembly of the relevant code in IDA (the disassembler i use in these projects, probably what most people use to reverse-engineer old DOS games like this). as with the rest here, i'm not sure when i would have time to go through and look through these details.
I guess I should have mentioned, I'm not an actual programmer, just some guy dinking around trying to figure things out. I don't know what IDA is or how to use it, so I'm just going on what info I can find online or observe myself. If you uncover any of these functions as you are reworking the logging system and publish them somewhere, that would be super helpful.

Another number I thought about that I'd like to see - UW2 gives the skill point count but UW1 doesn't. That would be nice to have.
avatar
pocococo: you mentioned how the game uses textual proxies for numeric bits of info in various places. i'm now thinking it might be worthwhile to (optionally) expose all of the raw numbers in those other places / types of messages, for players who want to see the numbers rather than merely textual approximations.

i could imagine two options: one to add log messages for attacks and other damage, and another to include actual numbers in log messages.
Absolutely. The game provides little in the way of numbers to the player, to make the game feel more story-telling and less number-crunching. It would be nice if your feature had a textual/numerical toggle option, the player can decide what they want to see.
avatar
grawlixster: Hey wisdomelemental how far did you get into ripping those functions out? Right now I'm working to import UW1 into the GZDoom engine, I'd love to know any of the behind-the-scenes functionality you know of.
Have a look here how to disassemble UW 1/2. Is a step by step instruction. It also includes named code regions. Someone painstakingly named everything in the sourceode. https://github.com/hankmorgan/UWReverseEngineering

Also contains various extracted data formats but way too technical.

I found out a bit more for example here is stats for weapons
Weapon damage: base damage / 9 + weapon damage + weap magic dmg
Weapon attack chance: Attack / 2 + weapon skill + weap magic bonus + DEX / 7 (+ 7 if you're playing on Easy)

Each weapon has it's own damage tables based on which attack style (chop, slash, stab) and that's where some of the data like weapon damage comes from. Weapon skill is just the specific weapon type skill like Sword, Axe etc.

The way weapons work in UW is very outdated system that borrows heavily from (then) contemporay rpg. The attack chance/dodge system is no longer used in most games today for a reason. It sucks.

High DEX can potentially be game breaking since it allows you to avoid most blows and hit most of the time but otherwise useless since it doesn't affect anything else but combat. It does seem to help some skills though. Attack and Defense and specific weapon skills are most important.

The values I have above like 1.35 * Strength are in fact approimations the actual formulas use fractionals like 15 / 11 * etc. I don't actually remember now. I think is because floats are not used but only ints so all the numbers after decimals are truncated (removed)

I think I covered pretty much all the most important basics in my previous two posts though. Especially for most users.
The game actually has a bug with magic weapons/armor. I can't remember exactly but seems to be using the wrong stat like magical protection for damage and magical damage for protection. It's towards the end of all damage calculations. It uses the wrong stat. This is ocassionally mentioned in some forums that magic items seem underwhelming at times.

There is also a lot of confusion around how stats are calculated. For example some people seem to think that magic or lore factors in Vitality. It doesn't.
Post edited February 24, 2022 by wisdomelemental
avatar
wisdomelemental: I found out a bit more for example here is stats for weapons
Weapon damage: base damage / 9 + weapon damage + weap magic dmg
Weapon attack chance: Attack / 2 + weapon skill + weap magic bonus + DEX / 7 (+ 7 if you're playing on Easy)
Interesting, do you know which file you found that in?

I didn't realize that Attack, Weapon Skill, and DEX all affect weapon attack chance, but don't seem to affect weapon damage. Do you know if any of those affect base damage? I would think that STR would affect base damage, but I would also think that Attack or Weapon Skill would affect base damage as well.

Do you know what Defense affects? Does it only affect your enemy's chance to hit or does it also affect the amount of damage you can take? ...and what about magic? Can a high Defense allow you to avoid a fireball, or does it only affect your chance to receive a melee or ranged non-magic attack?

So many aspects of what the Skills in UW affect are still unknown to me.
avatar
bliznik: Interesting, do you know which file you found that in?

I didn't realize that Attack, Weapon Skill, and DEX all affect weapon attack chance, but don't seem to affect weapon damage. Do you know if any of those affect base damage? I would think that STR would affect base damage, but I would also think that Attack or Weapon Skill would affect base damage as well.

Do you know what Defense affects? Does it only affect your enemy's chance to hit or does it also affect the amount of damage you can take? ...and what about magic? Can a high Defense allow you to avoid a fireball, or does it only affect your chance to receive a melee or ranged non-magic attack?

So many aspects of what the Skills in UW affect are still unknown to me.
They are in a specific routine (function) that returns damage inside the executable. UW skills are very limited in scope. I don't think it would affect anything other than adjusting the chance to be hit downward.

The Ultima Underworld 2 Clue Book "Gems of Enlightenment" says that chance to hit is Attack / 2 + Weapon skill (which is pretty close to the formula I found in the executable listed up above). It also mentiones that chance to get hit = Defense + weapon skill / 2.

Magic is a bit unknown to me but you can use something like cheat engine to up your Defense or other stats then do tests.
Post edited March 02, 2022 by wisdomelemental
Hi, I'm looking at re-implementing the UW combat style and feel for my own game. I enjoy the "chance to hit" mechanics that are missing from modern games. Without them your character doesn't progress and become a better skilled warrior, the characters to hit skill level is capped at _your_ ability to land a hit.

anyway

some interesting notes.
The clue book also states for weapon damage: `A number approximately equal to your character's strength divided by 18 is added to your damage score.`

This matches with your findings in unarmed and armed combat base damage calculation
unarmed = (Str / 2) + 5
weapon = (Str / 2) / 9 = Str / 18
in your original formula for unarmed damage the -5 was included in the base damage calculation lookup table, but the -5 would break the Str / 18 rule for weapon damage.

One thing that is mentioned in the clue book but I have never seen a value given for is the "Power Rating"
```Each weapon also has a maximum and minimum "power" and a rate at which the power changes while you're drawing it back. The damage number for the weapon gets multiplied by the power, and this number is roughly proportional to the average value of a bell curve used to determine the probabilities of different amounts of damage.```

I also never see this "power rating" in any formula given for damage. The "swing speed" is listed as the rate at which the gem fills, but no value is ever given for how it is applied and what the target number is.

Since I'm attempting to recreate the feel of UW, the Swing and Speed mechanic is a very large part of it and I really can't find any details on them.

Just thought I'd reach out. If I ever do get details I'll pop them in here too
avatar
ibgoge: This matches with your findings in unarmed and armed combat base damage calculation
unarmed = (Str / 2) + 5
weapon = (Str / 2) / 9 = Str / 18
in your original formula for unarmed damage the -5 was included in the base damage calculation lookup table, but the -5 would break the Str / 18 rule for weapon damage.

One thing that is mentioned in the clue book but I have never seen a value given for is the "Power Rating"
```Each weapon also has a maximum and minimum "power" and a rate at which the power changes while you're drawing it back. The damage number for the weapon gets multiplied by the power, and this number is roughly proportional to the average value of a bell curve used to determine the probabilities of different amounts of damage.```
Oh you misunderstood me. Only Unarmed has that weird STR/2 base damage.

However, looking at it again STR might not factor directly in the damge.

WEAPON
npc power = value at 5 STR (for player is 0 so it set after game starts)
swing damge = (npc power / 9) * 1-9 depending on weapon position + weapon table swing type damage
this could also be interepted as (weapon damage at STR5 / 9) * 1-9 depending on weapon position + weapon damage


UNARMED
npc power = value at 5 STR and unarmed/5
swing damage = (npc power / 6 + 4) * 1-9 dependong fist position

FINAL DAMAGE (for both after swing damge is calculated above):
damage = swing damge + (npc power / 9)
but could also be
damage = swing damage + (STR / 9)

A swing has 9 positions 1-9. If you let it charge all the way you're at 9 maximum power.

Full NPC power is divided / 9 * swing position to get the base damage for Weapon but for Unarmed is different it seems to depend on STR 5 and Unarmed/5.

Originally I interpreted npc power as STR but I might be wrong. It might actually be damage at STR 5 used in the minimum calculation.
Post edited September 05, 2022 by wisdomelemental
Thanks for the clarity!

yes the "value at 5 STR" and "base damage" was confusing but I see now it's the value from the critter data, which you are correct, the player is the last critter (critter 64, index 63) and the stats are loaded from the save file at launch.

I've been going through `hankmorgan`s repos, thank you for pointing me to this goldmine!

I see he calculates charge a little differently, not just a linear 1-9 but also using the "maximum and minimum "power"" described in the handbook.
I can't post links but you can find it here UnityScripts/scripts/Combat/UWCombat.cs#L541

This means if you fully charge your weapon you have the potential to do more than the value listed in the books. Quite a bit more in some cases.

Using these details I built something to extract these values and calculate the max potential weapon damage and weapon dps. there is some interesting stuff here.

I'm trying to find a way to publish the tool but for now here are the details for three weapons, the jeweled variants.

name... slash... bash... stab... min charge... speed... max charge... skill... durability... seconds to charge... max slash... max bash... max stab... slash dps... bash dps... stab dps...
a_jeweled_axe 13 8 5 75 8 200 4 255 1.25 33 20 12 16.00 26.40 9.60
a_jeweled_sword 14 7 11 70 11 190 3 255 0.91 33 16 26 17.60 36.30 28.60
a_jeweled_mace 9 17 5 65 6 220 5 255 1.67 26 49 14 29.40 15.60 8.40

this is purely weapon damage, not taking into account NPC Power / STR

there doesn't seem to be any formatting options or previewing so I have no idea how that chart is going to turn out, hopefully its somehow readable :\

hopefully you can see how the mace with the potentially heaviest single hit (without magic) still lags quite a bit behind the sword. and the axe is even far far worse. I would have made the jeweled axe have the speed of the regular axe to make it worth using. it even has a sprite that looks closer to the regular axe more than the battle axe...
This person figured much of the combat calculations
https://github.com/hankmorgan/UnderworldExporter/blob/master/UnityScripts/scripts/Combat/UWCombat.cs

Has PC hits NPC,NPC hits PC and NPC hits NPC which is a very simple calculation.

Some of the calcualtions I said are a bit better presented there but here is rundown of the most basic.

Attack Roll = (Attack Skill / 2) + Weapon Skill + (Dexterity / 7) + Magic Bonus + Flanking Bonus + Accuracy Bonus
Base Damage = Base Swing Damage + Weapon Bonus Damage + Player's Strength (or modified for unarmed)
Final Damage = Dice Rolls of Base Damage + Extra Damage from Charge + Flanking Bonus

Attack Roll is unknown to me how is being used. Notice how Dexterity is not that useful in calculation. In fact it seems Strength is most op attribute.

Seems everything is based on d6 dice. The range of everything seems to be 0-30 or 12-30. So perhaps Attack Roll is similarly based on this range so in this case a roll of say 30 or higher means 100% success

The most interesting aspect is how Damage is rolled. You roll x number of d6 equal to your total base damage/6 + 1-remainder. For example 35 damage is same as 5d6 + 1d5 which gives a min-max of 6-35. After armor and reduction the game guarantees minimum damage of 2. Also notice how player's Strength is important to the damage.

Attributes can be minimum 12 and maximum 30. The roll would have to be 2d10+10 for the first attribute. For the second attribute it would be 12 to (60-first attribute-12). For example if you roll 30 first time then second can be 12-18. The third attribute is whatever is left up to 60. All stats need to add up to 60.
Post edited September 09, 2023 by wisdomelemental