Orc captain attacking just after game load

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ClaytonAguiar
    Scout
    • May 2009
    • 40

    Orc captain attacking just after game load

    Hi,

    I was fighting an Orc Captain with my mage. When I was almost dying (just 6 HP), I saved my game. Now, when I load this game, just after the load process, the captain attacks me, and I die.

    I think the game should start in "paused" mode. Isn't that right, or a bug? Can I still save this char?

    Vanilla official beta from rephial.org (3.1.2v2), downloaded last week. Savegame attached.

    Help, please.
    Attached Files
  • Derakon
    Prophet
    • Dec 2009
    • 9022

    #2
    Given that you can only save the game when it's your turn, this does sound like a bug; it should still be your turn when you load the game.

    Comment

    • PowerDiver
      Prophet
      • Mar 2008
      • 2820

      #3
      Originally posted by ClaytonAguiar
      I think the game should start in "paused" mode. Isn't that right, or a bug? Can I still save this char?
      Can you compile the source yourself? Then it is easy. Otherwise, you could get someone to hack the savefile so that the adjacent orc captain has less energy.

      The problem is that in an attempt to give you the first move, someone took it away. At around line 1400 in src/dungeon.c it reads

      Code:
              /* Player gets to go first */
              p_ptr->energy = 100;
      Unfortunately, you and the orc captain both have energy over 100, so that costs you the move. I think the idea of putting something like that there is a mistake, but I don't know that part of the code well enough to suggest removing it. If you could change it and recompile, you would get your turn with

      Code:
             /* Player gets to go first */
              if (p_ptr->energy < 100)
                      p_ptr->energy = 100;
      I think it is a bit more complicated for someone to fix an official release as opposed to adding the fix to the nightlies, so it may be a while before there is a 3.1.2.v3.

      Comment

      • ClaytonAguiar
        Scout
        • May 2009
        • 40

        #4
        Compilation problem

        Hi,

        I downloaded the source from the Download tab in this forum. Followed the instructions in http://rephial.org/wiki/Compiling using Dev C++ for Windows, targeting a Windows environment. I had to remove the Nintendo DS stuff, and everything seems to compile ok. But the angband.exe had no "main menu". So, I saw a "Click file menu" message and no menu at all.

        Which of the "compiling instructions" is 100% safe for the windows port using dev c++? I have to compile WITH or WITHOUT the stl references?

        Thanks in advance.

        Comment

        • ClaytonAguiar
          Scout
          • May 2009
          • 40

          #5
          MinGW ok

          Hi,

          The compilation using MinGW worked flawlessly. I think the Dev C++ issue is related to the lack of "make" support using the supplied makefile.win.

          I'm still curious how to compile angband with Dev C++. :-)

          Comment

          • PowerDiver
            Prophet
            • Mar 2008
            • 2820

            #6
            If you are having problems, I just cast teleport self and saved. Hopefully I zipped and attached it to this message.
            Attached Files

            Comment

            • ClaytonAguiar
              Scout
              • May 2009
              • 40

              #7
              Ok

              Thanks a lot.

              About this change in the code: is it necessary to open a ticket for this issue myself to add it to the nightlies? You already did it? Any other option?

              Clayton.

              Comment

              • PowerDiver
                Prophet
                • Mar 2008
                • 2820

                #8
                Originally posted by ClaytonAguiar
                About this change in the code: is it necessary to open a ticket for this issue myself to add it to the nightlies? You already did it? Any other option?
                I did open a ticket already.

                I think someone else needs to do the fix. Direct changes to p_ptr->energy should only happen in 3 places -- birth, the do an action loop, and the one game turn passes loop. The fix I suggested is wrong. The line should be removed entirely.

                Whoever put it there must have had a reason, and presumably that reason ought to be addressed some other way.

                I guess it wouldn't hurt to make the change I suggested and redo or comment the ticket, so long as a record of the need to remove it entirely remains.


                BTW - Thanks a whole lot for finding this!!! I've felt like something occasionally seemed strange on reload, but never could figure out what or where to look.

                Comment

                • Derakon
                  Prophet
                  • Dec 2009
                  • 9022

                  #9
                  Shouldn't all creature energy be saved when the game is saved? And the game can't be saved when it isn't the player's turn, right? Therefore, all creature energy should be restored properly on load, meaning it should always be the player's turn when a save is loaded.

                  Basically I'm trying to figure out why manipulating energy on load would ever be necessary.

                  Comment

                  • PowerDiver
                    Prophet
                    • Mar 2008
                    • 2820

                    #10
                    Originally posted by Derakon
                    Basically I'm trying to figure out why manipulating energy on load would ever be necessary.
                    It isn't. Someone trying to solve some other problem did something wrong, with the side effect that on load energy is reduced.

                    Comment

                    • Pete Mack
                      Prophet
                      • Apr 2007
                      • 6883

                      #11
                      It sounds like some ancient cheat to make it possible to gain a free turn after a forced save.

                      It is (or was) possible to force quit (and save) with SIG_TERM (kill -15) on Unix. This would give you a free turn if you were getting pummeled by a mob of Cloud Giants or something.

                      Comment

                      • PowerDiver
                        Prophet
                        • Mar 2008
                        • 2820

                        #12
                        Originally posted by Pete Mack
                        It sounds like some ancient cheat to make it possible to gain a free turn after a forced save.
                        That would be sneaky and clever.

                        However, I usually assume carelessness over cleverness until proven otherwise. I just looked, and energy is not set in birth.c except from wiping the player structure. I wonder if that line was just intended to make a player start a new game with 100 energy.

                        Comment

                        • Derakon
                          Prophet
                          • Dec 2009
                          • 9022

                          #13
                          It would be kind of starkly amusing to start up a new gnome mage who just happened to appear in town right next to a mercenary.

                          The Mean-looking mercenary wakes up. -more-
                          The Mean-looking mercenary hits you. -more-
                          You die.

                          Hey, just one more place to add an instadeath to the game, right?

                          Comment

                          • will_asher
                            DaJAngband Maintainer
                            • Apr 2007
                            • 1124

                            #14
                            Originally posted by Derakon
                            It would be kind of starkly amusing to start up a new gnome mage who just happened to appear in town right next to a mercenary.

                            The Mean-looking mercenary wakes up. -more-
                            The Mean-looking mercenary hits you. -more-
                            You die.

                            Hey, just one more place to add an instadeath to the game, right?
                            It would have to be a half-troll mage to wake up the mercenary that fast..
                            Will_Asher
                            aka LibraryAdventurer

                            My old variant DaJAngband:
                            http://sites.google.com/site/dajangbandwebsite/home (defunct and so old it's forked from Angband 3.1.0 -I think- but it's probably playable...)

                            Comment

                            • PowerDiver
                              Prophet
                              • Mar 2008
                              • 2820

                              #15
                              It seems that the line is working as described by the comment except on game load.

                              The question is whether you think the player should always get the first move, even if he falls through a trap door and lands next to much faster monsters. If so, then the change I suggested earlier is correct. If not, a fair amount of work needs to be done.

                              Comment

                              Working...
                              😀
                              😂
                              🥰
                              😘
                              🤢
                              😎
                              😞
                              😡
                              👍
                              👎