How Many Lines?

Kezarus

Member
I was wondering how many lines of code my games have and and got this handy dandy script from @Tsa05 this from this thread.

On your project directory (where the .yyp or .gmx file are located), create a .txt file, put the code below inside, save as .bat and double click it.
Code:
@echo off

:CountLines
setlocal
set /a totalNumLines = 0
for /r %1 %%F in (*.gml) do (
    for /f %%N in ('find /v /c "" ^<"%%F"') do set /a totalNumLines+=%%N
    echo|set /p= "."
)

echo .
echo Total number of code lines = %totalNumLines%
echo Making progress!
pause
My project lines are:
OverKill, a top-down scrooling shooter: 1.856 lines
Endless RPG, a turn-based combat in a living random world: 12.234 lines
Shooter, proof of concept that I slap some code in 4h: 37 lines

How much lines are your games? =]
 
Last edited:

JackTurbo

Member
My main project A Day In Valhalla is sat at about 8398 lines apparently.

I'm guessing its including comments and unused scripts? I've got a few old systems that are simply commented out and a whole folder of old unused scripts, which I reckon are inflating that number a fair bit.
 
Eysir (WIP) - 8282 (so far)
Tried to run Simov through this, but it seems the batch file won't catch object code from GMS1 projects. Most likely due to the code being inside .gmx files. Would be really hard to separate the xml tags from the GML code.
 

GMWolf

aka fel666
Line count is a fun metric, but I think its worth mentioning it is by no way a good indication of quality or work put into a project.
You could spend weeks working on a complex system that only ends up being a couple thousand well written lines.

Equally you could spend weeks on something like writing missions/campaign whatever and end up with far more code, that wasn't hard to write, but required many simple lines of code.

My largest GM project i have on my disk now is 1300 LoC. tiny! I wonder how I have any credibility at all at this point.
largest personal game project is like, 6000 locs. Also relatively small. Does it do more than the GM project? well it was actually a port of the game, feature parity, but 5x the code. It did solve my performance issues though.
University team project ended up being around 100k lines of code. Now we are getting somewhere! that really was a large project for me... I ended up writing about 30k lines for that. wow...
Does that project do more than my personal project from before? of course it does! does it do 17x more? eeeh, no. As teams grow, as projects grow, code grows exponentially.
The AAA project I work on now? Ha! we are talking about terabytes of data! Uncountable! running a script to find out would take all day! oh but should i? yeah, im curious now...
But at this point the scale is getting really big... its completely incomparable to the previous projects I worked on. I probably contribute around 500-1000 locs on a good week. Way less than I do on my own projects over the weekends!
Does that mean I work more over the weekend then I do during the week at work? probably not.
well that went on a bit of a tangent. Hope it doesn't seem like a weird flex.

Please don't let that keep you from posting figures! its interesting !

I'm actually quite impressed by how compact, in terms of lines of code, the games you all are working on end up being! I guess that's the advantage you get from working with GM :)

p.s. annotating with tiny text is my new favourite thing...
 
Last edited:
Line count is a fun metric, but I think its worth mentioning it is by no way a good indication of quality or work put into a project.
You could spend weeks working on a complex system that only ends up being a couple thousand well written lines.

Equally you could spend weeks on something like writing missions/campaign whatever and end up with far more code, that wasn't hard to write, but required many simple lines of code.

My largest GM project i have on my disk now is 1300 LoC. tiny!
largest personal game project is like, 6000 locs. Also relatively small. Does it do more than the GM project? well it was actually a port of the game, feature parity, but 5x the code.
University team project ended up being around 100k lines of code. Now we are getting somewhere! that really was a large project for me... I ended up writing about 30k lines for that.
Does that project do more than my personal project from before? of course it does! does it do 17x more? eeeh, no. As teams grow, as projects grow, code grows exponentially.
The AAA project I work on now? Ha! uncountable! we are talking about terabytes of data! Uncountable! running a script to find out would take all day!
But at this point the scale is getting really big... its completely incomparable to the previous projects I worked on. I probably contribute around 500-1000 locs on a good week. Way less than I do on my own projects over the weekends!
Does that mean I work more over the weekend then I do during the week at work? probably not.
well that went on a bit of a tangent. Hope it doesn't seem like a weird flex.
I'm actually quite impressed by how compact, in terms of lines of code, the games you all are working on end up being! I guess that's the advantage you get from working with GM :)
Definitely agree with all of this. This topic is more "just for fun" for me.
 

