Bots [ C++ / Console ] Open Source

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • Bots [ C++ / Console ] Open Source

      SN Bot (Unfinished Project Release) :

      Hello everyone, due to a recent Windows system failure and the risk of losing my work, I decided to upload and share the project in its current state.The project is not finished yet, but it is functional and may still be useful for anyone interested in improving or extending it.

      This is a C++/CMake project. Currently, it supports Windows x86 and x64 builds only. I may look into Linux support in the future, but it is not available at this time.

      Although I consider the project unfinished, the bot system is already capable of handling research, resource management, and building upgrades. You can configure up to 10 different play schedules and run thousands of bots simultaneously. All calculations are performed outside of the game scripts, so they do not block real players like PHP-based solutions often do.

      The application can connect to a remote MariaDB/MySQL database over SSL, or you can run and develop it using a local database.

      Link : github.com/koraykarakus/SNBot.git

      Dependencies :

      This project uses two dependency systems:

      1 - Git Submodules
      The following libraries are included as Git submodules:

      bcrypt
      tomlplusplus

      These are located inside the deps folder.

      2 - vcpkg
      The following libraries are installed through vcpkg
      spdlog
      libmariadb

      The required packages are defined in vcpkg.json.

      Project Structure
      SN Bot
      ├── deps/ Third-party libraries (Git submodules)
      ├── include/ Header files, class definitions, structures and datasets
      ├── language/ Language files (currently unfinished)
      ├── logs/ Log files
      ├── out/ Output folder (generated executable)
      ├── src/ Source code│
      ├── .clang-format Formatting rules
      ├── .gitignore Git ignored files
      ├── .gitmodules Git submodule definitions
      └── vcpkg.json vcpkg dependency manifest

      Getting Started

      Prerequisites
      Install the following software:
      Git
      Visual Studio 2022
      C++ Desktop Development workload
      CMake support (included with the Visual Studio C++ workload)
      vcpkg

      Step 1 - Install Git

      Download and install Git
      https://git-scm.com/download/win

      Step 2 - Clone the Repository

      Open Git Bash and run

      Source Code

      1. git clone --recursive https://github.com/koraykarakus/SNBot.git





      --recursive flag is important because the project uses Git submodules.

      If you already cloned the repository without submodules,

      run:

      Source Code

      1. git submodule update --init --recursive

      Step 3 - Install vcpkg

      Clone vcpkg:

      Source Code

      1. git clone https://github.com/microsoft/vcpkg.git

      Bootstrap it:

      Source Code

      1. cd vcpkgbootstrap-vcpkg.bat

      Integrate it with Visual Studio:

      Source Code

      1. vcpkg integrate install

      Step 4 - Open the Project

      Open Visual Studio 2022 and select:
      File -> Open -> Folder
      Then select the cloned project folder.
      Visual Studio should automatically detect the CMake project and install the dependencies defined in vcpkg.json.

      Step 5 - Adjust Database Queries

      Open: src/CDatabase.cpp
      Update the SQL queries according to your project's table and column names.
      For example, if my database uses a column named:
      rocket_launcher and your project uses:
      missile_launcher
      simply rename the column references accordingly.
      Avoid introducing new columns unless you also update the corresponding code

      is_bot column for planets and users table is required for this to work efficiently, so add that column as follows

      Source Code

      1. ALTER TABLE planets ADD COLUMN `is_bot` BOOLEAN NOT NULL DEFAULT 0;
      2. ALTER TABLE users ADD COLUMN `is_bot` BOOLEAN NOT NULL DEFAULT 0;

      Step 6 - Build

      Select your target platform:

      x64 for 64-bit Windows
      Win32/x86 for 32-bit Windows

      Make sure SNBot is selected as the startup target and build the project.
      The executable will be generated inside the out directory.

      Step 7 - Configure

      Run SNBot.exe once.

      On first startup, it will generate: settings.toml

      Open the file and configure your database connection settings.

      Step 8 - Tuning
      Important settings:

      default_bot_reload_time = 300

      Bots will be reloaded from the database every 300 seconds.

      loop_time = 30

      Bot calculations will run every 30 seconds.

      Adjust these values according to your server requirements.

      Step 9 - Run
      Start the application by double clicking SNBot.exe which you already build, it is inside "out" folder.

      notes:

      This project is shared as-is. There are still unfinished parts, missing features, and areas that can be improved. Feel free to modify, extend, or optimize it for your own needs.
      bug reports, and suggestions are welcome.

      specialities:
      1 - Bots build building by using build queue
      2 - Bots build research by using research queue
      3 - Bots using shipyard queue to build colony ship
      4 - Bots make resource update, therefore they does not generate messages by fleet movements.

      commands:
      write /help to display commands.

      The post was edited 10 times, last by amamoslavida_: cleanup, add more info on use, sizing ().

    • Grüße.
      Ja das klingt gut .
      Was ich für mich sehe, wenn man kein eigen Root Server hat, kann man mit c++ nicht arbeiten.
      Oder Mann muss es auslagern. Ich baue schon eine weile an Botsystem an deiner Grundversion .
      Du hast aber recht mit c++ das belastet das Spiel nicht so stark.
      Hast du ein Server wo man es Testen kann.
      Danke für die Arbeit und dein Zeit.
    • unfortunatelly i dont have any vps server to test, when it finished it will be working on linux hosts. It depends on your hosting provider, if they letting you work it you can work it but generally they tend to limit those kind of software that works all day ( to sell more expensive vps etc. )
    • noonn wrote:

      I look forward to the AI bot.
      Thank you for your hard work.
      :thumbsup:
      lol i whis bots had AI but they are stupid as hell at the current state. They only make buildings and make research... But it is open ended, anything can be added in the future right now cleaning up a bit for better performance

      [2026-06-13 15:20:30.331] [info] [CDatabase] - 1002 bots and 1002 planets updated successfully in database.- time 154ms - 154335us]
      [2026-06-13 15:20:30.331] [info] Process handled in [361302 microsec / 361 millisec]

      Running 5000 bots and updating 1002 in 0.154 seconds .

      Added a few console commands like
      /start
      /add_bots [num]
      /help
      etc. needs a lot way to go.
    • Some tips I've added on my bot mechanic, that could make yours "not only build and research", for engagement:
      - target search within certain range or proportional with spy tech
      - realistic spy based on target stats
      - battle simulations and send a 75% confidence attack based on spy report
      - spy every x minutes
      - counter-check if sent attack would fail the battle if spy report changed, if so, cancel the attack

      anything else like colonization or fleeting could be triggered based on tech or alarming incoming fleet, per se.

      little tip, cmake compile will depend on the linux target processor you'll use. arm compilation usually won't work on x64, vice-versa.
      ONOVA

      DiscordID: qwatayean
    • ONOVA wrote:

      Some tips I've added on my bot mechanic, that could make yours "not only build and research", for engagement:
      - target search within certain range or proportional with spy tech
      - realistic spy based on target stats
      - battle simulations and send a 75% confidence attack based on spy report
      - spy every x minutes
      - counter-check if sent attack would fail the battle if spy report changed, if so, cancel the attack

      anything else like colonization or fleeting could be triggered based on tech or alarming incoming fleet, per se.

      little tip, cmake compile will depend on the linux target processor you'll use. arm compilation usually won't work on x64, vice-versa.
      those are great ideas, but I have to keep them for later sadly, because as you guessed I am really struggling with linux build :D thing gone crazy lol. My project builds in x86, x64 for now, and only making resource update + research + buildings.

      bots are using build queues and resource update checking those queue times and increase building/research respectively. Bots have their seperate online time and those can be edited. As default 10 types of play duration , some of the bots avtive during 8-12 and 16-24 for example, and some others are active around 16-20.

      check time, some bots check every 5 minutes, some check every 20minutes, some check every 1 hour. Checktime and Playing duration time can be set inside code..

      bots are updated by checking some flags, if no changes = no update so running thousands of bots are possible. lets assume have 5k bots and probably because of playing duration and checktime, only 1000 at max will need to be updated.

      added console command /remove_bots, on use remove all bots.
      added console command /add_bots [num] [universe] , on use adds bots to target universe.

      Bot data is refreshed every 300 seconds ( that can be changed by settings.toml )

      bot loop ( calculations for building research etc ) works every 30 seconds that can be changed by settings.toml

      added SSL option to support remote connection to database ( not sure if that gonna work, don't have remote db to test )

      removed SimpleIni dependency, project use tomlplusplus instead.

      added language system, runtime language can be changed. gonna support all default languages of steemnova ( but they will be AI translate sadly ).

      It needs a few cleanup and more CMake scripting to be able to build it WSL/linux , than I am gonna edit my first post and share it.
    • edited first message and shared project at the current state, probably i wont have enough time to spend on this project in the near future, so rest is up to you, you can edit & develope it with respect your needs.
    • update 26/06/2026

      implement shipyardQueue , bots use shipyard queue to build ships for example colony ship to colonize.
      implement max_logs -- logs can be limited now by changing max_logs value inside settings.toml
    • update: 27/06/2026

      new commands :
      /add_metal num -> adds metal to all bots
      /add_crystal num -> add crystal to all bots
      /add_deu num -> add deuterium to all bots
      /add_dm num -> add dark matter to all bots

      new settings : starting values of bot's darkmatter, metal, crystal and deu can be changed by settings.toml