Upload/Download finished Thud games

Hi there,

just a thought....( o dear, another one Shocked )

The possibility to upload finished games as saved in a *.thud file (if you play with the thudboard marc developed...www.million.com), so novice players can download games in order to learn....Just a list with downloadable games, eg. Ygdrassil vs Aine plus [outcome].

Rolling Eyes comments?

--

thud board game
Login or register to tag items

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

If you have a Look at Oograh's web site there are list of games with their scores. If you click on the links you will get the save games for Marc's thudbooard.

Hope that helps.


Re: Upload/Download finished Thud games

Bronze Member
Ygdrassil wrote:

The possibility to upload finished games as saved in a *.thud file (if you play with the thudboard marc developed...www.million.com)

Just a quick correction, it's www.million.nl Smile
I would volunteer to make a section under www.million.nl/thudboard where savegames could be stored (you would have to mail them to me then), and the links could be kept here in a topic then for easy access. But as Aine said, Oograh Boike already has a section for that on his site, so why duplicate the work Smile.
I don't know if Boi would mind if the savegames on his site were linked directly from a topic here.... Boi?

Ciao, Marc.


Re: Upload/Download finished Thud games

Mc wrote:

I don't know if Boi would mind if the savegames on his site were linked directly from a topic here.... Boi?

Ahum. First of all: I wouldn't mind, sure, let's do that. Hopefully it will get people to send me savegames, because 90% of what's on my site has been (re)played by yours truly.

But: I have been thinking, and I might as well drop the bomb now that you bring it up.
Lots of games on my site are from the old days, the old forum on thudgame.com. People interested enough would probably find the original forumgames somewhere in L-Space, but for how long? Now, with this new forum coming up, which is looking like the one that's going to stay Rolling Eyes , I was thinking of making a fresh start.
Not immediately, mind you, because that would leave us with a blank page. But maybe keep the old one up until january, hoping there will be enough games in here to make the new start.
The problem would of course be: people would lose their ranking and scores, carefully built up through the years, and would need to start again. I wouldn't mind, but I guess Aine (25 games) and Mc (#1), to name just two, need to think about this.
Any sentiments on that will be appreciated, and definitely taken into account.


25 games and still not a positive score...

I've no objections to the tables being restarted, from the game on this site... I can only improve my score... although I had worked out that I could be beated by 4 points and my over all score would still go up... just goes to show how bad I was in the begining... I've also go my own personal record so its not a problem.

Also if it helps I think I've got my excel sheets to print out the same kind of text files as the thudboard saved games...


Bronze Member

I don't really care about the ranking, but I think it would be nice to keep the savegames at the very least, so new players can replay the old classics (*ahum*) and perhaps figure out some good strategies.
If you would like to start afresh, then I would be willing to host the old savegames...

Ciao, Marc.


Hi there,

first of all: "mc, sorry for my type o... Embarassed"

an over all list of ranking is fine by me....hopefully more people will start playing. I really thought this forum would be dwelling with diabolic dwarves and tirannic trolls, who would enjoy the fine art of war...euh...thud.

Thnx for the advice...i will start/dwonloading looking at website of Oograh Boike

Grtz


There may be some scope for us saving old-forum games here on the site, and OB's work on this so far has been splendid.

One thing to consider is that a feature we're writing into the next game client is "Game Replay" based upon the moves stored in the database. It might be easiest to archive the old forum data into a safe place (and we're looking into that as well! Very Happy ) but, in/for the near future, access to old games might be best achieved by re-playing the games into the system when it's ready. Just something to think about...

I say all this to say that we feel it would be a real shame to let all that experience, know how (and glory for those who did well! Wink ) fade like a long forgotten small god into a lost history, thus we would like to work with various of the community to preserve old games in their different guises. All ideas welcome.


Hi y'all,

Thanks for your reactions!

Aine wrote:

25 games and still not a positive score....

You will definitely rank higher once we decide to make a fresh start. It was fun watching your skills grow, and sure as hells those first games stand in the way of a higher ranking, or maybe score, now.

Mc wrote:

I think it would be nice to keep the savegames at the very least

So do I. I was thinking about maybe an extra page for those. It's only text-files anyway, so I could keep them somewhere, and I will.
But I started the "savegames-page" for people to download them, and replay them while looking at the original posts. There's lots to learn from those ("I'm doing this, and not that, because..."; "@#$%, I didn't see that one coming!"; "very interesting opening move, that one!"; &tc), and I'm afraid all those comments will get lost in the depths of L-Space once this forum is up and running.
(Maybe we can get players to copy those remarks into the "comments"-box of ThudBoard, and keep them on my page alongside the savegames?)

