Development guidelines

Content and general development discussion, including quest scripts and server code. TMW Classic is a project comprising the Legacy tmwAthena server & the designated improved engine server based on evolHercules.


Forum rules

This forum houses many years of development, tracing back to some of the earliest posts that exist on the board.

Its current use is for the continued development of the server and game it has always served: TMW Classic.

Post Reply
User avatar
ElvenProgrammer
Founder
Founder
Posts: 2526
Joined: 13 Apr 2004, 19:11
Location: Italy
Contact:

Development guidelines

Post 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
Last edited by ElvenProgrammer on 25 Jun 2004, 09:11, edited 2 times in total.
User avatar
ElvenProgrammer
Founder
Founder
Posts: 2526
Joined: 13 Apr 2004, 19:11
Location: Italy
Contact:

Post by ElvenProgrammer »

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

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

Post 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?
Posts++
User avatar
ElvenProgrammer
Founder
Founder
Posts: 2526
Joined: 13 Apr 2004, 19:11
Location: Italy
Contact:

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

Post 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 :)
Posts++
User avatar
Chetic
Novice
Novice
Posts: 63
Joined: 12 Jul 2004, 09:31
Location: Sweden
Contact:

Post 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.
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: 28 Aug 2004, 05:47
Location: new brunswick, nj

Post 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$
User avatar
ElvenProgrammer
Founder
Founder
Posts: 2526
Joined: 13 Apr 2004, 19:11
Location: Italy
Contact:

Post 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...
Post Reply