forum

osu!al-1s | A simple chatbot framework

posted
Total Posts
3
Topic Starter
astro angelfish
This project is still under heavy construction and not really completed yet (but is already ready for tournament holding). No compatibility is guaranteed

After trying out other frameworks, I think they are not convenient enough for a rapid development of a tournament referee bot. So I just brought up a new project.

The bot framework was written in Java, with lightweight dependency injection framework by my own hand. May cause instability or issues.

Do not expect this framework would work on its own. You need to code your own logic onto it. I'll attach a general referee bot on my account as soon as possible if you need a complete product.

Tournament OFFC s1 is the first tournament that applied this bot framework. And I'm hoping osu!al-1s will not break things down.

Source code is available here
Sorry for not providing a maven package as I don't have money for a maven repository server. You need to build it on your own.
Documents will be available s∞n. For now you need to inspect my code and get sick.

Known issues:
  1. Fetching the referee list of multiplayer room would cause a dead-lock. Messages from BanchoBot is really really hard to parse.
    For now you need to launch another thread to get referee list.
  2. Multiplayer room controlling requires IRC. See ppy/osu-web#11426
  3. Quitting event during playing is not fired. See This topic
  4. I don't know if there is more issue. Please let me know if you discovered.
ekgame
This looks really cool! It looks like a lot of work was put into this.

One thing I missed is an example of how to use the framework to create your own bot - a starting off point for somebody interested in using this. I have a fair bit of experience in Java, but I would struggle to figure out how to use it as intended. I saw some tests that created an instance of a bot, but I always found that tests were usually hacking around the intended usage, so I don't trust them to be a good example.

Another concern I have is that the structure is a bit weird:
  1. osu-al1s-api - this looks like interfaces and record for all of the osu! API v2, Bancho IRC concepts and the bot framework
  2. osu-al1s-core - this looks like the actual implementation of those interfaces
This reminds me of the questionable enterprise Java practices - arguably useless interface for every actually useful class. In my experience this sort of "API" is only useful when you have proprietary software that somebody should be able to extend or you want to provide a specification where somebody else can come in and implement the actual logic. Plus it seems a bit messy to mix the code for all 3 domains and then also split it into two modules.

In my mind, I would have done something like this:
  1. module for osu! API v2 - self contained wrapper to make API calls and parse responses into a workable format, reusable for other projects that don't necessarily need bot functionality
  2. module for Bancho IRC - basically an IRC client, using some of the capabilities of the osu! API module to retrieve context about users in the chat, could also be useful for general in-game bots that don't need to create and manage multiplayer rooms (ex. Tillerino, Ameo, Sombrax79)
  3. module for the actual bot framework - combining the two previous modules to a system that can create and control multiplayer rooms, parse BanchoBot messages, keep track of multiplayer room state, provide currently selected beatmap information, handle user commands, etc.
I don't know, maybe you have some grander idea that I'm just not seeing yet.

I hope this criticism doesn't come off as dismissive of your work or disrespectful - I do appreciate what you're trying to do here! I'm rooting for the best with the tournament and I hope this project finds a community.
Topic Starter
astro angelfish

ekgame wrote:

This looks really cool! It looks like a lot of work was put into this.

One thing I missed is an example of how to use the framework to create your own bot - a starting off point for somebody interested in using this. I have a fair bit of experience in Java, but I would struggle to figure out how to use it as intended. I saw some tests that created an instance of a bot, but I always found that tests were usually hacking around the intended usage, so I don't trust them to be a good example.

Another concern I have is that the structure is a bit weird:
  1. osu-al1s-api - this looks like interfaces and record for all of the osu! API v2, Bancho IRC concepts and the bot framework
  2. osu-al1s-core - this looks like the actual implementation of those interfaces
This reminds me of the questionable enterprise Java practices - arguably useless interface for every actually useful class. In my experience this sort of "API" is only useful when you have proprietary software that somebody should be able to extend or you want to provide a specification where somebody else can come in and implement the actual logic. Plus it seems a bit messy to mix the code for all 3 domains and then also split it into two modules.

In my mind, I would have done something like this:
  1. module for osu! API v2 - self contained wrapper to make API calls and parse responses into a workable format, reusable for other projects that don't necessarily need bot functionality
  2. module for Bancho IRC - basically an IRC client, using some of the capabilities of the osu! API module to retrieve context about users in the chat, could also be useful for general in-game bots that don't need to create and manage multiplayer rooms (ex. Tillerino, Ameo, Sombrax79)
  3. module for the actual bot framework - combining the two previous modules to a system that can create and control multiplayer rooms, parse BanchoBot messages, keep track of multiplayer room state, provide currently selected beatmap information, handle user commands, etc.
I don't know, maybe you have some grander idea that I'm just not seeing yet.

I hope this criticism doesn't come off as dismissive of your work or disrespectful - I do appreciate what you're trying to do here! I'm rooting for the best with the tournament and I hope this project finds a community.
Thank you for providing comments.

One thing I missed is an example of how to use the framework to create your own bot
I knew that there were lack of examples. I'll make a bot template repository or a complete bot for that soon. But currently I'm really busy with my study, job and tournament mentioned above.

Another concern I have is that the structure is a bit weird
I just learnt this structure from Bukkit, another project on another game over 10 years old. I was expecting it to hide the details not needed and have a complete document. I don't really know if it is a good practice but I'm already used to it.

Further functions is still working in progress, as I always have to say, AL-1S is still under heavy construction and not complete yet.
Please sign in to reply.

New reply