Fires of Heaven Guild Message Board  

Go Back   Fires of Heaven Guild Message Board > Fires of Heaven Related Forums > Uberworlds Development Forum
User Name
Password
Or, use your gamerDNA username: (more...)
ForumSpy Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
Old 09-19-2008, 05:59 PM   #1 (permalink)
Cloud9_
Registered User
 
Join Date: Jul 2002
Location: Los Angeles California
Posts: 231
+8 Internets
Send a message via ICQ to Cloud9_
Organizing a large project

Anyone have some good reading material on how to organize a large project? My code is starting to get up there in size, right now its over 15k lines of code and I have a feeling it may top off at 30k before the engine is fully developed. I'm doing a lot of refactoring right now since I finished my dreambuildplay project.
Cloud9_ is offline   Reply With Quote
Old 09-20-2008, 11:30 AM   #2 (permalink)
Jenison
Cracker ass cracker
 
Jenison's Avatar
 
Join Date: Nov 2004
Location: Cave
Posts: 652
Like my code at work, class libraries are your friend. Organize your code with namespaces and dlls based on their category.

Example

I have

condev.tools - holds various objects that just help other code
condev.physics - holds physics objects such as AABB objects
condev.convert - will convert things for me. ie Collada to my model format and vice versa
condev.command - handles all my command queues and base command objects

this promotes reusable code so you spend less time reinventing the wheel.

PS - 15k is nothing :P
__________________
Waiting for [mmo name] to save us from [last mmo we were waiting for]
Jenison is offline   Reply With Quote
Old 09-20-2008, 12:37 PM   #3 (permalink)
Cloud9_
Registered User
 
Join Date: Jul 2002
Location: Los Angeles California
Posts: 231
+8 Internets
Send a message via ICQ to Cloud9_
Quote:
Originally Posted by Jenison View Post
Like my code at work, class libraries are your friend. Organize your code with namespaces and dlls based on their category.

Example

I have

condev.tools - holds various objects that just help other code
condev.physics - holds physics objects such as AABB objects
condev.convert - will convert things for me. ie Collada to my model format and vice versa
condev.command - handles all my command queues and base command objects

this promotes reusable code so you spend less time reinventing the wheel.

PS - 15k is nothing :P
Thanks for the reply, thats kinda how I'm doing things now but not a little different. But you gave me something to think about and some new ideas

15k is probably about the size of a very basic minor system in a real engine im thinking... what do full engines go for now a days? is it 100's of thousands or larger?

But to someone who has yet to write a very large program, 15k looked like a lot hehe.
Cloud9_ is offline   Reply With Quote
Old 09-21-2008, 09:06 AM   #4 (permalink)
Throag
Registered User
 
Join Date: Aug 2002
Location: Paris
Posts: 375
+1 Internets
I don't remember if this is already the case, but I strongly advise you to use some kind of versionning tool if you do not already. It's a must have, even for a personnal project like what you are working on.
SVN is free and quite easy to setup for instance.
Throag is offline   Reply With Quote
Old 09-23-2008, 08:54 AM   #5 (permalink)
findar
Registered User
 
findar's Avatar
 
Join Date: Aug 2002
Posts: 3,902
+11 Internets
Send a message via AIM to findar
i think the old quake2 engine was a half a million lines. but that doesn't mean anything, its all about optimization. what good is 50 lines of code if 3 can do it faster? one thing to look at is how can you optimize the code better.
__________________
-its clobbering time
findar is offline   Reply With Quote
Old 09-23-2008, 02:22 PM   #6 (permalink)
Cloud9_
Registered User
 
Join Date: Jul 2002
Location: Los Angeles California
Posts: 231
+8 Internets
Send a message via ICQ to Cloud9_
need to write it first.. I wont start optimizing until I get to a point where it needs to run faster. I don't write 10 lines of code where 3 will work, but I also don't try to work out how to write a block of code to be the fastest it can be if its only goingt o be called every few cycles.
Cloud9_ is offline   Reply With Quote
Old 02-02-2009, 12:40 PM   #7 (permalink)
CnCGOD
Conservative Whipping Post
 
Join Date: Jan 2003
Posts: 1,378
-55 Internets
While that approach works, often the effort to rewrite parts is more than the total initial effort if your not thinking optimization from day 1.
CnCGOD is offline   Reply With Quote
Old 02-02-2009, 06:59 PM   #8 (permalink)
Froofy-D
upper management material
 
Froofy-D's Avatar
 
Join Date: Nov 2002
Location: Orlando, FL
Posts: 2,198
+17 Internets
Quote:
Originally Posted by Cloud9_ View Post
15k is probably about the size of a very basic minor system in a real engine im thinking... what do full engines go for now a days? is it 100's of thousands or larger?
Just to give you an idea, the small Space/RPG project I'm doing for my dissertation is up to nearly 35,000 lines. The pic below is from this cool line counter tool I found:

CodeProject: Simple Source Line Counter in C# for C#. Free source code and programming help

It ended up that the UI takes the most code. Oh and each of those categories below is a folder with multiple .cs files. I tried to distribute the code files into folders in a logical way.
Attached Images
 
Froofy-D is offline   Reply With Quote
Old 02-02-2009, 08:49 PM   #9 (permalink)
Faille
Fires of Heaven Officer
 
Join Date: Jan 2002
Location: Melbourne, Australia
Posts: 3,364
+25 Internets
0 content?!
__________________
Faille
Fires of Heaven
http://www.fohguild.org/forums/uberw...lopment-forum/
Faille is offline   Reply With Quote
Old 02-02-2009, 11:02 PM   #10 (permalink)
Camerous
-internets from anon retards mean jack
 
