Author Topic: CartelNET - Dark Operator  (Read 143 times)

Inyong

  • New member
  • *
  • Posts: 7
CartelNET - Dark Operator
« on: August 31, 2026, 10:26:37 am »
Hi everyone,

I’d like to share my recently completed passion project, CartelNET: Dark Operator, a tactical cyber-warfare strategy game built entirely from scratch using Free Pascal and Lazarus.

In this game, you play as a rogue operator fighting for dominance over the DarkNet. The biggest twist is the enemy NPC, "Ghost"—instead of traditional behavior trees or hard-coded scripts, the enemy is driven by a real Large Language Model (integrating either the Google Gemini API or a local Llama.cpp server). Ghost reads the board state, manages its own economy, and adapts to your strategy in real-time.

Some technical highlights from the Lazarus development side:

Asynchronous LLM Integration: Handled background threads and async HTTP requests so the desktop UI remains completely fluid while waiting for complex JSON payloads from the AI.

Custom Cyberpunk UI: Heavy use of csOwnerDrawFixed and wrapper panels for standard components (like TComboBox) to force a consistent Dark Mode and terminal aesthetic, bypassing standard Windows native rendering.

Procedural Canvas Rendering: Implemented dynamic CRT screen-shake effects and live signal oscilloscopes by drawing directly on the canvas during high-intensity moments.

Dynamic NLP Taunting: Players can type text prompts to "taunt" the AI. The game feeds this to the LLM along with the board state, and the AI replies natively in the game's terminal log.

It’s been a fantastic journey pushing the boundaries of what Lazarus can do with modern AI APIs.

I'd love to hear your thoughts on using raw LLMs for enemy AI in desktop games. Also, if anyone is curious about handling async REST API calls or custom component drawing in Free Pascal, I'd be happy to share my approaches and discuss!

Regard
Inyong



Source Code : https://github.com/CodeInPas/cartelnet

 

TinyPortal © 2005-2018