Nocturne

Friendly Tyrant
Forum Staff
Admin
its not against the forum rules sooo, just make every text ever this small, *TINY HIGH PITCHED EVIL LAUGHS*
I would suggest that you READ the forum rules then...

  • Post in all CAPS or use excessive color, bold or large text, or special fonts, or any other excessive formatting. Instead use them sparingly for emphasis.
 

Kezarus

Member
but it seems the batch file won't catch object code from GMS1 projects.
I use GM Studio 1.4. Just copy your .bat into the .gmx folder and voilà. =]

Definitely agree with all of this. This topic is more "just for fun" for me.
Yeah! It's fun to see how efficient some games are.

I’m actually surprised GMS2 doesn't have a built-in system to count code lines.
I don't know that. I use GM Studio 1.4 and it doesn't have this mechanism. I don't think it's that important (by the reasons @GMWolf said) and just go about this 'cause my brother (the other game designer) want to know this info.

I love to do procedurally generated games and this probably shrink the level desing side.

Keep on posting. This is very interesting so far. =]
 
It only says LARGE SIZE of the text
Pretty sure "excessive formatting" covers only using small text. ;)

EDIT:
I use GM Studio 1.4. Just copy your .bat into the .gmx folder and voilà. =]
The .bat file only goes through .gml files. See the following line:
Code:
for /r %1 %%F in (*.gml) do (
In GMS1, all object code is stored inside .gmx files, which appear to be xml files. The only thing that uses .gml files are scripts. If you just add *.gmx to the .bat, you're going to get a lot of false lines added to the number because of all the tags and also because basically every single resource is a .gmx file. If you move the .bat into the "Objects" folder of a GMS1 project, you'll notice you get 0 lines.
 
Last edited:

EvanSki

King of Raccoons
Pretty sure "excessive formatting" covers only using small text. ;)

EDIT:

