Page 1 of 1

Development guidelines

Posted: 05 Jun 2004, 07:11
by ElvenProgrammer
As many of you requested here are some basic rules to "The Mana World Development Team". Hey it sounds good!
I suggest you to check this section frequently because it can change as the development goes on... :shock:

GENERAL

Every header file should contain at the beginning:

Code: Select all

// The Mana World (C) 2004
Just to give a semiprof aspect eheh.

COMMENTS

Every function should be preceded by:

Code: Select all

/** What this function does */
If you want to comment also some variables or other lines of code just put:

Code: Select all

// comment
at the end of the line.


DIR TREE

-The Mana World
|->Gui
|-->Skin
|->Graphic
|->Net
|->Maps
|->Sound
|-->BGM
|-->Samples

Well the names should be self-explanatory. The showed dir tree should be used for code but also for essential files such as bitmaps, mp3s, ecc..

FILE NAMES

File names as for every good program should have useful names.

GUI FILES:
*_dialog.h/.cpp (Where * stands for the function of the dialog: chat_dialog, new_char_dialog, ecc...)
BEINGS/ITEMS FILES:
npc.h/.cpp, item.h/.cpp, card.h/.cpp, ecc...

MODIFICATIONS TO CODE
When someone modifies other people's code they should add this lines:

Code: Select all

// "Author" "Version" "Date"
// "Description"

Modified code

// END
For example:

Code: Select all

// Elven Programmer v1.0 5/6/04
// I modified this code because I didn't like it! ihihih

...

// END

Posted: 05 Jun 2004, 07:12
by ElvenProgrammer
If you have questions feel free to post the here and good work to everyone! :D

Posted: 05 Jun 2004, 08:42
by natsuki
this will be additional task for us..
but surely it will be helpful
as it doesnt manifest now, the effect will in the near future^^
hope we all comply^^

Posted: 25 Aug 2004, 20:20
by VDM
Most code isnt really c++ oriented but for just incase.. some notes about member variable naming.

member variables should have a prefix of m_ followed by the type and finally the name.

eg

class CTile {
bool m_bPrivate;
public:
CTile();
virtual ~CTile();
m_strPublic;
};

b = bool
n = int,float,double.. any numberic
str = string
p = pointer

Ofcause this is just a proposal :)
But is does make sence as makes the code alot more clear, specially in derived works.

Some standard notation type would be handy too, though i have not to much trouble reading others code.. i does makes other people code more easy to read.

Could there be a one and only "Design" or Use-Case thread?
This is where everything that is made final will be described/noted.

Bascially it tells what we want and maybe how we want it.
And that all in the first message what will be kept as best as possible. This will leave space in the remaining thread is for questions.

How do you people think about this?

Posted: 26 Aug 2004, 12:15
by ElvenProgrammer
Pratically all the code is plain C except for some useful features of C++, for example local variable declaration. The code is not and I don't think will never be object oriented.

I don't understand the need of that prefix. Maybe if you can explain what does it mean a little better... Anyway you should understand I'm an old programmer of the old good C times, so my programming conventions are those one of a good C programmer so no need to specify the typa of a var also in the name. I've also tryed a lot of Java and those conventions you suggested, but in the end I prefer this way, If everyone prefer the one you suggested I'll change the code immediately :D

About your proposal for a Design or Use-Case Thread I like it a lot and if you can manage to make it, it will be great.

About the guidelines, there is a modification, now all the files will not contain

Code: Select all

// The Mana World (C) 2004
but the standard GPL header. For more infos look at source code.

Posted: 26 Aug 2004, 15:12
by VDM
If your working in classes and you read other peoples code, youl see right away that its a member var declared in the class definition or not. Specially handy if you work with derived works.. ofcause mainly handy for OO since member vars shoudnt be accessable by default :)

The prefix for type.. wel its just that u know what type it is right away.
The Company i worked for used prefixes like these and i started to like them very much becase it makes things very clear.

One can never do enough to make things clear i recon :wink:
Thats all :)

Posted: 27 Aug 2004, 07:19
by Chetic
I hope you move the BGM folder into sound some day..
Since music is sound :)
BGM looks kinda weird for some reason.. should be one full word.

Posted: 24 Sep 2004, 23:29
by bay
VDM wrote:Most code isnt really c++ oriented but for just incase.. some notes about member variable naming.

member variables should have a prefix of m_ followed by the type and finally the name.
this is called hungarian notation.

http://msdn.microsoft.com/library/defau ... anotat.asp

.02$

Posted: 25 Sep 2004, 07:30
by ElvenProgrammer
Oh yes, you're right. I've studyed it once, but I didn't like it and so removed it from my memory...