# Developing a simple Board-game

To clear my head before I get back into the swing of things, with my other project, I’m building a board-game. I need something simple right now, so simple I shall build.

Singleplayer:
You as the player control one white stone.
To capture another stone you have to jump over it.
You can make max. 3 moves where you don’t capture anything.

Versus mode: (Add-on if I feel like it)
Someone else controls a second white stone.
If you capture a blue stone your turn continues.
If you fail to capture a stone the other player/ai has a turn.
Most stones wins.

I started by building the pieces and making things look nice, so i didn’t have to look at ugly the entire time. Next I wrote a solver for it, so i can programmatically determine if a layout is solvable, how many possible paths there are and what the penalties and points for each one are.
The result is an inbred mix of a chess engine and a* It takes less than a second to solve complex sets so I’m not too fussed about cleaning that up tbh.

Next on my list is writing the logic for the player movement, collecting stones and endgame states.
After that I’ve got to write a little thing to dynamically populate the tiles based on difficulty settings (number of stones * penalties required to complete = difficulty). Then I’ll see if i can adjust the difficulty dynamically based on how the player is doing. I always want it to be challenging but never too easy. This game is meant to train spacial reasoning and planning. Kind of like a mix of Mühle, Go and 2048 but without the ability to win just using fixed movement patterns.

After that is done I’m thinking about adding something to dynamically build the tiles so I can resize the grid but more importantly punch holes in the grid to have impassable tiles and have the graph update accordingly (right now it’s just hardcoded).

Here’s the solver’s best path replayed:

2 Likes

aaand as is usual, i’m overengineering this thing again.

the grid is now resizable, there is player movement… aaand now theres a thing to find all possible, playable positions for x stones with y penalties on a field of z, w

its just a brute force approach that tries all possible placements and solves for all paths. ill let that run for a little longer on the 5x5grid and then write the actual bits to set up the playspace with the data i pre-crunched along with keeping track of points/ penalties. then ill have to find a good way to navigate that data-space for difficulty scaling. 3 stones with 3 penalties are harder than 6 stones with only 1 if there is backtracking…