Announcement

Collapse
No announcement yet.

DEBUG: Show City Production

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

  • DEBUG: Show City Production

    OK I've given up trying to debug this for now. I'm uploading the files I modified here to clean my project and maybe someone else can have a look too. It's a good feature and it makes the game a lot easier and enjoyable to play, so it's worth implementing at some point. Here's a screenshot of it.

    It freezes the game in final or final with logging builds, but I couldn't find any problems debugging it in the debug build. I guess there are some changes in tiledraw.cpp with the debug build that prevents it from freezing.

    I deleted the crash.txt that is produced after the freeze stops and the game just exits, but it was pointing to TiledMap:rawCityIcons in tiledraw.cpp. It isn't hard to replicate the crash anyway. Just compile the final or final with logging build, let the AI play for 50-75 turns, then scroll around their empire and you'll get the freeze and crash some seconds later.
    Attached Files
    Call to Power 2: Apolyton Edition - download the latest version (12th June 2011)
    CtP2 AE Wiki & Modding Reference
    One way to compile the CtP2 Source Code.

  • #2
    I can reproduce the crash. Its fine if you don't change player's though isn't it?

    Edit:I find it only happens when: You've changed to another player, you've revealed the whole map, and you've exited the cheat menu. Is it the same for you?
    Last edited by EPW; June 13, 2009, 05:09.
    "

    Comment


    • #3
      Originally posted by EPW View Post
      I can reproduce the crash. Its fine if you don't change player's though isn't it?
      I'm not sure.

      Edit:I find it only happens when: You've changed to another player, you've revealed the whole map, and you've exited the cheat menu. Is it the same for you?
      I always exited the cheat menu IIRC, so I don't know. I know it happened when I didn't reveal the whole map though.
      Call to Power 2: Apolyton Edition - download the latest version (12th June 2011)
      CtP2 AE Wiki & Modding Reference
      One way to compile the CtP2 Source Code.

      Comment


      • #4
        well, I tried my best.
        "

        Comment


        • #5
          I reverted the code, but now it won't compile!
          "

          Comment


          • #6
            What error are you getting?

            BTW I noticed some strange things when compiling with this code. For example I removed the city production icon code (but left the city name and build time in) so I could test if the icon was the problem. When I recompiled the production icon was still showing. I ended up just cleaning my solutions and recompiling them from scratch.
            Call to Power 2: Apolyton Edition - download the latest version (12th June 2011)
            CtP2 AE Wiki & Modding Reference
            One way to compile the CtP2 Source Code.

            Comment


            • #7
              I did a clean build and it worked.
              "

              Comment


              • #8
                I may have stumbled upon something relevant.

                Why did you use a different capitol "star" (file upc052.tga) than the one currently in use? (size 14x14 instead of 20x19).
                For some reason, TortoiseSVN did not revert this file with the rest on the last purge.
                When I added a capitol to a city in my scenario, the star popped up, but when I scrolled the game crashed. And I got the exact same crash.txt that I got when running the show production code.
                "

                Comment


                • #9
                  Originally posted by EPW View Post
                  I may have stumbled upon something relevant.

                  Why did you use a different capitol "star" (file upc052.tga) than the one currently in use? (size 14x14 instead of 20x19).
                  For some reason, TortoiseSVN did not revert this file with the rest on the last purge.
                  When I added a capitol to a city in my scenario, the star popped up, but when I scrolled the game crashed. And I got the exact same crash.txt that I got when running the show production code.
                  Interesting...

                  I used a new icon that removed the border around it the star. E (Ekmek) originally had it looking like the civ3 capitol star so it was bigger, then I made a smaller one for the AE, so it left a gap around the icon.

                  Do you feel like trying the code again with the previous capitol icon? (it might have to be moved slightly due to the border being put back in). I'm busy with the city sprites at the moment so I can't do it yet.
                  Call to Power 2: Apolyton Edition - download the latest version (12th June 2011)
                  CtP2 AE Wiki & Modding Reference
                  One way to compile the CtP2 Source Code.

                  Comment


                  • #10
                    I'm busy working on my scenario right now, maybe later.
                    "

                    Comment


                    • #11
                      Well I removed the new capital icon and the original crash disappeared. Now there is another. Even when "show city production" is turned off it crashes if you find the right spot to scroll over (luckily I have a save where I can replicate it every time).

                      This is the one line in crash.txt:

                      Code:
                        0x004329d4  [?DrawColorizedOverlay@TiledMap@@QAEHPAGPAVaui_Surface@@HHG@Z + 0x154]
                      I'm sure this is part of the TiledMap:rawCityIcons code, so I'm currently reverting changes I made there to get some luck.
                      Call to Power 2: Apolyton Edition - download the latest version (12th June 2011)
                      CtP2 AE Wiki & Modding Reference
                      One way to compile the CtP2 Source Code.

                      Comment


                      • #12
                        OK I've fixed the crashes, but now I've got to find a way to re implement the stuff I removed to get it working.

                        The main thing I removed was the increased height of the city name and city production icon/name/number. For some reason increasing this was causing a crash, perhaps it was going too high into another tile or something, I don't care enough to find out right now.

                        Now I either need to find another way to move the city name and the production stuff higher (so you can see the top of the city sprite), or move the production stuff above the city name, or even move the production stuff below the city sprite itself. Ideally I want it like I had it before though.

                        See attached for what it looks like now, as you can see the production stuff hides the top of the city sprite. Ignore the file injunction (hammer) icon, I will move those status icons up again so they don't overlap the production stuff, I just wanted to check it worked still. I may also re-add the larger capital and production icon for double-figure cities, if it doesn't cause problems.
                        Attached Files
                        Call to Power 2: Apolyton Edition - download the latest version (12th June 2011)
                        CtP2 AE Wiki & Modding Reference
                        One way to compile the CtP2 Source Code.

                        Comment


                        • #13
                          "

                          Comment


                          • #14
                            good job you could also set a mmax size for the city name and the production bar and center the name in there. then have all the icons there. because the problem looks like the placement is off whenever names are different sizes.
                            Formerly known as "E" on Apolyton

                            See me at Civfanatics.com

                            Comment


                            • #15
                              Originally posted by Ekmek View Post
                              good job you could also set a mmax size for the city name and the production bar and center the name in there. then have all the icons there. because the problem looks like the placement is off whenever names are different sizes.
                              The placement looks fine to me?

                              The only problem is with the capital and production icons not being wide enough left when the city is double-figures. It aligns left perfectly with single-figure sized cities.
                              Call to Power 2: Apolyton Edition - download the latest version (12th June 2011)
                              CtP2 AE Wiki & Modding Reference
                              One way to compile the CtP2 Source Code.

                              Comment

                              Working...
                              X