Announcement

Collapse
No announcement yet.

GENERAL: CTP2 Source Code Cafe

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • I have virtually no programming experience and have been curious about a couple of points with how this source code process works. And finally have enough nerve to bother you guys and ask.

    When someone makes a "fix" to the code how do the new lines of code get into the master file?

    Who is in charge of the master file?

    Is anyone doing code that the majority don't want done?

    And finally, a really lame question that you may not want to tackle. What does compile mean?

    Thanks in advance.

    Comment


    • When someone makes a "fix" to the code how do the new lines of code get into the master file?


      The source code consists of thousands of files. When a fix is done, a few files are modified, maybe just one. For instance, the latest bug fix modified, IIRC, 5 files. They are all then all zipped and posted in the altered source files thread.

      Periodically, Martin Guehmann puts together a zip with all updated files. Also periodically, someone compiles the game with the latest changes.


      What does compile mean?

      It's the process of turning the source coce files, which contain just text, into a new executable of the game, which can then be put up for download and used by anyone who has the game, regardless of having the source code.

      Is anyone doing code that the majority don't want done?


      If you mean if anyone's doing controversial additions, no, currently all additions are fixes to known bugs.
      Solver, WePlayCiv Co-Administrator
      Contact: solver-at-weplayciv-dot-com
      I can kill you whenever I please... but not today. - The Cigarette Smoking Man

      Comment


      • Hmm, Solver just beat me to most of the questions, but he left one:

        Originally posted by OnePresent
        Who is in charge of the master file?
        Noone really, so far we've pretty much worked on basis of common sense (in case of obvious bug fixes) or consensus (in case of design choices). If anyone, whoever compiles the playtest versions (used to be Martin, but now J Bytheway does it) is in charge of what changes are included and what's left out.
        Administrator of WePlayCiv -- Civ5 Info Centre | Forum | Gallery

        Comment


        • If anyone, whoever compiles the playtest versions (used to be Martin, but now J Bytheway does it) is in charge of what changes are included and what's left out.


          Were there any actually left out?
          Solver, WePlayCiv Co-Administrator
          Contact: solver-at-weplayciv-dot-com
          I can kill you whenever I please... but not today. - The Cigarette Smoking Man

          Comment


          • Originally posted by OnePresent

            And finally, a really lame question that you may not want to tackle. What does compile mean?
            That is the more or less easiest question:

            On computers there are different kind of languages:

            Interpreters, compiler and good old assembler.

            Interpreter are programs like good old basic, those are just interpreting your input and are required to be loaded before you can start your program. So without this interpreter you can't run your program.

            Compiler is a program in which you write your program, but when you are finished and compile your program it will save all necessary information to run your program stand alone. And compile just means, that it is translated to machine readable instructions. (and telling the programer: You stupid idiot, you forgotten another bracket there and there :doitnow: ) It will make sure, that the program will not crash the computer, but only to certain limits, it is just checking for logical mistakes in itself, so for the syntax, what you do with your program the compiler doesn't and can't check.

            Assembler: Won't loose to many words, but that is 'next' to the core. Most efficient, but also most intensive. Hardly ever used nowadays. Cheaper to upgrade PC's than to program efficiently

            Comment


            • Compiler is a program in which you write your program, but when you are finished and compile your program it will save all necessary information to run your program stand alone.


              Technically, that's not precise. You write your program in just any text editor. Compiler just takes the text and makes into an executable (object files for the linker first, to be precise). Now, there are mostly development environments, like MS Visual Studio, that combine compilers, linkers and text editors for the source, but in fact, all can be separate.
              Solver, WePlayCiv Co-Administrator
              Contact: solver-at-weplayciv-dot-com
              I can kill you whenever I please... but not today. - The Cigarette Smoking Man

              Comment


              • Whoah, just noticed two things - the previous post of mine was the post 6000 in this forum, and that at this time of the day, this forum is so amazingly active!
                Solver, WePlayCiv Co-Administrator
                Contact: solver-at-weplayciv-dot-com
                I can kill you whenever I please... but not today. - The Cigarette Smoking Man

                Comment


                • Originally posted by Solver
                  Compiler is a program in which you write your program, but when you are finished and compile your program it will save all necessary information to run your program stand alone.


                  Technically, that's not precise. You write your program in just any text editor. Compiler just takes the text and makes into an executable (object files for the linker first, to be precise). Now, there are mostly development environments, like MS Visual Studio, that combine compilers, linkers and text editors for the source, but in fact, all can be separate.
                  Actually that was and is again correct. It is just as people are changing programs are being adopted. In the good oooooooold times, you had to use the compiler editor to write your text, then it was changed that you can use whatever and now it is being changing to the old status again.......

                  Jesus........can't users not decide what they want

                  Comment


                  • Gilg, compiler has no function to write in it or whatever. MS Visual C++ environment in which you write is not a compiler - the compiler is a separate part of it, completely.

                    Like in Linux now, you'll likely use vim or emacs to type up your sources, and then gcc to compile...
                    Solver, WePlayCiv Co-Administrator
                    Contact: solver-at-weplayciv-dot-com
                    I can kill you whenever I please... but not today. - The Cigarette Smoking Man

                    Comment


                    • OK, if we wan't to split hairs:

                      The compiler will actually just take any file as input, run it through it's algorythms and produce an executable out of the input file in the form for it's native operation system (also this can be different as well).

                      But again it is nowadays quite often again a bundle, you might end up using the deplayed editors by the developer to write your input files.

                      Comment


                      • Originally posted by Solver
                        Were there any actually left out?
                        Changes that weren't posted in the altered source files thread in file format and those that required to alter the file itsself to make it compartible with the rest, had to wait. For instance the japanese modifications aren't working by just unzipping them over the source, I had to put the files into the directories myself and had to modify, because they weren't working as expected. However the Japanese stuff is not compartible with the rest so you have to define a Makro to get a more japanese friendly version but in fact it is in the source. However that japanese pack indeed contained a piece of code I rejected, that was a no CD crack. For the other code I had to insert it myself into the files, that is some additional work, that should be done by the creator of the new source himself and also Peter's slic implementations, because he didn't post it there, because he wasn't content with them, but I finally decided they are too important not to have even if there might be not finished.

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

                        Comment


                        • Well, with that I would agree . Of course, most text editors that are used for making source files now come packed with all other tools, and do highlighting of keywords and other stuff for you.

                          A minor nitpick might be that a compiler doesn't produce an executable. It produces object files, which are in binary format, therefore are not code, but can't yet be executed - a linker creates an executable from object files. The difference is small for a small program, but in CtP2, the compiler would just generate an object file for each source file, while linker would take its time putting it all together.

                          If the source files contain no syntax errors, they will compile. However, if they're calling functions implemented in a non-existient third-party library, for instance, they won't link. Like what happens to CtP2 source if you try to build the game without the DirectX/Media SDKs from MS.
                          Solver, WePlayCiv Co-Administrator
                          Contact: solver-at-weplayciv-dot-com
                          I can kill you whenever I please... but not today. - The Cigarette Smoking Man

                          Comment


                          • Originally posted by Solver
                            Well, with that I would agree . Of course, most text editors that are used for making source files now come packed with all other tools, and do highlighting of keywords and other stuff for you.

                            A minor nitpick might be that a compiler doesn't produce an executable. It produces object files, which are in binary format, therefore are not code, but can't yet be executed - a linker creates an executable from object files. The difference is small for a small program, but in CtP2, the compiler would just generate an object file for each source file, while linker would take its time putting it all together.

                            If the source files contain no syntax errors, they will compile. However, if they're calling functions implemented in a non-existient third-party library, for instance, they won't link. Like what happens to CtP2 source if you try to build the game without the DirectX/Media SDKs from MS.
                            Actuallz a minor correction from my side:

                            No, it depends on the compiler: Old compilers just produced an executable, only nowadays it works the way you described Always those youngsters sweet old times Remembers me of the good old times, when you even had problems creating some 'bigger' programs, good old limit off 500k..........There must have been ever more limits before I started, but what I remember are 500k............unless you would have had the 'deluxe' version...........

                            Comment


                            • Oh true, the days when 512 kb (not 500 ) was a limit were either beatiful, or a major pain, depends on how you look at it. At least, well, you couldn't have problems with 3000 source lines because you wouldn't fit that much code anyway . I will though admit that I haven't written programs with those limits, although I did run some shameless experiements on compiling 16-bit COM exeuctables just recently.
                              Solver, WePlayCiv Co-Administrator
                              Contact: solver-at-weplayciv-dot-com
                              I can kill you whenever I please... but not today. - The Cigarette Smoking Man

                              Comment


                              • It seems Gilg is one of those technical gurus who couldn't explain something in terms mortal beings can understand if he wanted to I see a lot of those people around me so I can always spot them right away

                                Solver is not quite that far gone yet
                                Administrator of WePlayCiv -- Civ5 Info Centre | Forum | Gallery

                                Comment

                                Working...
                                X