Author Topic: Rogue - let's beat it  (Read 283111 times)

LazyCat

  • Rogueliker
  • ***
  • Posts: 208
  • Karma: +0/-0
    • View Profile
Re: Rogue - let's beat it
« Reply #210 on: August 05, 2016, 02:27:13 AM »
@LazyCat: I think you're right about the elemental staves.  I'm going to run it through the debugger to make sure, but the fix should be online soon.  Thanks for reporting this.

Code: [Select]
.
.
            else
            if (weap->o_launch < 0)
                cp = weap->o_hurldmg;

It is puzzling to me why is there that test for o_launch being less than zero at all. Without it would work, if it was just like this:

Code: [Select]
.
.
            else
                cp = weap->o_hurldmg;

Let me know if you figure out more about it.

Lord_Mork

  • Newcomer
  • Posts: 43
  • Karma: +0/-0
    • View Profile
Re: Rogue - let's beat it
« Reply #211 on: August 05, 2016, 01:56:26 PM »
The geometry is counterintuitive, and the mechanics are very different from Rogue, but the overall gameplay has some similarities.

I think the one major uncomfortable difference between HyperRogue and others of the genre is the lack of inventory management.
You don't have to keep track of armor, weapons, scrolls, potions, rings, etcetera. Most of the items have little effect aside from unlocking new area types. The ones that do have an effect are quite cool but also don't really need to be managed. The lack of Hunger bothers me somewhat, but I guess the game is difficult enough.

Vanguard

  • Rogueliker
  • ***
  • Posts: 1112
  • Karma: +0/-0
    • View Profile
Re: Rogue - let's beat it
« Reply #212 on: August 05, 2016, 06:37:56 PM »
@LazyCat: I think you're right about the elemental staves.  I'm going to run it through the debugger to make sure, but the fix should be online soon.  Thanks for reporting this.

I know for sure I've hit with elemental staves in v4, and I'm pretty sure I've gotten them to hit in v5.  If there is a bug, and it was present in the original, I'd like to have the option to still play the game with its original balance.

Vanguard

  • Rogueliker
  • ***
  • Posts: 1112
  • Karma: +0/-0
    • View Profile
Re: Rogue - let's beat it
« Reply #213 on: August 05, 2016, 10:48:24 PM »
I just got an early wand of cold in v4 and used it to clear out a treasure room.  It hit every single time, so I think either they got nerfed in v5 (whether intentionally or unintentionally), or they have a base level of accuracy that doesn't improve as the player grows, so they're only reliable in the early game.

elwin

  • Rogueliker
  • ***
  • Posts: 96
  • Karma: +0/-0
    • View Profile
    • Roguelike Gallery
Re: Rogue - let's beat it
« Reply #214 on: August 05, 2016, 11:19:07 PM »
After spending a day digging through the tombs of long-dead source code, I have unearthed a few facts:

If an elemental bolt is working properly, it will hit a monster 50% to 80% of the time, depending only on the monster's level.

Rogue V5 contains the bug found by LazyCat, where the bolt's launcher is an uninitialized variable.  If this uninitialized value turns out to be positive, the bolt will do no damage.  The value is often the same throughout a whole game, so either the bolt always works properly, or all elemental staves are useless.  I suspect the compiler and its settings have the most influence over which happens.

This bug appears in our version of Rogue V5, but is not in PC Rogue, which makes me suspect someone introduced it at Berkeley after the original authors left.  It is definitely not intentional, and is not the behavior described in the Vade-Mecum.

There may be other bugs affecting elemental staves in other versions.

I intend to fix this.  The game will not get any easier than it often is.

Code: [Select]
.
.
            else
            if (weap->o_launch < 0)
                cp = weap->o_hurldmg;

It is puzzling to me why is there that test for o_launch being less than zero at all. Without it would work, if it was just like this:

Code: [Select]
.
.
            else
                cp = weap->o_hurldmg;

Let me know if you figure out more about it.

That test is there to rule out weapons which need a launcher that you don't have equipped.  Otherwise o_hurldmg would be used for all thrown weapons.  There would be no difference between shooting arrows with a bow and throwing them by hand unless the bow had an enchantment.
Roguelike Gallery: play Rogue online.  SSH or in browser.

LazyCat

  • Rogueliker
  • ***
  • Posts: 208
  • Karma: +0/-0
    • View Profile
Re: Rogue - let's beat it
« Reply #215 on: August 05, 2016, 11:19:55 PM »
I know for sure I've hit with elemental staves in v4, and I'm pretty sure I've gotten them to hit in v5.  If there is a bug, and it was present in the original, I'd like to have the option to still play the game with its original balance.

What is the original, Epyx version for DOS? Then perhaps you also want different ID scrolls be merged into one, to have ability to throw potions and affect monsters, to have vorpal enchant, ice monsters to shoot ice blasts? Also, I doubt very much "the original" has this bug. I'm certain Mac and Atari ST originals don't.

Unfortunately, judging by the lack of features and presence of bugs, it seems v4, v5 and whole that branch was split from the original source before the game was actually complete or properly tested. Anyway, what v4 are you talking about, where did you get it?

