1.9.0: new options and constants system

The developers will post here to let you peek into future versions and announce new releases.

Moderator: idcarlos

Post Reply
gyboth
Site Admin
Posts: 1421
Joined: Sat Dec 18, 2004 8:42 am
Location: Passau, Germany
Contact:

1.9.0: new options and constants system

Post by gyboth »

i've had some great ideas for 1.9.0 recently which i implemented during the last few days. but first some information on general progress:
  • the live game is mostly finished, except for the event consequences. this means, there are free-kicks, penalties, extra time, penalty shoot-out (if necessary) etc. but injuries, red cards etc. don't have any consequences; this is one of the things i'm going to do soon. the live game can also be paused and resumed (to make subs etc.)
  • the fixture update system is implemented. this means, that new fixtures for cups are written automatically when a cup round (be it a round robin stage or a knock-out round or else) is finished.
  • i've laid the foundation for hot-seat multiplayer. at the beginning of the game you first have to add at least one user to be able to start the game. users have individual option files.
now on to those great ideas: i've restructured the option file system. there are three files now:
  • bygfoot.conf contains general options, like whether there are season objectives
  • bygfoot_user.conf contains the default user specific options, like whether to show live games. custom option files get created from within the game, e.g. if your username is bob, you can save an option file 'bygfoot_bob.conf' which gets loaded whenever you start a new game as 'bob'.
  • here's the punchline: there's a file bygfoot_constants that contains lots of things that influence the game behaviour: probability to score, colours in treeviews, upper limit for the number of players in a team etc. all these get loaded when the game is started. so if you're not satisfied with the background color of your team in the tables, you just change the appropriate value in the constants file. you can also create your own one and edit bygfoot.conf to make the game load your file instead of the default one.
  • moreover, new options and constants can be added very easily: just add a line like

    Code: Select all

    int_bobs_option_does_nothing 123
    to bygfoot_constants and you can instantly use this option in the source code by writing

    Code: Select all

    const_int("int_bobs_option_does_nothing")
    which will return 123 in this case. this also works for the option files (you'd just use opt_int() or opt_user_int() to refer to the option)
this system has a lot of advantages:
  • for developers: no recompilation if an option or a constant's been changed
  • for users: possibility to customise the game extensively
  • for developers: easiness of adding new constants/options
  • for developers/testers: testers can help improve the game without knowing how to code, e.g. i'd be glad if some of you would help me balance out the live game by fine-tuning the live game constants (once the live game is completely implemented, that is)
the cvs is updated, so if you'd like to have a look at the changes, go ahead. there isn't much happening yet, though. you can click on new week and see live games, but there isn't a possibility to look at the results/fixtures/tables yet.

oh, and you can have a look at the current (not very extensively commented) constants file here.

gyözö
Press any key to continue or any other key to quit.
Post Reply