Lee Alley wrote:

we feel it would be a real shame to let all that experience, know how (and glory for those who did well! Wink ) fade like a long forgotten small god into a lost history

Spoken like a true monk.. (ouch!) ape.. (ouch!) orangutan!


Bronze Member
Lee Alley wrote:

One thing to consider is that a feature we're writing into the next game client is "Game Replay" based upon the moves stored in the database. It might be easiest to archive the old forum data into a safe place (and we're looking into that as well! Very Happy ) but, in/for the near future, access to old games might be best achieved by re-playing the games into the system when it's ready. Just something to think about...

Is that a fixed replay, or can you try out some different moves from different points in the saved game? That is something I like about the current thudboard, when you replay a game and see a point where you think you can play a better move, to actually play both sides then and see how it would have worked out...

BTW, do you have documentation about your savegame format? That way I can perhaps write a converter to/from the thudboard savegame format.

Ciao, Mc.


Mc wrote:

BTW, do you have documentation about your savegame format? That way I can perhaps write a converter to/from the thudboard savegame format.

like what he said... If it is a text file I can probably create one too...


Mc asks:

Quote:

BTW, do you have documentation about your savegame format? That way I can perhaps write a converter to/from the thudboard savegame format.

Not documented yet, though once it's been fully decided on, I verymuch want to make the server-client dialog public.

Savegames are currently stored on the server in mysql as a blob of sequences of two byte pairs, x1,y1, x2,y2 with coordinates starting at 1,1. The special "magic moves" 00 00 00 01 and 00 00 00 02 mean half-time and end game respectively, and I may add a few more magic moves in future.

This is transferred to the client bzipped and encoded in base-64, and split into chunks. Each chunk is prepended with the game number, the number of chunks, and the current chunk. And some other stuff.

There is also a separate "gameinfo" data line that sends info on who was playing, who challenged whom, what the scores are, who's go it is, who's playing which side, and so on. It gets this info from the "users" and "games" tables.

However, all those may change when I want to do an "undo" system: in particular, I may start storing which pieces were taken each move.

Basically, I wouldn't bother reading it from sniffing packets sent to the game - it'd be more sensible to be able to just download readymade save files from the web in some sensible format we can mutually agree on.

A little php script to list all the games between two players and let you select one shouldn't be tricky: with somewhat more work I could even have it display the last layout, or even generate an animated gif of the game on the fly so you could pick the one that you wanted to download.

So: what information would you like in your savegames, and what's a sensible format for them? I don't see that savegame downloading will ever be a significant percentage of our bandwidth, so I'm happy to use a bloaty XHTML format rather than the packed format I'm using at the moment. On the other paw, if you want blinding download speeds, each move could be packed as (4[trolls] or 6[dwarfs]) + 3[direction] + 4[distance]) = 11 to 13 bits, or less if you reduce the number of bits stored depending on how many pieces are left...

I don't see me ever (at least in any kind of reasonable amount of time) having it so that player A can view a game played between players B and C, rewind to the middle, and then fiddle around with it, making moves for both sides... that's just not what online thud is about: it's about a game between two players. ThudBoard, however, is perfect for that task.

With online thud, I'd have no idea who to store the resulting mangled game under, nor whether it should go towards the rankings of the people involved, or what... so I'm not going to touch that with a bargepole Razz


Bronze Member
Dewi Morgan wrote:

I don't see me ever (at least in any kind of reasonable amount of time) having it so that player A can view a game played between players B and C, rewind to the middle, and then fiddle around with it, making moves for both sides... that's just not what online thud is about: it's about a game between two players. ThudBoard, however, is perfect for that task.

That's why it would be nice to get a savegame from an online Thud game, and try it in ThudBoard... or viceversa, get a ThudBoard savegame and view the play in your viewer...

Dewi Morgan wrote:

Basically, I wouldn't bother reading it from sniffing packets sent to the game - it'd be more sensible to be able to just download readymade save files from the web in some sensible format we can mutually agree on.

I agree with that... if you don't have any other use for that savegame for your client or server, then perhaps the ThudBoard format is sensible enough?

My basic format for ThudBoard is a simple text-based file, the first line stores the initial position, and each subsequent line is a move (including captures), like so:

