Please sign in to access this page

Depadeka

Depadeka

7 devlogs
6h 19m
Created by Tree Plate

An online adaptation of a chess-like board game my friend is designing. The server receives messages via a Dart CGI program on the server.

Timeline

1.0. replace ({String piece, bool white}) with a sealed class Piece

1.1. pieces implement _upWidth, _upHeight, _uprightWidth, and _uprightHeight to specify their size

1.2. Piece() is a factory that parses a piece+orientation

1.3. piece position is now topleft if rotated to up/upright

1.4. size and rotate pieces based on this

2.0. use runtimeType to render piece name

Update attachment
  1. piece position is now topleft for white and bottomright for black (instead of the center)
  2. better error messages for invalid command being sent to server
  3. add scp.sh, which copies the neccessary files to the server 10.1. add readmeforserver which explains that
  4. add updatestart.sh to run makesymmetric and pipe it to start.dpdk
Update attachment

I replaced the little caret subscript things with _ to fix encoding issues with sending non-ascii over http (it's simpler to work around the issue than figure out what the issue actually is). I stripped newlines from the board state before sending it to the client, so the parser doesn't get confused. I copied the parser to the client to make the client render each piece (as squares for now, but that's just a placeholder). Also, this project's repo is now a repo with two submodules, client and server.

Update attachment

I removed recovery tile moves from the first turn moves, as you don't start with anything on your recovery tiles.

Update attachment

Apparently rotation is now separate from moving now, and so both can be done in one turn. I updated my spec and my board files to match that.

Update attachment

Ok so the way i was doing rotations makes no sense, i can just use AV>< for noting direction in the file, for the actual UI i can just rotate the widget by 90 degrees

Update attachment

NOTE: not all of this is recorded on hackatime, i set it up partway through this commit

First devlog! So the server needs to store its board state locally, and give it to the client when it asks. This means I had to do two things:
a) Create the initial board state.
b) Write a program that sends the board state to the client.

My first step was actually to start on b). I had already worked on CGI scripts (see https://treeplate.damowmow.com/robliterator/robliterator.dart, my bot for software.hixie.ch/fun/robliterator), but not recently, so I looked at the code for that.

I first thought about a very short-lived websocket over CGI server, and did some work on that, but then realized just simple HTTP was both easier and made more sense. I only briefly looked at my old code and made the incorrect assumption that the request lines were the arguments. They were not. The arguments are empty, stdin has the request. After discovering that, I made a Dart+CGI program that gets a file and returns its contents if it exists, thus accomplishing b).

Now for a), I had a few problems. One, I needed to decide on a file format. I eventually settled on the format described in DPDK.md. Two, this format (which tries to match the official notation) has some characters that aren't in ASCII. Thanks to shapecatcher.com for finding all the necessary characters (well, except for orientations of K/k, which i could not find).

Another problem was that different pieces are different sizes. I decided to just always put the center as the coordinate, and for 2x2 put bottom left if white and top right if black.

To generate start.dpdk, I first wrote by hand justwhite.dpdk, containing all the white pieces, and then wrote parser.dart to parse it into a state defined in state.dart, and makesymmetric.dart to add black pieces, which is rotated around the center of the board by 180 degrees.

Update attachment