From eabcd60f2645d6cea45b39065ca6816f050bdd66 Mon Sep 17 00:00:00 2001 From: swarmformer Date: Tue, 3 Dec 2024 20:07:20 +0200 Subject: [PATCH 01/10] client/shell.nix --- client/shell.nix | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 client/shell.nix diff --git a/client/shell.nix b/client/shell.nix new file mode 100644 index 0000000..9fe72cd --- /dev/null +++ b/client/shell.nix @@ -0,0 +1,4 @@ +{ pkgs ? import {} }: + pkgs.mkShell { + nativeBuildInputs = with pkgs.buildPackages; [ nodejs yarn ]; +} From 41fdd9a9f004076881b7329cbb0764ed04c5912d Mon Sep 17 00:00:00 2001 From: swarmformer Date: Tue, 3 Dec 2024 20:08:04 +0200 Subject: [PATCH 02/10] fixed README instruction for starting client --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 841ea46..d61af40 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ This is intended to be a hive game engine, as well as assets and a react client. git clone https://github.com/chriscauley/hive.js.git cd hive.js yarn install -yarn develop +yarn serve ``` The above will start only the client. If you also want to run the client you will need python3 and postgres installed. You'll also need docker (or redis if you don't want to use docker). To install the python server and start both the client and multiplayer server at http://localhost:8239 run: @@ -34,4 +34,4 @@ docker run -p 6379:6379 -d redis:5is:5 * minmax AI -* add more variants from board game geek \ No newline at end of file +* add more variants from board game geek From b9b8126fdc6b35436104c13ea1e36458190190f5 Mon Sep 17 00:00:00 2001 From: swarmformer Date: Tue, 3 Dec 2024 20:15:59 +0200 Subject: [PATCH 03/10] Scorpion, Orbweaver lose hop ability. Orbweaver movement decreased 3 > 1. Notes about buffing scorpion anticrawl range. --- game/Board/moves.js | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/game/Board/moves.js b/game/Board/moves.js index 4f4664c..1e61acb 100644 --- a/game/Board/moves.js +++ b/game/Board/moves.js @@ -6,7 +6,7 @@ import webs from './webs' export const notEnemyScorpion = (board, source, target) => { const { stack, player } = board.layers return !stack[target] || player[source] === player[target] -} +} //confused how this works to identify not a scorpion const getPlacement = (board, player_id, excludes = []) => { if (board.turn === 0) { @@ -45,6 +45,7 @@ const getPlacement = (board, player_id, excludes = []) => { const stepAlongHive = (board, index, excludes = []) => { const touching = board.geo.touching[index] + return touching.filter((target_index, i) => { if (board.stacks[target_index] || excludes.includes(target_index)) { return false @@ -60,6 +61,14 @@ const stepAlongHive = (board, index, excludes = []) => { export const stepOnHive = (board, index, excludes = []) => { const touching = board.geo.touching[index] + + const adjacentScorpions = touching.filter((target_index) => { + return notEnemyScorpion(board, index, target_index) + }).length + +//!adjacentScorpions && TODO: add this to the touching.filter +//right now other bugs like orbweaver count for this too + return touching.filter((target_index) => { return ( board.stacks[target_index] && @@ -352,6 +361,14 @@ const spider = (b, i) => { const kung_fu_mantis = (b, i) => (b.stacks[i].length > 1 ? beetle(b, i) : []) +const orbweaver = (b, i) => { + return nStepsAlongHive(b, i, 1); +} + +const scorpion = (b, i) => { + return nStepsAlongHive(b, i, 3); +} + const moves = { stepOnHive, stepOffHive, @@ -378,9 +395,9 @@ const moves = { // all spider-likes move the same spider, - scorpion: spider, + scorpion: scorpion, trapdoor_spider: spider, - orbweaver: spider, + orbweaver: orbweaver, emerald_wasp, kung_fu_mantis, } From fa44cd85f484762690139c9fa8ac12c76558184d Mon Sep 17 00:00:00 2001 From: swarmformer Date: Wed, 4 Dec 2024 04:44:52 +0200 Subject: [PATCH 04/10] Scorpions: move 2 along the hive. Block opponent bugs from landing on self ++ adjacent stacks --- game/Board/index.js | 4 ++++ game/Board/moves.js | 20 +++++++++++--------- game/Board/specials.js | 4 +++- game/Board/webs.js | 4 ++++ 4 files changed, 22 insertions(+), 10 deletions(-) diff --git a/game/Board/index.js b/game/Board/index.js index 3f8319d..eae89c6 100644 --- a/game/Board/index.js +++ b/game/Board/index.js @@ -27,6 +27,7 @@ const B = { type: {}, player: {}, stack: {}, + stinger: {}, crawl: {}, fly: {}, } @@ -35,6 +36,9 @@ const B = { b.player_list = [1, 2] b.reverse = {} b.geo = getGeo(b) + + + Object.entries(b.stacks).forEach(([index, stack]) => { if (!stack || stack.length === 0) { // prune unused stacks diff --git a/game/Board/moves.js b/game/Board/moves.js index 1e61acb..5521da6 100644 --- a/game/Board/moves.js +++ b/game/Board/moves.js @@ -5,8 +5,17 @@ import webs from './webs' export const notEnemyScorpion = (board, source, target) => { const { stack, player } = board.layers - return !stack[target] || player[source] === player[target] + const touching = board.geo.touching[target]; + const noAdjacentScorpions = touching.filter((i) => notEnemyStinger(board, source, i)).length === 6; + + return noAdjacentScorpions && (!stack[target] || player[source] === player[target]) } //confused how this works to identify not a scorpion + +export const notEnemyStinger = (board, source, target) => { + const { stinger, player } = board.layers + + return !stinger[target] || player[source] === player[target] +} const getPlacement = (board, player_id, excludes = []) => { if (board.turn === 0) { @@ -62,13 +71,6 @@ const stepAlongHive = (board, index, excludes = []) => { export const stepOnHive = (board, index, excludes = []) => { const touching = board.geo.touching[index] - const adjacentScorpions = touching.filter((target_index) => { - return notEnemyScorpion(board, index, target_index) - }).length - -//!adjacentScorpions && TODO: add this to the touching.filter -//right now other bugs like orbweaver count for this too - return touching.filter((target_index) => { return ( board.stacks[target_index] && @@ -366,7 +368,7 @@ const orbweaver = (b, i) => { } const scorpion = (b, i) => { - return nStepsAlongHive(b, i, 3); + return nStepsAlongHive(b, i, 2); } const moves = { diff --git a/game/Board/specials.js b/game/Board/specials.js index 8bbca30..77c452e 100644 --- a/game/Board/specials.js +++ b/game/Board/specials.js @@ -104,7 +104,9 @@ const praying_mantis = (board, piece_id, args) => { } target_index += dindex } - targets.push([last, snag]) + if (!board.layers.stinger[last]) { + targets.push([last, snag]) + } }) if (args.length === 0) { let snag_targets = [] diff --git a/game/Board/webs.js b/game/Board/webs.js index 5418f95..a8a7b3b 100644 --- a/game/Board/webs.js +++ b/game/Board/webs.js @@ -5,6 +5,7 @@ const web_targets = { fly: ['fly', 'hornet', 'ladybug', 'cockroach', 'grasshopper', 'cicada', 'lanterfly'], crawl: ['ant', 'cicada'], // , 'orbweaver', 'scorpion', 'trapdoor_spider', 'spider'], stack: ['beetle', 'orchid_mantis', 'praying_mantis', 'fly', 'dragonfly'], + stinger: ['beetle', 'orchid_mantis', 'praying_mantis', 'fly', 'dragonfly'], //includes damsel fly } const piece_shows_webs = {} @@ -20,6 +21,7 @@ export default { scorpion: (b, i) => { // no piece can step on top of a scorpion b.layers.stack[i] = true + b.layers.stinger[i] = true }, orbweaver: (b, i) => { // no piece can fly over an orbweaver @@ -38,6 +40,7 @@ export default { fly: (b, i) => !b.layers.fly[i], crawl: (b, i) => !b.layers.crawl[i], stack: (b, i) => !b.layers.stack[i], + stinger: (b, i) => !b.layers.stinger[i] }, getVisible(b, i) { @@ -56,5 +59,6 @@ export default { `Since the ${type} started in this web, it cannot be stuck on it again.`, stack: (type) => `The ${type} cannot step on top of the scorpion.`, fly: (type) => `The ${type} cannot move over the orbweaver.`, + stinger: (type) => `The ${type} cannot move within the scorpion's stinger range.`, }, } From 96cfdebd61df88dedce3e7b6f4f2538899447240 Mon Sep 17 00:00:00 2001 From: swarmformer Date: Fri, 6 Dec 2024 00:08:58 +0200 Subject: [PATCH 05/10] +7 presets --- client/src/components/NewGame.vue | 78 +++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) diff --git a/client/src/components/NewGame.vue b/client/src/components/NewGame.vue index 2d9d6fb..e92422d 100644 --- a/client/src/components/NewGame.vue +++ b/client/src/components/NewGame.vue @@ -171,6 +171,84 @@ const presets = [ beetle: 2, }, }, + { + slug: 'dunes', + description: 'Tough, hard to pin pieces.', + pieces: { + beetle: 3, + praying_mantis: 1, + scorpion: 2, + fly: 1, + kung_fu_mantis: 1, + emerald_wasp: 3, + }, + }, + { + slug: 'swamp', + description: 'Fast moving pieces and grabbers.', + pieces: { + cicada: 3, + praying_mantis: 3, + orchid_mantis: 2, + dragonfly_nymph: 2, + orbweaver: 2, + }, + }, + { + slug: 'marsh', + description: 'Carrying pieces.', + pieces: { + kung_fu_mantis: 2, + lanternfly_nymph: 2, + dragonfly: 3, + cockroach: 2, + praying_mantis: 2, + }, + }, + { + slug: 'attic', + description: 'Pesky flies.', + pieces: { + beetle: 1, + scorpion: 1, + orbweaver: 1, + fly: 4, + beetle: 1, + damselfly: 3, + ant: 2, + }, + }, + { + slug: 'frenzy', + description: 'Quick attackers.', + pieces: { + hornet: 3, + orchid_mantis: 2, + scorpion: 2, + praying_mantis: 2, + ant: 2 + }, + }, + { + slug: 'jitters', + description: 'Emerald Wasp and other pieces that take effort to activate.', + pieces: { + emerald_wasp: 4, + orchid_mantis: 2, + cockroach: 3, + trapdoor_spider: 2, + }, + }, + { + slug: 'skulking', + description: '4 bugs that can counter each other.', + pieces: { + cicada: 3, + trapdoor_spider: 3, + lanternfly_nymph: 3, + beetle: 3, + }, + }, ] presets.forEach((p) => (p.name = startCase(p.slug))) From 11f7873642255384059489950b36a7cd6024585b Mon Sep 17 00:00:00 2001 From: swarmformer Date: Sun, 8 Dec 2024 05:53:22 +0200 Subject: [PATCH 06/10] clean up --- game/Board/index.js | 3 --- game/Board/moves.js | 2 -- 2 files changed, 5 deletions(-) diff --git a/game/Board/index.js b/game/Board/index.js index eae89c6..ba4f81d 100644 --- a/game/Board/index.js +++ b/game/Board/index.js @@ -36,9 +36,6 @@ const B = { b.player_list = [1, 2] b.reverse = {} b.geo = getGeo(b) - - - Object.entries(b.stacks).forEach(([index, stack]) => { if (!stack || stack.length === 0) { // prune unused stacks diff --git a/game/Board/moves.js b/game/Board/moves.js index 5521da6..8593216 100644 --- a/game/Board/moves.js +++ b/game/Board/moves.js @@ -54,7 +54,6 @@ const getPlacement = (board, player_id, excludes = []) => { const stepAlongHive = (board, index, excludes = []) => { const touching = board.geo.touching[index] - return touching.filter((target_index, i) => { if (board.stacks[target_index] || excludes.includes(target_index)) { return false @@ -70,7 +69,6 @@ const stepAlongHive = (board, index, excludes = []) => { export const stepOnHive = (board, index, excludes = []) => { const touching = board.geo.touching[index] - return touching.filter((target_index) => { return ( board.stacks[target_index] && From 4195681b7e876bd4cf729491f5372236cefb7659 Mon Sep 17 00:00:00 2001 From: swarmformer Date: Thu, 12 Dec 2024 23:17:51 +0200 Subject: [PATCH 07/10] Reorder pieces: ascending power further down rows, organized by rough functionality by column. --- game/pieces.js | 34 ++++++++++++++++------------------ 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/game/pieces.js b/game/pieces.js index 43ae9c4..fac8679 100644 --- a/game/pieces.js +++ b/game/pieces.js @@ -9,35 +9,33 @@ const VANILLA = { spider: 2, } +//sorted for vertical roguh functionality groupings const piece_counts = { queen: 1, ...VANILLA, - // expansion - ladybug: 1, - mosquito: 1, pill_bug: 1, - - // boardgamegeeks orchid_mantis: 2, - fly: 3, - hornet: 3, - dragonfly: 1, + cicada: 3, cockroach: 1, + trapdoor_spider: 2, centipede: 1, + dragonfly: 1, + praying_mantis: 1, + lanternfly: 3, scorpion: 2, - - // hive.js - trapdoor_spider: 2, + ladybug: 1, + dragonfly_nymph: 2, + kung_fu_mantis: 1, + fly: 3, orbweaver: 2, - cicada: 3, - lanternfly: 3, - lanternfly_nymph: 3, - earthworm: 1, + emerald_wasp: 1, damselfly: 1, - dragonfly_nymph: 2, + earthworm: 1, + hornet: 3, praying_mantis: 1, - emerald_wasp: 1, - kung_fu_mantis: 1, + lanternfly_nymph: 3, + mosquito: 1, + } // currently not used, colors are stored on svg From ef1395cd45fa1f491e526f1ffdb8dd873dd1e6a6 Mon Sep 17 00:00:00 2001 From: swarmformer Date: Thu, 12 Dec 2024 23:19:07 +0200 Subject: [PATCH 08/10] superhive -> modern_hive --- client/src/components/NewGame.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/components/NewGame.vue b/client/src/components/NewGame.vue index e92422d..bda2d40 100644 --- a/client/src/components/NewGame.vue +++ b/client/src/components/NewGame.vue @@ -118,7 +118,7 @@ const presets = [ }, }, { - slug: 'superhive', + slug: 'modern_hive', description: 'Classic hive with a few tweaks', pieces: { ant: 3, From cb5200ee51837c9498d04b358e730939a047f97d Mon Sep 17 00:00:00 2001 From: swarmformer Date: Thu, 12 Dec 2024 23:39:42 +0200 Subject: [PATCH 09/10] fixed help text for accuracy, consistency, and grammar. --- game/help.js | 6 +++--- game/short_help.js | 25 ++++++++++++++----------- 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/game/help.js b/game/help.js index c9dcdd4..99343b2 100644 --- a/game/help.js +++ b/game/help.js @@ -12,8 +12,8 @@ const _spider = (s, e = '') => `The ${u(s)} must crawl exactly 3 spaces along th const queen = [_along('queen')] const emerald_wasp = [ - 'If starting on the ground, the emerald wasp can take two steps on top of the hive', - 'If starting on the hive, the emerald wasp can step off the hive', + 'If starting on the ground, the emerald wasp can take two steps on top of the hive.', + 'If starting on the hive, the emerald wasp can step off the hive.', _orbweaver('emerald_wasp'), _scorpion('emerald_wasp'), ] @@ -87,7 +87,7 @@ const kung_fu_mantis = [ const praying_mantis = [ 'If starting on the ground, the praying mantis leaps in any direction and lands on the furthest piece.', - 'It cannot leap over any breaks in the hive', + 'It cannot leap over any breaks in the hive.', 'If the mantis encounters any stacks while leaping, it will carry the top most piece with it.', 'If starting on top of a stack, the mantis can only step off the stack onto the ground.', _orbweaver('praying_mantis'), diff --git a/game/short_help.js b/game/short_help.js index 200688d..649d68b 100644 --- a/game/short_help.js +++ b/game/short_help.js @@ -1,4 +1,4 @@ -const _along = 'Move one square along the hive.' +const _along = 'Move one space along the hive.' const _stack = 'Cannot step on scorpion.' const _fly = 'Cannot move over orbweaver.' const _crawl = 'Will stop moving if it touches the trapdoor spider.' @@ -7,7 +7,7 @@ const _beetle = 'Moves like a beetle if it starts a turn on the hive.' const queen = [_along, 'If surrounded, you lose.', 'You can only have one queen.'] const beetle = [_along, 'Can move onto hive.', _stack] -const grasshopper = ['Hops over hive.', _fly] +const grasshopper = ['Jumps over the hive.', _fly] const cicada = ['Can make unlimited jumps over the hive.', _fly, _crawl] const spider = _spiderlike([]) const ant = ['Can move unlimited spaces along the hive.', _crawl] @@ -17,10 +17,10 @@ const mosquito = [ _beetle, 'Cannot copy special abilities.', ] -const pill_bug = [_along, 'Can move any piece it is touching to another empty square.'] +const pill_bug = [_along, 'Can move any piece it is touching to an empty adjacent space.'] const orchid_mantis = [_along, 'Can pull a piece under itself.', _beetle, _stack] const kung_fu_mantis = [ - 'Can pull a piece two spaces in any direction under itself.', + 'Can pull a piece from two spaces in any direction under itself.', _beetle, _stack, ] @@ -28,13 +28,13 @@ const kung_fu_mantis = [ const praying_mantis = [ 'Can jump over the hive and land on the furthest piece in any direction', 'Will carry a stacked piece with it when it jumps.', - 'If on the hive, can only step on the ground.', + 'If on the hive, can only step to the ground.', _fly, _stack, ] const fly = [ 'If on ground, can step on the hive.', - 'If on the hive, can fly to any open square.', + 'If on the hive, can fly to any open tile.', _fly, _stack, ] @@ -54,22 +54,25 @@ const dragonfly_nymph = [ ] const centipede = [_along, 'Can swap with an adjacent piece.'] const earthworm = [_along, 'Can swap with the bottom piece of any stack 3 (on hive) moves away.'] -const orbweaver = _spiderlike([ +const orbweaver = [ + 'Moves one step along the hive', 'No piece can move over.', 'Defends against grasshopper, cicada, ladybug, fly, hornet, emerald wasp, and cockroach.', -]) +] + const trapdoor_spider = _spiderlike([ 'Traps any piece that moves next to it.', 'Defends against ant and cicada.', ]) -const scorpion = _spiderlike([ +const scorpion = [ + 'Moves two steps along the hive.', 'No piece can stack on top of the scorpion.', 'Defends against beetle, fly, dragonfly, and orchid mantis, kung fu mantis, and praying mantis.', -]) +] const emerald_wasp = [ 'If on the ground, can take two steps onto the hive.', - 'If on the hive, can only step on the ground.', + 'If on the hive, can only step to the ground.', _fly, _stack, ] From fea6c5d93f08d56bb72826eca51483223c03d4d2 Mon Sep 17 00:00:00 2001 From: swarmformer Date: Thu, 12 Dec 2024 23:45:41 +0200 Subject: [PATCH 10/10] changelog --- client/src/views/ChangeLog.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/client/src/views/ChangeLog.js b/client/src/views/ChangeLog.js index 55881f9..45bb477 100644 --- a/client/src/views/ChangeLog.js +++ b/client/src/views/ChangeLog.js @@ -1,6 +1,20 @@ import css from '@unrest/css' const content = { + 'v1.0.3 Dec 12, 2024': [ + 'Arachnid rebalance: Scorpion movement decreased to 2, range of stinger increased by 1. Hop ability removed.', + 'Arachnid rebalance: Orbweaver movement decreased to 1. Hop ability removed.', + 'NEW PIECE SET: Dunes. Tough, hard to pin pieces.', + 'NEW PIECE SET: Swamp. Fast moving pieces and grabbers.', + 'NEW PIECE SET: Marsh. Carrying pieces.', + 'NEW PIECE SET: Attic. Pesky flies.', + 'NEW PIECE SET: Frenzy. Quick attackers.', + 'NEW PIECE SET: Jitters. Emerald Wasp and other pieces that take effort to activate.', + 'NEW PIECE SET: Skulking. 4 bugs that can counter each other.', + 'Renamed Superhive to Modern Hive, to reflect its intention as a modern balance patch.', + 'Reorganized pieces in piece selection. Functionality is roughly organized in columns. Power roughly increases with each row.', + 'Help text improved for accuracy, consistency, and grammar.' + ], 'v1.0.2 Dec 28, 2020': [ 'NEW PIECE: Praying Mantis can leap onto furthest piece in any direction and drag a stacked piece with it.', 'NEW PIECE: Kung Fu Mantis can grab a piece two spaces away and move it underneath.',