Skip to content

About

Qt auto-battler game project

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Stardust Gambit

Stardust Gambit is a C++/Qt desktop auto-battler. It combines a lightweight PvE round loop, shop economy, hero traits, star upgrades, equipment drops, save files, and snapshot-based LAN/remote battles in a single Qt Widgets application.

Stardust Gambit start screen

Features

  • 8 x 8 tactical board with drag-and-drop deployment.
  • Automatic combat with target selection, movement, attacks, mana, and hero skills.
  • Shop system with refresh, gold economy, population upgrades, win/loss streaks, and interest rewards.
  • Hero collection with 10 units, 5 traits, and automatic 3-to-1 star upgrades.
  • Equipment drops with drag-to-equip, unequip, and sell interactions.
  • Three JSON save slots for stable prep/resolve game states.
  • Full-screen image-based UI with menu music and volume settings.
  • LAN battles over QTcpServer/QTcpSocket.
  • Remote room matching through the Python relay in server/remote_relay.py.

Tech Stack

  • C++17
  • Qt 5 or Qt 6
  • Qt Widgets
  • Qt Network
  • Qt Multimedia
  • CMake 3.16+

Build

Qt Creator

  1. Open CMakeLists.txt in Qt Creator.
  2. Select a kit that includes Qt Widgets, Network, and Multimedia.
  3. Configure, build, and run the Stardust_Gambit target.

Command Line

If Qt is already discoverable by CMake:

cmake -S . -B build
cmake --build build

If CMake cannot find Qt, pass your Qt installation path:

cmake -S . -B build -DCMAKE_PREFIX_PATH=C:/Qt/6.10.2/msvc2022_64
cmake --build build

On Windows, use Qt's windeployqt when distributing the executable to machines without a matching Qt installation.

Runtime Assets

The game loads images from image/ and menu music from music/. Keep these directories next to the project root, next to the executable, or in a parent directory that the executable can reach at runtime.

How To Play

  1. Start a new game from the main menu.
  2. Buy heroes from the shop during the preparation phase.
  3. Drag heroes from the bench onto the lower half of the board.
  4. Press Space or click the battle button to start combat.
  5. Win rounds to earn gold, advance through encounters, and collect equipment.
  6. Survive the five-round PvE run to win.

Useful controls:

  • S: save during non-combat phases.
  • Esc: return from menus or the end screen.
  • Right click a friendly unit: sell it during preparation.
  • Ctrl + right click, or U while hovering a unit: unequip its item.
  • Drag equipment onto a friendly unit: equip it.

Multiplayer

Stardust Gambit uses round snapshots instead of frame-by-frame real-time synchronization. Each player prepares an army, both sides exchange ready snapshots, and the clients play out the resulting battle locally.

LAN

  1. Both players run the same version of the game on the same LAN.
  2. One player chooses LAN host.
  3. The other player joins with the host machine's IPv4 address.
  4. Both players prepare their armies and start the round.

LAN mode uses port 45454.

Remote Relay

The relay server is in server/remote_relay.py.

python server/remote_relay.py --host 0.0.0.0 --port 45455

Clients connect to a relay, join the same room id, then exchange battle snapshots through the server. The current client code points to 67.216.192.97:45455; change RemoteRelayHost and RemoteRelayPort in mainwindow.cpp if you want to use your own relay.

Repository Layout

Stardust_Gambit/
  CMakeLists.txt              CMake project definition
  main.cpp                    Qt application entry point
  mainwindow.h/.cpp           UI, game loop, input, saves, networking
  unit.h/.cpp                 Unit base class, heroes, skills, traits
  player.h/.cpp               Player health, gold, level, streak economy
  equipment.h/.cpp            Equipment model and catalog
  tile.h/.cpp                 Board tile model
  image/                      Runtime UI and hero image assets
  music/                      Runtime audio assets
  server/remote_relay.py      Remote battle relay server
  server/stardust-relay.service
                               Example systemd service for the relay

Notes

  • Save files are written as save_slot_1.json, save_slot_2.json, and save_slot_3.json in the application directory.
  • Combat saves are intentionally disabled so save files only contain stable game states.
  • The remote battle mode is authoritative at the room/result level, not a deterministic lockstep PvP simulation.

License

No license file has been added yet. Until a license is provided, all rights are reserved by the repository owner.

About

Qt auto-battler game project

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages