Life In 19x19 http://www.lifein19x19.com/ |
|
SGF manipulation: truncate before move http://www.lifein19x19.com/viewtopic.php?f=18&t=1585 |
Page 1 of 1 |
Author: | lorill [ Wed Sep 08, 2010 12:30 am ] |
Post subject: | SGF manipulation: truncate before move |
Hi, I have a simple use case: browse a game to move N, then remove all preceding moves, replacing them by setup stones to keep the position, and keep the following moves. Does anyone know a tool able to do this ? I don't care wether it's linux or windows, and a command line tool is acceptable too. I already tried drago, multigo, and cgoban. Even gogui doesn't do it, it can replace the preceding moves by setup stones, but loses the following nodes. I can change the code myself (and actually, I've done it to see if it was easy to do), but I don't have to time to play with git, translations... I'll probably do it if there's no other way, but i'd rather use something already working. Thanks! |
Author: | willemien [ Wed Sep 08, 2010 5:44 am ] |
Post subject: | Re: SGF manipulation: truncate before move |
Interesting suggestion but under some (quite rare) situations there can be problems. - The end result of the game can differ - (because if you make it a setup the prisoner count is deleted) - What if the position is a ko position where the player can not play somewhere (because in the game it would mean retaking the ko) - Superko position (what if some crazy variation is forbidden in the game because it leads to a position earlier played in the game) Having said all that it still is an interesting option Oh was just looking in SmartGo think that tools >> add to collection is just what you want (but do try it out first) |
Author: | lorill [ Wed Sep 08, 2010 6:13 am ] |
Post subject: | Re: SGF manipulation: truncate before move |
willemien wrote: - The end result of the game can differ - (because if you make it a setup the prisoner count is deleted) - What if the position is a ko position where the player can not play somewhere (because in the game it would mean retaking the ko) - Superko position (what if some crazy variation is forbidden in the game because it leads to a position earlier played in the game) This is all true, but I don't care. I'll also truncate the end of the file a few moves later, the idea being to extract a sequence of moves to ask questions on it without losing time to find the original position in the full file during the review. In case of a ko or particular situation, i'll cut before, or mark it as a comment. I'll check smartgo. |
Author: | willemien [ Wed Sep 08, 2010 6:49 am ] |
Post subject: | Re: SGF manipulation: truncate before move |
let us all know if it is what you want ![]() |
Author: | lorill [ Wed Sep 08, 2010 8:31 am ] |
Post subject: | Re: SGF manipulation: truncate before move |
willemien wrote: Oh was just looking in SmartGo think that tools >> add to collection is just what you want (but do try it out first) Nope, it's just like gogui's "keep only position". Subsequent moves are lost. |
Author: | willemien [ Wed Sep 08, 2010 8:55 am ] |
Post subject: | Re: SGF manipulation: truncate before move |
willemien wrote: Oh was just looking in SmartGo think that tools >> add to collection is just what you want (but do try it out first) Nope, it's just like gogui's "keep only position". Subsequent moves are lost.[/quote] oops From the manual Quote: 3.6.8 Add to Collection Adds the current position to a collection. All the visible stones and marks of the current position are copied; moves before and after this position are not copied, except for next moves marked as either good (!) or bad (?). You can use this to create and extend a collection of problems or interesting positions, for example. Note: To add whole games to a collection (not just the current position), rightclick on the list of games and choose Add File . Collection: Specify the SGF file name where you want to add this position. If the file doesn't exist, it will be created. Name: Specify the name that you want to give this position, so you can easily find it in the collection. This will set the node name. Detail: If the name contains a letter followed by a number from two to five digits, the number will be incremented automatically each time you add a position. For example, P0017 will become P0018. Source: Specify where this position is from. This will set the Source field in the Game Info. Mark current position with a Hotspot or Checkmark: Check this box to automatically add either a hotspot or a check mark at the current position, to indicate that you've added this position. Start new game after adding position: This is a useful option when you enter multiple problems from a problem book, for example, and you immediately want to start entering the second problem after you added the first one. Warning: Use this option with care, as it will discard any changes to the current game without giving you a chance to save them. (The manual can be found at http://www.smartgo.com/help/SmartGo.pdf, it is the manual of an very old version 1.5 and not everything is where the manual says it is, but most options are still somewhere) I don't know how many moves ahead it keeps (i haven't tried this option myself. I am still hoping on SmartGo v3, Long ago Anders told me I could be beta tester but haven't heard from him since. I also added your wish to Sensei's GoSoftwareForTheFuture |
Author: | lorill [ Wed Sep 08, 2010 8:59 am ] |
Post subject: | Re: SGF manipulation: truncate before move |
bah, i'll just patch my own gogui copy then. Anyway, thanks for the suggestion! |
Author: | Cassandra [ Wed Sep 08, 2010 12:51 pm ] |
Post subject: | Re: SGF manipulation: truncate before move |
An idea: Open a copy of that SGF-file with a text-editor. Replace all of the ";" within the coding of moves (";B[xy]" / ";W[xy]" = Black's / White's move at the coordinates "xy") until the last one you want to be part of the setup position with "A" ("AB[xy]" / "AW[xy]" = add a Black / White stone at coordinates "xy"). Save the copy and open it with a SGF-editor. Compare with the position in the original SGF-file. Delete all stones that should have been taken off the board. Adjust Komi. |
Author: | cyclops [ Wed Feb 02, 2011 8:17 am ] |
Post subject: | Re: SGF manipulation: truncate before move |
I downloaded the gogui software and opened it in Eclipse. To exercise a little my first task was to change the color of the grid into green. I managed after taking some times to find the lines of code. Next exercise was to change the thickness of the lines. I failed because the java (awt) command drawline(..) draws only lines of one pixel thick. It was too heavy to replace the command just for an exercise. Next exercise I will undertake is to rotate the position over 90 degrees in such a way that also the exported sgf will have the positions rotated. This includes also the change of the user-interface to allow the user to initiate the rotation. Sooner or later I want to program more serious changes to gogui. For example lorill's request at the start of this thread. Or to allow the user the correct a misplaced stone if he is editing a game from a book, without losing all further moves. Or to insert a pair of forgotten stones. And so on, until the editor is perfect. OC I intend to collect ideas using this forum. The questions that arise now: - What does Lorill mean when he says: no time to get involved with git? - Is it correct to get the gogui software from sourceforge and adapt it as I wish? - How should I proceed if I want to make my adaptions public? - It seems progress towards GTP 2.0 has stopped. Correct? OC, when it gets serious I will try to contact the maker of Gogui, Markus Enzenberger. He wrote a beautiful piece of software. |
Author: | Vesa [ Wed Feb 02, 2011 9:11 am ] |
Post subject: | Re: SGF manipulation: truncate before move |
Quote: I have a simple use case: browse a game to move N, then remove all preceding moves, replacing them by setup stones to keep the position, and keep the following moves. GoWrite 2 can do this with just a little manual work: - Select the black stones [shift down - right click through all black stones] - Right click -> Black setup stones - Repeat the same for white stones - In the game tree, select the previous moves from 1 to the last before the setup stones mark and delete them Edit: Of course, you can use diagrams with the next move starting from 1 if you just want to have the image effect. Cheers, Vesa |
Author: | John Fairbairn [ Wed Feb 02, 2011 10:52 am ] |
Post subject: | Re: SGF manipulation: truncate before move |
If it's really a case of just wanting to get a setup kind of position and being able to play on from there (and not really wanting to delete the earlier moves), MultiGo does this very easily. At the point you want to diagram, you just tell it to renumber at move X (which can also be the actual move number), and all moves before that point appear as setup stones. The resulting position can be copied as an image. It's what I use when passing files to Bill Cobb at Slate & Shell. Bill uses SmartGo to get the same result and more, but he did say it was a steep learning curve. |
Author: | cyclops [ Wed Feb 02, 2011 4:55 pm ] |
Post subject: | Re: SGF manipulation: truncate before move |
Lorill's problem is not the only issue. Maybe indeed I should have started a new thread. My irritation with go-editors started when I wanted to record a game in sgf and towards the end noticed that I misplaced a stone halfway. I saw no other solution then to save in sgf, load the sgf in a plain text-editor, search for the wrong move in clumsy sgf-coordinates and correct the move manually. Sometimes I want to extract from a game the moves played in a certain area to discover the joseki. Gogui is open source and Java. That makes it suitable for me to adapt. |
Author: | ethanb [ Mon Feb 07, 2011 1:04 pm ] |
Post subject: | Re: SGF manipulation: truncate before move |
SmartGo (or at least SmartGo Kifu) has this feature, but I don't believe there's a Linux version. I'm thinking about adding it to Quarry, but I need to get off my butt and try to package up a release now that I have UGF import working. If I do it this week I might be able to get it in before Natty feature freeze. So not this version coming out, but maybe the next one. ![]() |
Author: | cyclops [ Mon Feb 07, 2011 3:27 pm ] |
Post subject: | Re: SGF manipulation: truncate before move |
OK, Ethan. I then wish you good luck, though I don't know how Linux, UGF and Natty are involved. |
Author: | ethanb [ Mon Feb 07, 2011 8:26 pm ] |
Post subject: | Re: SGF manipulation: truncate before move |
Sorry, I must not have been very clear - often a failure of mine. ![]() I've been thinking about adding this feature (insert new nodes between existing moves or edit the placement of a stone mid-tree) to Quarry. I recently finished adding a new feature to the current code, and am going to try to make a release and package it up before Natty feature freeze. Therefore I won't be able to get the new move insertion feature you were asking about into Quarry before the next release, as I work way too many hours a week and don't have enough time. If you have more time, adding it to GoGui will probably be faster than waiting on Quarry, but I just wanted to note that at least one other SGF editor will have this feature at some point. ![]() |
Page 1 of 1 | All times are UTC - 8 hours [ DST ] |
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |