Weekly Map Scorer Program

Started by mopa42, July 19, 2011, 04:53:29 PM

Previous topic - Next topic

Helper

@J - Thanks.
I did the manual trick on last week's game and thought I would try the 'Import' function this week. I hadn't seen the problem mentioned here, so thought I would post it.
This week's titles are now plugged in (manually) and all of the scoring functions seem to be working as designed.

[Off-topic - when are you submitting another map...it's been a while and they are always worth playing.
:)]

@thepenguin - Thanks for testing that. I was going to try an XP box next.

I know that MS updates will often break links/functions, so maybe that is the reason.

thepenguin

Quote from: Helper on August 07, 2012, 07:46:24 AM
This week's titles are now plugged in (manually) and all of the scoring functions seem to be working as designed.
I'm pretty sure they aren't WAD on an XP box, because they aren't working.

They are working right, just too well (PEBCAK)
We have become the creeper...

Helper

LOL!
"PEBCAK"...closely related to "PICNIC", I believe. Frequently I am an example of both.

thepenguin

yeah, import buttons still aren't working (at all)

just the scoring functions work well
We have become the creeper...

mopa42

I'm working on a fix for these (and other) issues. I just don't have a lot of time right now, probably won't for another couple weeks.
For now, here's a build that probably has some import/null errors fixed.

Helper

#50
@mopa42 -
The fix worked - thank you.
I just tried the new version and it pulled up all of the new games.

Tournament Results



   
   
   
   
   
RankPlayerTotal Score
1.Wheatmidge58346
2.Helper57231
3.UoADeadeye42983*
4.ctuna12222*
* Did not finish all maps.

Scores recorded at 2012-08-11 10:59:47 forum time.

SmileyCoder

Hej Mopa

Can I ask you how you retrieve the scores for your tool?

I am maintaining the thread "Do a Member" and I like to check if the maps have actually been, and was wondering how you are getting the scores?

