Announcement

Collapse
No announcement yet.

PBEM turn file modification

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

  • PBEM turn file modification

    Lately I've been toying around with the PBEM turn file encryption because I was hoping that the wrong-faction-graphic-bug of SMAX could be solved by editing the faction identifiers in the turn files like you can do with unencrypted SMAC single player save files. But the strings that label the faction are all correct, as I found out - still SMAX simply ignores the data from the turn files and insists on the faction order of the alphax.ini file (which always sets itself to the choice of factions you made in the last SMAX game that you started). Whoever programmed the expansion should be nerve-stapled and thrown into the brood pits, if you ask me

    Anyway ... in the process of doing so I managed to figure out how SMAX actually encrypts its turn files. Yes, I'm admitting that freely and vow to my current and future co-pbem players, that I'm really too honest and principled to be using that knowledge for cheating against other players. Actually, the encryption of SMAC(X) is so simple, that I suspect that quite a few other people must have already figured it out by now (more reason for the programmers to become worm food).

    Breaking the encryption was just one step anyway. Understanding what the values (except for obvious names) mean is a different challenge. But I was thinking that if we could figure that out, we would be able to program in-between-turn processing that can fix a few issues of SMAC and maybe even add a few new things.

    One of my first thoughts actually was the infamous stockpile bug. We could have a process running over the turn file every beginning of a turn that detects production queues switching to stockpile and reduce the player's energy reserves by that amount, that was given to him by the bug. Perhaps a few other bugs can be taken off the "intentionally-avoid-doing-this"-list too (it would only require that the last player of a turn uploads his file to a webpage that does the modifications and where the first player of the next turn can download it).

    The second idea would be to create a better and stronger AI for Planet itself. We could actually make fungus expand like forests and make more mind worms appear. Perhaps even make the Planet appear "smart" enough to really act like having an agenda and not just being something that pops in once in a while when your eco-damage grows to high.

    Well ... what do you think? Would anyone feel like it being worth the effort? Or do you rather feel we shouldn't touch Pandora's box and dig too deep into the secrets of PBEM turn file manipulation?

  • #2
    You'd need to let the secrets out, keep them to yourself, and anyone who doesn't want to expend the effort to crack it(such as myself) will not. also fungus expanding like forests :shudder:

    Comment


    • #3
      Yeah well ... to analyse the turn file data structure, it's enough to work with the unencrypted single player save file.

      Btw ... there is some interesting stuff possible. I was just fooling around with the "unit command" byte when ...



      (And it actually worked too!)

      Comment


      • #4
        lol !
        Learn to overcome the crass demands of flesh and bone, for they warp the matrix through which we perceive the world. Extend your awareness outward, beyond the self of body, to embrace the self of group and the self of humanity. The goals of the group and the greater race are transcendant, and to embrace them is to acheive enlightenment.

        Comment


        • #5
          sweet

          some of the conservitive we-own-the-game CMNs may not approve of this on public forum, but yeah. could be usefull.

          What are you using to edit with? a hexidecimal editor like ultraedit or something else? can you post some heavier details? getting formers to make monoliths was impossible before. what exactly is the range of definitions contained in the sav file?
          Last edited by Kataphraktoi; February 20, 2006, 17:08.
          if you want to stop terrorism; stop participating in it

          ''Oh,Commissar,if we could put the potatoes in one pile,they would reach the foot of God''.But,replied the commissar,''This is the Soviet Union.There is no God''.''Thats all right'' said the worker,''There are no potatoes''

          Comment


          • #6
            I'm using a hex editor. Ultraedit too, but mostly a tool called HexCmp which allows for binary comparsion of files.

            So far it's basically trial and error. I found the faction data (basically names and some variables for the interludes), unit data and data for bases (don't like the location of your HQ? Let me move it for ya ...). I still haven't looked at map, tech, SE and workshop data at all.

            Mostly I change some value and see how it changes something in the game. Or change something in the game and see how it alters the save file. Then I document it for later reference. But it's tedious work, I tell you ...

            Comment


            • #7
              I am hex editing a older RTS for a mod, and yeah it can be just a little tedious im only a novice at hex editing, unfortunatly.
              if you want to stop terrorism; stop participating in it

              ''Oh,Commissar,if we could put the potatoes in one pile,they would reach the foot of God''.But,replied the commissar,''This is the Soviet Union.There is no God''.''Thats all right'' said the worker,''There are no potatoes''

              Comment


              • #8
                Wow, Sperber, keep it up and keep us updated about your findings!
                -- What history has taught us is that people do not learn from history.
                -- Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.

                Comment


                • #9
                  You know what would be awesome? An end of turn file parser. You could put something like: If the angels have PSA, set their innate probe bonus to +1 instead of +2. No more probe rollover.
                  #play s.-cd#g+c-ga#+dgfg#+cf----q.c
                  #endgame

                  Quantum P. is a champion: http://geocities.com/zztexpert/docs/upoprgv4.html

                  Comment


                  • #10
                    May I suggest you contact Kody and ask him about his findings?

                    Personally I certainly like the ideas you suggested.
                    Contraria sunt Complementa. -- Niels Bohr
                    Mods: SMAniaC (SMAC) & Planetfall (Civ4)

                    Comment


                    • #11
                      I found the bases' production queues yesterday. So by comparing a turn file with the turn file of the previous turn, it should be possible to compensate for the stockpiling bug.

                      I'm still a long way from having determined what different 'chunks' the save file is composed of and how to determine where they begin and end.

                      Once I understand that, I may get a better understanding how to determine the "encryption key offsets" in the pbem turn files which are probably related to them. Without that, I'm still unable to automate de- and reencryption.

                      The Probe bonus rollover could perhaps be fixed too by raising the probes' morale value in a post-process once a rollover has taken place. But that's still a long way to go.

                      Comment


                      • #12
                        The only effect of the probe rollover bug is that units and bases aren't immune to mindcontrol at 3+ SE Probe. Probe morale works just fine.
                        Contraria sunt Complementa. -- Niels Bohr
                        Mods: SMAniaC (SMAC) & Planetfall (Civ4)

                        Comment


                        • #13
                          I decided to do something similar make a few minor changes possible that I figured would be benificial and have minimal impact. I mean what harm could being able to change who's turn it was have, and set human players to AI or back again. Then I found out just those two things can allow you to open up other player's turns bypassing their password completely.

                          So I thought I would figure out the password and protect the program I made so that only someone with all the passwords could use the program. However, I then realised the program itself was a vulnerability, since someone could just track the minor changes my program was making, and find exactly where to change things without all the white noise the game adds to the save file.

                          Although I was doing this around the time when I was wiseing up to the fact Enimga was abusing bugs. Which made me a bit paranoid about the possibly doing more harm than good.

                          EDIT: I gave Sperber some general information about what I know the file structure. Where they store what kind of data, probably stuff he already knows. Also that SMAC,SMAX, singleplayer have differences in formats. Decided it probably a not good idea to give exact locations for the parts I've decrypted, or how they do reload warnings (something I researched in hopes of figuring out how to stop Enigma's reload hack).
                          Last edited by Kody; February 21, 2006, 11:55.

                          Comment


                          • #14
                            Has anything come of this? I've got a game where the Believers have lost their password. Does anyone know if it can be recovered using tools?

                            Comment


                            • #15
                              when the angels discover psa, sholuldn't units still be vulnerable to mind control anyways? only bases get +2 probe, also for planet ai, you may be able to inseert a human player to control it, I'm not familar with hex editing, but I did find something out about the aliens, if you create a scenario with no factions and run it, you have no choices on who to be (duh) and are defaulted as planet, the map is covereed in condencers unless you open the editor, and you can't control growth or towers, but you get all other native.
                              Are you safe from the dangers of dihydrogen monoxide? Learn more at www.DHMO.org.

                              Comment

                              Working...
                              X