Camerous's Avatar
 
Join Date: Nov 2003
Location: Overthere next to that place
Posts: 2,720
-79 Internets
Quote:
Originally Posted by Faille View Post
0 content?!
He must work for Sigil! Ouch sorry.. couldn't help myself lol
__________________

Give me more -internets you little bishes!
Camerous is offline   Reply With Quote
Old 02-03-2009, 11:54 AM   #11 (permalink)
rangoth
collector of stuff
 
rangoth's Avatar
 
Join Date: Feb 2006
Location: constitution beach
Posts: 863
+9 Internets
Send a message via AIM to rangoth Send a message via MSN to rangoth
Quote:
Originally Posted by Cloud9_ View Post
need to write it first.. I wont start optimizing until I get to a point where it needs to run faster. I don't write 10 lines of code where 3 will work, but I also don't try to work out how to write a block of code to be the fastest it can be if its only goingt o be called every few cycles.
I HIGHLY recommend unit testing in the extreme as you write stuff and optimize at that level. Yes you can optimize once it's all said and done but you are just making it more difficult on yourself. Do it at the micro level as much as possible.

Notes to help organize large code projects(some have been stated):
1.) Name and locate stuff appropriate within namespaces and classes that make sense.
2.) Use a version/checkin system. CSV(long time since college but I think that was free), always MS Source Safe for those in the standard windows business world, probably about a thousand other solutions out there too. Just check on google.
3.) It's hard to make a full UML diagram for a large project, especially if you program as you go because this is a personal thing. But do try. At the bare minimum map out a full high level-architecure, and at least classes and their basic function.
4.) Test again when you are done testing
5.) Set goals and checkpoints. Stick to them. Don't feature creep. Learn the resource triangle!

I'm sure there are more as well. I've worked on huge software projects at both small and large companies as both developer and manager so I have a decent amount of experience and it still sucks. There is always crap that gets by or some idiot sales guy who tells you 2 days before it due that he just promised the client something that doesn't exist and now wants me to have my team stay all weekend to get it in! Fuck those dudes, I just tell them to screw now.
rangoth is offline   Reply With Quote
Old 02-04-2009, 02:57 AM   #12 (permalink)
Throag
Registered User
 
Join Date: Aug 2002
Location: Paris
Posts: 375
+1 Internets
Quote:
Originally Posted by rangoth View Post
2.) Use a version/checkin system. CSV(long time since college but I think that was free), always MS Source Safe for those in the standard windows business world, probably about a thousand other solutions out there too. Just check on google.
I think you mean CVS. But no, don't use CVS, it's a steaming pile of crap. Use SubVersion (SVN) instead. It has it's problems but it's still free and much better than CVS.
I will second the use of unit tests. But even though it look simple, it's not. Making good and relevant unit tests is not an easy task and is difficult to learn alone if don't have a minimum software developement experience but in the end the effort is worth it.
As for the whole "optimize early" versus "optimize later" debate, I'm more on the later side. A program using a good algorithm will always be faster than an ultra optimized (and impossible to maintain/expand) program using a shitty algorithm. There are indeed some stuff you can think and do early on but it really depends on what you are doing.

Last edited by Throag; 02-04-2009 at 03:04 AM..
Throag is offline   Reply With Quote
Old 02-04-2009, 12:28 PM   #13 (permalink)
rangoth
collector of stuff
 
rangoth's Avatar
 
Join Date: Feb 2006
Location: constitution beach
Posts: 863
+9 Internets
Send a message via AIM to rangoth Send a message via MSN to rangoth
Quote:
Originally Posted by Throag View Post
I think you mean CVS. But no, don't use CVS, it's a steaming pile of crap. Use SubVersion (SVN) instead. It has it's problems but it's still free and much better than CVS.
I will second the use of unit tests. But even though it look simple, it's not. Making good and relevant unit tests is not an easy task and is difficult to learn alone if don't have a minimum software developement experience but in the end the effort is worth it.
As for the whole "optimize early" versus "optimize later" debate, I'm more on the later side. A program using a good algorithm will always be faster than an ultra optimized (and impossible to maintain/expand) program using a shitty algorithm. There are indeed some stuff you can think and do early on but it really depends on what you are doing.
You are right, it's CVS. I kept looking at that and thinking of the store so I changed it Been a long time since college.

What I meant by optimize early was as you said...per function, per equation. If you write shit and then wait until your entire project is done until you notice that your crappy method of sorting/searching/calculating is taking 30 seconds it can often be too late. Or perhaps you change it to make it short and fuck up the job it does in some odd way you didn't realize the rest of your code relied on. Chain reaction type thing.
rangoth is offline   Reply With Quote
Old 02-04-2009, 03:32 PM   #14 (permalink)
Soygen
100% Pure Soy Monk
 
Join Date: Mar 2002
Location: Ft. Lauderdale, FL
Posts: 7,447
+107 Internets
Quote:
Originally Posted by Camerous View Post
He must work for Sigil! Ouch sorry.. couldn't help myself lol
This could turn it around for Galactic Arms Race.
Soygen is offline   Reply With Quote
Old 02-04-2009, 07:28 PM   #15 (permalink)
Froofy-D
upper management material
 
Froofy-D's Avatar
 
Join Date: Nov 2002
Location: Orlando, FL
Posts: 2,198
+17 Internets
Haha the VG jokes never get old.

Actually, the content folder is the vast majority of the MB size of the game (music, textures, models). However, there are no lines of C# code in it. Content is basically just raw data.
Froofy-D is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On

uberguilds network



All times are GMT -7. The time now is 07:11 AM.


Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.0.0 RC6