bernds / q5Go

A tool for Go players: SGF editor, analysis tool, game database and pattern search tool, IGS client
GNU General Public License v2.0
166 stars 28 forks source link

How to use svg/ascii part of q5Go for developers? #57

Closed HackYardo closed 2 years ago

HackYardo commented 2 years ago

I am developing a Go web GUI for non-standard Go games for fun, and I want to use svg/ascii to save/load positions as pictures because they both can be edited.

bernds commented 2 years ago

I'm not entirely sure what the question is. There's some SVG code in svgbuilder.cpp and svgbuilder.h, and the rendering code is in board.cpp. But honestly I'm not sure how reusable it would be for other games.

HackYardo commented 2 years ago
  1. Are there any document or interface of svg/ascii or q5Go for those developers who don't know c++/qt? If so, they can use the codes in no time.
  2. If no, what's the format of svg/ascii of q5Go? If different softwares/sites use the same format of svg/ascii, then svg/ascii images can be used anywhere, just like q5Go, sensei library, lifein19x19 use the same ascii.
HackYardo commented 2 years ago

Files about Go games, i.e. SVG/ASCII, SGF and so on, should have the universal format! Different Go GUIs use different sgf formats. If a kifu has been analyzed in Sabaki, then open it with KaTrain, you need analyze again. That's not good.

bernds commented 2 years ago

The ASCII diagram syntax is shown on Sensei's Library if you try to edit any page. SVG is just a vector graphics format, there's nothing Go specific about it, you just write out something that hopefully looks good. It's like any other image format, really.

I agree that SGF should have a universal format for analysis, but when I brought this up, no one was interested and I was told to just use a random SGF property that's private to q5go. So, that's what ended up happening.

HackYardo commented 2 years ago

Because svg/ascii can be edited, why not convert svg/ascii into sgf and convert sgf into svg/ascii? What only need to do is adding some captures information below the Go Board. That's what I want to ask in the beginning of this issue. If q5Go can load sgf from svg/ascii, VastGo(my new project) can do it too, then q5Go and VastGo can load sgf from each other's svg\ascii, that's a universal svg/ascii format of Go games.

bernds commented 2 years ago

ASCII import might be doable, but SVG import is out of the question. It's an image format. SGF is the file format you need to support if you want to interchange Go files.