Page 1 of 1

Code documentation.

Posted: Sun Dec 19, 2004 12:51 pm
by GeoVah
Hi,

After my first look in the bygfoot C code, there is my first impression :
Very good !!
But (yes there is always one but...) the code documentation is not present.
For some school project, We're using doxygen tools -http://www.doxygen.org- (like javadoc tools):
It's generate Code documentation from tag found in .h (and .c file). There is one example :

Code: Select all

/**
 * This is a dummy function
 *@param  dummy a dummy param 
 *@return Return Always 42
*/
gint answerOfUltimateQuestion(int dummy);
The idea behing : improve the code legibility, we know what the function does and information about parameters, just reading the .h file and not read inside .c file.
More over doxygen generate good documentation in html.

I think this can help someone to send patch/contribution if he can read and understand only with .h and not go inside .c.

Some functions are documented but not in doxygen format so... :-(.

Posted: Sun Dec 19, 2004 1:34 pm
by Guest
*sigh*... i always hated writing docs :oops:

but of course you're right. i promise to use doxygen in the 1.9 branch (provided it's not too complicated, but i don't think so).

and of course you can ask me about the (undocumented) code anytime.

gyözö

edit: sorry wasn't logged in.

I wish to document BFM

Posted: Tue Feb 15, 2005 10:14 am
by Nadeem
Hello people
I am a student in a computing degree course, and I live Mauritius.
I am undertaking an online soccer simulation game (using J2EE) as my final year project and I came across your game.

I wish to understand more of you game logic (behind the scenes). I will document your functional specifications to some extent, and with your permission I shall use a few design pieces from your project and adapt it to my game.

Regards,
Nadeem M Nayeck
Email: nadeem@clickpost.com

Re: I wish to document BFM

Posted: Tue Feb 15, 2005 12:28 pm
by gyboth
Nadeem wrote:Hello people
I am a student in a computing degree course, and I live Mauritius.
I am undertaking an online soccer simulation game (using J2EE) as my final year project and I came across your game.

I wish to understand more of you game logic (behind the scenes). I will document your functional specifications to some extent, and with your permission I shall use a few design pieces from your project and adapt it to my game.

Regards,
Nadeem M Nayeck
Email: nadeem@clickpost.com
hi there,

you're welcome to use any part of the code. unfortunately it's not well documented :oops: but i will answer any questions that might arise. good luck with your project :-)

gyözö

Re: I wish to document BFM

Posted: Wed Feb 16, 2005 6:50 am
by nadeem
gyboth wrote:hi there,

you're welcome to use any part of the code. unfortunately it's not well documented :oops: but i will answer any questions that might arise. good luck with your project :-)

gyözö
Okay, actually my most important concern is how is a football match simulated? Can you point me to the C source files where the simulation engine is located? I'll try to study it and I'll ask you whatever questions I may have.

Re: I wish to document BFM

Posted: Wed Feb 16, 2005 8:04 am
by gyboth
nadeem wrote:Okay, actually my most important concern is how is a football match simulated? Can you point me to the C source files where the simulation engine is located? I'll try to study it and I'll ask you whatever questions I may have.
the match outcome functions are in 'game.c' (you'll want to look at the ones beginning with process_ and prg_). you can ignore the objective_ functions at the end of the file.

basically, the match simulation works like this: based on a team's players, structure (e.g. 442) and playing style (e.g. Defend) the attack and defend values of the team are calculated. then the number of scoring chances for the team are calculated, using the attack value and the opponent's defend value. then, each scoring chance is simulated using the attack value, the opponent's defend value and the opponents goalie value. this is done for both teams.

in fact this isn't simulating a real football match, but it's a concept that gives realistic match outcomes and is easy to handle.

gyözö