Core CLASH is a turn-based RPG that runs entirely in the console and plays over LAN with no central server. Each PC becomes a character whose stats are generated from real hardware (CPU, RAM, GPU, Disk). Lobby and turns are managed serverlessly via UDP broadcast and socket.io.
- Turn-based combat: players act one by one in a round-robin order.
- Available actions:
- ATTACK → deals damage based on CPU power.
- DEFEND → reduces incoming damage this turn.
- PASS → skip your turn.
- (planned: SPELLS based on RAM, SPECIALS based on GPU, status effects like Memory Leak or Blue Screen).
- Winner: the last PC standing with HP > 0.
Each character is automatically generated from real hardware specs using systeminformation:
- Name =
${username}-${cpuBrand} - HP (Health) = proportional to the main disk capacity
- Force (Attack) = based on CPU cores and max frequency
- Mana (Energy) = based on RAM size and average RAM clock
- GPU (Special) = score depending on GPU type (integrated, gaming, workstation)
- Status = current conditions (Overheat, Stun, etc. – WIP)
Example character card:
========================
simone-AMD
HP: [███████████████░░░] 180/200
Force 17 ⚔
Mana 12 ✨
GPU 15 🎮
Status: -
========================
- Auto-discovery of players using UDP broadcast.
- If a client finds an existing host → it connects.
- If no host responds → it becomes the host.
- The host manages the lobby, turn order, and action validation, but also plays as a character.
- Real-time synchronization powered by
socket.io.
- Pure ANSI console output:
- ASCII player cards
- HP/Mana bars
[████░░░░░░] - Colored logs for actions (ATTACK in red, DEFEND in cyan, PASS in yellow)
- Each player sees:
- Their own character card
- The full list of players with updated stats
- Action logs during the battle
- Input: simple numeric choice + Enter
=== GAME START ===
========================
simone-AMD
HP: [███████████░░░░] 120/180
Force 17 ⚔
Mana 12 ✨
GPU 15 🎮
Status: -
========================
Turn: luca-Intel (20s)
[ATTACK] luca-Intel hits simone-AMD for 7 damage!
[DEFEND] simone-AMD defends, reducing incoming damage.
character.js→ generates characters from hardwarediscovery.js→ UDP auto-discovery and host electionhost.js→ lobby logic, turn order, action validationclient.js→ console UI, player input, updates from hostui.js→ ASCII rendering utilitiesindex.js→ entrypoint, decides whether to become host or client
Clone the repo and install dependencies:
git clone https://github.com/simonegosetto/core-clash.git
cd core-clash
npm installStart the game:
node index.js- If no host exists → you become the host.
- If a host exists → you connect automatically.
✅ LAN lobby with auto-discovery
✅ Host participates as a player
✅ Round-robin turn system
✅ Character stats generated from real hardware
✅ Console input with Enter
✅ ASCII UI with HP/Mana bars
✅ Colored action logs
- RAM-based spells (Memory Leak, Garbage Collector)
- GPU-based specials with cooldown
- Real status effects (Overheat if CPU temperature is high, Blue Screen, etc.)
- Competitive presets (casual / ranked / turbo)
- Improved console UI using blessed
- Multi-target actions (choose which opponent to attack)
- Deterministic replays with seeded RNG
MIT License
