Development guidelines

Content and general development discussion, including maps, quests, and server code from the development team.
Post Reply
User avatar
ElvenProgrammer
TMW Adviser
TMW Adviser
Posts: 2526
Joined: Tue Apr 13, 2004 8:11 pm
Location: Italy
Contact:

Development guidelines

Post by ElvenProgrammer » Sat Jun 05, 2004 8:11 am

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
Last edited by ElvenProgrammer on Fri Jun 25, 2004 10:11 am, edited 2 times in total.
User avatar
ElvenProgrammer
TMW Adviser
TMW Adviser
Posts: 2526
Joined: Tue Apr 13, 2004 8:11 pm
Location: Italy
Contact:

Post by ElvenProgrammer » Sat Jun 05, 2004 8:12 am

If you have questions feel free to post the here and good work to everyone! :D
User avatar
natsuki
Novice
Novice
Posts: 105
Joined: Sat May 22, 2004 9:35 pm
Contact:

Post by natsuki » Sat Jun 05, 2004 9:42 am

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^^
^^いつも笑顔でもっとよろこび。。^^
-- shimokawa natsuki --
VDM
Peon
Peon
Posts: 13
Joined: Mon Aug 23, 2004 8:41 pm
Location: Netherlands
Contact:

Post by VDM » Wed Aug 25, 2004 9:20 pm

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?
Posts++
User avatar
ElvenProgrammer
TMW Adviser
TMW Adviser
Posts: 2526
Joined: Tue Apr 13, 2004 8:11 pm
Location: Italy
Contact:

Post by ElvenProgrammer » Thu Aug 26, 2004 1:15 pm

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.
VDM
Peon
Peon
Posts: 13
Joined: Mon Aug 23, 2004 8:41 pm
Location: Netherlands
Contact:

Post by VDM » Thu Aug 26, 2004 4:12 pm

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 :)
Posts++
User avatar
Chetic
Peon
Peon
Posts: 63
Joined: Mon Jul 12, 2004 10:31 am
Location: Sweden
Contact:

Post by Chetic » Fri Aug 27, 2004 8:19 am

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.
Quote of the year:
<Sull> the diff with GPL and priced software,GPL is faster to install cause you dont have to put a crack/serial

xD
User avatar
bay
Peon
Peon
Posts: 16
Joined: Sat Aug 28, 2004 6:47 am
Location: new brunswick, nj

Post by bay » Sat Sep 25, 2004 12:29 am

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$
User avatar
ElvenProgrammer
TMW Adviser
TMW Adviser
Posts: 2526
Joined: Tue Apr 13, 2004 8:11 pm
Location: Italy
Contact:

Post by ElvenProgrammer » Sat Sep 25, 2004 8:30 am

Oh yes, you're right. I've studyed it once, but I didn't like it and so removed it from my memory...
Post Reply