The .bat file only goes through .gml files. See the following line:
Code:
for /r %1 %%F in (*.gml) do (
In GMS1, all object code is stored inside .gmx files, which appear to be xml files. The only thing that uses .gml files are scripts. If you just add *.gmx to the .bat, you're going to get a lot of false lines added to the number because of all the tags and also because basically every single resource is a .gmx file. If you move the .bat into the "Objects" folder of a GMS1 project, you'll notice you get 0 lines.
Delving into it and how the batch file works it takes the .gml file lets say
Code:
if (pinapples == 1)
{
     game_end();
}
it would count that as 4 lines of code. noting this only reads .gml files, so basically you can do this your self with out a batch file by opening each .gml in a text editor......so in short it has its flaws, how ever we can edit this by adding in some filters when deciding whats a line and whats not, along with what type of files to read.
 

Kezarus

Member
In GMS1, all object code is stored inside .gmx files, which appear to be xml files. The only thing that uses .gml files are scripts. If you just add *.gmx to the .bat, you're going to get a lot of false lines added to the number because of all the tags and also because basically every single resource is a .gmx file. If you move the .bat into the "Objects" folder of a GMS1 project, you'll notice you get 0 lines.
Hmm, how can this script be written better then? With DOS command lines could be a challenge. I can write something in C# if you tell me the rules, but maybe it will be a little bit overkill.
 

EvanSki

King of Raccoons
Hmm, how can this script be written better then? With DOS command lines could be a challenge. I can write something in C# if you tell me the rules, but maybe it will be a little bit overkill.
It depends on how much effort you really want on this as the current one "works"
But if you wanted to go over kill

I wouldnt count lines that are just {}
In .gmx files it needs to cut out all the stuff that isnt code with the same filters of taking out {} lines

You can do it in batch just it wouldnt be fast nor good
 
According to a different line counter, my first game is around 200,000 lines of code.
According to this line counter it has 89,000+ lines.

Then again I tend to code:
Code:
if(this)
{
this = that;
}
My current game has... 138,000+ lines. I thought the line counter was stuck in a loop or something, it just kept going for a full screen of ................

Then there are these four:
https://sitebender.itch.io/alienvania has 5,400 and that's surprising.
https://forum.yoyogames.com/index.php?threads/cloud-cover-a-simple-shmup-play-it-now.54689/ has 5,100
https://forum.yoyogames.com/index.php?threads/16-bit-ish-penguin-platformer.46149/ has 19,000
https://forum.yoyogames.com/index.p...evel-editor-modified-larger-explosions.33086/ has 22,000

The interesting thing of those four is the first two are 1 month projects. One was a 10 day game jam, but the engine took a month then the second was a 3 day game jam that then went on for a month.
The latter two are long term, 6 month projects and they ballpark around the same amount.
 
Last edited:

Kenshiro

Member
I'm currently working on a project that has ~7.2k lines of code.
There's also a much more complex one which has ~23k lines currently.
Both are being made with GMS1.4.
 
L

lorcanarie

Guest
I was wondered how many lines of code my games have and and got this handy dandy script from @Tsa05 this from this thread.

On your project directory (where the .yyp or .gmx file are located), create a .txt file, put the code below inside, save as .bat and double click it.
Code:
@echo off

:CountLines
setlocal
set /a totalNumLines = 0
for /r %1 %%F in (*.gml) do (
    for /f %%N in ('find /v /c "" ^<"%%F"') do set /a totalNumLines+=%%N
    echo|set /p= "."
)

echo .
echo Total number of code lines = %totalNumLines%
echo Making progress!
pause
My project lines are:
OverKill, a top-down scrooling shooter: 1.856 lines
Endless RPG, a turn-based combat in a living random world: 12.234 lines
Shooter, proof of concept that I slap some code in 4h: 37 lines

How much lines are your games? =]
I’m actually surprised GMS2 doesn't have a built-in system to count code lines.
 
I'm sitting at around 7.3k lines for Floramancer right now. I'd guesstimate wildly about another 7k or so left until it's finished. I think I'm nailing down about 250 lines per day at my current rate. If only my quality matched my quantity.
 
Thought you guys might find this as an interesting bit of trivia, and maybe a reference point for your own projects,

According to the old GM website, back when GM was still a one-man band (GM6), it was about 40,000 lines of code, with another 40,000 for the runner.
Game Maker is written in Delphi (version 7 at the moment). Almost all the code was written by Mark Overmars except for a few freeware components to read different image formats and to compress the data. The Game Maker source code is over 40.000 lines of code. The source code for the runner part is similar in size.
Source

Although I imagine it's ballooned out a little bit over the years as the YYG's team have been working on it!
 

Yal

🐧 *penguin noises*
GMC Elder
it was about 40,000 lines of code, with another 40,000 for the runner.
No, it was over 40,000 lines of code... no qualifiers that narrows down how much. So technically this statement still holds:
The Game Maker source code is over 40.000 lines of code
It was over 40k lines of code back then; these days, it's also over 40k lines of code. Probably over 40k with a longer shot, but it's really all we can say with the current information :p
 
No, it was over 40,000 lines of code... no qualifiers that narrows down how much. So technically this statement still holds:
Nerd. :rolleyes:

This somehow does remind me of someone I use to work with who had a job interview. The interviewer asked how big his current project was, and he replied that it was about 'one GB' in just code, and went on to talk about how huge the project was. After the interview, he went back to check how close he was. The project was about 100mb. Close enough. (He did get the job).

It was over 40k lines of code back then; these days, it's also over 40k lines of code. Probably over 40k with a longer shot, but it's really all we can say with the current information
I'm actually wondering about this.

Based on the original source, what Mark referred to as GameMaker seemed to just be the IDE (Runner excluded).

GUI programming tends to get the most bloated, so you'd think with the new GM GUI it would be a factor larger. But remembering that Mark wasn't really a GUI engineer, and GM's old UI was just something he whacked up in his spare time. I wouldn't be surprised if with a bit of good engineering GM's GUI's kept close enough to 40k.

The actual runners themselves.. well, we've got multiple to look at. I'd even hazard a guess the javascript runner's even less lines of code, new feature aside. Javascript is a really concise language.. and 'canvas' graphics set up is just a few lines, as opposed to what I would guess would have originally been hundreds of lines to handle Windows, and it's various quirks.

Android runner, being java-ish, and having to back-ward support a bunch of different OS's, is probably bloated as heck.
iOS runner might be pretty tight, because so few systems it has to work on.
Windows... now that is probably 4x bigger than it was originally. ;)
 

Lukan

Gay Wizard Freak
Well, the current version of Homestead in GMS2 sits at 19161 currently, as I am actively writing more scripts.
The old GMS1 code sits at 66165... A lot of that was bloat I cleaned out a year or so ago, hence the smaller number now.
 

Yal

🐧 *penguin noises*
GMC Elder
I'm currently working on a metroidvania engine... I'm doing everything super barebones, but it's still getting pretty huge! I've worked on it since february. Almost 41k lines of code...
upload_2019-10-8_19-42-44.png
 

Coded Games

Member
Thought I'd give it a try on my last two projects.

My on going large project Decks of Dexterity: 33269
My latest Hour of Code game Cloud Constructor: 3288

That's the difference a week compared to over a year of working on a project.
 

JeffJ

Member
Current side project, which is small in scope and ambition, and about 20% done content wise:
6889

Main project, which is my biggest project to date and has been in development on and off since 2011, all the way from GM8 > GMS1 > GMS2:
66147

But to be fair, that one has a lot of bloat and is a bit of a mess, with all sorts of delicious legacy stuff and simply just bad coding. I'd wager maybe around 20k lines could theoretically be removed/refactored/optimized away and it'd still work - but that would take way too long at this point, and this is one of those cases where it's better to just finish it (as it's actually in production/content development stage too) and then learn from mistakes in the next from scratch project.

EDIT:
Just tried it on the most recent source of Spoiler Alert too, which on top of the base game and all its platform specific code for mobile and Steam, also has more recently added code for Switch and Xbox One:
48037
 

SSJCoder

Member
One time I had this one project which was a lot of LoC, but I was copying/pasting a bunch so... I didn't actually write out most of it xD
It ended up being about ~ 23 k LoC (~ 300 KB if I recall correctly). And wow, those are some big numbers there guys (for everyone posting here).

Haven't made a project that big since (in LoC), and I don't think I will reach that point again (tho I could be wrong) because I'm adapting my programming methods. We will see I guess?
 

Yal

🐧 *penguin noises*
GMC Elder
Checked my latest big project so far out of curiosity, it's got 15174 lines of code. Arguably a bit less since it's got a bunch of scripts with inline data definitions, both my favorite "one-line array assignment helper" variety and a bunch of array definitions created using a helper tool, but... details
 

Japster

Member
Shhhiiiiiii...... Just ran this... ...TetraLogical is 20,747 lines (!)...

Not even added online multiplayer yet, and some more stuff I've yet to implement (challenges, bonuses and penalty tiles mode party play, etc), probably looking at about 24k with those all in...

I could probably drop some commonly used but slightly different events code into scripts, but it runs fine atm, and I daren't change and risk breaking the logic, just for the sake of change! - it's an unwieldy beast as it is... :D

Nice script btw, @Kezarus - thanks for the heads-up!
 
Last edited:
Top