Code documentation.

Discussions about the internal structures of the game. You can also post here if you'd like to know how things really work (and don't know how to read C code).
Post Reply
GeoVah
Posts: 50
Joined: Sat Dec 18, 2004 10:38 am
Location: Sophia Antipolis - France

Code documentation.

Post 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... :-(.
Geovah - geovah@jabber.sk- (yes i'm french...)
Guest

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

I wish to document BFM

Post 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
gyboth
Site Admin
Posts: 1421
Joined: Sat Dec 18, 2004 8:42 am
Location: Passau, Germany
Contact:

Re: I wish to document BFM

Post 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ö
Press any key to continue or any other key to quit.
nadeem

Re: I wish to document BFM

Post 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.
gyboth
Site Admin
Posts: 1421
Joined: Sat Dec 18, 2004 8:42 am
Location: Passau, Germany
Contact:

Re: I wish to document BFM

Post 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ö
Press any key to continue or any other key to quit.
Post Reply