04 Dec, 2008, David Haley wrote in the 21st comment:
Votes: 0
quixadhal said:
while we roll a random number from 0 to 31, try again if it's less than 20.

Actually it's the other way around… :wink: It stops when it finds something smaller than 20.

quixadhal said:
Had they actually followed the AD&D 2nd edition rules, the code would have special cases since a natural 20 is always a hit, and a natural 1 is always a miss.

They do have those special cases, just for 0 and 19, not 1 and 20.
05 Dec, 2008, Sharmair wrote in the 22nd comment:
Votes: 0
quixadhal said:
tphegley said:
So what about this:

while ((diceroll = number_bits (5)) >= 20);


***EDIT***
That seems to be the case. I don't know why I've never went through my one_hit before. It's making more since now.


Please, do tell me how that line makes sense! It's EVIL!!!!!

while we roll a random number from 0 to 31, try again if it's less than 20.

How about instead we just roll 1d12+19? Please? No semi-deterministic while loops?


My best guess as to why they did it this way was that they thought the bit based random was faster.
They probably thought it would be better in the long run even it they had to reroll some of the time.
In the older CPUs, multiply and divide were quite expensive, some times on the order of 100 times
the cycles of an add, subtract or bit shift.
05 Dec, 2008, David Haley wrote in the 23rd comment:
Votes: 0
My bet is that somebody thought that but didn't do their homework to see if it actually made any difference. Even if it's 100 times slower, you'd have to be doing quite a lot of it before it started mattering. We're (probably) not talking about CPUs from the 80's after all.
05 Dec, 2008, Scandum wrote in the 24th comment:
Votes: 0
Tyche said:
elanthis said:
Then I'd like to know where the author of said language lives, and where the hardware store nearest to his house is.


Elanthis' silver hammer went down upon said language author's head.
Elanthis' silver hammer made sure that he was dead.

Would that make it a dead language?
05 Dec, 2008, elanthis wrote in the 25th comment:
Votes: 0
DavidHaley said:
I believe that armor should have both a deflection value and an absorption value. Don't have much time to go into it at the moment, but I think it's a fairly realistic depiction of what armor actually does


Oh boy, my favorite pet peeve armor argument. :)

Absorption does not depict what armor does at all. Armor deflects and stops damage, period. If it doesn't, the armor is ineffective.

First, you do not swing a sword like a baseball bat. Sword blows simply are not made with that level of force. Any swordsman who tried to make a big and wide enough swing to break armor in a single swing is going to both coreograph his attack to his opponent (which means his opponent could have a block in place before the attacker is even done drawing his weapon back) and possibly give his opponent enough time to strike first. The movies love to show warriors slicing opponents in half, but then, they also love to show men in full plate armor getting killed from a single sword swing. If combat worked anything like it does in the movies, one would have to wonder why armor was ever invented in the first place. Watch a true hand-to-hand martial artist. Look at how he fights. He doesn't swing his arms, he doesn't flail his body around. He attacks are swift, direct, focused, and tight. Take those exact same motions, but imagine he has a sword in his hand. That's how sword combat works. Even with great swords, katanas, and other large weapons – combatants don't make huge swings with steel-shattering strength. A little known fact with katanas, for example, is that the fast majority of contact comes from the 3 inches of the blade nearest the handle. Long sword fighting is about getting the blade in contact with your opponent, and then drawing the sword across him, cutting him deeply. It is NOT about getting a ton of leverage to make a giant swing that slices through steel and bone in one hit.

Second, armor is shaped and contoured to make a sword strike glance away from the body. It very literally attempts to deflect the shot rather than absorb it whenever possible. Look at any real armor (not the stupid fantasy crap game artists use). Notice how most breast plates have a vertical ridge down the center. Or how most helmets after the Crusades had an "onion" shape giving them a point or ridge at the top. Notice the v-shape guard most breast plates have just under the neck, or the flanges at the elbows and knees. See how the armor is all curves and not flat lines. These protect the wearer in very special ways. The ridges cause even most solid sword strike to glance away from the body, redirecting the force of the hit outward. Other ridges act as guards to stop glancing blows from sliding into seams. The later period armor rarely even had open seems, and very early period plate armor was always meant to be worn with either a full chain hauberk underneath or to be worn with a gambeson that had patches of chain sewn on areas not covered by the plate armor itself.

