Arimaa Forum (http://arimaa.com/arimaa/forum/cgi/YaBB.cgi)
Arimaa >> General Discussion >> Board position image generator (Updated)
(Message started by: leo on Jan 7th, 2008, 4:19pm)

Title: Board position image generator (Updated)
Post by leo on Jan 7th, 2008, 4:19pm
EDIT: check the new page instead: http://lestrucsaleo.net/arimaa/boardtools.php

I'm experimenting a system to generate board position images on the fly through a script.

You can have a look at it there: http://lestrucsaleo.net/arimaa/boardgendoc.php

Check the test page.

Would it be interesting to integrate it into the forum to illustrate games?

Example of what it can produce:

EDIT: removed examples as the system changed

Title: Re: Board position image generator
Post by jdb on Jan 7th, 2008, 6:10pm
Nice.

Title: Re: Board position image generator
Post by camelback on Jan 7th, 2008, 6:59pm
:o So cool, good job.

Is it possible to have the generally used notations like the one below for generating images?

Ee8 Rf8 Rd7 Mg7 De5 Rb4 Dc4 Rd4 Ra3 Cc2 Re2 Rh2
rg8 rh8 ee7 re6 rh6 rb5 rd5 ra4 db3 db2

This notation is used in plangame and puzzle generation links in Arimaa.

Title: Re: Board position image generator
Post by chessandgo on Jan 8th, 2008, 2:41am
Extremely nice, Leo, it would be extremely enjoyable to have the position images included in problem threads and some others !

Title: Re: Board position image generator
Post by leo on Jan 8th, 2008, 8:36am
@camelback: It would be no problem to add support for the standard notation.

But I now realize that direct links to the applet with position included is way more useful than an image.

And it would be even more useful to have a forum plugin that inserted a mini-applet into a post...

Or alternatively a template as there are in the Wikipedia pages, but I'm not sure the forum would support complex tables with board image background and piece images overlayed on the table grid.

Anyway thanks for the feedback everybody.

Title: Re: Board position image generator
Post by Fritzlein on Jan 8th, 2008, 6:20pm
Very nice, Leo!  Part of the reason I was inspired to write strategy articles on Wikibooks was that I could include text diagrams that automatically transformed into board images.  For editing the board positions on Wikibooks, it was very convenient that the board was human readable, i.e.


[arimaa diagram|=
|tright
|
|=
8 |  |  |  |  |  |  |  |rs|=
7 |rs|rg|cs|  |  |ds|rs|  |=
6 |dg|ds|  |hg|  |  |  |  |=
5 |  |  |  |es|  |  |  |  |=
4 |  |  |rs|  |  |rs|  |  |=
3 |  |dg|rs|eg|rg|  |rg|  |=
2 |  |  |hs|rs|  |hs|  |  |=
1 |  |  |cg|cg|rg|rg|rg|rg|=
|
]


If I wanted to move the silver rabbit one step north it was obvious how to edit it.  But I understand why you like the compact notation and camelback likes the official notation.  Different strokes for different folks, I guess.   :)  In any case, diagrams from text are a huge help in writing about Arimaa.

Title: Re: Board position image generator
Post by leo on Jan 8th, 2008, 6:34pm
Yes, the Arimaa diagram template on Wikipedia is extremely convenient. :) I recently imported it into the French Wikipedia. We could improve it by using the finer looking PNG images for the pieces instead of the GIFs currently stored on the Commons, what do you think? We could also add the X and O symbols for the cross and dot as in the Chess diagram template.

The reason for the script to take the position in a single line is a constraint of CGI calls but I know it is poorly readable. The ideal solution would be to plug an add-on into this forum to parse a layout similar to the one on Wikipedia. I don't know how hard it is to do that for YaBB. It would save much bandwidth compared to producing a new image for each new board position.

Title: Re: Board position image generator
Post by camelback on Jan 8th, 2008, 8:31pm

on 01/08/08 at 18:34:36, leo wrote:
Yes, the Arimaa diagram template on Wikipedia is extremely convenient. :) I recently imported it into the French Wikipedia. We could improve it by using the finer looking PNG images for the pieces instead of the GIFs currently stored on the Commons, what do you think?


I think Arimaa diagram template in wikibooks needs improvement. When I printed out the wikibook last year, the pieces and board were totally off base and not useful when reading in paper.