I would then like to implement a similar method, allthough in VB (Since I don't do java :)

Hoping you can help.
Best of luck with your game,
TheSmileyCoder

TheSmileyCoders YouTube channel feat. tutorials on using Treeviews in Access
I might have promised fool proof, but I never promised user proof.

mopa42

Quote from: SmileyCoder on August 24, 2012, 09:13:06 AM
Can I ask you how you retrieve the scores for your tool?

There's a writeup in the source code - extract the jar file (jar = zip), then look at the docs\HOWTO-get-scores-from-server.txt file. TP also quotes it here.

Summary of the method: query http://knucklecracker.com/creeperworld2/scoreQuery.php?gameUID=proceduralX-YZ,
where X is the first 4 bytes of the MD5 hash of the lowercase code name, represented as unsigned integer; Y is size 0-2; and Z is complexity 0-2. Then parse the XML data.
Example: for the map "(e)" on large/high, the corresponding URL is http://knucklecracker.com/creeperworld2/scoreQuery.php?gameUID=procedural1021749350-22.

SmileyCoder

#53
Thank you very much. I have been trying now to recreate this in a VBA environment, but must admit my knowledge of working with byte and hex values is quite limited.

I am going to try and take it step by step, since my current approach isn't working :P

Can I ask you, for the map "(e)" what value do you get for the MD5 hash of "(e)"? so that I have something to compare with, and at least know that I got the first part right.

Once again, thank you.


For comparison, I get MD5("(e)")=3ce6a866dc8e30ae0263bdcf0ea27809

If I try to convert the first hex value "3c" to a byte I get 60
Converting the first 4 hex values, and concatanating them gives me: 60230168102

P.S. Thanks for the jar=zip tip, did not know that.
Best of luck with your game,
TheSmileyCoder

TheSmileyCoders YouTube channel feat. tutorials on using Treeviews in Access
I might have promised fool proof, but I never promised user proof.

mopa42

(e) -> 3ce6a866dc8e30ae0263bdcf0ea27809.
Next you convert the first 4 bytes all at once: 3ce6a866 -> 1021749350. In java I use Long.parseLong(hex, 16) to do the conversion; I don't know what the equivalent method in VBA is. I used a Long format to make sure the number was unsigned (as all integers in Java are signed).
Code (The method I use) Select

public static long getSeedFromString(String str) {
    str = str.toLowerCase().trim();
    String hex = DigestUtils.md5Hex(str).substring(0, 8);
    return Long.parseLong(hex, 16);
}


SmileyCoder

Thank you, finally got it! I had somehow gotten the idea that you did each byte seperately. Thank you very much for your help and patience!
Best of luck with your game,
TheSmileyCoder

TheSmileyCoders YouTube channel feat. tutorials on using Treeviews in Access
I might have promised fool proof, but I never promised user proof.

mopa42

I found some time to work some more on this program, and now most of the import bugs are fixed. Everything is reasonably tested and polished, so I'm uploading it as v0.6. (Side note: this is now over 3000 lines of code. Wow!)

Highlights of the latest release:

  • Auto-import works for all recent tournaments. It even accepts "ending" instead of "closing" and "challenge" instead of "tournament".
  • The [open] tag in the auto-import tournament list should properly expire at the end of the closing day.
  • Time scale is Last Month by default, since some tournaments were lasting longer than one week.
  • Removed Copy User's Results since we haven't used that at all.
  • Fancy detailed tournaments result list - generates these types of tables, showing the results per player and the top three scores for each map.
    Top 3 scores per map

    Results Per Player


       
       
       
       
       
       
       
       
       
       
       
       
    RankNameLive Well and Prosper  Beam me up, Scotty IllogicalI'm a doctor, not a... Captain, I'm frightened Total ScoreTotal Time
    1Helper12429109581195511865117975900433:19
    2mopa4212453109771183111826117695885634:28
    3dt4212220107671177211668115895801640:49
    4Wheatmidge12393107471191711524111995778043:24
    5ctuna12209106531153811365112295699449:21
    6teknotiss11519103981112111456110205551459:45
    7UoADeadeye11290100651065810909107215364378:34
    8inept_celt1144299121071810701100655283886:55
    9TheSmileyCoder1240410957117111157846650
    10Mad Spy10923100049443854738917
    11Martin1073210732
    Scores recorded at 2012-09-16 20:44:38 forum time.
    [close]
    You can also go for a simplified look (only the top scores are in bold). Cleaner, but less information.
    Top scores in bold

    Results Per Player


       
       
       
       
       
       
       
       
       
       
       
       
    RankNameLive Well and Prosper  Beam me up, Scotty IllogicalI'm a doctor, not a... Captain, I'm frightened Total ScoreTotal Time
    1Helper12429109581195511865117975900433:19
    2mopa4212453109771183111826117695885634:28
    3dt4212220107671177211668115895801640:49
    4Wheatmidge12393107471191711524111995778043:24
    5ctuna12209106531153811365112295699449:21
    6teknotiss11519103981112111456110205551459:45
    7UoADeadeye11290100651065810909107215364378:34
    8inept_celt1144299121071810701100655283886:55
    9TheSmileyCoder1240410957117111157846650
    10Mad Spy10923100049443854738917
    11Martin1073210732
    Best scores in Bold.
    Scores recorded at 2012-09-16 20:44:38 forum time.
    [close]
    The format for these tables was inspired by Amram a while back. I lightened the silver color to make it look better, but kept gold and bronze as they were. Hope this looks ok. There are checkboxes in the export menu to select between these types of tables.

Download the latest version on the first post. (I've removed v0.5, let me know if anyone needs it for anything).

Helper

mopa42 - v6.0 rocks!
I just downloaded it and ran through the functions.
Exellent work and will sure make it easier to post and update scores.

Very nice work.

SmileyCoder

#58
Minor bug report:
An oddity occured, and I wonder if it is by intent. When viewing the rankings for this game:
Current High Scores:
1: inept_celt   45279
2: TheSmileyCoder   46824*
3: Helper   44747*
4: Ronini   30292*
5: dt42   11276*
6: Wheatmidge   11127*
7: UoADeadeye   10852*
8: rob3k   10383*

* Did not finish all 5 missions.
It shows inept_celt in first place even though he has less points then me. However when exported it looks ok:

Results Per Player


   
   
   
   
   
   
   
   
   
RankNameDinosoursGummy BearsRocketsSmartiesFuzzy PeachesTotal ScoreTotal Time
1TheSmileyCoder1170112177111831176346824
2inept_celt9929947795036623974745279160:46
3Helper1111211559105551152144747
4Ronini980410612987630292
5dt421127611276
6Wheatmidge1112711127
7UoADeadeye1085210852
8rob3k1038310383
Scores recorded at 2012-11-27 15:04:46 forum time.

I presume it is because he has completed all maps?

P.s. Love your score tool, use it every week.
Best of luck with your game,
TheSmileyCoder

TheSmileyCoders YouTube channel feat. tutorials on using Treeviews in Access
I might have promised fool proof, but I never promised user proof.

Helper

#59
Quote from: SmileyCoder on November 27, 2012, 03:09:19 PM
It shows inept_celt in first place even though he has points then me.

I think that is probably the reason.
Finishing "Rockets" right now, so let's see what happens when I post that score.


EDIT:
Posting current results to see what they look like:
************************
Results Per Player


   
   
   
   
   
   
   
   
   
RankNameDinosoursGummy BearsRocketsSmartiesFuzzy PeachesTotal ScoreTotal Time
1Helper11112115591104710555115215579461:50
2inept_celt9929947795038591974747247155:38
3TheSmileyCoder1170112177111831176346824
4Ronini980410612987630292
5dt421127611276
6Wheatmidge1112711127
7UoADeadeye1085210852
8rob3k1038310383
Scores recorded at 2012-11-27 15:38:25 forum time.