012d038025
Assets (CC0 license): - 3D models: Blaster gun, walls, platforms, grass, clouds, enemy - Sounds: blaster fire, impacts, footsteps, jumps, weapon change - Sprites: crosshair, hit marker, muzzle flash, skybox, blob shadow - Font: Lilita One Code changes: - weapon_manager.gd: load blaster.glb as gun model (replaces box mesh) - player.tscn: use Kenney sounds (blaster.ogg, enemy_hurt/destroy) and crosshair Test suite (100 unit tests + 4 integration scenarios): - weapon_data.gd: 27 tests — all 6 weapons every stat verified - economy.gd: 19 tests — constants, loss streak, buy thresholds - bomb.gd: 15 tests — state machine, timing constants - round_manager.gd: 10 tests — win conditions, elimination logic - team_manager.gd: 8 tests — auto-balance, team assignment - headless_test_bot.gd: integration bot with movement/idle/rounds scenarios - run_multi_bot.sh: multi-client launcher
54 lines
1.6 KiB
Bash
54 lines
1.6 KiB
Bash
#!/bin/bash
|
|
# Multi-bot launcher for tactical-shooter headless testing.
|
|
# Launches N bot instances simultaneously, each connecting to the server.
|
|
#
|
|
# Usage: ./tests/run_multi_bot.sh [count] [server] [duration]
|
|
# count - number of bots (default: 2)
|
|
# server - server address (default: 192.168.0.127:34197)
|
|
# duration - seconds per bot (default: 10)
|
|
|
|
COUNT=${1:-2}
|
|
SERVER=${2:-192.168.0.127:34197}
|
|
DURATION=${3:-10}
|
|
|
|
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
|
PROJECT_DIR="$(cd "$SCRIPT_DIR/.." && pwd)"
|
|
|
|
echo "# ============================================================"
|
|
echo "# Multi-bot launcher: $COUNT bots → $SERVER for ${DURATION}s"
|
|
echo "# ============================================================"
|
|
|
|
# Launch N bots in background, each gets a unique stdout color tag
|
|
PIDS=()
|
|
for i in $(seq 1 $COUNT); do
|
|
PORT=$((34197 + i)) # unique but unused — just for identification
|
|
echo "# Starting bot $i..."
|
|
cd "$PROJECT_DIR" && \
|
|
timeout $((DURATION + 15)) \
|
|
~/.local/bin/godot --headless --scene res://tests/bot_test_scene.tscn \
|
|
--path . -- --server "$SERVER" --duration "$DURATION" --scenario idle \
|
|
--peer-id 2>&1 | sed "s/^/[Bot $i] /" &
|
|
PIDS+=($!)
|
|
sleep 0.5 # stagger spawns to avoid connection thundering herd
|
|
done
|
|
|
|
# Wait for all bots to finish
|
|
echo "# Waiting for $COUNT bots..."
|
|
ALL_OK=true
|
|
for PID in "${PIDS[@]}"; do
|
|
wait $PID
|
|
EXIT=$?
|
|
if [ $EXIT -ne 0 ]; then
|
|
ALL_OK=false
|
|
echo "# Bot PID $PID exited with code $EXIT"
|
|
fi
|
|
done
|
|
|
|
if $ALL_OK; then
|
|
echo "# ALL $COUNT BOTS PASSED"
|
|
exit 0
|
|
else
|
|
echo "# SOME BOTS FAILED"
|
|
exit 1
|
|
fi
|