Page 1 of 5

[DONE] Clean up

PostPosted: 03 Mar 2011, 08:08
by StefanP.MUC
Some clean up tasks that could be considered.

[None left]

Re: Clean up

PostPosted: 03 Mar 2011, 10:37
by oln
Folder structure - what should be cleaned up here?
gui folder content - i assume you are working on that
fonts folder - yes, we could probably do that
setting default font - will fix this once the new gui is up in the repos
"example" programs - it is the shader programs that we use. Currently we use the default ogre ones. We could possibly do a rename, though we will have to look at how exactly we deal with the shaders after this release is out and we are going to look more into normal mapping.
development - can probably be deleted
media.cfg - have to check that, if it's not used it should be removed
"ExampleApplication" - There is another class "MapEditor" that inherits from this one. These two classes should be merged, and cleaned up.
Plugin directory - if you mean the ogre plugins, yes it is like that on windows currently, we should probably create a plugins folder, this should be easy to change.

Re: Clean up

PostPosted: 03 Mar 2011, 10:51
by StefanP.MUC
Yeah, my local OD installation already uses the cleaned up gui/font structure. For the last steps there's also code changes needed.
Yup, the Ogre plugins on Windows.
If there's something called "example" this always looks so "cobbled". ;)

edit: The folder structure: remove the "Media" folder. Now it's od\Media\gui, it could also be "od\gui".There's no other folder besides "Media" in the od root directory.

Re: Clean up

PostPosted: 03 Mar 2011, 11:55
by TheAncientGoat
I agree, the media folder, especially the textures folder, could use cleaning up. Personally, I'd like to see folders for each creature, which would make it slightly more sane. Also, what's up with those material preview images? Surely they aren't used for anything?

Re: Clean up

PostPosted: 03 Mar 2011, 11:57
by StefanP.MUC
Yeah, everything that isn't needed for running the game shouldn't be shipped.

Re: Clean up

PostPosted: 03 Mar 2011, 13:14
by Skorpio
TheAncientGoat {l Wrote}:I agree, the media folder, especially the textures folder, could use cleaning up. Personally, I'd like to see folders for each creature, which would make it slightly more sane. Also, what's up with those material preview images? Surely they aren't used for anything?

Regarding the textures folder, It's more convenient for me to have everything in one folder. I often have to make a lot of changes to the materials and textures and it would be rather annoying to switch the folder everytime I have to adjust something.

What do you mean with material preview images? I think everything (or almost everything) in this folder is used.

Re: Clean up

PostPosted: 03 Mar 2011, 13:20
by oln
Having all textures in one folder is okay IMO, though the material scripts should be moved to the "scripts" folder.
Having a folder for each creature would just be more confusing.

Re: Clean up

PostPosted: 03 Mar 2011, 14:38
by TheAncientGoat
For example what is "Media/materials/textures/buvneurt_env5.png" and all the other Env* maps used for?

There are ways to work in separate folders from a central location too, and while having everything in one folder is kind of convenient, it is rather... messy

Re: Clean up

PostPosted: 03 Mar 2011, 14:56
by Skorpio
Env maps are environment maps. They are used to fake reflections. But I just found some textures that were redundant, like the different wall textures, and removed them.

TheAncientGoat {l Wrote}:There are ways to work in separate folders from a central location too, and while having everything in one folder is kind of convenient, it is rather... messy

I don't care if it's messy, as long as it's faster.

Re: Clean up

PostPosted: 03 Mar 2011, 15:05
by TheAncientGoat
If it's messy, it can be harder for new people to get used to the setup, also makes it harder to glean the amount of content that's already created, find related files etc.

Re: Clean up

PostPosted: 03 Mar 2011, 15:36
by svenskmand
Skorpio {l Wrote}: I don't care if it's messy, as long as it's faster.

I agree, nobody will look at this. And the few people who will (Skorpio) should have it their way to be able to work efficient. When we make a new release it is automatically compiled and packaged anyways. And players of the game could not careless about file structure in the game folder, they will never look at it.

The clean up should benefit us the developers, not be a hassle.

Re: Clean up

PostPosted: 03 Mar 2011, 15:51
by Bodsda
svenskmand {l Wrote}:
Skorpio {l Wrote}: I don't care if it's messy, as long as it's faster.

I agree, nobody will look at this. And the few people who will (Skorpio) should have it their way to be able to work efficient. When we make a new release it is automatically compiled and packaged anyways. And players of the game could not careless about file structure in the game folder, they will never look at it.

The clean up should benefit us the developers, not be a hassle.


