Announcement

Collapse
No announcement yet.

E's Source Code attempts

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

  • Originally posted by E
    and it seems that its the same crash
    Code:
      0x004cb9c0  [?KillUnitsOverBudget@MilitaryReadiness@@QAEXJAAV?$DynamicArray@VArmy@@@@J@Z + 0x340]
      0x004841b4  [??0BattleEvent@@QAE@XZ + 0x4]
      0x00501eb3  [?SaveAdvances@MapFile@@QAE_NPAU_iobuf@@@Z + 0x1c3]
      0x00482e1b  [?armyevent_Initialize@@YAXXZ + 0x1eb]
      0x00482eb3  [?armyevent_Initialize@@YAXXZ + 0x283]
      0x0084085d  [?g_const_token_data@@3PAUTokenData@@A + 0xc0c5]
      0x005ba5af  [?Serialize@UnitRecord@@QAEXAAVCivArchive@@@Z + 0x49f]
      0x005ba546  [?Serialize@UnitRecord@@QAEXAAVCivArchive@@@Z + 0x436]
      0x005bb20a  [?Serialize@UnitRecord@@QAEXAAVCivArchive@@@Z + 0x10fa]
      0x005b8e64  [?ResolveDBReferences@TerrainRecord@@QAEXXZ + 0xa4]
      0x005bb068  [?Serialize@UnitRecord@@QAEXAAVCivArchive@@@Z + 0xf58]
      0x005bb00b  [?Serialize@UnitRecord@@QAEXAAVCivArchive@@@Z + 0xefb]
      0x0040efe1  [??0ActorPath@@QAE@JJJJ@Z + 0x51]
      0x00407db0  [?InitializeAppDB@CivApp@@QAEJAAVCivArchive@@@Z + 0xa0]
      0x00407827  [?New@?$tech_Memory@ULink@?$tech_WLList@PAD@@@@QAEPAULink@?$tech_WLList@PAD@@XZ + 0x7]
      0x008adf5c  [?g_mapTokenData@@3PAUTokenData@@A + 0x19564]
      0x7c816d4f  [__onexitbegin + 0x7bd591b7]
    should I try what ctp2linuxfan suggested? or am I missing something?
    E, do you use the debug version for testing? The debug version should delete any files in the log folder, including any crasht.txts. The debug version generates a log files with a lot of bits of information about the game including call stacks in the case of asserts and exceptions.

    Look at these call stacks. And of course ctp2linuxfan's idea should be considerated when you got the debug version running and you still have no idea.

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

    Comment


    • How do I get a debug version? do I have to compile a debug version or is there some setting?

      If I do ctp2linuxfan's suggestion, is it just renaming it, because I havent seen how events are called. when I do a search they don't come up.

      Also I've been figuring out the diplomacy ldl when I reach point I don't understand in this hidden nationality code. Pretty soon I'll have a few questions about splitting te tabs into listboxes and putting treaties in both.
      Formerly known as "E" on Apolyton

      See me at Civfanatics.com

      Comment


      • Originally posted by E
        How do I get a debug version? do I have to compile a debug version or is there some setting?
        I thought so that you would have this question sooner or later.

        Unfortunately I don't have VS6 here and VS.NET is a little bit diffrent. Somewere in the menu there is a an option to set the current configuration and there is something to manage your configuration (add, modify, etc.). I know this can be a little bit confusing, especially as you can only select from the configuartion setting menu the configuartion.

        There you select the debug configuration and then you conpile the whole code again. The compile progress report will start then stating that you are compiling the debug version and not the final version.

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

        Comment


        • In MSVC6, go to the Build menu, and select "Set Active Configuration". You should get a pop-up window, on which you have to select the "ctp2 - Win32 Debug" configuration.
          Don't forget to reset the configuration to "ctp2 - Win32 Final" when you are generating a (faster/optimised) version for distribution.

          Comment


          • Thanks Martin and Fromafar,

            I made the debug and tried out my code and
            when I attacked with my Sneak Attack(SA) pirateship versus a defender's stack of a galley (non-SA) and a defender's pirate ship (is SA) I got a gameobj.cpp error

            it said no such ID 805306348

            then ctd


            I have no idea what this means, i go this from civ3log.txt it looks like the relevant part:



            Code:
                   Unit.cpp@178 : Unit::RemoveAllReferences: id: 268435476     Player.cpp@1438: Player::RemoveUnitReference(10000014, 2)
                ObjPool.cpp@175 : ObjPool: Deleting object id d0000014
                ObjPool.cpp@175 : ObjPool: Deleting object id 10000014
                   Unit.cpp@178 : Unit::RemoveAllReferences: id: 268435477     Player.cpp@1438: Player::RemoveUnitReference(10000015, 2)
                ObjPool.cpp@175 : ObjPool: Deleting object id d0000015
                ObjPool.cpp@175 : ObjPool: Deleting object id 10000015
                GameObj.cpp@124 : No such id d0000014
               c3errors.cpp@183 : Error: GameObj.cpp Error, No such id -805306348
                c3debug.cpp@320 : Assertion (FALSE) Failed in File:F:\SVN-Code\trunk\ctp2_code\ctp\ctp2_utils\c3errors.cpp, Line:59
                c3debug.cpp@323 : Stack Trace: '  0x00457070  [(unknown) + 0x0]
            Formerly known as "E" on Apolyton

            See me at Civfanatics.com

            Comment


            • Originally posted by E
              I have no idea what this means, i go this from civ3log.txt it looks like the relevant part:
              [/code]
              No, this isn't the relevant part at least not of it. The stack trace below the Assertion (FALSE) is the relevant part.

              But what is this:

              Code:
              c3debug.cpp@323 : Stack Trace: '  0x00457070  [(unknown) + 0x0]
              Why is the stack trace unknown? What did you do with the *.exe?

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

              Comment


              • Originally posted by Martin Gühmann


                No, this isn't the relevant part at least not of it. The stack trace below the Assertion (FALSE) is the relevant part.

                But what is this:

                Code:
                c3debug.cpp@323 : Stack Trace: '  0x00457070  [(unknown) + 0x0]
                Why is the stack trace unknown? What did you do with the *.exe?

                -Martin
                the only thing i did with the exe is open the ctp2 debug.exe. I did not use a final ctp2. maybe it became unknown because it basically crashed, well it minimized and then had the endobj,cpp error.
                Formerly known as "E" on Apolyton

                See me at Civfanatics.com

                Comment


                • I suspect that
                  Code:
                  GameObj.cpp@124 : No such id d0000014
                  might be an indicator of your problem.

                  Comment


                  • Thanks J,

                    do you know what that means though? the unit id? is it the sneak attack flag? i'm not sure how to read this data...
                    Formerly known as "E" on Apolyton

                    See me at Civfanatics.com

                    Comment


                    • Code:
                      Unit.cpp@178 : Unit::RemoveAllReferences: id: 268435476     
                      Player.cpp@1438: Player::RemoveUnitReference(10000014, 2)
                      ObjPool.cpp@175 : ObjPool: Deleting object id d0000014
                      ObjPool.cpp@175 : ObjPool: Deleting object id 10000014
                      tells you that the unit labelled "d0000014" has been removed from the game.

                      Code:
                      GameObj.cpp@124 : No such id d0000014
                      c3errors.cpp@183 : Error: GameObj.cpp Error, No such id -805306348
                      means that you are trying to do something with this unit after it has been removed.

                      This is a common error. You will get this lots of times in "post-action" Slic and game event handlers. In these cases, you have to verify that the unit is still valid, because it may have been killed in a battle.

                      Comment


                      • thanks fromafar,

                        i guess my next question would be how do i fix that. i guess my sneak attack code is trying to send a message after the defenders are beaten in a stack, or is trying to do a stack check. I think I might have to try something from the civilian code above aftermath

                        Code:
                        	if (u.GetDBRec()->GetCivilian() == true) {
                        		if (not_at_war &&
                        			army.Num() == 1
                        but i'm not sure that will sove the stack issue. all I wantt o do is have it declare war if a defenders stack has one SA unit and one non-SA unit...
                        Formerly known as "E" on Apolyton

                        See me at Civfanatics.com

                        Comment


                        • Originally posted by E
                          the only thing i did with the exe is open the ctp2 debug.exe. I did not use a final ctp2. maybe it became unknown because it basically crashed, well it minimized and then had the endobj,cpp error.
                          My suspicion is that you moved the executable from its creation directory to some other location. That would explain why the crash.txt you posted contains nonsense. And of course it also explains the stack trace with unknown methods/functions. And by the way before I can give you more advice, you have to fix the problem with the stack trace first.

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

                          Comment


                          • when I compile an exe it compiles into my SVN/ctp folder thenI move it to one of my ctp2 game folders and I execute it from there. I've played may games this way. should I compile it so it appears in the game folder then?
                            Formerly known as "E" on Apolyton

                            See me at Civfanatics.com

                            Comment


                            • No, moving the exe is OK. Just make sure that you move the map file to the same place. I guess you now have a map file of an older version there, which causes your crash logs to become useless.

                              In cases where you can not be sure of the unit validity, you have to check it before accessing it. Something like:
                              Code:
                              if (u.IsValid())
                              {
                                  // Now you know that the unit is valid.
                                  if (u.GetDBRec()->GetCivilian())
                                  [...]
                              }

                              Comment


                              • Originally posted by E
                                when I compile an exe it compiles into my SVN/ctp folder thenI move it to one of my ctp2 game folders and I execute it from there. I've played may games this way. should I compile it so it appears in the game folder then?
                                And that's the problem. Well Fromafar is right about that it is sufficient to move the executable with the map file, but however this methods bears some disadvantages.

                                First thing is that you have to copy always the the executable and the map file to the other directory whenever you compile the program. And that holds also for all the text files you get from the repository. Of course except if the ctp2_data directory you use is part of your working copy. You can always forget to copy something.

                                Second you can't run the game from the IDE, it is so simple if you do just press Ctrl+F5 and the game is compiled and run. Just two keys.

                                And with this setup you can't use the debugger, at least I don't know how, but certainly you can't just press F5.

                                So it is better to to copy all the art, sound and text files that aren't already part of your working copy to your working copy and run the game from your working copy.

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

                                Comment

                                Working...
                                X