How many lines of code is your game?

Discussion in 'Game Development (Technical)' started by Mike Boeh, Oct 22, 2005.

  1. voodooshaman

    Original Member

    Joined:
    Mar 9, 2006
    Messages:
    45
    Likes Received:
    0
    hehe, I win :)

    Global Summary (46.1 MB, actual: 41.1 MB)
    -----------------------------------------------
    Number of lines of code: 844725
    Number of directive lines: 69290
    Number of empty lines: 209753
    Number of comment lines: 224586
    Number of empty comment lines: 113780
    -------------------------------------------
    Total number of lines: 1462134
    -----------------------------------------------

    6125 file(s) processed.

    OK ... I admit, this is the project at work (with a team of about 80+ people). And it's UE3 based so includes all that code too - although the UE3 base code is a lot smaller than you'd think ...
     
  2. tau

    tau New Member

    Joined:
    Mar 15, 2007
    Messages:
    86
    Likes Received:
    0
    I tend to reuse my own libraries, and my games are stay in 10,000-20,000 lines range.
     
  3. impossible

    Original Member

    Joined:
    Aug 9, 2004
    Messages:
    443
    Likes Received:
    0
    Smaller than you think, except that there are individual files in UE3 that have more lines of code than a lot of people's entire games :).
     
  4. lexaloffle

    Indie Author

    Joined:
    Jul 27, 2004
    Messages:
    207
    Likes Received:
    0
    Fascinating! Here's mine (using cat *.c *.h | wc):

    codo (framework): 10666
    Neko Puzzle: 6368
    Zen Puzzle Garden: 9125
    Swarm Racer: 5271
    Chocolate Castle: 9833
    Jasper's Journeys (in development): 9637
     
  5. Bad Sector

    Original Member

    Joined:
    May 28, 2005
    Messages:
    2,742
    Likes Received:
    5
    Shouldn't that be "wc -l" ?
     
  6. lexaloffle

    Indie Author

    Joined:
    Jul 27, 2004
    Messages:
    207
    Likes Received:
    0
    -l just suppresses the display of word count and character count.
     
  7. ilya2

    ilya2 New Member

    Joined:
    May 21, 2007
    Messages:
    17
    Likes Received:
    0
    For my game that I'm working on right now(a pretty big space invaders clone, which I wrote because I wasn't really able to write anything else)...

    Global Summary (139 KB, actual: 95.0 KB)
    -----------------------------------------------
    Number of lines of code: 3557
    Number of directive lines: 54
    Number of empty lines: 94
    Number of comment lines: 67
    Number of empty comment lines: 27
    -------------------------------------------
    Total number of lines: 3799
    -----------------------------------------------
    That includes some apps I wrote for making sound files, around 1000 lines...
    It also includes a framework that I use for SDL(that I wrote), which is probably around 500 lines.


    For my website(lots of PHP):
    Global Summary (168 KB, actual: 109 KB)
    -----------------------------------------------
    Number of lines of code: 3517
    Number of directive lines: 5
    Number of empty lines: 130
    Number of comment lines: 127
    Number of empty comment lines: 47
    -------------------------------------------
    Total number of lines: 3826
    -----------------------------------------------
    Some duplicate code in it, and it counted some useless code(200 lines?).
    Doesn't count the css and js files.
     
  8. Grey Alien

    Indie Author

    Joined:
    Nov 29, 2005
    Messages:
    2,791
    Likes Received:
    0
    wow some of these games are really small.

    Anyway it would be great if the % of each type of line were also shown. Then you can see what % is code and what % is comments for example.

    Hey a stock control/business management system I wrote in Delphi/SQL over many years was way over 300,000 lines last time I checked.
     
  9. Sean Doherty

    Original Member

    Joined:
    Jul 31, 2004
    Messages:
    433
    Likes Received:
    0
    Starchon has ~ the following:

    Total Files : 147
    Total Lines : 28093
    Total Code : 16333
     
    #49 Sean Doherty, Jun 9, 2007
    Last edited: Jun 10, 2007
  10. Michael Flad

    Indie Author

    Joined:
    Aug 4, 2004
    Messages:
    190
    Likes Received:
    0
    Here's the numbers for a project I'm currently working on - it's a J2ME game for cellphones so it's quite big given the ususal limits of my target platform.

    The huge number of comment lines isn't because I comment that much but because of a lot of tables and other game related data was first defined within the code for easy development but has since moved into data files because Java is not able to handle static data efficiently.
    Most of the lines (>28.000) are consumed by a single class, again because writing nice *and* compact code isn't possible in Java (based on todays cellphone limits).

    Global Summary (1,00 MB, actual: 609 KB)
    -----------------------------------------------
    Number of lines of code: 19770
    Number of directive lines: 0
    Number of empty lines: 3496
    Number of comment lines: 5243
    Number of empty comment lines: 524
    -------------------------------------------
    Total number of lines: 29033
    -----------------------------------------------

    5 file(s) processed.
     
  11. tau

    tau New Member

    Joined:
    Mar 15, 2007
    Messages:
    86
    Likes Received:
    0
    That's a lot for a J2ME game! What will be the size of the JAR? I bet it's about 60K-100K or even more?

    My last J2ME game had 7 files and 2100 lines of code, and that included about 15 gaming levels.
     
  12. Michael Flad

    Indie Author

    Joined:
    Aug 4, 2004
    Messages:
    190
    Likes Received:
    0
    I usually create 64kb ports but for this project it's really not an option.
    At the moment the target handsets are only those which can handle JAR sizes of about 250-300kb as the .class files (optimized and obfuscated) are already about 200kb (~80kb as a compressed JAR).
     
  13. tau

    tau New Member

    Joined:
    Mar 15, 2007
    Messages:
    86
    Likes Received:
    0
    Wow, you are really pushing it to the limits :) Is it a 3D game?
     
  14. Michael Flad

    Indie Author

    Joined:
    Aug 4, 2004
    Messages:
    190
    Likes Received:
    0
    No it's only 2D - it's a Themepark Manager alike simulation game including a story mode with different missions as well as a freeplay mode.

    Here are the numbers for "Magic Garden" a more typical sized game, one that managed to fit into the 64kb jar/200kb heap limits of S40 devices. This time with more files as the game wasn't as close to the limits so it was ok to use a few classes :)

    Global Summary (303 KB, actual: 203 KB)
    -----------------------------------------------
    Number of lines of code: 7481
    Number of directive lines: 103
    Number of empty lines: 2018
    Number of comment lines: 1371
    Number of empty comment lines: 148
    -------------------------------------------
    Total number of lines: 11121
    -----------------------------------------------

    20 file(s) processed.
     
  15. supagu

    Original Member

    Joined:
    Feb 25, 2006
    Messages:
    104
    Likes Received:
    0
    MY WHOLE RESPOSITORY (includes 1 game WIP, 3d engine, tools, test cases, my web site code):

    Global Summary (31.1 MB, actual: 26.5 MB)
    -----------------------------------------------
    Number of lines of code: 526323
    Number of directive lines: 102626
    Number of empty lines: 150337
    Number of comment lines: 123590
    Number of empty comment lines: 45620
    -------------------------------------------
    Total number of lines: 948496
    -----------------------------------------------

    5037 file(s) processed.


    THE MAJOR LIBRARIES THAT AREN'T MY CODE IN MY REPO:

    BOOST:

    Global Summary (19.2 MB, actual: 15.7 MB)
    -----------------------------------------------
    Number of lines of code: 338488
    Number of directive lines: 76588
    Number of empty lines: 90994
    Number of comment lines: 53077
    Number of empty comment lines: 17944
    -------------------------------------------
    Total number of lines: 577091
    -----------------------------------------------

    3216 file(s) processed.




    MAXSDK:

    Global Summary (5.73 MB, actual: 5.21 MB)
    -----------------------------------------------
    Number of lines of code: 68347
    Number of directive lines: 14672
    Number of empty lines: 27161
    Number of comment lines: 34814
    Number of empty comment lines: 8482
    -------------------------------------------
    Total number of lines: 153476
    -----------------------------------------------

    590 file(s) processed.



    MORE MAX SDK STUFF

    Global Summary (1.96 MB, actual: 1.75 MB)
    -----------------------------------------------
    Number of lines of code: 40201
    Number of directive lines: 3536
    Number of empty lines: 6762
    Number of comment lines: 5057
    Number of empty comment lines: 2873
    -------------------------------------------
    Total number of lines: 58429
    -----------------------------------------------

    221 file(s) processed.


    so looks like ive done about 400,00 total lines of code roughly
    there are some other header files which arent mine.

    Still seems a fair bit :p although my 3D engine can compete with with most commercial engines
     
  16. negativegeforce

    Original Member

    Joined:
    Jul 2, 2006
    Messages:
    53
    Likes Received:
    0
    The game I am working on right now Pipe Mania without external libs, it includes all the windows startup, opengl drawing and game code. I cant believe how huge some of the sources are for alot of these "simple" games I see. Did you guys write an entire sound,image,3d model,3d software rasterizing library supporting everything, lol?


    Pipe Mania
    -----------------------------------------------
    Global Summary (177 KB, actual: 152 KB)
    -----------------------------------------------
    Number of lines of code: 4559
    Number of directive lines: 259
    Number of empty lines: 1431
    Number of comment lines: 605
    Number of empty comment lines: 154
    -------------------------------------------
    Total number of lines: 7008
    -----------------------------------------------
     
  17. Sybixsus

    Original Member

    Joined:
    Aug 2, 2004
    Messages:
    959
    Likes Received:
    0
    Funny you should say that. I more or less did.
     
  18. Spodi

    Spodi New Member

    Joined:
    May 13, 2007
    Messages:
    12
    Likes Received:
    0
    For my vbGORE engine, including the client, server, and all tools (VB6 code):

    Code:
    Lines of code: 54,351
    Lines of comments: 8,833
    Blank lines: 12,515
    Total lines: 75,699
    Files: 117
    
    Really doesn't seem like much for over a year of hard work. Almost every line I wrote myself, so I'm not counting code of an engine used or something like so of you. ;)
     
  19. ragdollsoft

    Original Member

    Joined:
    Sep 11, 2005
    Messages:
    234
    Likes Received:
    0
    My upcoming flash game has only 2500 even though I started it months ago... It's not about quantity it's about quality ;)
     
  20. Applewood

    Moderator Original Member Indie Author

    Joined:
    Jul 29, 2004
    Messages:
    3,858
    Likes Received:
    2
    I'm involved in several projects at the moment, so this is the stats for my companies total output since it began a couple of years ago (with avg of 3 programmers).

    Got to say I was expecting more tbh, though it does have almost double the lines in the O/S they used to control Jurassic Park! :)

    I'm cheating a bit as we've done a couple of ports where we inherited complete games before mungeing them. It's all been touched by us though, so wth :)

    I'm amazed at the number of directives. That can't be right!

    Global Summary (110 MB, actual: 96.0 MB)
    -----------------------------------------------
    Number of lines of code: 2297243
    Number of directive lines: 222430
    Number of empty lines: 662451
    Number of comment lines: 395750
    Number of empty comment lines: 151096
    -------------------------------------------
    Total number of lines: 3728970
    -----------------------------------------------

    10513 file(s) processed.

    Done.
     
    #60 Applewood, Sep 25, 2007
    Last edited: Sep 25, 2007

Share This Page

  • About Indie Gamer

    When the original Dexterity Forums closed in 2004, Indie Gamer was born and a diverse community has grown out of a passion for creating great games. Here you will find over 10 years of in-depth discussion on game design, the business of game development, and marketing/sales. Indie Gamer also provides a friendly place to meet up with other Developers, Artists, Composers and Writers.
  • Buy us a beer!

    Indie Gamer is delicately held together by a single poor bastard who thankfully gets help from various community volunteers. If you frequent this site or have found value in something you've learned here, help keep the site running by donating a few dollars (for beer of course)!

    Sure, I'll Buy You a Beer