Skip to content

Conversation

@NicEastvillage
Copy link
Contributor

@NicEastvillage NicEastvillage commented Nov 16, 2025

Refactors the bot and script managers to be more similar to v4. Users instead implement a interface called IBot and its methods: GetInitialLoadout, GetOutput, OnMatchComms, and Retire. The bot is managed by a BotManager (either SingleThreadBotManager, MultiThreadBotManager, or HivemindManager) which handles the lifetime of the bot and the packet communication with RLBot. Users can also easily create their own managers using the abstract class BaseAgentManager. The manager creates the bot using a factory method that is passed to it on creation. Example:

RLBotInterface rlbot = new();
SingleThreadBotManager manager = new(
    rlbot,
    "test/csharp_atba",
    (rlbot, index, team, name, agentId, matchConfig, fieldInfo) =>
        new Atba(rlbot, index, team, name, agentId, matchConfig, fieldInfo)
);
manager.Run();

On major difference to v4 is that the RLBot connection is passed around as well ala dependency injection. In v4, RLBotInterface was a static class that could be called everywhere. The bot needs RLBot to do rendering, send match comms, set game state, and set loadout. We could create a facade for RLBot if we want to hide the other functionalities of the RLBot connection, but the freedom is nice, too. Let me know what you think.

@NicEastvillage NicEastvillage marked this pull request as ready for review November 21, 2025 19:06
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