Skip to content

Limit placement radius#100

Draft
UnKabaraQuiDev wants to merge 1 commit into
WolverinDEV:masterfrom
UnKabaraQuiDev:feature/limit-player-placement
Draft

Limit placement radius#100
UnKabaraQuiDev wants to merge 1 commit into
WolverinDEV:masterfrom
UnKabaraQuiDev:feature/limit-player-placement

Conversation

@UnKabaraQuiDev

@UnKabaraQuiDev UnKabaraQuiDev commented Jun 18, 2026

Copy link
Copy Markdown

The objective is to stop the players from making small islands far away on the board, so I suggest limiting the radius to 1-2 cells, like this:
image
image
I assume this could be an option when creating a game/lobby/sandbox/whatever

What I've done
Instead of fixing the max radius to 8

export const PLACE_CELL_HEX_RADIUS = 8;

it now stores the placement radius in the LobbyOptions:

export const zLobbyOptions = z.object({
    visibility: zLobbyVisibility,
    timeControl: zGameTimeControl,
    rated: z.boolean().default(false),
    firstPlayer: zLobbyFirstPlayer.default(`random`),
    placementRadius: z.number().int().positive().default(PLACE_CELL_HEX_RADIUS),
});

I also updated isCellWithinPlacementRadius and GameSimulation.applyMove accordingly

Unfortunately, I couldn't get the backend to run for some reason, so I haven't been able to try it out. The frontend isn't implemented at the moment. It would also be nice to highlight the possible cells for the current player.

@UnKabaraQuiDev

Copy link
Copy Markdown
Author

We could also add more options like the length of a line to win, by default 6, but more/less could be interesting. Or the amount of moves per turn

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant