View Single Post
Stijn Stijn's Avatar

Administrator

Joined: Mar 2001

Posts: 6,964

Stijn is a splendid one to beholdStijn is a splendid one to beholdStijn is a splendid one to beholdStijn is a splendid one to beholdStijn is a splendid one to beholdStijn is a splendid one to beholdStijn is a splendid one to behold

Jan 3, 2012, 12:39 PM
Stijn is offline
Reply With Quote
Quote:
Originally Posted by Grytolle View Post
Considering that most of the code will be reusable (saving match results etc) and that if i recall correctly EM laid out our idea in formulas, a recoding of the score calculation shouldn't be a huge project. Maybe you can take a look at the source code and give us an estimate of how much work it is, stijn? That would probably be useful when searching for a volunteer.
Each JDC season has its own folder with script files (/jdc1/ til /jdc20/ and the current or latest season in /jdc/). Each season also has its own set of database tables in which it stores duels etc

Regarding the scoring formula, several paramters are saved in the database for each season:
  • Points per duel
  • Opponent factor
  • Roast/fall factor
  • Confidence
  • Win factor
  • Quality exponent

So changing these is a matter of updating a value in the database. Then for actually calculating the score for each duel, a player's quality, etc, there's a bunch of functions that rely on a bunch of other functions that rely on another set of functions (there might be more levels of dependency, not sure). Anyway, it's not the most comprehensive setup, but most functions for actually calculating things seem to be in one file - jdcscoring.php. These functions are fairly complex since a lot of data needs to be recalculated or checked whenever a duel is submitted so among other things it creates a few temporary SQL tables during calulcation.

All in all it looks to me like it's going to be fairly difficult to change a part of the system - as said, a lot of things depend on other parts of the system to function so changing parts might be more work than rewriting the whole thing. This obviously depends on what kind of change you specifically want to make. As said a lot of the actual calculations are in one file, so it could also very well be that all you need to do is make a few tweaks in there.

However, the code is kind of messy - sorry, Bob - and I think it would be fairly confusing to someone who isn't very familiar with it (I've only worked on fairly specific parts, so I too have trouble finding out what part of the code does what), so having someone go over it and move things around might be more trouble than it's worth. I think that, especially if you intend to make the scoring simpler and change some other things too, a rewrite would be a worthwhile project, though obviously it would still take a fair amount of time. I think this kind of project would greatly benefit from an object oriented type of code framework, and JDC was probably written back when PHP didn't actually support objects. The best would probably be to have someone who knows his PHP and JDC info well to go over the scoring functions and determine whether changing the current system would be possible, once you've finalized the new scoring system.

JDCE is in a completely separate codebase (though it borrows a lot of things from JDC, the files and database are separate) and getting it running would probably be less of a problem as you apparently don't intend on changing much about that.

If you manage to convince Bob to help though, he'd probably have no problem changing things around, the code probably makes a lot of sense to someone who is deeply familiar with it