how many lines?

Whats up dudes, im new here and this is my first post in this wonderful forums (i’ve been watching them for a while).

I was wondering, just for curiosity, how many lines your game has and what kind of game it is.

To start with this, in my case i have:

Lines: 2400+ aprox
Game: 3 ways, castle at left, enemies come from right. tower + unit defense
Status: unfinished (80% done)

guess you are more pro than i. So how about you guys?

2400 sounds ok - if you indent like I do then about half of them will be ‘{’ or ‘}’ anyway! The main thing is to keep the code readable (good structure, plenty comments).

Line count is not much good factor to rate anything… clever things can be very small in line counts and bad code can be big in line count… What really matters is if the game is fun :slight_smile:

But anyway, it’s kinda interesting and I’ve didn’t count it yet for my project, so here it is:

Lines: 43188 in 324 files
Game: online FPS
Status: heading to public alpha after 2 years of development

Additionally I’ve created some bigger libraries that I use in the game, like JBullet (46962 lines in 249 files) and GUI library based on heavily modified Swing library (213801 lines in 588 files, dunno how many are written by me, but nothing small either and there is some overhead for license blocks in each file).

You might be better to count NCSL (non comment source lines)

Kev

dunno thousands but hey cant you stick it all on one big long line ? file size is the key im trying to make mine smaller so it downloads qicker.

Quoted for truth.

JMTetris: 3596 (100%)
2D tile map editor: ~3500 (??%)

By the way jezek2, is that FPS a commercial project?

Yes. I work on it as a half-time job (sponsored by other activities). I’m doing mostly everything from coding to modelling/texturing/animating. I’m not doing the project entirelly alone, but the others can’t do much actual work (or not until some core things like editor are usable enough for someone else to actually use it without problems), but we’re discussing every detail a lot :slight_smile:

Here are some earlier videos: ragdoll.avi and walking.avi.

i know the lines are not something to calculate anything.

i mean, lots of few lines dont mean a good or bad game, nor a well or bad coded algorithm.

its just for curiosity/fun, not to make a deep analysis about anything :slight_smile:

Btw that online fps looks good, looking forward to see it in action (im dloading ragdoll.avi but its going to take like 25 mins to dload :slight_smile:

Is there an Eclipse plugin wot can calculate all this stuff automatically for me?

Cas :slight_smile:

wc -l stopped working ? ::slight_smile:

http://www.easyeclipse.org/site/plugins/stateofflow-metrics.html

I dunno if that’s the same I use at home, but probably is the same thing

Some projects I did:

Agent: 00PK (platformer):
26128 lines

Best Game Evar 2 (RPG):
10666 lines

Image Manager UI:
1460 lines

A Lasting Impression (Game for JGO Comp 2008 (84 hours)):
4832 lines

Mario clone:
4484 lines

Adaptive ballistic AI:
707 lines

Lego City Ransom (Game for Retro Remakes competition (River City Ransom clone + more)):
7616 lines

Tetris clone (bare-bones):
447 lines

Tool for flattening OBJ models into sprites:
6067 lines

Sinuosity game:
4783 lines

java.awt.Robot with a lot of UI and options:
2068 lines

Tool that splits up and creates sprite sheets:
2179 lines

Newtonian physics simulator:
1336 lines

Video capture program:
763 lines

Level editor for iPhone game:
4772 lines

Worms clone:
2185 lines

Wikipedia searcher / game:
1793 lines

:slight_smile: Most of these are not done.

dont you think that 26000+ lines is a bit much lol :stuck_out_tongue:

47685 lines just for my graphics engine, but a lot of that is documentation

that is just insane!

Clearly not, because there was still plenty left to write.

But that game included, aside from the game engine, a few different learning algorithms for AI, physics, a level editor, texture wrappers/loaders for OpenGL from scratch, and a lot of other junk. To just make any old platformer, you can do that in much less (like my Mario clone with 4484 lines, which also included a level editor), but it was my senior capstone project for college so I had to (well… I wanted to) include a lot of other stuff. Two of the things I studied in college were AI and physics, so I wanted to make sure those sections of the game were complete and tightly done. Both the physics and the AI in the game are total overkill - it’s really not very fun, because I spent so much more time on the technical aspects than the gameplay.

SingSong is a competitive singing game: http://singthegame.com/
NCSL in SingSong: 16708
NCSL in Slick (only the parts SingSong uses): 16988
However, line counts from many other project aren’t included: LWJGL, TWL, YamlBeans, XPP3, etc

I used this perl script to count the lines:
http://www.reasoning.com/downloads/java_line_count_estimator.html

My largest project was my programming language with interpreter, a small standard library and editor. In total 24,106 lines. I never got around to finishing the editor or the language. My main big project right now is my constantly ongoing rapid-development game framework which is 10,382 lines. The games I’ve made with it range from 117 lines (Pong Out) to 13,110 (called Sokoban Supreme).

I personally don’t think line numbers are good or bad on their own, most of the problems people have with counting lines is about the details (like including empty lines) or about the workplace (with over-authoritarian managers). It’s a statistic, nothing more, and so making predictions based on one value is kinda flawed. However typically there is some truth behind the numbers. With my numbers above, PongOut was written entirely today and features 1 continuous level, whilst Sokoban took me over 6 months (on and off) and features 250 levels.

But despite that, I also don’t think it’s a good thing for developers to work with their line count in mind.

But it can be nice to be proud of how many lines you yourself have placed down into your game, or util, or whatever. A lot of work.

Totally agree. in facts i’ve only counted the lines once, just to measure something.

You know humans need to measure everything to see how it’s going.

Measuring time could be useful too, but some people (like me) arent working all days with the games, so maybe saying one week when i’ve only coded for 3 hours or so its not a good measuring system.

The original purpose was to see how was i going. i.e. if i’ve coded too many or too few lines