Announcement

Collapse
No announcement yet.

DEBUG: Pbem?

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

  • DEBUG: Pbem?

    Has anyone found any references to it yet? Particularly why the turn doesnt end.
    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
    PBEM was the next thing I was planning to attack. If you could provide precise details of the problem, it would help .

    Comment


    • #3
      OK, IIRC its when you end turn it goes to the black screen and asks to close or exit (i think) and saves the turn to desktop, this is all normal, but when youve played all turns of all players and it goes back to player 1's turn, the turn still says "Turn 0" and all production/science/food whatever hasnt been collected and all player moves moved in the last turn are still exhausted, basically the turn hasnt ended but it goes around the player order.
      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
        And human to human diplomacy. If you could have that done by lunch time tommorow, that would be great. Thanks

        Comment


        • #5
          Well, I think I've found the source of the problem, at least.

          Essentially, in CTP1 the dialog asking you to forward the turn didn't pop up until after the next players turn had already begun, and all his start-of-turn stuff had been processed. This led to problems, because you could determine information about his empire by the kind of messages he was receiving and also what gold, PW and population he had.

          It seems that they have moved the save game time forward now so that the game advances the player, and then the save occurs before any of the start-of-turn stuff happens.

          Presumably, when you load the game it doesn't realise that it still has the start-of-turn stuff to do. I haven't investigated that yet. I am reminded, however, that when you play scenarios it does that start-of-turn stuff every time you load regardless, and so perhaps they shifted the code which should have been for the PBEM to the scenario stuff instead...

          Something that does concern me a little is that just before it does the PBEM save it sets g_isScenario = false, and so I suspect PBEM forgets when you try to play it with a scenario. Of course, noone uses scenarios at the moment because they're broken, but I'm hoping that will change.

          Comment


          • #6
            Am now crawling through the initialization code that occurs when you first start the game with a parameter to load a PBEM game. It's all pretty mundane so far. Initializing databases, etc. Exactly what you'd expect.

            Comment


            • #7
              Well, I found a way to fix it, but for some reason it causes the turn to end as soon as it starts, so although you have the ability to do stuff you don't have the time.

              Back to the drawing board...

              Comment


              • #8
                okdat dont worry im still reading your prodress j although i cant help at all really epecially when im a little drunk
                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


                • #9
                  My prior attempt involved altering things when you load. I'm now trying for the CTP solution of altering them before you save. However, asynchronous event handling stops this from working... I can't seem to make the event manager flush its events before the save takes place. I thought that g_gevManager->Process() would do the job, but it doesn't seem to. Ho hum.

                  Comment


                  • #10
                    Well, I *think* I have a fix, at least to a certain extent.

                    I've altered things in such a way that it should:
                    - affect only email and hotseat games
                    - improve email games
                    - not break hotseat games too badly

                    Indeed, if I understand what's going on it shouldn't break hotseat games at all, but I certainly don't understand everything involved correctly because my other attempts at fixes weren't working as expected and I don't yet know why.

                    In any case, you can now at least build cities and units, move units and earn gold and PW in email games correctly. There are still some things which aren't working quite correctly, though, for instance the year and turn number never change.

                    Comment


                    • #11
                      Well, I've been unable to come up with anything better, so the fixes are at:



                      These are to replace gs/utilities/newturncount.cpp and gs/gameobj/PlayerEvent.cpp. Essentially, I cut out the code that saves the game and pops up the messagebox from where it was, which was during the BeginTurn event handling before everything had happened, and I've put it in the FinishBeginTurn event, where almost everything has happened.
                      Last edited by J Bytheway; November 8, 2003, 11:02.

                      Comment


                      • #12
                        Does that also mean the Diplomacy carries over to the next players turn too, like it should? The problem was you would give a proposal to a human player and it would disappear on his turn.
                        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
                          Well, I've just tred sending a proposal to another human player, who responded just like an AI, as you might expect. However, this process seemed to make one of the players an AI. I'm not sure whether it was the sender or the recipient... Peculiar.

                          Comment


                          • #14
                            Well im about to try this, as i got the source to compile thannks to ahenobarbs "ctp2 sourcecode compiling for dummies"

                            Just a thought, but would it be possible to fit in a password option for ctp2 pbem save files? Even when theyre tried to be opened in single player, basically impossible to open.
                            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


                            • #15
                              You could make a password option, but anyone with the source code could bypass it, so it would be fairly pointless. Indeed, anyone with the source code can do pretty much anything they want in the way of cheating in PBEM, so if you don't trust your opponents, don't bother.

                              Comment

                              Working...
                              X