The problem is images of the individual pieces are getting super imposed on the board image in wikibook. If the diagram is generated as a single final image as in leo's website then it would look good on paper, I think.


Title: Re: Board position image generator
Post by Janzert on Jan 9th, 2008, 12:26am
Just as a note, the reason for the gif images in the Arimaa wikipedia template was because some browsers couldn't handle the pngs I tried initially. I'm pretty sure at the time IE was the big one that had a problem, maybe it's finally improved since then? Maybe the png versions are still hanging around on the commons and someone could give them another try.

I would say the template not printing correctly is a browser bug. ;) Although a single server side image would be nicer and certainly not subject to all these different browser problems. Unfortunately I'm pretty sure there's no way within the current wikipedia framework to have the server generate images, but then the current template is also "impossible" per several large wikipedia contributors. :) Shh, don't tell 'em I worked around the template restrictions they might decide to make their previous statement true. :P

Janzert

Title: Re: Board position image generator
Post by leo on Jan 9th, 2008, 2:36am
Argh, the many varied joys of web document technology... I just tried to convert the printable version of the Wikibook to PDF in order to see how the diagram table behaved, but OpenOffice got stuck as a rabbit too close to the enemy elephant. Often I wonder why the Web, instead of expanding a smart solid technology such as TeX, decided to reinvent the wheel all the long way through html, xml, php, svg, etc only to end up with a giant square wheel.

Janzert, I'm curious why the Arimaa template was considered impossible. I think it's safer to stay with the gifs for now, I hadn't realized there were problems with the pngs.

Title: Re: Board position image generator
Post by Janzert on Jan 9th, 2008, 5:55am

on 01/09/08 at 02:36:00, leo wrote:
Janzert, I'm curious why the Arimaa template was considered impossible. I think it's safer to stay with the gifs for now, I hadn't realized there were problems with the pngs.


It's been a while so I may be misremembering, but I'm pretty sure it was that you weren't supposed to be able to have one image overlay another. IIRC, I worked around that by using negative margins. That is probably also what ends up throwing the printing and pdf generation off.

Janzert

Title: Re: Board position image generator
Post by leo on Jan 10th, 2008, 12:57pm
But I seem to recall that negative margins are valid in most CSS elements. They are even necessary in some cases to approximate book quality layout. But the browsers see only what they want from CSS...

I have abandonned direct image production for the moment but I wrapped it into a utility page that also converts between various position notations. I also added an option to orient the board. You can check it here:

http://lestrucsaleo.net/arimaa/boardtools.php

Let me know if you find bugs, there must be some.

Title: Re: Board position image generator (Updated)
Post by omar on Jan 12th, 2008, 5:26pm
When I was working on the new game client I had started to include a "compose" mode, but had not quite finished it. But it does work for the most part and can be useful for creating puzzles. To try it out go to:

http://arimaa.com/arimaa/puzzles/compose.html

Click on the first move in the move list and then click the 'U' button to undo all the moves.

Now you can click on a square to place the piece shown in the center of the board. Clicking on the piece in the center skips to the next piece. Clicking on a piece you have already placed removes it (but doesn't work right for silver pieces). When you have placed the pieces click on the '--' button. From here you can move the Gold pieces. But if it should be Silvers turn you can click on '--' again. To get the move notation for the move list click on the 'L' button.

Title: Re: Board position image generator (Updated)
Post by Fritzlein on Jan 13th, 2008, 12:26pm
Very nice interface and functionality, leo.   Thank you.  I may use this off-line even if it doesn't get integrated into the local wiki.

Title: Re: Board position image generator (Updated)
Post by omar on Jan 18th, 2008, 9:11am
I've linked the position conversion tool on the 'Games' page.

http://arimaa.com/arimaa/games/

so we can find it easily.

Title: Re: Board position image generator (Updated)
Post by rajmahendra on Aug 15th, 2009, 8:01am
leo i have suggestion.

if we have a feature like this it will be good for anyone who like to display image in there website dynamically.

one php file accepts

FEN arimaa position
size of the board
 direction to place gold pieces

user will use a standard url and send these information and include this file in there php page. so image automatically ads in there website.

any idea on this ?



Arimaa Forum » Powered by YaBB 1 Gold - SP 1.3.1!
YaBB © 2000-2003. All Rights Reserved.