• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.

Archived

This topic is now archived and is closed to further replies.

vallis

Count Your Code

24 posts in this topic

I just knocked up a little program to count how many lines of code there are in a project. Dunno if anyone else would like to play with it or would find it useful but you can get it here if you want it. http://members.xoom.com/blvallis/CodeCounter/CodeCounter.zip If you do use it mail me or leave a message here so I can feel all warm and fuzzy inside
0

Share this post


Link to post
Share on other sites
Hey, I''m using it! That''s pretty cool, man! hehe.. I wish I could code as good as you! :p

Programming::~Fredric(const Annoy_Ance)
0

Share this post


Link to post
Share on other sites
I haven''t tried it yet, but I''d like to because some friends at school always asks me how many lines of code I have written, I personally think that''s pure crap because there''s no way the amount of code can express how good/bad your code is (well, maybe in extreme cases).

Can you make it count Visual Basic source files too, if it''s not too much to ask?

============================
Daniel Netz, Sentinel Design
"I'm not stupid, I'm from Sweden" - Unknown
0

Share this post


Link to post
Share on other sites
Also, the number of lines doesn''t even accurately depict how much code there is, since some people write condensed code where many lines are long, whereas others write code spread among many lines, with a lot of white space and comments, and function parameters each on their own line.

But it seems like a useful utility anyway.

~CGameProgrammer( );

0

Share this post


Link to post
Share on other sites
Its true, lines of code are no indicator of skill or amount of work. However it is a ''fun'' way to indicate the progress of a project etc

Spiff - I think that might be a bit difficult because the VB files contain more than source code. I could count the lines in .mod files easy enough but .frm files would take a bit of parsing.

If anybody else wants a VB edition though, post here and Ill do it
0

Share this post


Link to post
Share on other sites
Yeah - I decided i''ll do the VB version tonight. Tell me if im missing anything here:

* Im gonna add a combo box to select C++ or VB mode.
* Im gonna read in the amount of lines in .mod files
* Im gonna read in the amount of lines in .frm files *after* the form declaration section.

Am I missing anything here or is that all?
0

Share this post


Link to post
Share on other sites
Yep, .cls files too (classes). I''m not really sure if there are any other file types for VB cuz I''m at work now and I can''t check it, but I can do it tonite.

============================
Daniel Netz, Sentinel Design
"I'm not stupid, I'm from Sweden" - Unknown
0

Share this post


Link to post
Share on other sites
Cool - thanks everyone.

If someone could post a full list of extensions then i'll get to work on it...

I take it .bas is the extension for VB modules (not .mod as I thought)

Is there any other programs that I could support as well - may as well make the program complete if i'm gonna do it

I'll probably add assembler .asm support as well

PS - What are peoples thoughts on using multiple directories in their source tree...does anyone use more than one directory to store their source, and therefore should I add functionality for this??

Edited by - vallis on 3/10/00 5:30:18 AM
0

Share this post


Link to post
Share on other sites
I just create a directory called "Source" and just throw all my source files into there.

Add a character counter as well that ignores whitespace.

more accurate code count


Edited by - Kavos on 3/10/00 5:34:08 AM
0

Share this post


Link to post
Share on other sites
quote:
Original post by Kavos

I just create a directory called "Source" and just throw all my source files into there.

Add a character counter as well that ignores whitespace.

more accurate code count


Edited by - Kavos on 3/10/00 5:34:08 AM

Consider it done. I''ll put all of you on the credits for this thing too
0

Share this post


Link to post
Share on other sites
Hey. All done (nearly)

Just added character counting support, and a few other niceties. Also added preliminary VB support. Havn''t been bothered to parse the FRM files yet so at the moment it includes all of your window details in the count. Ill fix this soon...can anyone suggest a quick way of detecting the start of the code?

I thought about counting the "Begin"''s and "End"''s and when you have matching Begins and Ends you are in the code section. Thats my best one so far...

Also - for VB I currently look at the extensions .BAS .CLS .FRM - are there any others??

Code Counter Version 1.1
http://members.xoom.com/blvallis/CodeCounter/CodeCounter-1_1.zip

Enjoy!
0

Share this post


Link to post
Share on other sites
In answer to the question about detecting the start of code in VB form files look for lines beginning with ''Attribute''. These follow the form definition and preceed the code (VB5+ only). I dont think you should disregard the form definition though - it provides an indication of the complexity of the form. Perhaps you want to start maintaining different counters for different aspects of the code (how much time where you going to put into this app?)

The cleanest way to analyse VB projects is via the project file (.vbp in VB5,6 and .mak in VB3). This includes the OCX references and project properties as well as a list of all the files which make up the project. Working from this means that you pick up all files regardless of where they are *and* you don''t count files which happen to be in the project directory but aren''t part of the project any longer.

Because I work with large VB projects that share code and use split folders I wrote a utility to copy projects, check for bad file references, compare source intelligently, etc. The code''s pretty crude, but I could cut out the section which parses the project file if that would be useful. Of course it might be faster for you just to pick up a complicated project file and work out it''s structure yourself - there''s really not much to it. Reply here if you want me to email you any of this (I can also provide some sample project files - both VB 3 and 5).

Among all the other things the VB team did right storing the whole project in text files was an often overlooked blessing.
0

Share this post


Link to post
Share on other sites
Hey, your code counter sounds really cool.

It''s a nifty, fun way to demonstrate the project''s
completion.
But a lot of people say code lines are no indication
of the greatness of the project.
So why not count procedures?
And/Or Classes, structs etc...
Just a little idea for you...

Take it easy,

-Mezz
0

Share this post


Link to post
Share on other sites
One thing that would be cool to see is the ability to check all of the sub-directories as well. Large projects generally don't have all of the source in a single directory.

BTW, how are you determining a line? Are you counting semicolons? Carriage returns? Do you include comments in the line count?


Mark Fassett
Laughing Dragon Entertainment
http://www.laughing-dragon.com

Edited by - LaughingD on 3/11/00 4:12:27 AM

Edited by - LaughingD on 3/11/00 4:15:04 AM
0

Share this post


Link to post
Share on other sites
quote:
Original post by LaughingD
BTW, how are you determining a line? Are you counting semicolons? Carriage returns? Do you include comments in the line count?



Currently carriage returns...comments are included.

0

Share this post


Link to post
Share on other sites
quote:
Original post by Mezz

Hey, your code counter sounds really cool.

It''s a nifty, fun way to demonstrate the project''s
completion.
But a lot of people say code lines are no indication
of the greatness of the project.
So why not count procedures?
And/Or Classes, structs etc...
Just a little idea for you...

Take it easy,

-Mezz



Noted for a future version
0

Share this post


Link to post
Share on other sites
quote:
Original post by LaughingD

One thing that would be cool to see is the ability to check all of the sub-directories as well. Large projects generally don''t have all of the source in a single directory.



Yeah - this is what I was asking about earlier...I''ll try and add support for this ASAP.

0

Share this post


Link to post
Share on other sites
You might wanna add these files too, they''re available in Visual Basic 6 (UserControls and PropertyPages), they work like a .frm file, with the Begin and End.

.ctl
.pag

============================
Daniel Netz, Sentinel Design
"I'm not stupid, I'm from Sweden" - Unknown
0

Share this post


Link to post
Share on other sites
Thats a great utility! Very useful, I now use it all the time (hey, I *AM* an egomaniac after all ).
Like Fredric said I wish I could make programs like that
0

Share this post


Link to post
Share on other sites
quote:
Original post by Spiff

You might wanna add these files too, they''re available in Visual Basic 6 (UserControls and PropertyPages), they work like a .frm file, with the Begin and End.

.ctl
.pag

============================
Daniel Netz, Sentinel Design
"I''m not stupid, I''m from Sweden" - Unknown



Thanks again Spiff
0

Share this post


Link to post
Share on other sites
quote:
Original post by Staffan

What about the .c extension?



"I think, therefore I am...I think"


The .C extension is already supported, it has been since the first version. Have you had problems with it with .C files Steffan? If you have could you email me so I can get it fixed. Thanks


Also - thanks to Blah! - consider me flattered yet again

0

Share this post


Link to post
Share on other sites
Well - version 1.2 is done. It is mainly code and cosmetic changes but I would like some feedback on it. I have put a listview on the window so I can show more statistics about a project and I have added a file counter too.

Does everyone prefer the interface this way?

Also - for the interested, the code was very poor before, and I have now completely OOP''d it up into a class and its ''nice''. I may release it as open source one day.

The VB support is the same as before, but I will add the new stuff soon.

The Include Subdirectories dosn''t work yet and neither does the Generate HTML thingy. That was just my crazy idea to make some HTML code about the project to go straight into a webpage. Will fix it by the next version.

Have fun!

http://members.xoom.com/blvallis/CodeCounter/CodeCounter-1_2.zip
0

Share this post


Link to post
Share on other sites