Third, the gambeson that you really do -need- to wear under the plate (you really don't want to experience plate armor on bare skin or thin cloth garmnets… the chaffing will kill you before your enemy ever does) does provide a cushion, especially in the few areas of the body where the plate armor is braced against the wearer. Those mostly exist at the shoulders, upper thighs, and elbows. The plate in those areas is still designed to deflect hits, but the shock of the hits can be passed through. Any even remotely decent gambeson is going to negate that entirely. Believe me two things: when I participate in combat, I come home bruised, sored, and often limping; and the only times I ever gain bruises are when I get hit in an unarmored location (back the legs and the butt, usually).

Maille armor is a bit of a different story, but I don't believe absorption represents it well, either. Maille is still intended to be worn over thick garments, but yes, you can get a good deal of bruising with it. Its purpose is to stop a sword from slicing, and the garments underneath are meant to reduce the shock of the hit. In general, though, it's pretty black and white. Either the hit was a slice and the armor effectively stops all real damage, or the hit was piercing (usually from a spear) and you're dead. Maille is not as likely to break apart when hit as many seem to think. The kind of maille that most people have seen – the cheap crap the losers at Renaissance faires and the like wear – is nothing like historical armor. The stage actor crap is usually made of butted rings made from round wire, while real maille was usually made of flattened rings riveted together. The flattening actually makes them a little stronger, and the riveting obviously holds the rings together better than butted rings. My first armor ever was a butted maille shirt. It fell apart without even getting into real combat (I LARPed in those days… yes, I feel the burning agony of shame). My current hauberk, before I got too fat to fit in it and my gambeson at the same time (yes, I feel the burning agony shame), lasted three years including two years of heavy combat and only lost 5 rings, all in the right armpit (a high stress point when the armpit isn't weaved a particular way).

Leather armor is a farce. It really wasn't actually used much at all outside of primitive times. Quite simply, leather armor is worthless against any kind of real weapon. I've been hit by a "killing blow" shot with a rattan weapon in body part covered only by leather. The bruise was as long and wide as my forearm, swelled out almost half an inch, and took a month to fully fade away. Had that been live steel, I'd only have 3 limbs right now. Leather armor doesn't absorb hits, either, unless those hits happen to be thrown stones, light sticks, and punches. The only kind of leather armor used during the age of metal weaponry would be things like llamelar, like brigandine or a coat of plates. That is, heavy cloth or leather that has some kind of actually protective metal sewn into or onto it. A properly made llamelar will stop a sword hit just as well as good plate armor, assuming the sword doesn't slide into a seem or the strike didn't just happen to hit a gap.

Certain weapons do negate certain kinds of armor. A solid sword thrust or spear thrust is going to punch through maille like it wasn't there, and with enough force it would do the same to lower grade (thinner) plate armor. Arrows pierce just about anything; a modern compound bow can punch through an engine block, and historical bows could easily punch through 18ga steel at a respectable range. Some weapons of war were designed solely for piercing armored knights, such as a footman's mace. Large heads with spikes or flanges, they were basically the combat version of a metal punch.

Some weapons just never existed. The fantasy warhammers that dwarves in every game seem to love never, ever existed. No man could realistically fight with one of those things. Real military hammers and military axes existed almost exclusively in the form of specialized spear heads. Their shape was made more for the use of controlling opponents than actually causing direct damage. I may be wrong, but I think these evolved from the crossguards on early spear heads. While there were some polearms that did feature rather vicious-looking axe heads, most of those were phased out by the time armor become a battlefield norm.

If you want realistic armor, don't add in absorption. Add in durability. Real armor deflects most of a strike, and what little shock there is to absorb is more than handled by the rest of the attire a properly armored man would be wearing. Real armor can and does eventually break after it gets enough abuse, though; what does not bend eventually snaps, after all, and neither iron nor steel are known for their flexibility. (I don't think medieval armor smiths had access to spring steel, sadly.)

I have never once seem a bruise result from a hit to a properly armored location. I have however seen high grade stainless steel shatter after enough solid, repetitive hits. A year months ago I watched as the left thigh of my friend's $1600 leg harness shatter into three pieces while he was endurance training for a tournament. He was a good sport about it, but oh man… that was some truly beautiful armor. My old cheapo leg harness also shattered the last time I wore it. Still waiting for the new legs I ordered to come in. (Armorers are notoriously slow… it was supposed to be done in May, but I probably won't see it until February… and I won't be surprised if it doesn't fit and I end up having to Ebay it, like the set of arms I just got in a month ago.) It's worth noting that both of those pieces of armor only broke because they had been hit over and over and over in the same areas for hours a day for very many days. My armor had some extra stress applied because the legs were made just slightly longer than they should've been for my body, so fighting on my knees put a huge amount of tension into the thighs and stressed the rivets in the knee articulation, so it lasted for a lot less time than it should have had it fit me perfectly. (That's another slight pet peeve with fantasy games… the idea that you can just pick up armor from some dead body or buy it off a smith's store shelves and have it actually fit.)