I have a different view point. All structure should be designed to allow for collaboration and joint development. Whichever way is chosen, it needs to be documented. A new developer poking around in the project files should be able to understand almost everything from developer documentation and the folder structure, rather than having to ask the project devs how things are structured.

Bodsda

Re: Clean up

PostPosted: 03 Mar 2011, 15:57
by svenskmand
Also true :)

Re: Clean up

PostPosted: 03 Mar 2011, 16:51
by StefanP.MUC
The content grouping is one aspect (the graphic guys can sort their stuff as they like it). But another aspect is the folder "deepness". The folder structure should not be unnecessary deep. That's why I suggested removing the Media folder. It's an unneeded level of deepness (because there are no other folders on the same level). That's like putting a multi-panel bookshelf in a one-panel cupboard. ;)

Re: Clean up

PostPosted: 04 Mar 2011, 15:06
by Bodsda
blablub {l Wrote}:The content grouping is one aspect (the graphic guys can sort their stuff as they like it). But another aspect is the folder "deepness". The folder structure should not be unnecessary deep. That's why I suggested removing the Media folder. It's an unneeded level of deepness (because there are no other folders on the same level). That's like putting a multi-panel bookshelf in a one-panel cupboard. ;)


This also has a technical reasoning behind it - NT based Windows systems struggle with long folder paths. The MAX_PATH is set to 260, with a realistic maximum of 248 and apparantly the windows API in unicode can address 32,767 character paths. However, when creating directories, it is not possible to exceed the MAX_PATH.

Bodsda

Re: Clean up

PostPosted: 04 Mar 2011, 16:03
by andrewbuck
Thats a good point. Initally I was against the idea of moving the media folders out of media, however Bodsda's comment about the max_path is a good one.

-Buck

Re: Clean up

PostPosted: 04 Mar 2011, 18:30
by StefanP.MUC
Updated my list in the first post.

Re: Clean up

PostPosted: 04 Mar 2011, 18:59
by andrewbuck
Regarding the use of ExampleFrameListener, ExampleApplication, etc in the code: changing these is not conceptually difficult but would take quite a bit of doing and I don't really know what to change them too anyway. OpenDungeonsFrameListener is not any more specific or informative. Also, the only place those names are actually really used is in the 100 or so lines of Ogre code which creates them and calls a few of their functions. The bulk of the actual game code doesn't do anything with those names anyway (or shouldn't once I get things reorganized a bit better). I am not opposed to changing the names in principle I just don't think there is much to be gained anyway. Additionally: those are the names Ogre tutorials, etc, use so other Ogre coders will immediately know what those classes are used for and what methods they should expect the classes to have.

-Buck

Re: Clean up

PostPosted: 04 Mar 2011, 21:36
by StefanP.MUC
By the way, why does the git repo has a Media folder (with only the test level file) as well? Is this needed?

Re: Clean up

PostPosted: 04 Mar 2011, 22:09
by andrewbuck
There has been much discussion about this. I basically consider the file Media/levels/Test.level to be more a part of the source code than I think of it as "art content". When the game loads it automatically reads this file and if the format is not exactly correct it will crash without giving you any kind of useful error message. So if I change the code and the file format changes I want to make absolutely sure that anyone who downloads the new code also gets at least one level that will load properly when they run the game.

-Buck

Re: Clean up

PostPosted: 04 Mar 2011, 22:17
by svenskmand
Why not use xml for the level files then you can check for the version of the game and other stuff and then give back propper error messages

Re: Clean up

PostPosted: 04 Mar 2011, 22:20
by StefanP.MUC
Yes, using something more "standard" (XML sounds good, like svenskmand said) is something I support, too.

Re: Clean up

PostPosted: 04 Mar 2011, 22:49
by andrewbuck
Presently, the format that is stored in the file and the format that is sent over the network in multiplayer games is identical. This makes coding the multiplayer system much easier since the same code used to read the level files is used to talk over the network, and any changes to the code for one automatically bring the other up to date. If I used XML for the level file it would mean that the network would either also have to use XML (which would slow it down significantly), or I would have to use separate code for network and level file loading. Since the level file is not meant to be edited by hand when the game is finished, I opted to go with this format which is more like the binary format that will be eventually be used on both the network and the level files.

-Buck

Re: Clean up

PostPosted: 04 Mar 2011, 23:04
by StefanP.MUC
Ah ok, didn't know about the network handling. And the argument about the user not being supposed to edit directly the files is true. So you are probably right in using this selfmade format.

Re: Clean up

PostPosted: 05 Mar 2011, 00:46
by svenskmand
I do not know exactly how you have made the network code so it works using the games code for loading levels, but with XML you could make a visitor that translate the XML into the corresponding network format, which is then sent. That way you do not have to send more data over the network?