Teapot Wars vs. Production game

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • Teapot Wars vs. Production game

      Hey guys,

      I was just wondering, how well does Teapot Wars represent production game code with respect to structure and cleanliness? Is it cleaner than average because it was published in a book? Or is it at/below average because of whatever reason?

      The reason I ask is:
      1) I find the elegance it to be quite appealing. After looking at a nightmare FORTRAN 77 code for 8 hours a day it is kind of treat to look at sane programming, and actually learn a thing or two! It would be kind of disappointing if most aren't so good.

      2) I'm in the middle of re-implementing the STL to learn data structures and algorithms. I'm looking at the headers of the visual studio deque and the GNU deque, and its just not as clean. Some is cosmetic such as a weird indenting format, and some is for performance/standard compliance. For instance they basically call raw operator new and delete and manually call constructors and destructors. Sometimes they do a huge amount of stuff in one line, which I'm guessing is to "help" the compiler make some optimizations.

      It's not very important. I was simply curious.
    • RE: Teapot Wars vs. Production game

      It depends on the game. I've worked on games that had a much stronger architecture. I've also worked on games that were much worse.

      GCC has a number of systems and features that are really cool and make it a joy to work with. The process system, the event system, the DirectX abstraction, entities & components, the editor, the network layer, etc. Basically anything with a chapter dedicated to it. These systems are on training wheels and a real game will be MUCH more complex, but the idea is the same. There are also some things that aren't good at all. Search the codebase for "hack" to find examples. The input system is pretty bad too, with lots of hard-coded values.

      Most games are the same. You'll have some things that are really nice and some things that you wish you could change. The biggest difference is complexity. Professional games about 20 times as complex. For example, the core decision-making AI on The Sims 4 is probably 5000 - 10,000 lines of code spread across a dozen source files.

      -Rez