Implement CoordinatorBot - a multi-role strategy bot that dynamically allocates roles (Attacker/Harvester/Defender/Scout) each turn based on game state. Features: - Per-turn role assignment using greedy Hungarian-style algorithm - Dynamic role rebalancing based on threat level, economic pressure, score - Zone-aware survival logic - HTTP server with HMAC authentication - TypeScript implementation with full type safety Role allocation algorithm: - Base split: 50% attackers, 25% harvesters, 15% defenders, 10% scouts - Adjusts: +10% defenders if threat > 0.3 - Adjusts: +10% harvesters if energy < spawn threshold - Adjusts: +20% attackers if score leads by 5+ - Assigns bots by proximity to role targets Co-Authored-By: Claude <noreply@anthropic.com>
23 lines
377 B
Docker
23 lines
377 B
Docker
# Build stage
|
|
FROM node:22-alpine AS builder
|
|
|
|
WORKDIR /app
|
|
COPY package.json tsconfig.json ./
|
|
COPY src ./src
|
|
|
|
RUN npm install && npm run build
|
|
|
|
# Runtime stage
|
|
FROM node:22-alpine
|
|
|
|
WORKDIR /app
|
|
COPY --from=builder /app/dist ./dist
|
|
COPY --from=builder /app/node_modules ./node_modules
|
|
COPY package.json ./
|
|
|
|
ENV BOT_PORT=8084
|
|
ENV BOT_SECRET=""
|
|
|
|
EXPOSE 8084
|
|
|
|
CMD ["npm", "start"]
|