RLBotJavaExample icon indicating copy to clipboard operation
RLBotJavaExample copied to clipboard

Document minimal Java bot requirements and interaction model

Open Lambeaux opened this issue 5 years ago • 1 comments

This might be in the wrong place but I figured I'll document it somewhere for now and it can get moved if necessary or closed if it isn't valuable.

I don't think this is an urgent need but I would like to suggest documenting the interaction model and all functional dependencies of a well-behaved Java bot process. There's a little magic hidden by Gradle that devs would have to reverse engineer to understand correctly. Ideally we have a set of rules that, if any Java process follows, you can reasonably expect it to work.

I recently tried to create the most bare-bones, minimal Java bot I could make using Maven as the build tool. Here's what I did:

  1. Created a standalone directory (under source control or not) for bot.cfg, bot-appearance.cfg, and bot-module.py; this is data that, once updated to reflect my own values and ingested into the RLBot UI, largely remains unchanged.
  2. Created the maven project with a single pom.xml and three classes: Main, BotImpl, and PythonInterface. That's it.
  3. Ensure the resultant jar has transitive dependencies packaged correctly.
  4. Ensure the resultant jar is executable.
  5. Ensure the system property jna.library.path is set to a directory with RLBot_Core_Interface.dll in it. In my case I'm just calling System.setProperty in Main to some stable, external directory (for now).

Doing the above resulted in a working bot controller without any Gradle assumptions. I can rebuild and restart the jar completely independent of the cfg files or python module and everything keeps working.

Lambeaux avatar Jul 20 '20 04:07 Lambeaux

See https://github.com/Lambeaux/Clojure-Bot for some sample maven work and refer to the commit log for varying levels of detail when it comes to bot impls.

Lambeaux avatar Aug 16 '20 10:08 Lambeaux