fortune teller

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
goldberg
Posts: 2
Joined: Sat Apr 29, 2006 10:00 pm

fortune teller

Post by goldberg »

Hi, a bygfoot-newbie here ;)

I made a not-so-small patch for Bygfoot 1.9.5 providing "Fortune Teller" feature. Wanna hear the story? :)
First, i wanted to solve a problem: "given an opponent, and a set of players compute best possible structure and team to play against this opponent". In order to do this i needed to extract the algorithm of one-time game play. When i did, it showed up, that the algorithm is to slow to acomplish such a difficult task ;)
I didnt want to abandon all my work, so eventually i decided to implement a "fortune teller" - feature that allows you to estimate probabilities of win, draw and defeat in a next coming match.

It was quite a difficult job for me, to make bygfoot play one match and not screw anything up. This probably can be made in an easier way, but i do not know how (btw, it's my first time i used gtk/glib for anything). For now - there is a lot of copy-pasted code from original Bygfoot, modificated only slightly (preventing Bygfoot from changing account balance for example).
Being honest, i dont think it is my fault ;) I could not see modular structure inside Bygfoot code (i dare not to say objective design ;), and extensive use of global variables (even for temporary variables - statX) was a bit of shock for me :) So i dont like this code :)
On the other hand, it might as well be my prejudice, as i really dont like gtk, and programming in pure C, when C++ is at hand :)
What my code do is taking the next Fixture, that user team is involved in, and repeat the following procedure 50 times:
- make a rather deep copy of that Fixture (new Teams, new Players)
- play a match
In the end a summary of results is presented.
Fortune Teller is activated via button next to "next week" button. Yes, this one with a dark sphere ;)
The best part of my patch in my opinion is the image you see during simulations :)
You can get Fortune Teller on http://www.kormoran.net/kubol/
Comments are welcomed ;)
Post Reply