View previous topic :: View next topic |
Author |
Message |
chronozphere DeleD PRO user
Joined: 20 Jun 2006 Posts: 1010 Location: Netherlands
|
Posted: Sat Jan 16, 2010 3:58 pm Post subject: Organize units in directories |
|
|
Hey guys
Would it be possible to organize the units in directories. All those many files in /trunk/units make me dizzy. I'm used to smaller projects (like 20 or 30 files, not 200 )
I was thinking about the following:
--> /Tools/: Most of the units implement some kind of tool. We could make a tools directory (with subdirectories) to organize the tools (vertex tools, primitive tools, skeleton tools, etc etc )
--> /Materials/: All material and texture related code
--> /Animation/: All animation related stuff here
--> /Raytracer/: Allready exists
My main concern is having the tool implementations separated from the rest. It's way easier to find your unit when there is a decent directory structure.
Also, we should add a list of units (the important ones) on the wiki and add a little description for each one of them.
Let me know what you think? |
|
Back to top |
|
|
Paul-Jan Site Admin
Joined: 08 Aug 2004 Posts: 3066 Location: Lage Zwaluwe
|
Posted: Sat Jan 16, 2010 6:56 pm Post subject: |
|
|
As long as we don't end up with < +/- 3 files per folder, I totally agree.
You will be needing a Misc (or whatever you want to call it) folder though, unless you are an absolute wizard at classification. |
|
Back to top |
|
|
Jeroen Site Admin
Joined: 07 Aug 2004 Posts: 5332 Location: The Netherlands
|
Posted: Sat Jan 16, 2010 7:02 pm Post subject: |
|
|
Yep, I agree too. Be aware though, this would be a rather big, project-wide change. Some coordination (as to when/how/etc) would be needed. _________________ Check out Figuro, our online 3D app! More powerful 3D tools for free. |
|
Back to top |
|
|
Paul-Jan Site Admin
Joined: 08 Aug 2004 Posts: 3066 Location: Lage Zwaluwe
|
Posted: Sat Jan 16, 2010 7:07 pm Post subject: |
|
|
Why? It just affects the structure and deled.dpr, nothing more. Go ahead and do it, I say. Then commit. If we hate your guts for it we'll simply revert.
Just make sure to move the files using svn (rightclick-drag-and-drop if you are using TortoiseSVN), not the explorer / command line. There isn't much history to keep at the moment, but still. Have to do this the right way. |
|
Back to top |
|
|
Jeroen Site Admin
Joined: 07 Aug 2004 Posts: 5332 Location: The Netherlands
|
Posted: Sat Jan 16, 2010 8:07 pm Post subject: |
|
|
Paul-Jan wrote: |
Why? It just affects the structure and deled.dpr, nothing more. Go ahead and do it, I say. Then commit. If we hate your guts for it we'll simply revert.
Just make sure to move the files using svn (rightclick-drag-and-drop if you are using TortoiseSVN), not the explorer / command line. There isn't much history to keep at the moment, but still. Have to do this the right way. |
Yeah, that's exactly what I mean. I have some bad experience with SVN and moving files and folders (at least combined with Visual Studio projects) so just wanted to make sure that whoever does rearrange the project pays very close attention to what they're doing.
Edit: Visual Studio in combination with AhknSvn and TortoiseSvn I meant. Combining several SVN clients might mess up things. _________________ Check out Figuro, our online 3D app! More powerful 3D tools for free.
Last edited by Jeroen on Sat Jan 16, 2010 11:09 pm; edited 1 time in total |
|
Back to top |
|
|
chronozphere DeleD PRO user
Joined: 20 Jun 2006 Posts: 1010 Location: Netherlands
|
Posted: Sat Jan 16, 2010 10:16 pm Post subject: |
|
|
Quote: |
You will be needing a Misc (or whatever you want to call it) folder though, unless you are an absolute wizard at classification. Very Happy
|
I think we could leave some "core" components of the code directly in the units/ directory. We could also introduce a "base" directory containing the whole system on which deled is built (abstract classes, enumerations and other definitions). What do you think?
Quote: |
Yep, I agree too. Be aware though, this would be a rather big, project-wide change. Some coordination (as to when/how/etc) would be needed.
|
I was thinking the same thing. Are we sure that the compiler can find all files, even though they are located in subdirectories? (I don't know exactly how Delphi looks for files. Does it iterate through subdirs? )
Quote: |
Just make sure to move the files using svn (rightclick-drag-and-drop if you are using TortoiseSVN), not the explorer / command line. There isn't much history to keep at the moment, but still. Have to do this the right way.
|
Ok, never heard of right-click-dragging before. I'll wait, until we are sure how to organize those files. I'm just an SVN beginner, so you could do it if you want? |
|
Back to top |
|
|
Paul-Jan Site Admin
Joined: 08 Aug 2004 Posts: 3066 Location: Lage Zwaluwe
|
Posted: Sun Jan 17, 2010 9:19 am Post subject: |
|
|
No offense, but if you don't know exactly how Delphi looks for files in subfolders(*), I'm starting to feel a little less confident about my "just do it" suggestion. Like Jeroen says, stuff like this is an immediate build-breaker if not done right.
There are two ways to address this in a less drastic way:
a) you rearrange the files locally and post your suggested structure here in this thread, and then we all discuss things together
b) We change this forum post into a formal tracker issue, where any developer can discuss it and try to pick it up.
Something like that?
----------------------
For the record,
-> The way Delphi handles files in folders(*),
There are 3 search-levels here:
(1) Through direct reference in the .dpr
(2) Through the project search paths
(3) Through the environment (Delphi-wide) library paths.
Units can also find each other "if located in the same folder", but that is a maintenance nightmare I won't go into.
Of these three levels, DeleD uses only (1), to maintain maximum portability from one machine to the next. The file references all use relative folders, of course.
-> Moving files through TortoiseSVN is fully explained in the manual, here. Make sure you practice a bit with this functionality before doing it on a live project! It's really simple once you get the hang of it. |
|
Back to top |
|
|
chronozphere DeleD PRO user
Joined: 20 Jun 2006 Posts: 1010 Location: Netherlands
|
Posted: Sun Jan 17, 2010 11:54 am Post subject: |
|
|
Quote: |
No offense, but if you don't know exactly how Delphi looks for files in subfolders(*), I'm starting to feel a little less confident about my "just do it" suggestion. Wink Like Jeroen says, stuff like this is an immediate build-breaker if not done right.
|
Sorry.. The only thing I didn't know was whether delphi searches through subdirectories. Often I couldn't get a library working, so I started doing some trial and error until it worked. I often added search paths to either the enviroment or a project. As a last option I moved things to the /lib/ directory, which is just "wrong". (But that was years ago lol).
Quote: |
There are 3 search-levels here:
(1) Through direct reference in the .dpr
(2) Through the project search paths
(3) Through the environment (Delphi-wide) library paths.
|
Never seen this info. Thanks alot. Now I can ditch my trial 'n error way of getting things working.
Quote: |
a) you rearrange the files locally and post your suggested structure here in this thread, and then we all discuss things together
|
I think this would be the best option. It gives me the chance to learn and to contribute at the same time. I'll make a local copy and try to make a working build. I'll keep you guys posted.
I'll make sure all files are referened by the DPR (Chronoz looks at DPR now!!) |
|
Back to top |
|
|
Paul-Jan Site Admin
Joined: 08 Aug 2004 Posts: 3066 Location: Lage Zwaluwe
|
Posted: Sun Jan 17, 2010 12:16 pm Post subject: |
|
|
Sweet, looking forward to what you come up with! |
|
Back to top |
|
|
chronozphere DeleD PRO user
Joined: 20 Jun 2006 Posts: 1010 Location: Netherlands
|
Posted: Mon Jan 18, 2010 9:21 pm Post subject: |
|
|
Organizing all the files is really tedious and boring. But i'm not going to give up that easily, because I just know everyone will benefit.
It'll probably take more than a week to re-structure everything (Keep in mind that i'm busy with other things aswell ) |
|
Back to top |
|
|
Paul-Jan Site Admin
Joined: 08 Aug 2004 Posts: 3066 Location: Lage Zwaluwe
|
Posted: Tue Jan 19, 2010 3:23 pm Post subject: |
|
|
Hang in there! Keep in mind that if it had been Loads Of Fun (And Really Simple) to restructure the file tree it would probably have been done ages ago. |
|
Back to top |
|
|
chronozphere DeleD PRO user
Joined: 20 Jun 2006 Posts: 1010 Location: Netherlands
|
Posted: Fri Jan 22, 2010 10:17 am Post subject: |
|
|
Ok, I propose the following:
Quote: |
======= Directories ==========
Base/
Base/Animation/
Base/Bone/
Base/Joint/
Base/Skeleton/
Base/Primitive/
Base/Materials/
Base/Lights/
FileFormats/
Textures/
UI/
Utils/
Libs/
Misc/
Tools/
Tools/Animation/
Tools/Bone/
Tools/Vertex/
Tools/Edge/
Tools/Polygons/
Tools/Face/
Tools/Primitive/
Tools/Creation/
Tools/CSG/
Tools/Joint/
Tools/Skeleton/
========= Remove =========
//Units do not appear to be used
unit_BHV.pas
unit_Raytracer.pas
unit_GeometryManipulator.pas
|
Explanation:
Base contains all abstract/often-used code that forms the structure of DeleD. Some files are stored directly in "base/" while others are put in one of the subdirectories.
Tools contains all tool specific code (abstract tool definitions are in base/). All tools are categorized into sub-directories.
Fileformats contains all XML, DMF and DML related code.
Textures: Pretty self explaining, i guess.
UI: All UI specific code (either reusable elements or big objects like the viewport-manager).
Utils: Powerfull utilities that are used all over the place, but have few dependancies themselves (math, string-utils, datastructures).
Libs: External libraries and their utilities
(This needs to be on the wiki )
Some directories contain very few files, but I decided to add them anyway, for consistency.
What do you think? Can I commit it if I can make this buildable? |
|
Back to top |
|
|
Paul-Jan Site Admin
Joined: 08 Aug 2004 Posts: 3066 Location: Lage Zwaluwe
|
Posted: Fri Jan 22, 2010 2:58 pm Post subject: |
|
|
First of all, excellent work.
- I like your basic structure, but I'm waiting for the responses by others. Mainly JC.
- I do think you might have overdetailed a bit here and there, for instance I don't see Base/Lights containing more than a single file (unit_lights). A folder containing a single file is overdoing it (i.e. makes it harder to navigate, not easier). Then again, one could argue that unit_lights should be split up, and consistency is good.
- I just deleted the tree obsolete files from the repository. Good job spotting them, now you don't have to worry about them any longer.
- It is really important that you move these files through the versioning system (i.e. shift-move in tortoisesvn) to keep their history. Even though we don't have much history, this has to be done right on principle. Because of this, I'd very much prefer to this trough a patch (I am assuming the patch format properly supports) so the moves can be verified by a second pair of eyes before they end up into the repository. Shouldn't matter too much for your workflow, just do your thing, then generate a patch and submit it to sourceforge in stead of doing the commit. |
|
Back to top |
|
|
chronozphere DeleD PRO user
Joined: 20 Jun 2006 Posts: 1010 Location: Netherlands
|
Posted: Fri Jan 22, 2010 5:47 pm Post subject: |
|
|
Good... I'll take another close look at it. You are right about the lights. On the other hand, the directory will not contain a single file. It will also contain the tree "light builder" units.
I'm not too sure about the Bone tools though.. There's only a single file (BoneremoverTool AFAIK). I think I better put this one in "Tools/". On the other hand, It will then be the only file there (the rest are sub-dirs). |
|
Back to top |
|
|
Jeroen Site Admin
Joined: 07 Aug 2004 Posts: 5332 Location: The Netherlands
|
Posted: Fri Jan 22, 2010 6:58 pm Post subject: |
|
|
I like the structure as well. I don't mind having only 1 file in a directory if the file logically needs to be separated from the rest.
I do have questions about the UI directory. The user-interface of DeleD consists of forms, frames and a number of additional units. Further detailing of that directory might be a good idea. _________________ Check out Figuro, our online 3D app! More powerful 3D tools for free. |
|
Back to top |
|
|
|