Thud is a board game played on an octagonal 15x15 board. (for implementation purposes it might be useful to consider it as square and just never move onto the non existing squares) One player plays with 32 dwarfs as pieces, the other one has 8 troll pieces.
I am wondering how to efficiently generate captures. E.g. the dwarfs can capture like a queen, however only as many squares away as they have dwarfs behind them backing it up. I.e.
captures possible: DT ; DD-T ; DDD--T ; DDD-T
not possible: D-T ; DD--T etc. (D = dwarf, T = troll, - = empty square; these captures work in all 8 queen directions like that)
I never worked with the magic numbers for chess move generation, would something like that be applicable here? Seems tricky due to the large board size.
One idea would be to have a bitboard with all squares we can capture on, and on making a move update the affected regions of the board. (which shouldn't be that much effort, though still the question how to do this most efficiently)
Alternatively since there's only 8 trolls, maybe one could look from their POV in all 8 directions to see if there's a dwarf line that could capture that troll. If done naively (i.e. for each troll and each direction first check if the position is D , then -DD, then --DDD ) that would be quite slow, but maybe there's some tricks to speed this up?
Any other ideas what could work? And once again, if this is too offtopic please tell me, then I will refrain from such posts in the future.