The only cases of injury even when proper armor is used that I have ever even heard of would be finger and hand fractures. Weapons without guards leave the hands very open, and the gloves inside of gauntlets don't pad the hands nearly so well as a gambeson does. The same friend I mentioned above has broken several of his fingers of the years, including one about two years ago I witnessed when he was doing polearm exercises with a regional spear champion. He was wearing very high quality stainless steel fingered gauntlets (the match to those same legs above), and a hit to his hand jammed his finger hard enough to fracture it. Had he been wearing clamshell gauntlets he likely would not have suffered that injury, but clamshell gauntlets just don't look as nice. ;) (He – like I – is an armor whore. No point wearing it if you aren't going to look damn good in it.)

My final argument against absorption is that even if a combatant does sustain a bruise or even a minor fracture due to the shock of a strike, you really just don't notice it. I've been in a lot of heavy combat fighting, but I've never been in a fight to the death. Just the same, once the adrenaline takes hold, you don't feel anything. It's actually a problem in some of the bigger tournaments, because the fighters sometimes fail to acknowledge legal strikes because they literally don't feel it. The friend who fractured his finger didn't even have a clue he had taken an injury until he went to pull the gauntlet off. (It's also worth noting that you could break most of your fingers and still be able to hold and swing a sword… break your elbow, though, and you're screwed.) SWAT members and police know this all too well, too; in a gun fight, it's not all that uncommon for a man to take a very serious gunshot wound but keep on firing back because his brain doesn't even register the wound until the adrenaline wears off. That's why killing blows in gunfights are so important – your shot either kills him and takes him out of the fight, or it doesn't kill him and he stays in the fight. The same applies to hand-to-hand weapons – the attack kills him and he's done, or it doesn't and he keeps fighting.

If you take a truly abstract approach to Hit Points (as they were actually intended to be taken), then maybe you could make a reasonable case for absorption. The usual spiel about abstract Hit Points is that they represent an action hero in the movies: he never actually gets shot, but he gets worn down, until eventually his luck runs out and he takes a serious bullet wound. It essentially is just a luck buffer, really, protecting the player from a single lucky enemy attack. If Hit Point loss represents a combination of fatigue, -very- minor wounds, and used up luck, then it may be realistic (within the abstract terms) to say that armor preserves Hit Points. The only game system I know of off the top of my head that works this way is Warhammer Fantasy Roleplay. In that system, your Wounds (HP) measure very minor bruises, fatigue, and even armor damage. Once a character is reduced to zero Wounds, he does not immediately die or fall unconscious – he hasn't technically taken any real damage, after all. Once he is at zero Wounds, every strike then counts as a Critical Hit, which has very real and serious consequences… die penalties, stunning, disablement, dismemberment, severe bleeding, death, and spectacularly over-the-top death. :)

All of that aside, there is nothing wrong with making an armor system that absorbs damage. It's just a game, after all. The one and only thing that matters is that the game be fun. Just, please, don't claim that damage absorption is realistic. :)
05 Dec, 2008, Sharmair wrote in the 26th comment:
Votes: 0
DavidHaley said:
My bet is that somebody thought that but didn't do their homework to see if it actually made any difference. Even if it's 100 times slower, you'd have to be doing quite a lot of it before it started mattering. We're (probably) not talking about CPUs from the 80's after all.


I am pretty sure this goes back to diku, and the coders might have still had a mind set from the 80's. But
I do agree, even if the use of these randoms were at a rate that the micro difference would matter, I
think the time in the random generator itself (the core random generator that gives the raw seed) would
take much more of the time then the bit masking done at the number_bits() level.
05 Dec, 2008, Lobotomy wrote in the 27th comment:
Votes: 0
Great post, elanthis. I'm not at all part of this conversation, but I very much enjoyed reading all of that spiffy, detailed information. :smile:
05 Dec, 2008, quixadhal wrote in the 28th comment:
Votes: 0
Great posting elanthis, and I couldn't agree more. :)

Personally, I don't like the ever-increasing hit point system that tries to lump the character skill into the equation by increasing your health with levels, rather than just making you harder to hit. However, nobody likes a game where 90% of the blows are misses, and if you're going to have "hit points", then "absorption" is a good enough model for blows that got deflected away, I suppose.

