Variants
2023-09-26   dejbug.github.io

Variants

Human beings definitely have minds. Other creatures on this planet or elsewhere may have minds. Inanimate objects such as rocks do not have minds. These claims will no doubt seem unexceptionable to all but the most perverse. — A Companion to the Philosophy of Mind. Blackwell: 1994.

Variant #1 - The Simulator

Player gets some random position (optionally hand-picked, randomly from a real game, or procgen'd). Player starts with only the pawns while the pieces are off board. Player can re-insert the pieces arbitrarily (optionally only on Player's half of the board). After insertion the game enters simulation mode. The game is played through by the engine, making best moves for both sides.

Personalities

Write engine frontends that exhibit the following personalities. 1. The engine will always try to exchange whenever it gets the chance (optionally, unless it blunders something). 2. The engine will try to avoid all exchanges... 3. The engine will always try to mirror Player's moves or try to reach the same kind of piece-placement and structure, when delayed (optionally, unless it blunders...).

Genetic Search

An engine which calculates normally but introduces random mutations upwards of a certain depth or kilo-node count. These mutations are to cause misevaluations of the position and are meant to reflect a human player's visualisation errors. There are more human-style errors to add. Calculation fatigue. Forgetting of candidate lines. Chickening out of sharp but unclear play. Complicating in "lost" positions.

Variant #2 - Dominoes

This is based on the variant called "suicide". You are given a position with Opponent's pieces and have to place your pieces so that they will all get captured in the end.

Variant #3 - Dice it up!

There are six types of chess piece, so one per die-face. Do something with that.

Variant #4 - RPG

Invent a set of super abilities and the equivalent of XP progression. For example. A special ability could be to once in a while get to move an Opponent piece. And advancing to a new level based on XP could be tied to either getting new abilities (drawing randomly from a deck of cards) or reloading your current abilities (or both). Other abilities could be to get a pawn which you can insert into a game. Maybe you get a world and have to plan a sortie/raid through it. You would naturally start with a sequence of low-level opponents to acquire the abilities you'd need to best the higher-level ones. If you mess up you can revive your hero by solving puzzles or drilling basic endgames end so on. In particular keep a child's psychology in mind here. We don't want to frustrate our youngest players.

Pen and Paper

To actually implement these games I'm going to write a Python backend and a simple JS frontend. gh python-chess:rtd gh pyscript.net // gh pypi

Awesome

awesome-python.com gh gh zulko:gh pydoit.org gh gh inotool.org gh gh gh nuitka.net

Homepage Rewrite

I'll have to rewrite our club's site springerbk. Because I've noticed that, as time is passing, I'm growing less likely to keep it up to date. So it needs to be remade into something that is primarily a joy to admin. Ok. I've just updated it and it's funny how intuitive it is. That's not because of but despite it being me who wrote it. Still, I think I can do better now. I've been looking at some SSGs like Pelican: docs.getpelican.com getpelican.com pelicanthemes.com gh and Nikola: gh getnikola.com. Also at some templating tools: gh makotemplates.org. More powerful grokking: pypi gh gh. Backend stuff: gh passlib:rtd.

CHESSERACT

Chess-Cataract? Chess-Tesseract! chessvariants.com Apparently there's a kind of scriptable engine called "Zillions of Games" (for Windows). chessvariants.com

FEN Scanner

I want to extract the FENs from my chess books.

Pdf2Png

To render PDF pages to PNG I've used pdftopng which ships with xpdf. I'm going to do it manually though. Using MuPDF mupdf:rtd and libpng libpng.org libpng.org.

Png2Bmp

To preprocess the images I was thinking of using Tesseract's gh dependency Leptonica leptonica.org or going full Crowley with gh or jumping right into OpenCV. docs.opencv.org. I've seen that the package is small enough so I went ahead and installed it speculatively. I wanted to add the Python bindings afterwards. pypi But the bindings are bundled with their own binaries so the packages are huge. I don't much care for that. I'm going to see how far I'll get with pillow, which I have already installed. pillow:rtd. So far I'm dealing with images that don't lose anything important when quantized to monochrome, which pillow can do. pillow:rtd pillow:rtd pillow:rtd Also look here gh. If all else fails, I'm going to go through this index of imaging libraries for Python. awesome-python.com pythongeeks.org SimpleCV looks nicely pythonic. tutorial.simplecv.org

Bmp2Txt

Now, I don't think I'd be going to like to train a Tesseract model for this. tesseract-ocr:gh gh tesseract-ocr:gh pypi. Although there may come a time when I'd need to OCR some things. Using the pretrained models gh though, this answer makes it look very user-friendly: So.

Bmp2Fen

Instead I'm going to cut out the diagrams (autocropping-like), subdivide them into squares, then grokk those individually. Some auto-levelling (rotation) might be necessary for this. But maybe the squares can be simplified into conceptually circular regions, depending on the chess fonts used and the amount of scanning artifacts and shear. Going to use FANN for grokking. gh wiki See the simple training example. leenissen.dk Get the handbook. fann:sf Brush up on ANN theory. leenissen.dk They've made building it very easy but there's also an AUM that does the job. aur:arch

GUI

A GUI is needed at this point. First for going through the images and checking (eyeballing) that the diagrams are boxed-in properly. Then by going through the cropped diagrams and checking (eyeballing) that the squares are boxed-in fine. Then for annotating the squares into a growing training set. Ideally, depending on how long it takes to train it, I'd like the ANN to be updated frequently so that each new board I look at will get pre-annotated and all I have to do is correct the wrong ones which should hopefully become fewer with each additional correction. This would have to be done for every book since, especially in older books, the chessfonts used are so diverse. More boringly, given that a book's scanning quality may vary across pages, we can't guarantee that training on the first half of the book will work on its other half. We must remember to tell our GUI to pick diagrams randomly.

Auto-Training

In case that training on-the-fly turns out to be too slow, which is likely, we could also try and auto-train the ANN upfront but unsupervised. So, first, create a rasterfont. That is, take a couple random pages, cut their board diagrams into squares in such a way that we have N different tokens of each type of "glyph". So e.g. 16 each of 1. empty light squares, 2. empty dark squares, 3. white and 4. black pieces (on light squares). Then create a page-synthesizer. That is, randomly pick some letters from this alphabet, do some light shearing and fuzzy-noisy stuff to those images and then paste them together into diagrams and write them out into PNGs that are approximately laid out like the pages in our book. Since we know what FEN needs to come out of the OCR, we can run it, compare, correct, re-run, and keep toying with the fuzzer.

Auto-Eyeballing (Preliminary Pass)

So much for the training. When we run it on the test set, we could use an engine to sanity-check the FEN for legality (non-randomness) and to see whether the result as indicted on the page is indeed the case. This result is a little text string somewhere around the diagram and can be cropped out and shown next to the engine's eval, for lightning-fast sanity-check eye-balling. Afterwards, in a slower second pass, we would look more carefully at the FENs.
This is an era before logic or science, a time when anything is possible. In short, if medieval Germans believed something might be true, in Darklands it may actually be true. — Darklands Manual. Microprose: 1992. wiki

Options

Like the churches in my neck of the woods, recently my bank has begun bolting down the gates at night. It has this vestibule where the ATMs are but you can't get there anymore past a certain cutoff time. Although there's no info about that whatsoever on their page. sparkasse-odenwaldkreis.de Anyway, I will need one of those: sparkassen-shop.de.

Ladiladiho!

yt