Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Ever wondered how many lines of code you have to write for a "succesful" game?  (Read 14196 times)

0 Members and 1 Guest are viewing this topic.

cpolymeris

  • Jr. Member
  • **
  • Posts: 65
    • View Profile
    • Email
Well, statistically speaking...


Around 100-300K should do ;)

The data, programmatically fetched from Ohloh.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10820
    • View Profile
    • development blog
    • Email
I've only heard of about 2 on that list. Maybe you'd also need a line vs popularity statistics to see how many lines are need to make a popular game. :P

Besides that lines of code is rather bad way to messure anything. ;)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

cpolymeris

  • Jr. Member
  • **
  • Posts: 65
    • View Profile
    • Email
I've only heard of about 2 on that list. Maybe you'd also need a line vs popularity statistics to see how many lines are need to make a popular game. :P
Yeah, the list is about 60 games, though (the most "I use this" voted on Ohloh), not only those labeled in the abscissa, including e.g. FreeOrion, Wesnoth, OpenTTD, Warzone 2100, Freeciv, and other open-source "classics". They just didn't all fit.

Quote
Besides that lines of code is rather bad way to messure anything. ;)
I agree. This was just for fun. I find it interesting that after 400K lines or so, codebases seem to explode.

EDIT: Nethack is "only" 200K lines, that's amazing. Meanwhile, Worldforge, forever vaporware is 1.6M o.O
« Last Edit: July 15, 2013, 09:57:41 am by cpolymeris »

cpolymeris

  • Jr. Member
  • **
  • Posts: 65
    • View Profile
    • Email
Maybe you'd also need a line vs popularity statistics to see how many lines are need to make a popular game. :P

Not very conclusive:


Ohloh user count seems to not be a good indicator of popularity, since most users don't use that site. In fact, only the 30 projects I used for this graph register more than 20 users.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10820
    • View Profile
    • development blog
    • Email
Yeah, the list is about 60 games, though (the most "I use this" voted on Ohloh), not only those labeled in the abscissa, including e.g. FreeOrion, Wesnoth, OpenTTD, Warzone 2100, Freeciv, and other open-source "classics". They just didn't all fit.
Hmmm I guess, I'm just not so much into Open Source games... ;)

I find it interesting that after 400K lines or so, codebases seem to explode.
Well you have to take into account that the bigger code bases are mostly MMOs or 3D games and there it's relatively easy to get too much code quickly. What I wonder though, is how a Super Mario clone needs 700k. They've either implemented a lot of boilerplate or idk. Maybe I should take a look at that... ;)

EDIT: Nethack is "only" 200K lines, that's amazing. Meanwhile, Worldforge, forever vaporware is 1.6M o.O
Well Nethack is also a rather simple system in regards to a full blown 3D MMO like Worldforge.

Not very conclusive:


Ohloh user count seems to not be a good indicator of popularity, since most users don't use that site. In fact, only the 30 projects I used for this graph register more than 20 users.
Well I've never heard of Ohloh and I've never seen a link or anything to it on many different IRC channels and forums, so yeah I guess not many know/use it. :D
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6286
  • Thor Developer
    • View Profile
    • Bromeon
There are some things one should not forget:
  • A lot of games come include a whole engine. Others use an existing one, which makes comparison difficult.
  • The wheel is reinvented a lot (wrapping pure OpenGL or DirectX as well as OS-specific APIs).
  • Code can be written more compactly as time goes on. On one hand through language improvements (modern C++ idioms, C++11), on the other as a result of dedicated libraries for many tasks.
  • Game developers may exploit newest hardware and graphical techniques, but they are rarely at the cutting edge of the programming language, leading to more code than necessary. In my opinion, this point is still widely underestimated.
  • Usually the expectations and requirements become higher and higher, but from time to time a game with awful minimalism (such as Proteus) can have success.
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

FRex

  • Hero Member
  • *****
  • Posts: 1845
  • Back to C++ gamedev with SFML in May 2023
    • View Profile
    • Email
I wonder what libraries do last 3 games use because they have more lines than doom does, which is crazy :o considering Doom 3 is a game and an entire id tech 4 engine that includes libcurl, own stl, lexer, parser, two scripting languages, gui surfaces, opengl multithreaded renderer and a ton of features, still pretty good for use (Brink from 2011 is latest commercial triple A, also I know one indie game and one very good mod that is now going standalone that use it too) is staying around 600k of code and 150k of blank and comments each.
« Last Edit: July 15, 2013, 08:15:54 pm by FRex »
Back to C++ gamedev with SFML in May 2023

cpolymeris

  • Jr. Member
  • **
  • Posts: 65
    • View Profile
    • Email
I wonder what libraries do last 3 games use because they have more lines than doom does...

In the case of WorldForge, I think it's because it's a 15-year-old vaporware "game" that was rewritten numerous times and offers several clients (2D, 3D, this or that toolkit) for the same game. In the case of PlaneShift, I think it's because over half of the lines are XML. If you count only C++, the LoC count is closer to 500k.

Then there is Warzone 2100, originally a commercial game, with no less than 799,999 lines of code (was that on purpose?), not counting comments and blanks!

The most interesting cases for me are those of well-establlished, and enjoyable games like OpenTTD, Battle for Wesnoth, naev and Freeciv. Most of those seem to hover around a relatively sane 200 to 300K lines.

FRex

  • Hero Member
  • *****
  • Posts: 1845
  • Back to C++ gamedev with SFML in May 2023
    • View Profile
    • Email
Quote
over half of the lines are XML
Wow.. just wow. :o
Quote
well-establlished, and enjoyable games like OpenTTD, Battle for Wesnoth, naev and Freeciv. Most of those seem to hover around a relatively sane 200 to 300K lines.
Nethack too(200k you said). Nethack in terminal is best. ;D
Back to C++ gamedev with SFML in May 2023

Lethn

  • Full Member
  • ***
  • Posts: 133
    • View Profile
Define 'successful' do you mean sales figures or do you mean whether people are actually playing still? I've seen games like CoD or Halo get millions but they become ghost towns after awhile because they don't attempt anything new after awhile so in response they churn out dozens of sequels that are all the same in the hopes they'll get lucky.

Meanwhile games like Minecraft come out and completely embarrass them because it's just a block being deleted after several mouse clicks ( Yes I know there's more going in the background but you get the idea ) and then there's the simple puzzle games like Bejewelled or on the app end of the market angry birds.

The Terminator

  • Full Member
  • ***
  • Posts: 224
  • Windows and Mac C++ Developer
    • View Profile
I remember reading somewhere that skyrim has around 57 million lines including the engine. That's slightly less than windows 7, which hovers around 70 million.
Current Projects:
Technoport