I think I've figured out how a weekly 5-map tournament can be conducted in the DMD. I've always has a fair amount of interest in the CW2 weekly tournament. And maybe Mopa42 can write the necessary interface for CW3?
The compiler for the week generates 5 DMD maps, name them according to the theme and play them. ALternatively, (s)he can take maps from the current inventory if they already fit the theme. Then all players have the week to improve their scores.
I'm going to hate myself in the morning, but count me in.
That CW2 tourney was a lot of fun - but time-consuming and addictive.
Hmmm, count me in too... Probably.
It is a fun way to encourage random map playing.
I still have not actually made any DMD maps. So I'll have to play around with that for a while the first time I get to make a tournament.
count me in
So, I was thinking about taking a stab at building a tool similar to mopa42's CW2 tournament tool, but I'm not sure how to go about pulling scores for CW3 maps. For CW1 and CW2, there is a web interface for viewing player scores that can be leveraged by such a tool, but as far as I can tell CW3 has no equivalent service. Presumably this is because of the ways that scores can be viewed within the CW3 application itself, but it makes it more difficult to write a utility that would need to access the map scores. Would it be possible for whatever method the CW3 application uses to pull scores from the knucklecracker website to be shared with us?
I so miss the weekly games. I'd love to be in. I also haven't tried generating any DMDs, but I could give it a try on the off chance I win!
Someone who need to reverse engineer what the game does to talk to the server to get the scores.
I'm not aware of anyone on the forums with the skill and time to do such a thing. (I'm not sure if I have the skill or tools, but I know I don't have the time even if I did)
Quote from: miquelfire on April 28, 2014, 09:56:16 AM
Someone who need to reverse engineer what the game does to talk to the server to get the scores.
I'm not aware of anyone on the forums with the skill and time to do such a thing. (I'm not sure if I have the skill or tools, but I know I don't have the time even if I did)
Well, I looked at it it a little bit, and it looks like getting the scores for a particular map isn't too difficult, provided you have the gameUID of the map that you want. There is a php script that the game appears to call named scoreQuery.php which looks pretty straightforward from the packet trace I was looking at. However, getting the list of games (Which is where I assume you'd map the map names to the gameUID values) looks to be a bit trickier. There is a queryMaps.php that looks to be used for that, but the data being returned from that appears to be binary data. Possibly encrypted or compressed. If it's just compression, and I can identify the type of compression being used, that might be enough to get where I need to be at, but I haven't had enough time to continue my analysis, as I've been busy getting settled into a new job that I started last week. I was hoping that Virgil might just tell us how to use the score listing utilities, but in the absence of that, I think there is still a decent chance that we can work it out given time.
I've just extended the scoreQuery.php service to take a map # for either a custom map or a dmd map.
Examples:
http://knucklecracker.com/creeperworld3/scoreQuery.php?customID=1
http://knucklecracker.com/creeperworld3/scoreQuery.php?dmdID=1
This allows you to skip knowing the guid for a map and just work off of the much easier to manage map number.
The data returned is XML and the format is obvious. Note that with a little bit of creativity somebody could create a score viewer or a 5 map score viewer all in javascript so it runs in browsers directly. Here's a proof on concept slapped together from google seach results copy pasted together:
<html>
<body>
<script>
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.open("GET","http://knucklecracker.com/creeperworld3/scoreQuery.php?dmdID=1",false);
xmlhttp.send();
xmlDoc=textToXML(xmlhttp.responseText);
document.write("<table border='1'>");
var x=xmlDoc.getElementsByTagName("record");
for (i=0;i<x.length;i++)
{
document.write("<tr><td>");
document.write(i+1);
document.write("</td><td>");
document.write(x[i].getElementsByTagName("user")[0].childNodes[0].nodeValue);
document.write("</td><td>");
document.write(x[i].getElementsByTagName("score")[0].childNodes[0].nodeValue);
document.write("</td><td>");
document.write(x[i].getElementsByTagName("time")[0].childNodes[0].nodeValue);
document.write("</td></tr>");
}
document.write("</table>");
function textToXML ( text ) {
try {
var xml = null;
if ( window.DOMParser ) {
var parser = new DOMParser();
xml = parser.parseFromString( text, "text/xml" );
var found = xml.getElementsByTagName( "parsererror" );
if ( !found || !found.length || !found[ 0 ].childNodes.length ) {
return xml;
}
return null;
} else {
xml = new ActiveXObject( "Microsoft.XMLDOM" );
xml.async = false;
xml.loadXML( text );
return xml;
}
} catch ( e ) {
// suppress
}
}
</script>
</body>
</html>
QuoteXMLHttpRequest cannot load http://knucklecracker.com/creeperworld3/scoreQuery.php?dmdID=1. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access.
Ah, cross-domain security (no, running the same file off my dropbox (http://dl.dropboxusercontent.com/u/73817062/programming/CW3/dmdtest.html) instead of localhost doesn't fix it).
Try it again now...
Yeah, working now, thanks! And heck, I can probably pull together something with html and javascript if I know what all features you want.
If you do start this, I only ask that you don't use any maps bigger than, say, 200x200, to be merciful to those with slower machines who still want to participate (me...)
Thanks, Virgil! That should make things a lot easier. Maybe I'll have some time this weekend to do something with that, assuming that somebody else hasn't already come up with something by then.
dmd.html (http://dl.dropboxusercontent.com/u/73817062/CW3/dmd.html)
Got a basic viewer for up to 5 maps. Note it caches each map's output html for subsequent look ups, so if you look up a map with this, then post a score, you have to refresh the page (or clear that cache) in order to get the updated scores from that map.
It also supports for a url parameter "?maps=[comma separated list of map numbers]" to pre-fill the inputs:
dmd.html?maps=10,9,20,5a (http://dl.dropboxusercontent.com/u/73817062/CW3/dmd.html?maps=10,9,20,5a) (Yes that is intentionally a case of not-a-number)
I can definitely do more advanced stuff with this if people want.
Awesome. Look at the CW2 game and the table there. It would be col if you could make an export file that can be copy/pasted into the forum to conform. :)
dmd.html (http://dl.dropboxusercontent.com/u/73817062/CW3/dmd.html)
Okay thousands of requests to the server later I got something more to show.
-Added a player totals table, ranked by number of maps, then score. It should in theory handle rank ties correctly too. Times are only displayed in the totals table as tooltips on the scores and aren't summed but I could change that if wanted.
-Added a blacklist by player name, entered through an input (separated by newlines), by checkbox on the total table, or in the url like the maps (e.g. dmd.html?maps=10,9,20,5a&bl=teknotiss,Grauniad (http://dl.dropboxusercontent.com/u/73817062/CW3/dmd.html?maps=10,9,20,5a&bl=teknotiss,Grauniad)) (dunno if commas, ampersands, or equals signs are allowed in names ingame but I know they could and would interfere with parsing the url)
-Export totals table, for the forums or wiki. Doesn't have the coloring options that mopa42's program had, but I can add them if they're wanted. Note: do have to copy yourself because of security but it does auto-select after export. Example:
Spoiler
Rankings for DMD maps #6, 7
# | Name | Score 6 | Score 7 | Total |
1 | MadMag | 6515 | 5590 | 12105 |
2 | tomiz | 4818 | 3850 | 8668 |
3 | purpleyukari | 5958 | | 5958 |
4 | Folacin | 5407 | | 5407 |
5 | teknotiss | | 4864 | 4864 |
6 | BinkyRider | | 4574 | 4574 |
7 | Toyoch | 3516 | | 3516 |
8 | The Mole | | 3266 | 3266 |
-Pressing enter while on a map id input should fetch scores.
I removed most of the caching, mainly so that the time you grab the scores is guaranteed to be about the same. This was intended to be for a timestamp feature like you see on mopa42's exports but I got confused trying to convince the Date object to consistently convert to the forum's timezone. The only caching left should be something that stops you from fetching the exact same set of maps within a minute.
Totally not sold on the colors or page layout. I'm not so good at stuff like so if you have specific suggestions I'm all ears.
Virgil, if you're still reading this topic, how would I get scores by time like you can ingame?
dmd.html (http://dl.dropboxusercontent.com/u/73817062/CW3/dmd.html)
Because I can't leave well enough alone, I've gone and rewritten most of the code. Mostly internal changes to use libraries and to make the xml requests asynchronous, though I did figure out coloring per-map scores and the timestamp* in the exports.
Let me know if anything's broken/missing
(besides the time range, I still don't know how (if I can)).
*I hope it's right anyway, timezones are confusing. >_>
Spoiler
Rankings for DMD maps #6, 7
# | Name | Score 6 | Score 7 | Total |
1 | MadMag | 6515 | 5590 | 12105 |
2 | tomiz | 4818 | 3850 | 8668 |
3 | purpleyukari | 5958 | | 5958 |
4 | Folacin | 5407 | | 5407 |
5 | teknotiss | | 4864 | 4864 |
6 | BinkyRider | | 4574 | 4574 |
7 | Toyoch | 3516 | | 3516 |
8 | The Mole | | 3266 | 3266 |
Scores retrieved at 18:58:07 14 June 2014 +05:00EDIT: Watched the network requests on the CW2 scores and got the time filter working for this.
@kwinse,
Looks as though you've done some nice work, so what's the next step?
I think it would be great if we could get some new people interested in this. Has anyone tried mentioning it on Steam forums? I actually haven't played much creeper world in the last while but the weekly tournaments are always a blast.
I've been tempted to express interest in this but not sure if I can commit the time... would it be considered bad form to only participate some weeks?
Quote from: stewbasic on July 01, 2014, 07:58:22 PM
I've been tempted to express interest in this but not sure if I can commit the time... would it be considered bad form to only participate some weeks?
No at all. I think the only rule was that the winner of each week selects the maps for the next week. There is no obligation to play all the time.
Quote from: kwinse on June 14, 2014, 08:24:16 PM
Let me know if anything's broken/missing
Well, it's not something broken or missing, but more of a feature request. Can you make a second version that pulls scores from CS maps?
I want to include a link in my signature that contains all my maps so far (or my most recent ones if I have more than it can handle) top ten scores plus my own.
Since it's unlikely I'll ever have a top ten score in my own maps :P
Ironed out over PM (http://knucklecracker.com/forums/index.php?topic=16650.0), if you hadn't noticed Flabort's sig yet. ;)
Count me in, at least at first. Though selecting the next week's maps and posting the matrix and results was a real chore for a dinosaur like me. I'd guess from the low scores I see about the system compared to my own, that "low score" ship has sailed.
I'm in, for sure. Tried some of the CW2 1-week 5-maps tournaments, but those are hard, some of them. I'll be back to make a list for the first one.
Quote from: Wheatmidge on July 03, 2014, 11:54:23 PM
Quote from: stewbasic on July 01, 2014, 07:58:22 PM
I've been tempted to express interest in this but not sure if I can commit the time... would it be considered bad form to only participate some weeks?
No at all. I think the only rule was that the winner of each week selects the maps for the next week. There is no obligation to play all the time.
lots of people would participate in the CW2 tournament and only do a couple of the maps. maybe it was because of time, maybe they just weren't interested in winning and having the responsibility of setting up the next tournament or maybe some of the maps just didn't interest them, only they know for sure