dF1,dG1,dJ1,dK1,dL2,dM3,dN4,dO5,TG7,TH7,TJ7,TG8,TJ8,RH8
dA6-J14
TH9-J10
dL2-L13
TG9-H9
dG15-H15
TJ7-K7
dD13-J13
TJ10-L12xL13xM13
dJ14-L12xL12

(the first line is usually a bit longer, but any startposition is ok)
My savegames are always for just one half of the battle, so the second half is just a new file...

Ciao, Marc.


Since your format requires the takes as well as the moves (very sensibly, I now realise: undo is tricky without this), I need to either calculate them in the CGI script, or start storing them in the DB.

The latter is more sensible, since it helps me move towards having proper undo.

There are some other priorities for me to deal with before undo, but it is fairly important, so I should be able to get this done eventually.

[Edit: why isn't this showing up with my name by it? *grumble* - Dewi]


Bronze Member

Just a question, how do you calculate the captures when captures are optional? The Dwarf bit I can see, but I assume you think a Troll will automatically capture _all_ surrounding Dwarfs? (I've never found a good reason not to do this when playing with the Trolls, but who knows...)

Ciao, Marc.


They're... optional? O.o;

[We need an emoticon for "abject, quivvering terror"]


Yup. You must capture in order to make a shove, but you need not capture all dwarves capturable.
Also for a position where it makes sence(X thudstone, . empty space, d dwarf, T troll):

     .d.dd
    ......d
   d.T......
  d......d.d.
 .............
d...T.........d
d.T....T.....d.
.......XT....dd
d.T.....T.....d
d.............d
 d..T....d.ddd
  .....ddd...
   ....ddd..
    d......
     .....

Here the trolls first need to make a shove to J11, the dwarves would then like to prevent a shove to L10, as this would give the trolls an extra move towards breaking the block on the right. If the trolls capture all for dwarves adjacent to J11, then the dwarves will hurl from m11 and be rather happy, as they both got the bothersome dwarf out of the way and was able to remove a troll. If the trolls leave K11 standing the dwarves will have to choose between capturing J11 and securing the block. If the dwarves move M11-O9, the trolls ca then capture K11, saving J11 in the process. If the dwarves capture J11 from K11 then the troll will shove to L10 and the block on the right is doubtfull.

Not read as much as i would like on this, so I might be wrong. Also would be extremely surprised if the above position developed in an actuall game.


Going back to the save file format: what line separators do you accept in your save files?

Also, is there any ability to have comments, for things like player names, date, etc?

As for the non-compulsory takes... dang, that means some (lots of) rewriting on my part.

Dwarf takes are compulsory, right? No standing-onna-trollhead nonsense?

What was your own solution to all this? (I am beginning to feel that I shoulda talked to you about this years ago).

Maybe we should take this discussion offline, though p'raps not, since this stuff might be really interesting to the next person who tries to write a client...

Have to change my server dialog to include takes, both in the move and the replay parts. And the scoring tests have to change, along with all the move/take validation code on both server and client.

And clearly I *must* store takes in the DB. How? I rely on each move being a set length. I guess a bitfield of the squares around the troll. If I'm bitpacking, might as well use one byte per coord, instead of two. That'd get each move down to 3bytes for trolls, 2 for dwarfs. I do hope Flash can cope with bit-frobbing.

And of course I need a way for people to choose which piece to take on the GUI, and making that intuitive and work with all skins may well be the hardest part.

Maybe a "take all" checkbox at the bottom. If unselected, popup asking which to take. A diamond/square (depending on board orientation) of checkboxes, greyed out for positions where there's no dwarf. Three buttons: leave all, take selected, take all. Clicking them gives a definite "end" to their move, and I can send it to the server.

Have to either disable board rotation while the dialog's showing, or rotate the dialog in sync (cooler and more "right", but nobody'd notice Smile.


Bronze Member
Dewi Morgan wrote:

Going back to the save file format: what line separators do you accept in your save files?

Basically anyt line separator, even different line separators in the same file is ok, it is crossplatform so it would need that... but python takes care of that so I don't have to Smile

Dewi Morgan wrote:

Also, is there any ability to have comments, for things like player names, date, etc?

There is, it was added much later and they are stored in a separate file so new savegames can still be used in older versions. The separate file is xml which contains only comments at the moment, but could include more. This was thought up and implemented by Jan Stocker, with a bit of communication between us of course.

Dewi Morgan wrote:

As for the non-compulsory takes... dang, that means some (lots of) rewriting on my part.

I had the advantage that I don't specify _any_ rules in the game, except that the Rock was stationary, so when Trevor came up with Koom Valley Thud I had to change very little. It was always my preference to keep the rules separate anyway, so when they get public, I can easily incorporate them...

Dewi Morgan wrote:

Dwarf takes are compulsory, right? No standing-onna-trollhead nonsense?

Yeah, there can't be two pieces occupying the same space.

Dewi Morgan wrote:

What was your own solution to all this? (I am beginning to feel that I shoulda talked to you about this years ago).

The easy way: no rules at all... if you want, your first move can be to move a Dwarf one space and then capture all the Trolls in the same move... obviously illegal, but there's someone playing at the other end who knows the rules, so why should the program know them too? Smile I even saw a thread on the old forum once where Trevor said that you are allowed to cheat as long as the other party doesn't notice, so illegal moves are actually legal too...

My thoughts are that implementing the rules should allow for highlighting of possible legal moves, for indicating threatened areas, for building an AI that you can play against when there's noone around or if you just want some practice before you go public with your skills... the AI _will_ notice if the player tries anything illegal of course Smile

BTW, I do have a simple ThudboardOnlineProtocol file sitting on my server just in case I ever got around to implementing a client/server version, perhaps it can be of some use... comments are in Dutch though, but perhaps this is enough to give you some thoughts... see http://www.million.nl/file/ThudBoardOnlineProtocol.txt

Dewi Morgan wrote:

Maybe we should take this discussion offline, though p'raps not, since this stuff might be really interesting to the next person who tries to write a client...

It's fine by me to keep the discussion in the open, people might want to join in development, that's always welcome...

Dewi Morgan wrote:

Have to change my server dialog to include takes, both in the move and the replay parts. And the scoring tests have to change, along with all the move/take validation code on both server and client.

ouch, that does sound like a lot of work...

Dewi Morgan wrote:

And clearly I *must* store takes in the DB. How? I rely on each move being a set length. I guess a bitfield of the squares around the troll. If I'm bitpacking, might as well use one byte per coord, instead of two. That'd get each move down to 3bytes for trolls, 2 for dwarfs. I do hope Flash can cope with bit-frobbing.

Not to be picky, but _must_ you pack all this into fixed-length? A record per move would be fine too, right? With one text-field like the move+capture lin e in the ThudBoard save file, and other fields for comments and whatnot....
What if you wanted to implement a version of Koom Valley Thud, where the Dwarf Commander can move the Rock too? The procesing power needed to get from the start to any move in the game, replaying things, is really not all that huge is it? It works in ThudBoard where you can click any line to see how the board looked then...

Dewi Morgan wrote:

And of course I need a way for people to choose which piece to take on the GUI, and making that intuitive and work with all skins may well be the hardest part.

I used the right mouse-button for that, and found it works very well except for one glitch, and that is the Mac-users using a single-button mouse... haven't thought up a good way to get around that yet...

Dewi Morgan wrote:

Maybe a "take all" checkbox at the bottom. If unselected, popup asking which to take. A diamond/square (depending on board orientation) of checkboxes, greyed out for positions where there's no dwarf. Three buttons: leave all, take selected, take all. Clicking them gives a definite "end" to their move, and I can send it to the server.

Basically, that's just user interface, the parts you send to the server would need all the captures as well, otherwise the transfer-protocol would include some of the rules... I would suggest to let the transfer-protocol be completely ignorant about whatever rules there are, and just make sure that moves, captures and placements (ok, so you cannot place a new piece on the board now, but who knows what Trevor comes up with next Smile) are possible...

And when I say it's just user interface, that doesn't mean I don't think it's important, in fact, I think it's the most important thing of all: how the user feels when he or she interacts with the program.

That's enough babbling from me for now Smile

Ciao, Marc.


Bronze Member
Anonymous wrote:

Also for a position where it makes sence

Hey, nice setup, I have tried to come up with a setup myself but couldn't quite figure out an example that would work, but this seems to leave a benefit for the Trolls if they don't take all the Dwarfs.

Ciao, Mc!


I thought Guest was you, Mc!

Who was that masked thudplayer???


Dewi Morgan wrote:

Who was that masked thudplayer???

Whoever (s)he was, it was a very nice setup indeed. A ThudBoard snapshot of the setup can be found on my downloads page. It's good in ASCII, but looks even better now. Wink

(Yeah, I know, the links page again, for want of a better place... I'm thinking of making an extra page for special things like this and the Koom Valley Thud rules, also still to be found there.)

edit: I created a new page: downloads. Look there for any stuff like this, and Koom Valley Thud rules.


Bronze Member

Hi Boi,

Can you put the koomvalley.thud savegame on that links page as well?

Ciao, Marc.


Mc wrote:

Can you put the koomvalley.thud savegame on that links page as well?

Done.


Bronze Member

Perhaps you can put a note with that link that it requires ThudBoard 1.5 to play?

Thanks, Mc!


Mc wrote:

Perhaps you can put a note with that link that it requires ThudBoard 1.5 to play?

Thanks, Mc!

Anything else? Wink

Just for the record: I added a downloads page, for stuff like this. It's not on the links page anymore. I'll edit all my posts so they will point to the new page.


Dewi Morgan wrote:

Going back to the save file format ...

Not sure if this is usefullt, but you might want to take a look at it;
http://www.red-bean.com/sgf/ .


Thank you Smile

I do like to avoid reinventing the wheel if I can, so at the very least, an export util to download your games as sgf would be a Nice Thing, because then sgf tools can be used on them.

I'll read up on it in more detail later, but for the moment, food beckons Smile


I may be being really dense with this but when using oograh boike's website for saved games do you need to move the pieces yourself or is there a method which allows you to copy and paste the moves? (notably i'm thinking about "the game where Marc is dwarfs versus Palm." I've tried but it doesn't seem to be working.

I appologise now if i'm being dumb but please help so that i can learn from the pros.


--

I'm Meeeellllllltttttiiiiiiiinnnnnggggg!!!!!


thunderchild83 wrote:

I may be being really dense with this but when using oograh boike's website for saved games do you need to move the pieces yourself or is there a method which allows you to copy and paste the moves? (notably i'm thinking about "the game where Marc is dwarfs versus Palm." I've tried but it doesn't seem to be working.

I appologise now if i'm being dumb but please help so that i can learn from the pros.

You should be able to save the .thud files down to your computer then open them in the thudboard app and step thru the moves just by selecting the move number you want to see in the thudboard app. Hope that helps.


Mc wrote:
Dewi Morgan wrote:

Also, is there any ability to have comments, for things like player names, date, etc?

There is, it was added much later and they are stored in a separate file so new savegames can still be used in older versions. The separate file is xml which contains only comments at the moment, but could include more. This was thought up and implemented by Jan Stocker, with a bit of communication between us of course.

Could you provide the file format for this? I'm wrying to write an exporter to .thud for the tournament, and this "extra info" file would be a Good Thing to provide.

Oh, and looking at some savegames on OB's site, there are prefixes on some lines ("~" and ">") - what do these mean?


Bronze Member
Dewi Morgan wrote:

Could you provide the file format for this? I'm wrying to write an exporter to .thud for the tournament, and this "extra info" file would be a Good Thing to provide.

The filename is the same as thud name but with info added, so battle.thud would become battle.thudinfo.
The .thudinfo file is utf-8 encoded xml, and basically looks like this:

<thudbattle>
  <info/>
  <moves>
    <move/>
    <move/>
    <move/>
    <move>
      <comment>Hello World</comment>
    </move>
  </moves>
</thudbattle>

The moves should be the same in number and order as the moves in the .thud file.
To experiment with this just enable the comments in the options menu of ThudBoard.

Dewi Morgan wrote:

Oh, and looking at some savegames on OB's site, there are prefixes on some lines ("~" and ">") - what do these mean?

The ~ means that the rules are not enforced (they are not implemented, so they cannot be, but I thought I'd future-proof it), the > is for the current battle-line (the selected line when the battle is saved, which is not necessarily the last move in the list), which represents the current state of the board.


All I really want to save is who played which side and what the final score was. Possibly not worth making a .thudinfo file.

Anyway, please do play with the following, and GIVE FEEDBACK! Very Happy It's not ready for primetime yet but once everyone's given feedback on it, and I've fixed the problems people are having, I'll take it live.

http://www.thudgame.com/getgame

Most people will use the above URL just as-is, but it accepts various parameters for those wishing to link to games from their own sites:

  1. id=gamenumber - the game to display.
  2. move=movenumber - the move number to display in the HTML view.
  3. firsthalf=anything - display the first half.
  4. secondhalf=anything - display the first half, if the above is not set.
  5. half=1 or 2 - display the relevant half, if the above are not set.
  6. thud=anything - diwnload the file as a .thud file.
  7. html=1 or 0 - 1 for html (default) or 0 for .thud file, if above is not set.

If your browser is sensible, it should even download the .thud files with a sensible filename like "Dearmer-vs-Dwarvesaresmall-1.thud" rather than "index.php" Smile

This all means that you don't actually need to store the game on another server: you just need a link, something like this:

<p>Rightclick to save the first half of the "Dearmer vs Dwarves are small" game as a .thud file:
<a href="http://www.thudgame.com/getgame?id=2544&half=1&thud=1">link</a>


Dewi Morgan wrote:

All I really want to save is who played which side and what the final score was. Possibly not worth making a .thudinfo file.

Anyway, please do play with the following, and GIVE FEEDBACK! Very Happy It's not ready for primetime yet but once everyone's given feedback on it, and I've fixed the problems people are having, I'll take it live.

http://www.thudgame.com/getgame

Most people will use the above URL just as-is, but it accepts various parameters for those wishing to link to games from their own sites:

  1. id=gamenumber - the game to display.
  2. move=movenumber - the move number to display in the HTML view.
  3. firsthalf=anything - display the first half.
  4. secondhalf=anything - display the first half, if the above is not set.
  5. half=1 or 2 - display the relevant half, if the above are not set.
  6. thud=anything - diwnload the file as a .thud file.
  7. html=1 or 0 - 1 for html (default) or 0 for .thud file, if above is not set.

If your browser is sensible, it should even download the .thud files with a sensible filename like "Dearmer-vs-Dwarvesaresmall-1.thud" rather than "index.php" Smile

This all means that you don't actually need to store the game on another server: you just need a link, something like this:

<p>Rightclick to save the first half of the "Dearmer vs Dwarves are small" game as a .thud file:
<a href="http://www.thudgame.com/getgame?id=2544&half=1&thud=1">link</a>

What you get when you download this is a html file with picture of the game at the beginning and the .thud file moves appended at the end

To get working thud file on a windows system rename the .thud file .txt

open in notepad

cut from "dF1," to the end of the file paste it into new blank text file do save as txt but select UTF-8 as the type of text.

rename the new file .thud and it will now work in the thud app.

i cracked that quicker than i thought i would Very Happy i am glad to know i am not totally senile these days as old IT guy approaching 4th decade Wink

Well done Dewi now can you fix it so that games dont have more than 2 halfs?(having said that we tried 2370 and it did not break the data base tho it does have several games in it only the first 2 show i think)


SANEAlex wrote:

open in notepad

cut from "dF1," to the end of the file paste it into new blank text file do save as txt but select UTF-8 as the type of text.

rename the new file .thud and it will now work in the thud app.

From previous experiences with emailed games I think I should add that you should check that the .txt file you want to rename to .thud doesn't have any carriage returns at the end of the file. Copy and paste just the text from first character to last.
Any extra CRs at the end of the file make it "corrupt" as far as ThudBoard is concerned.


Bronze Member
Oograh Boike wrote:

Any extra CRs at the end of the file make it "corrupt" as far as ThudBoard is concerned.

I'll take that as a bug-report Smile


Instead of trying to down load the .thud files i tried your step thru the move by move html file and i noticed that the 2370 game the first half does not show the thud board so you cant step thru it maybe this is because it was one of the multiply half games that i mentioned before hope this helps.

Any chance of a search so that you can search for games that you have played by player name?.

Are we likely to break anything if we give the number of the game to someone while we are playing so that this can be used for third parties to view a game in progress? or will the DB lock others out of live games?

edit game 2558 and 2559 do not show the board in either half


Quote:

What you get when you download this is a html file with picture of the game at the beginning and the .thud file moves appended at the end

Oops... very strange. Fixing...

Edit: should be fixed, thud files should save correctly now. Please test.

I had forgotten to check whether it was HTML, when displaying the pretty board.

SaneAlex: looking into the problems you reported, too.

Further edit... geesh.

select move_id, x2, y2 from moves where game_id=2370 and x1=0 order by move_id;  
+---------+----+----+
| move_id | x2 | y2 |
+---------+----+----+
|       1 |  0 |  1 |
|      40 |  0 |  2 |
|      41 |  0 |  1 |
|     108 |  0 |  2 |
|     109 |  0 |  1 |
|     157 |  0 |  2 |
|     158 |  0 |  1 |
|     233 |  0 |  1 |
|     309 |  0 |  2 |
|     310 |  0 |  1 |
|     352 |  0 |  1 |
|     421 |  0 |  2 |
|     422 |  0 |  1 |
|     488 |  0 |  1 |
|     526 |  0 |  2 |
+---------+----+----+
15 rows in set (0.08 sec)

Any move to a coordinate 0,1 is the end of a halfgame, any move to 0,2 is the end of a full game.

The above shows that game id 2370 contains no fewer than nine end-half-games (including one as the first move of the game!), and six end-full-games.

In the database scheme I am going to upgrade to once the competition is over, there will be able to be at most one of each.

How the SMEG can I convert games like this?

Obviously, I can remove any markers before which there are no moves, so I can remove move 1.
I can also remove any markers followed immediately by another marker, so I can remove 40, 108, 157, 309 and 421.
(what convoluted SQL queries would accomplish this, and simultaneously renumber the move_ids so's not to have gaps, I don't know, but I anticipate headaches just from this alone).

But then, I'd have the slightly more sensible:

+---------+----+----+
| move_id | x2 | y2 |
+---------+----+----+
|      41 |  0 |  1 |
|     109 |  0 |  1 |
|     158 |  0 |  1 |
|     233 |  0 |  1 |
|     310 |  0 |  1 |
|     352 |  0 |  1 |
|     422 |  0 |  1 |
|     488 |  0 |  1 |
|     526 |  0 |  2 |
+---------+----+----+

That's still eight end-half-games before the end-full-game, and I'm not even sure that applying the same rules to all broken games would give the same neat "all 0,1 except the last move" result.

Ideas GREATLY appreciated Sad

Further edit: 150 games are affected (and five more have a change-ends at the beginning). That's few enough that I can fix them nanually if I must, but I'd love suggestions on what to DO to fix them manually or otherwise. Game 2323 is the worst with no fewer than FIFTY THREE side-changes Sad


Have tried the new version it looks more like a thud file but...

the thud board app still does not like it.

it seems to be missing the rock RH8 in the begining list

also missing tildes"~" b4 moves and missing a greater than ">" telling it which is the current move.

I have not got any bittwiddleing file viewers set up on my xp install at the mo so cant go into more detail i was just using notpad.

I will have another look after i have had cold bath i am a bit too much like a troll in that hot weather lesserns brain power Puzzled so may be able to write better bug report later.


Oh, I missed out the rock. Added now.

So far as I know, the tildes are not required, since the rules are enforced in all games you will get from the server. I'll put the > before the last move, unless the "move=" parameter is specified, in which case it goes before that move, then.

OK done that - try now?

And yes, I really really know what you mean about the heat Sad Both windows and my door open, fan in the window, gobbling freezepops like they were coffee, and still can't think Sad This is part of why I usually work until 4-6am.


Dewi Morgan wrote:

Oh, I missed out the rock. Added now.

So far as I know, the tildes are not required, since the rules are enforced in all games you will get from the server. I'll put the > before the last move, unless the "move=" parameter is specified, in which case it goes before that move, then.

OK done that - try now?

i tried game 1501

the game will load into the thud app and you can see the moves but you cant step thru the moves like normal.

Also it does not start at move one

~
~
~

wierd if you use the cut and paste from the game app for moves you just get a "~"

What i actually see is

% d B9 - B8
T K9 - L 10
1. d L15 - C7
T L15 - C7
2. etc

working thud files start with move 1
1. etc

I think there must be xtra control codes or somthing to mangle the cut n paste.

sorry for the bad news but on the bright side you are getting closer as it does load into the thud board ap and you can see what the moves are.


I'm gonna have to cave in and get python and tb and install them and try it myself, so that I can debug my stuff, I suspect Sad


Bronze Member
Dewi Morgan wrote:

I'm gonna have to cave in and get python and tb and install them and try it myself, so that I can debug my stuff, I suspect Sad

Why the unhappy face? ThudBoard is cool! Cool Python too! Laughing


Bronze Member

I tried this one, and it starts with

RH8,dF1,dG1,....
dB7-B8
TH8-G8

Now the first line is ok, but the first move is invalid: there is no Dwarf on B7...
Second move is invalid too, the Rock is on H8, not some Troll...

Can you get me a list of id's which should, theoretically, work?


Bronze Member
Dewi Morgan wrote:

Further edit... geesh.
How the SMEG can I convert games like this?

Assuming a single id is used for both halves of the game, and no two games have the same id... perhaps you can just remove any end-half and end-game markers, reconstruct the complete moves, and look for the point where subsequent moves don't compute: that should happen at most once per game, and gives a good indication where the firsts half ended. Since the first discrepancy is not guaranteed to be the switch-over point, perhaps you can look back from that move and find the first end-half marker, and split the game there.

Did that make any sense? It's hot here, too.... Wink


Bronze Member
SANEAlex wrote:

What i actually see is
% d B9 - B8

If you see a % before the move, it means it cannot be played from the previous position. In this case, since it is the first move and there is no Dwarf on B9 in the starting position, you cannot move that Dwarf.

But, this file (id 1501, half 1, or 1501-1 for short) actually loads, whereas 2544-1 won't even load... I'll have a look to see why that file is invalid.


Bronze Member
Mc wrote:

2544-1 won't even load...

There are some strange moves in this file! Starting from move 35 (that is, 17 moves each):
dJ2-J4xJ4.......... this loads, but the piece moves and captures itself!
TN11-M12xN13.. this loads, even though there is no N13 on the board
dM14-10........... here it bails: I can't move to square 10! there's no such thing!

Hope this helps!

Ciao, Marc.


Bronze Member
Oograh Boike wrote:

Any extra CRs at the end of the file make it "corrupt" as far as ThudBoard is concerned.

Not quite: the last line may or may not have a CR... but more than one CR after the last line is indeed invalid.


You could always make it ognire all blank lines and lines beginning with # or ; or some other comment character? Would make me a happy bunny at least Razz

My guess on the games is that I've got an off-by-one going on there - moving the rock on the troll's first turn is a good indication of that. I'll take a peek in a couple hours, just finish some other stuff off.

Mc: didn't mean to insult thudboard, and only slightly to insult Python (I'm a deout Perl/PHPer and hate OOP languages, and the idea of a language in which whitespace is in any way relevant makes me cringe). But, it's just one more thing to install and learn and I have so little time lately Sad

Also, your idea is clearly good, except... I can prettymuch guarantee that every end marker indicates the end of half a game. That's fine. So a game with nine halves (!) can be split into four separate games, in theory.

But, who played which half?

This is significant for the ranking tables. If I get it the wrong way round on a game with 53 halves (!!!), then someone could have potentially 106 more wins relative to their competitor than they ought to. So just one game (let alone 150 of them) could massively affect the league tables.

I think the first move will be for me to grok the bug, find out exactly whqat is happenning there, and who would (given payer A as dwarfs) be playing which side in which game, then to split all games into multiple games on that basis.

I've also prettmuch decided to scrap the whole halfgame marker thing, and have each halfgame stored as a separate, isolated game, but with a comment linking the two games in a round.


Mc wrote:

Not quite: the last line may or may not have a CR... but more than one CR after the last line is indeed invalid.

I've sent you an email with a game that has the "corrupt" problem, so you can have a look at it yourself.


Bronze Member
Dewi Morgan wrote:

You could always make it ognire all blank lines and lines beginning with # or ; or some other comment character? Would make me a happy bunny at least Razz

Since you generate the files anyway, why would you want to insert blank lines or comment lines?

Dewi Morgan wrote:

My guess on the games is that I've got an off-by-one going on there - moving the rock on the troll's first turn is a good indication of that.

Could be... that also explains the N13, if that is M13 (or even M12) then it would make sense. Doesn't explain the bare 10 though...

Dewi Morgan wrote:

Mc: didn't mean to insult thudboard

No worries, I'm not so easily insulted Smile

Dewi Morgan wrote:

and only slightly to insult Python (I'm a deout Perl/PHPer and hate OOP languages, and the idea of a language in which whitespace is in any way relevant makes me cringe).

So how do you feel about Perl 6 and PHP 5? Wink And you can code in Python without OO-ish stuff as well if you wish.
About the whitespace thing: loads of people seem to feel that way, and I cannot understand why... you indent your Perl/PHP code too, right? So what is different except for the braces?
(I code PHP for a living, but it annoys me more and more...)

Dewi Morgan wrote:

But, it's just one more thing to install and learn and I have so little time lately Sad

So quit sleeping! Shocked

Dewi Morgan wrote:

Also, your idea is clearly good, except... I can prettymuch guarantee that every end marker indicates the end of half a game. That's fine. So a game with nine halves (!) can be split into four separate games, in theory.

Ehm, you mean there's no seperate ID for a game???

Dewi Morgan wrote:

I've also prettmuch decided to scrap the whole halfgame marker thing, and have each halfgame stored as a separate, isolated game, but with a comment linking the two games in a round.

How about just storing it in .thud format? Laughing

If you have some games to test, post a few urls here and I'll try to analyze the .thud compatibility.

Ciao, Mc!


Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.