Announcement

Collapse
No announcement yet.

DEBUG: Code Questions (Compiling, Bugs, Revision Reports, Etc)

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    Oops. I now remember being busy modifying this piece of code when getting interrupted by a RL event. I have completed the modification in revision 721, so it should be working again.

    Comment


    • #17
      Originally posted by E
      putting a
      Code:
      if (g_player[m_owner] != NULL) {
      doesn't work either. But this code used to work before 709 so I think a MSVC6++ compatibility was broken. Fortunately this crash can be avoided by having the userprofile for sectarianhappiness to be off. But this line is the same as cultureonly units and other stuff throughout the code so something is broken.
      g_player[m_owner] being NULL would make g_player[m_owner]->GetCivilisation()->GetCityStyle() crash, but there are more possibilities.
      Use the debugger to check if maybe
      • m_owner is "invalid" (e.g. PLAYER_UNASSIGNED)
      • g_player[m_owner] is OK, but GetCivilisation returns NULL

      Comment


      • #18
        Originally posted by E
        am I the only one that gets a lot of assert errors when trying to run civctp_dbg.exe? at start up it hits me with setnew.h ln 52 and then a game i get diplomat.cpp ln870
        then it may throw up other diplomat errors in line 206,207,208 or 543
        The setnew.h assert is because of MSVC6 being too old to support the C++ standard properly.
        You don't mention the circumstances for the diplomat asserts, but these could occur when disbanding in neutral territory. You prevented a crash with your update in revision 719 by not really using it, but you left in a reference to the diplomacy data of an unassigned player.

        BTW: This thread is a mess, and my replies only seem make it worse . I prefer your previous idea of having a separate (non-topped) thread per issue.

        Comment


        • #19
          Originally posted by cap601
          The errors do appear even if the AE mod is not loaded before the scenario.
          And what kind of errors appear, for instance which error messages in particular? I tested it on my setup and the Alex Scenario loaded fines both on final and debug version. And no difference between revion 717, 719 and 721.

          -Martin
          Civ2 military advisor: "No complaints, Sir!"

          Comment


          • #20
            I'm not going to do a full list as there are too many but the following databases have things missing:-
            - Icon (e.g. ICON_GOOD_ARCTIC_MOUNTAIN_THREE)
            - UnitBuildList (e.g. UNIT_BUILD_LIST_SPECIAL_SCIENTIST)
            The messages are of this form

            This is from loading the Alexander scenario immediately after running the game. Similar messages appear for the other scenarios but I believe the actual messages are different (IIRC one of them mentioned the Strategy data

            Comment


            • #21
              Well, actually Fromafar did already some compatibility fixes which actually just restored loadability, but prevented the AI from usage the improved strategies.txt. Well obviously E never included those files. Furtuantely this makes it easer to archieve real compatibility. I updated UnitBuildList.txt and uniticon.txt so that the scenario can use the default strategies.txt. However there seems still to be a little incompatibility with the AI slider setting. Obviously city growth is slowed down in the Alex scenario that causes some problems since the AI tries to set the city growth at least to a rate of one pop per 30 turns. Well this can be fixed by modifying the strategies.txt. But maybe there is another solution.

              Anyway the Nuclear Dentente scenario seems just to need an updated uniticon.txt and the Seven Smurai scenario an updated uniticon.txt as well and a modified goods.txt.

              -Martin
              Civ2 military advisor: "No complaints, Sir!"

              Comment


              • #22
                Time for another bug:-
                The Great Library entries for the different terrains show the entries for other terrains (example). There also appears to be (mucked up) entries for "bridge" and "special" which may be related.

                Comment


                • #23
                  When I get a chance I'll use this thread to be the directory for current and fixed bugs. Slowly I'll migrate these to other threads in the meantime i have a readme to work on.
                  Formerly known as "E" on Apolyton

                  See me at Civfanatics.com

                  Comment


                  • #24
                    In addition to the previous bugs I've discovered a reference to a space colony. In this case the text is that of the last page visited before this one and so changes.

                    EDIT - I've done a bit of poking around with this one. The space colony reference can be removed by:-
                    -Commenting out the line #UNIT_SPACE_CITY "Space Colony" in gl_str.txt
                    -Commenting out the line #DESCRIPTION_UNIT_SPACE_CITY "junkstring_DESCRIPTION_UNIT_SPACE_CITY" in junk_str.txt
                    -Commenting out the whole of UNIT 57 in Units.txt

                    Not sure how this would affect other languages (gl_str and junk_str are in /English but Units is in /Default

                    How would I go about submitting this?

                    Also I'm going to look into fixing the others in a similar way.

                    EDIT2 - I believe I've found the true cause. There are a series of different definitions of objects with the property GLHidden. This appears to be broken as these all appear in the GL without a correct description. Here's a list of locations for these properties. Good luck in finding where in this code this happened.
                    Last edited by cap601; April 19, 2007, 17:27.

                    Comment


                    • #25
                      this might be a cde issue with the handling of the flag GLhidden.

                      if you want to submit stuff here is the source code repository


                      but for in game text files you can upload them to apolyton and I can add them in. But hopefully martin will look into the errors IIRC he fixed this problem before
                      Formerly known as "E" on Apolyton

                      See me at Civfanatics.com

                      Comment


                      • #26
                        The text files depend on whether we want to prune out unneeded strings etc. Some should be easy to remove (e.g. Space colony) but some of the others are probably impossible (e.g. ORDER_MOVE). With a fix to GLHidden then it probably isn't worth it though it may be best for neatness sake.

                        Comment


                        • #27
                          I've prodded around in the code files and I believe the GLHidden problems are due to the file greatlibrary.cpp and specifically the function void GreatLibrary::UpdateList( DATABASE database ). In here it checks for the flag when clicking any of the side buttons and does not display the objects with the GLHidden flag (this works). However, when searching (case DATABASE_SEARCH) this is not done and the objects do appear on searches. Unfortunately I don't know where any check would go.

                          Hope that makes sense and helps.

                          Comment


                          • #28
                            Originally posted by cap601
                            In addition to the previous bugs I've discovered a reference to a space colony. In this case the text is that of the last page visited before this one and so changes.

                            EDIT - I've done a bit of poking around with this one. The space colony reference can be removed by:-
                            -Commenting out the line #UNIT_SPACE_CITY "Space Colony" in gl_str.txt
                            -Commenting out the line #DESCRIPTION_UNIT_SPACE_CITY "junkstring_DESCRIPTION_UNIT_SPACE_CITY" in junk_str.txt
                            -Commenting out the whole of UNIT 57 in Units.txt

                            Not sure how this would affect other languages (gl_str and junk_str are in /English but Units is in /Default

                            How would I go about submitting this?
                            Actually we don't want to change here anything for two reasons. First removing unit 57 from the unit databse breaks savegame compatibility and second even if we have other priorities we haven't given up to restore the space layer.

                            Originally posted by cap601
                            Some should be easy to remove (e.g. Space colony) but some of the others are probably impossible (e.g. ORDER_MOVE).
                            ORDER_MOVE is used that is the first one you can click on the order's button bank.

                            Originally posted by cap601
                            I've prodded around in the code files and I believe the GLHidden problems are due to the file greatlibrary.cpp and specifically the function void GreatLibrary::UpdateList( DATABASE database ). In here it checks for the flag when clicking any of the side buttons and does not display the objects with the GLHidden flag (this works). However, when searching (case DATABASE_SEARCH) this is not done and the objects do appear on searches. Unfortunately I don't know where any check would go.
                            That's indeed the problem.

                            -Martin
                            Civ2 military advisor: "No complaints, Sir!"

                            Comment


                            • #29
                              An old bug but if you save the game whilst a space plane is in space flight it vanishes. It still appears in the Unit Manager when you first load the file but vanishes on the next turn.

                              Comment


                              • #30
                                I've also noticed a few mistakes in the GL's text. A corrected copy is attached but I can't guarantee I've caught all of them. Any chance of adding it?
                                Attached Files

                                Comment

                                Working...
                                X