I want an efficient, one byte way to store a chess move. Standard Algebraic chess notation takes too many bytes, and other solutions I came up with (such as numbering the squares 0-63 and them appending the numbers one after the other) also don't work. I also understand that stuff like promoting might take more than one byte, but I want a standard move to take an average of one byte. Is there any standard / algorithm for that?
Chess Programming Wiki tells us:
If the generated moves inside a move list are deterministic, one may encode moves as relative list index. Since the maximum number of moves per positions seems 218, one byte is enough to index the move. This encoding was used in early game databases.
So this requires that your implementation can generate all valid chess moves for a given position. The linked article mentions a few improvements to this method, but if your concern is only to stay in the 1-byte range, then this is enough.