LazyCat

  • Rogueliker
  • ***
  • Posts: 208
  • Karma: +0/-0
    • View Profile
Re: Rogue - let's beat it
« Reply #216 on: August 05, 2016, 11:39:36 PM »
That test is there to rule out weapons which need a launcher that you don't have equipped.  Otherwise o_hurldmg would be used for all thrown weapons.  There would be no difference between shooting arrows with a bow and throwing them by hand unless the bow had an enchantment.

Quote
        if (hurl)
        {
            if ((weap->o_flags&ISMISL)
                && cur_weapon != NULL && cur_weapon->o_which == weap->o_launch)
            {
                cp = weap->o_hurldmg;
                hplus += cur_weapon->o_hplus;
                dplus += cur_weapon->o_dplus;
            }
            else
            if (weap->o_launch < 0)
                cp = weap->o_hurldmg;
        }

It looks to me the first test takes care of arrows when bow is equipped. So then for every other case I don't think there should be any test and cp would simply be initialized with the default damage.

LazyCat

  • Rogueliker
  • ***
  • Posts: 208
  • Karma: +0/-0
    • View Profile
Re: Rogue - let's beat it
« Reply #217 on: August 06, 2016, 12:27:48 AM »
Just looked at v4 source from rlgallery and indeed it doesn't have that second test:

Quote
   if (hurl)
       if ((weap->o_flags&ISMISL) && cur_weapon != NULL &&
         cur_weapon->o_which == weap->o_launch)
       {
      cp = weap->o_hurldmg;
      hplus += cur_weapon->o_hplus;
      dplus += cur_weapon->o_dplus;
       }
       else
      cp = weap->o_hurldmg;


Epyx 1.48 version handles it without additional test as well:

Quote
    cp = weap->o_damage;
    if (hurl && (weap->o_flags&ISMISL) && cur_weapon!=NULL && cur_weapon->o_which==weap->o_launch)
    {
      cp = weap->o_hurldmg;
      hplus += cur_weapon->o_hplus;
      dplus += cur_weapon->o_dplus;
    }

...but this fails to assign throwing damage for all the other cases, so instead those projectiles incorrectly deal melee damage, or so it would seem.


Also, in Epyx 1.48 missile wand has "bolt.o_hplus = 1000;" which should make them hit every time, while elemental wands have "bolt.o_hplus = 30;" that probably also makes them hit pretty much every time. In v5 they all have "bolt.o_hplus = 100;", so I think the intention was to make them hit every time, which makes sense for them being late game weapon and it's really needed to help handle late game monsters.

Now looking back at Squeeealer's victory without being able to use these very helpful wands, it was really a some kind of miracle.
« Last Edit: August 06, 2016, 12:49:24 AM by LazyCat »

LazyCat

  • Rogueliker
  • ***
  • Posts: 208
  • Karma: +0/-0
    • View Profile
Re: Rogue - let's beat it
« Reply #218 on: August 06, 2016, 02:42:40 AM »
More bugs...

This one is really funny and quite unfortunate, present in v5, v4, and also Epyx 1.48:

Quote
    /*
     * If the creature being attacked is not running (alseep or held)
     * then the attacker gets a plus four bonus to hit.
     */
    if (!on(*thdef, ISRUN))
   hplus += 4;

File "fight.c", function roll_em(). This is supposed to give the player bonus chance to hit sleeping (held) monsters, and monsters to get this bonus when player is faint or frozen/paralyzed. The funny part is that it actually gives monsters this bonus all the time, while player never gets it. Ha-ha! As if the game was not intended to be hard enough these bugs make it still much harder and super-very unfair. And that Squeeealer managed to beat it with all these bugs and against all odds, I have to say again it's some kind of miracle.

Anyhow, there are two problems. First, ISRUN flag for the player is not handled properly somewhere else in the code so effectively the player is always "fainted" and thus the monsters always get this to-hit bonus. Second, in function fight(), there is a call to function runto(), which wakes up monsters, before the dice roll, so by the time it is decided whether to give the player to-hit bonus for sleeping/held monsters they are already up and running and thus the player never gets it.
« Last Edit: August 06, 2016, 04:02:02 AM by LazyCat »

Vanguard

  • Rogueliker
  • ***
  • Posts: 1112
  • Karma: +0/-0
    • View Profile
Re: Rogue - let's beat it
« Reply #219 on: August 06, 2016, 03:07:01 AM »
What is the original, Epyx version for DOS? Then perhaps you also want different ID scrolls be merged into one, to have ability to throw potions and affect monsters, to have vorpal enchant, ice monsters to shoot ice blasts? Also, I doubt very much "the original" has this bug. I'm certain Mac and Atari ST originals don't.

Unfortunately, judging by the lack of features and presence of bugs, it seems v4, v5 and whole that branch was split from the original source before the game was actually complete or properly tested. Anyway, what v4 are you talking about, where did you get it?

The Unix version was the original, but that's not what I'm talking about.  If I play Rogue v4 I want it to be the same v4 as everyone else has been playing throughout the years.

