Give UP about this Shard!

Discussion in 'Renaissance Discussion' started by Daniel Cardoso, Nov 30, 2017.

  1. BlackEye

    BlackEye Well-Known Member
    UO:R Subscriber

    Joined:
    Nov 24, 2014
    Messages:
    4,917
    Likes Received:
    5,095
    Snap, how can you compare weapon dmg calculation (10 to 30) with a fail/success discussion (0 or 1)?

    Weapon damage: If you really want to have the damage concentrated around your average damage, then yes, you want some kind of gauss distribution. I have no idea, if that was era accurate, or not, but it's also not very important right now. Because I know, that the above discussion wasn't only about the dmg outcome. It was about the weird effect, that no damage is shown at all, while you hear the hit noise. This shouldn't be possible according to Telamon as there is a minimum damage higher than zero. EDIT: Maybe there is some mistake with the armor absorption...

    Success for gates: It's a 0 (fail) or 1 (success) situation. If you have 50:50 chances, you will have exactly the results that are predicted. Like 12% chance for 3 fails after each other. And to be honest, that's exactly how I experience it. I dare to say, that anything else that has been said about hit chances or cast success (that means anything that is a 0 or 1 outcome) etc is a cognitive bias or perception error: You remember negative outcomes much more likely than positive outcomes. Who remembers three succesfully cast gates for example? They aren't cast right after each other normally. You wouldn't even feel like it has been 3 gates, because they aren't cast within 30 secs. But you certainly remember your 3 fails (12% chance isn't low by the way) when you needed to escape that mobs.
    Last edited: Dec 13, 2017
    Aragorn - OCT likes this.
  2. Vandalin

    Vandalin Well-Known Member
    UO:R Donor

    Joined:
    Nov 5, 2016
    Messages:
    1,336
    Likes Received:
    1,494
    Late to the party but yes this definitely happens to me too.
  3. Erlkonig

    Erlkonig Well-Known Member

    Joined:
    Jun 14, 2015
    Messages:
    1,131
    Likes Received:
    1,165
    as far as 0 hit damage. lets see the code

    @snap dragon

    Standard Method
    Code:
    int damage = Utility.RandomMinMax( min, max );
    inside utility.cs randomminmax class is ran as:
    Code:
    return min + m_Random.Next( (max - min) + 1 );
    which returns min damage + a value equal to 0 but not greater than max-min
    this is effectively 1 dice roll

    Dice Roll Method
    inside of utility.cs
    Code:
            public static int Dice( int numDice, int numSides, int bonus )
            {
                int total = 0;
                for (int i=0;i<numDice;++i)
                    total += Random( numSides ) + 1;
                total += bonus;
                return total;
            }
    It actually uses multiple random dice rolls.

    Overall, no idea how the code is ran on ren
  4. Zapp Brannigan

    Zapp Brannigan New Member

    Joined:
    Oct 6, 2017
    Messages:
    25
    Likes Received:
    19
    No, Ive never seen that animation while killing mobs w/o a shield. But even so, shouldn't I be doing a minimum of 1 dmg?
  5. BlackEye

    BlackEye Well-Known Member
    UO:R Subscriber

    Joined:
    Nov 24, 2014
    Messages:
    4,917
    Likes Received:
    5,095
    That animation only shows up when you block something, or on the mob, when you have a effective working slayer and you hit. So if you are using a slayer, you would have an animation apart from the sound, proving that you hit (without any dmg). I guess that's why Pirul asked.
  6. snap dragon

    snap dragon Well-Known Member

    Joined:
    Oct 18, 2013
    Messages:
    1,944
    Likes Received:
    3,220
    As far as swinging with 0 damage goes, I'm not sure it's ever happen to me. Probably some more checks into armor calculations as @Silas Blackeye mentioned would be in order for that.

    I didn't bother to re-check how it works in the runuo distro because as you mentioned, there's no way to know what is going on on UOR. If I wanted to cut down on processor power, I know dumbing down the psuedo random number generation for some actions would be one of my first go-tos. It's probably fine for a false linear distributed random number scale to work for things like random item drops when you just want something to work like 1/200 chance. But for things where accurate representation of random in series is important (weapon damage, hit/miss ratio, spell casting, skill use) you probaby want it correct.

    However, I do know (from working on other projects unrelated to UO), that the .net framework System.Random glass is not suitable for sufficiently random numbers because (of course) the tables are finite.

    From the MSDN directly:


    Ultimately this is something that definitely exists, I think everyone can agree (almost everyone..). The first step in resolving it would be have developer run unit tests on the code generating the random outcomes in a manner that will do more than predict "yes the average is correct" (which is ultimately meaningless here).
  7. Smash

    Smash Well-Known Member

    Joined:
    Jan 25, 2017
    Messages:
    1,271
    Likes Received:
    852
    Telamon posted the min damage code in another thread. I think the one about parry
  8. snap dragon

    snap dragon Well-Known Member

    Joined:
    Oct 18, 2013
    Messages:
    1,944
    Likes Received:
    3,220
    Seems like I saw that. I am assuming it still uses System.Random though so it doesn't matter much.
  9. Erlkonig

    Erlkonig Well-Known Member

    Joined:
    Jun 14, 2015
    Messages:
    1,131
    Likes Received:
    1,165
    Yea but its lacking complete information for the code before and after. If I had to guess why players receive 0 damage with an on-hit sound notification its because at that point in the code damage is a double (decimal) and afterwards it is initialized as an integer. So damage could be .4, which is greater than 0 and doesn't get pushed to min damage, but afterwards it gets pushed into an integer, which rounds up or down, to 1 or 0. I haven't coded since high school 15 years ago, VB, C++, and Java, so I can be utterly wrong about that.

    This is the very last bit of code on damage where it changes into an integer:

    // pre-AOS, halve damage if the defender is a player or the attacker is not a player
    if ( defender is PlayerMobile || !( attacker is PlayerMobile ) )
    damage = (int)(damage / 2.0);
    return damage;

    The runuo distro weapon damage code is a mess. Telamon is right about that.
  10. Smash

    Smash Well-Known Member

    Joined:
    Jan 25, 2017
    Messages:
    1,271
    Likes Received:
    852
    he said it was the very last piece of coding before damage was applied which means its after it becomes an integer. i cant find the thread anymore but it was basically this.

    if damage = 0
    then damage = (min weapon damage / 2)

    all other decimals etc should be irrelevant
  11. Smash

    Smash Well-Known Member

    Joined:
    Jan 25, 2017
    Messages:
    1,271
    Likes Received:
    852
    actually - its a part of this thread

    if (AbsorbArmor == 0)
    {
    if (this is Fists)
    damage = 1;
    else
    damage = this.MinDamage / 2;
    }
    else
    damage = AbsorbArmor;

    last piece of code. this is where damage is applied
  12. PaddyOBrien

    PaddyOBrien Well-Known Member

    Joined:
    Aug 12, 2014
    Messages:
    3,254
    Likes Received:
    4,474
    I forgot how this thread went from some whiney little douche rants to a discussion on damage and weapon mechanics haha
  13. snap dragon

    snap dragon Well-Known Member

    Joined:
    Oct 18, 2013
    Messages:
    1,944
    Likes Received:
    3,220
    It's because sometimes people with valid complaints voice them in a less than mature manner. It doesn't mean their complaints aren't valid though, and those that simply rebut with an attack are equally immature.

    Equally so, sometimes people with invalid complaints voice them maturely.

Share This Page