Skip to content

Make JBWAPI ready to connect as fast as possible - #97

Merged
JasperGeurtz merged 2 commits into
JavaBWAPI:developfrom
dgant:develop
Nov 5, 2026
Merged

JasperGeurtz merged 2 commits into
JavaBWAPI:developfrom
dgant:develop

Conversation

@dgant

@dgant dgant commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Most software stacks that run client bots (SC-Docker, Tournament Manager, SCHNAIL, for example) don't bother checking whether the client is connected before starting a game. There's not even an obviously good way to do this.

Instead they just launch the client bot, wait a few seconds, then launch StarCraft and pray the client is ready. This usually works, but when it doesn't, the bot fails to connect. The game is ruined.


This pull request aims to prevent failed connections by reducing the time required for client bots to be ready for connection:

  • Don't allocate the asynchronous frame buffer until after connection.
  • Don't bind the whole Kernel32 interface, just the functions we need: OpenFileMapping and MapViewOfFile.

These changes were vibecoded but have undergone several rounds of iteration and testing.

Comment thread src/main/java/bwapi/BWClient.java Resolved
Comment thread src/main/java/bwapi/Client.java Resolved
@JasperGeurtz
JasperGeurtz merged commit 618862c into JavaBWAPI:develop Nov 5, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants