It is currently Sat Apr 27, 2024 3:40 pm

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 15 posts ] 
Author Message
Offline
 Post subject: SGF manipulation: truncate before move
Post #1 Posted: Wed Sep 08, 2010 12:30 am 
Lives with ko

Posts: 281
Location: France
Liked others: 69
Was liked: 25
Rank: yes
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!

Top
 Profile  
 
Offline
 Post subject: Re: SGF manipulation: truncate before move
Post #2 Posted: Wed Sep 08, 2010 5:44 am 
Lives in gote

Posts: 350
Location: London UK
Liked others: 19
Was liked: 19
Rank: EGF 12kyu
DGS: willemien
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)

_________________
Promotor and Librarian of Sensei's Library

Top
 Profile  
 
Offline
 Post subject: Re: SGF manipulation: truncate before move
Post #3 Posted: Wed Sep 08, 2010 6:13 am 
Lives with ko

Posts: 281
Location: France
Liked others: 69
Was liked: 25
Rank: yes
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.

Top
 Profile  
 
Offline
 Post subject: Re: SGF manipulation: truncate before move
Post #4 Posted: Wed Sep 08, 2010 6:49 am 
Lives in gote

Posts: 350
Location: London UK
Liked others: 19
Was liked: 19
Rank: EGF 12kyu
DGS: willemien
let us all know if it is what you want :salute:

_________________
Promotor and Librarian of Sensei's Library

Top
 Profile  
 
Offline
 Post subject: Re: SGF manipulation: truncate before move
Post #5 Posted: Wed Sep 08, 2010 8:31 am 
Lives with ko

Posts: 281
Location: France
Liked others: 69
Was liked: 25
Rank: yes
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.

Top
 Profile  
 
Offline
 Post subject: Re: SGF manipulation: truncate before move
Post #6 Posted: Wed Sep 08, 2010 8:55 am 
Lives in gote

Posts: 350
Location: London UK
Liked others: 19
Was liked: 19
Rank: EGF 12kyu
DGS: willemien
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

_________________
Promotor and Librarian of Sensei's Library

Top
 Profile  
 
Offline
 Post subject: Re: SGF manipulation: truncate before move
Post #7 Posted: Wed Sep 08, 2010 8:59 am 
Lives with ko

Posts: 281
Location: France
Liked others: 69
Was liked: 25
Rank: yes
bah, i'll just patch my own gogui copy then. Anyway, thanks for the suggestion!

Top
 Profile  
 
Offline
 Post subject: Re: SGF manipulation: truncate before move
Post #8 Posted: Wed Sep 08, 2010 12:51 pm 
Lives in sente
User avatar

Posts: 1311
Liked others: 14
Was liked: 153
Rank: German 1 Kyu
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.

_________________
The really most difficult Go problem ever: https://igohatsuyoron120.de/index.htm
Igo Hatsuyōron #120 (really solved by KataGo)

Top
 Profile  
 
Offline
 Post subject: Re: SGF manipulation: truncate before move
Post #9 Posted: Wed Feb 02, 2011 8:17 am 
Lives in sente
User avatar

Posts: 801
Location: Amsterdam (NL)
Liked others: 353
Was liked: 107
Rank: KGS 7 kyu forever
GD Posts: 460
Somehow I fail to understand why it is better to open a new thread when this one suits me well. ( You are welcome to explain it to me: here, in forum rules or by pm ).

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.


Last edited by cyclops on Wed Feb 02, 2011 4:44 pm, edited 1 time in total.
Top
 Profile  
 
Offline
 Post subject: Re: SGF manipulation: truncate before move
Post #10 Posted: Wed Feb 02, 2011 9:11 am 
Lives with ko
User avatar

Posts: 205
Liked others: 6
Was liked: 65
Rank: EGF 5 dan
GD Posts: 29
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


Last edited by Vesa on Wed Feb 02, 2011 12:05 pm, edited 1 time in total.
Top
 Profile  
 
Offline
 Post subject: Re: SGF manipulation: truncate before move
Post #11 Posted: Wed Feb 02, 2011 10:52 am 
Oza

Posts: 3658
Liked others: 20
Was liked: 4633
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.

Top
 Profile  
 
Offline
 Post subject: Re: SGF manipulation: truncate before move
Post #12 Posted: Wed Feb 02, 2011 4:55 pm 
Lives in sente
User avatar

Posts: 801
Location: Amsterdam (NL)
Liked others: 353
Was liked: 107
Rank: KGS 7 kyu forever
GD Posts: 460
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.

Top
 Profile  
 
Offline
 Post subject: Re: SGF manipulation: truncate before move
Post #13 Posted: Mon Feb 07, 2011 1:04 pm 
Lives in gote

Posts: 355
Liked others: 52
Was liked: 43
Rank: AGA 2d
IGS: ethanb
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. :)

Top
 Profile  
 
Offline
 Post subject: Re: SGF manipulation: truncate before move
Post #14 Posted: Mon Feb 07, 2011 3:27 pm 
Lives in sente
User avatar

Posts: 801
Location: Amsterdam (NL)
Liked others: 353
Was liked: 107
Rank: KGS 7 kyu forever
GD Posts: 460
OK, Ethan. I then wish you good luck, though I don't know how Linux, UGF and Natty are involved.

Top
 Profile  
 
Offline
 Post subject: Re: SGF manipulation: truncate before move
Post #15 Posted: Mon Feb 07, 2011 8:26 pm 
Lives in gote

Posts: 355
Liked others: 52
Was liked: 43
Rank: AGA 2d
IGS: ethanb
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. :)

Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 15 posts ] 

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: Bing [Bot] and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group