Vanguard

  • Rogueliker
  • ***
  • Posts: 1112
  • Karma: +0/-0
    • View Profile
Re: Rogue - let's beat it
« Reply #220 on: August 06, 2016, 04:28:41 AM »
More bugs...

This one is really funny and quite unfortunate, present in v5, v4, and also Epyx 1.48

Looks like someone else noticed the same thing in another thread a few years ago.  http://forums.roguetemple.com/index.php?topic=3491.0

Vanguard

  • Rogueliker
  • ***
  • Posts: 1112
  • Karma: +0/-0
    • View Profile
Re: Rogue - let's beat it
« Reply #221 on: August 06, 2016, 05:04:49 AM »
Alright I just did some testing that seems to confirm that the bug is present in v4 but not v3 on Elwin's site.

I let level 1 enemies attack a fresh character 150 times in v3 and 52 of them hit, so that's 34.667%.  Next I took 156 attacks from level 1 enemies as fresh character in v4 and 84 of them hit, which is 53.846%.  A +4 bonus to hit is 20%, so that's exactly what I'd expect to see.

LazyCat

  • Rogueliker
  • ***
  • Posts: 208
  • Karma: +0/-0
    • View Profile
Re: Rogue - let's beat it
« Reply #222 on: August 06, 2016, 07:57:48 AM »
Alright I just did some testing that seems to confirm that the bug is present in v4 but not v3 on Elwin's site.

I let level 1 enemies attack a fresh character 150 times in v3 and 52 of them hit, so that's 34.667%.  Next I took 156 attacks from level 1 enemies as fresh character in v4 and 84 of them hit, which is 53.846%.  A +4 bonus to hit is 20%, so that's exactly what I'd expect to see.

v3 doesn't have that bonus damage code at all, so yes, that fits your observation. The bug came with v4 as soon as the bonus to-hit feature was implemented. In other words, it was not implemented properly from the start and obviously it was not tested properly, which is disappointing.

LazyCat

  • Rogueliker
  • ***
  • Posts: 208
  • Karma: +0/-0
    • View Profile
Re: Rogue - let's beat it
« Reply #223 on: August 06, 2016, 08:52:23 AM »
Looks like someone else noticed the same thing in another thread a few years ago.  http://forums.roguetemple.com/index.php?topic=3491.0

Interesting. I have to comment on what Elwin said there...


Quote from: elwin
Monsters getting a bonus is probably not a bug.

Code: [Select]
    /*
     * If the creature being attacked is not running (alseep or held)
     * then the attacker gets a plus four bonus to hit.
     */
    if (!on(*thdef, ISRUN))
hplus += 4;

If you look at the comment, it talks about: "creature", "asleep", "held". All those point that the bonus was meant to help the player against monsters primarily, and possibly not the other way around at all. The test against ISRUN flag is used a lot in the code handling monsters, but only a few times concerning the player, so I would not be surprised if whoever wrote that didn't know ISRUN flag would actually apply to the player and thus give monsters the bonus as well.

In conclusion, monsters getting the bonus when character is frozen could very well not actually be intended, but the fact monsters get this bonus all the time is almost certainly a bug, and definitively not justified as monsters were already deadly more than enough.


Quote from: elwin
The Rogue devs extensively tested the game, and I doubt they accidentally made it substantially harder than they intended.

If it was only about monsters getting the bonus, and getting it all the time, but it's even worse than that, it's about player never getting the bonus at all. Clearly that was not intention, so it seems whoever wrote that didn't really have a clue what they were doing, and however extensive the testing, it was obviously not proper.

It's not kind of thing you would normally notice through play-testing having the game employ a very wide RNG range for most outcomes. It ought to had been tested within the code itself. I tested it by simply putting a print string command that would print on the screen "bonus" if the test passed and "no bonus" if it didn't. When monsters attack it always says "bonus", and when player attacks it always says "no bonus" even when when attacking sleeping ones. As I pointed out earlier, when looking in the code it is clear why is that so.
« Last Edit: August 06, 2016, 09:02:55 AM by LazyCat »

elwin

  • Rogueliker
  • ***
  • Posts: 96
  • Karma: +0/-0
    • View Profile
    • Roguelike Gallery
Re: Rogue - let's beat it
« Reply #224 on: August 06, 2016, 12:09:35 PM »
There are two possible issues here.

1. Monsters always get a to-hit bonus when attacking the player.

If you work through the numbers in the Vade-Mecum's sections on fighting and armor, you'll see that it describes the +4 bonus.  See in particular the part about how much AC is needed to block all hits from Hobgoblins.  If the mechanics have always been that way, to the point where they're described in the Vade-Mecum, I'm not going to call it a bug.

While the authors may not always have understood why their code did what it did, a 20% increase in monster accuracy has a significant effect, one that they and their lab of playtesters would have noticed.  It may have been introduced by accident, but it remained deliberately, and became part of the balance of the game.

2. The player never gets the bonus, even when attacking a sleeping monster.

If this is happening, it is definitely a bug.
Roguelike Gallery: play Rogue online.  SSH or in browser.