I do think durability is important. My old diku had durability for every item, and the gold plate mail our city guards wore was awesome defense for about one or two fights, then it cost so much to repair that it wasn't worth it. There's also something to be said for having equipment get scrapped during a fight because you got hit by a fireball and, duh!, all your cloth and half your leather took fire damage.
05 Dec, 2008, David Haley wrote in the 29th comment:
Votes: 0
I think you said several times that armor does in fact contribute to absorbing some of the damage done, for instance by bruising or fracturing the combatant. Arguing about whether or not you "feel it" is kind of silly IMO when we're talking about characters that are perfectly fine for all HP values greater than zero, and dead when HP is equal to zero. :wink: When you start with the premise that we're talking about characters with hit points, who sustain no fractures or any such thing, I do indeed believe that a combination of damage negation and damage absorption is quite representative of what armor does for you. I suppose that I find it hard (if not almost nonsensical) to talk about "full reality" when we're already in the premise of a world with highly altered physics, but in the context of those physics, I do not believe it makes sense at all for a hit to either fully connect or fully miss. Hence my desire to see deflection and absorption.
05 Dec, 2008, David Haley wrote in the 30th comment:
Votes: 0
To clarify: I'm not saying that you are wrong about how things work in the real world. Actually, I agree. What I'm saying is that real world arguments aren't necessarily relevant in a game world that already applies its own physics; however, in the context of those physics, some things are more realistic than others – again, in the context of the modified physics.
05 Dec, 2008, elanthis wrote in the 31st comment:
Votes: 0
DavidHaley said:
To clarify: I'm not saying that you are wrong about how things work in the real world. Actually, I agree. What I'm saying is that real world arguments aren't necessarily relevant in a game world that already applies its own physics; however, in the context of those physics, some things are more realistic than others – again, in the context of the modified physics.


Hey, you just said "realistic" the first time. :p It's just a game, do it however you like, so long as it's fun for the players. That's all that matters. Just don't use "realism" as a bullet point in favor of that approach, k? I -will- rant and rave about this more if I have to. ;)

quixadhal said:
However, nobody likes a game where 90% of the blows are misses, and if you're going to have "hit points", then "absorption" is a good enough model for blows that got deflected away, I suppose.


Oh no, I fully agree. I mean, seriously, watching a real sword fight is 10 minutes boredom, .6 seconds cool action. Excessive obedience to Realism sucks in games. Show me a truly realistic game, and I'll show you a throng of players ready to burn down your house because their 50th level character just died from a ruptured bladder because they forgot to type in the "urinate" command within 18 hours of the last potion they drank. Imagine if Nethack did that. You'd be voyaging down into the dungeon and run into the tombstone of one of your previous characters. "Here lies Grognack, who died of dehydration-induced constipation, for he ate too many slime molds and drank not enough water."

I can just see the leader boards on Realism MUD:

Elanthis [M] (Rogue) L.32 [deceased: choked on piece of cheese]
Catherine [F] (Scientist) L.31 [deceased: died during childbirth]
Elanthis [M] (Baker) L.30 [deceased: food poisoning]
Elanthis [M] (Fighter) L.27 [deceased: Syphilis]
Elanthis [M] (Ranger) L.27 [deceased: lucky critical hit by lame goblin elder]
Elanthis [M] (Fighter) L.27 [deceased: Malaria]
Elanthis [M] (Wizard) L.26 [deceased: Malaria]
Elanthis [M] (Rogue) L.25 [deceased: Malaria]
Tyche [M] (Guru) L.25 [deceased: blood pressure]
Elanthis [M] (Fighter) L.22 [deceased: Malaria]
Elanthis [M] (Priest) L.20 [deceased: fell off cart, broke neck]
Elanthis [M] (Rogue) L.17 [deceased: stabbed by orc… and Malaria]
05 Dec, 2008, David Haley wrote in the 32nd comment:
Votes: 0
elanthis said:
Hey, you just said "realistic" the first time. :p It's just a game, do it however you like, so long as it's fun for the players. That's all that matters. Just don't use "realism" as a bullet point in favor of that approach, k? I -will- rant and rave about this more if I have to. ;)

As I said I'm not trying to talk about real world realism, but realism in the sense of a coherent set of physics. It's just that it doesn't make much sense to mix real world physics with game world physics and expect something intelligible to come out. :wink: (You can substitute "realism" for "believability" or "consistency" if you prefer those words.) We could talk about "realism" in a game system's magic, and I think it would be clear that nobody actually thinks we're talking about real-world magic, no? (E.g., the SW "force" has quite a few rules, and some things would not be realistic at all in that context.)
05 Dec, 2008, elanthis wrote in the 33rd comment:
Votes: 0
You take everything I say _way_ too seriously, dude. :)
05 Dec, 2008, David Haley wrote in the 34th comment:
Votes: 0
Eh, blame it on me being up way too late due to not having been able to sleep since Sunday. :smile:
05 Dec, 2008, quixadhal wrote in the 35th comment:
Votes: 0
elanthis said:
Elanthis [M] (Rogue) L.25 [deceased: Malaria]
Tyche [M] (Guru) L.25 [deceased: blood pressure]
Elanthis [M] (Fighter) L.22 [deceased: Malaria]
Elanthis [M] (Priest) L.20 [deceased: fell off cart, broke neck]

Quixadhal [M] (Tourist) L.12 [deceased: Heart Attack, induced by bacon]
20.0/35