-
-
Notifications
You must be signed in to change notification settings - Fork 50
feat: add dynamic BotChatter system with regional packs (AU/NZ/UK/CA/US) #362
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: squad-mates-use-full-vehicle-seats-and-more
Are you sure you want to change the base?
feat: add dynamic BotChatter system with regional packs (AU/NZ/UK/CA/US) #362
Conversation
Introduces a modular bot chatter system with support for multiple regional packs (AU, CA, Default, NZ, UK), personalities, and message distortion. Adds server-side logic for event-driven bot chat, rate limiting, and pack selection, as well as a client overlay for displaying bot messages (using DebugRenderer:DrawText2D to avoid WebUI conflicts). Updates .gitignore for backup folders and integrates the new system into client and server initializations.
|
Really cool stuff, would you mind just integrating this one into dev rather than my branch? Its still not cleaned up and the wip is a bit larger than expected currently in mine. I'll try to check all you did on the next days. |
|
Hi, looks really nice! Thanks a lot for all the work! |
|
I just moved this mr to a new feature-branch in the fun-bot-repository: https://github.com/Joe91/fun-bots/tree/feature/bot_chatter
I really like the idea and looking forward to test and play around a little with this 👍 |
|
I agree on the config to toggle it on or off as desired! |
Too easy, it really only depends on your branch because of your modified client/server/shared init files. My system can be added to just about any branch or build easily enough by just bootstrapping BotChatter files from each of the init files in a build, it doesn't really depend on your build that heavily, it was just what I had installed at the time of building this, because I like the fixes you've implemented for vehicles 👍
Thanks, and sure! I'm happy to go along with whatever 😁 This started as a personal project quite a while ago, but I just had bots randomly saying things in the server without context. I decided a couple of months ago to ramp this up and add context, which I thought would be somewhat easy, but turned into a more difficult project than I suspected...
I actually thought about this but I keep forgetting to implement a toggle lol. The problem I predict happening with this is that the system will continue running in the background even without it being 'enabled'. Have to figure out a graceful way to 'kill' it while running so that bots will STFU after it's toggled off.
That's good to hear and I agree about adding the names back. The great thing about what I've done here is that you can provide any number of name and/or chat packs in a modular way, and not affect the others, and even give them weights for how often they're considered in the random pool of names/chat lines... That would mean that not only can the older names from BotNames be added back, if you really wanted, you could give devs, supporters and contributors their own unique pool of lines 😂 But not specific players as such, just the pool itself will choose from specific lines in their matching packs. For example, devs could go in a pack called DEVS.lua and have the pool of dev names in there, which the system will randomly assign those names based on the weights to a session, then, if you specify clan tags within those names (like
That's not a bad idea, but having them separate might create feature dissonance, meaning like, if you update something that the standalone mod relies on, and I don't get back to updating it for a while, the chat system will be broken until I myself update it. That's not really a problem for you as such, but I'd rather have this be integrated in a way that only really relies on the init* files, and VU's API itself. What I would actually love, is a way to have 2 parts to your WebUI, because you can only have 1 instance of a WebUI running from 1 mod at a time. Currently, you're hooking yours up to an admin toolkit that can't be seen or activated by regular players, which is understandable, but if there was a way to branch part of your WebUI off so that clients can see messages from it, then bam, we have a way to cast the bot chatter to clients in a nice, formattable way, that will still protect the WebUI admin toolkit (bot editor, path/waypoint editor) behind an admin required function...
Thanks Joe 😊 looking forward to hearing back from you! |
|
Wow, you're really fast :-) ! I merged you other PR into the feature-branch and will play around with the two options on how to integrate it into the main mod, that it is as good integrated as possible! Either with the standalone-mod and minimal adjustments or by regestry-option (and porting the settings to either the registry as well or the Config.lua). |
|
Just did a quick test: What do you think about this proposal? |
|
@JenkinsTR , what do you think about this own mod (see comment above)? Best regards |

Summary
Adds a modular BotChatter system with multiple regional packs (AU, NZ, UK, CA, US as Default), personality biasing, light text distortion, and per-event triggers (kill, headshot, longshot, vehicle, multi, streak, spawn, revenge, round start/end). All lines are ASCII-only and scoreboard-safe.
Key changes
ext/Server/BotChatter/{BotChatter.lua, PackLoader.lua, Personalities.lua, Distort.lua, Util.lua}ext/Server/BotChatter/Packs/{AU.lua, NZ.lua, UK.lua, CA.lua}+ US styleDefault.luaLevel:Destroy)Config
ext/Shared/BotChatterConfig.luadefaultPack = "Default"allowPerBotPackByTag = true(maps[AU],[NZ],[UK],[CA]etc to their packs)seeded(deterministic per-bot withseed = 1337)Rendering rationale (no WebUI changes)
The chat feed is drawn via
DebugRenderer:DrawText2Dto avoid conflicts with Fun-Bots’ existing WebUI (used for admin tooling and path/waypoint editing). Hooking that UI requires its own integration pipeline and admin context, so BotChatter renders a lightweight, non-interactive overlay that does not modify or depend on WebUI. Casting via the ingame chat system results in limitations I wasn't happy with, such as every message coming from "ADMIN". There is no way that I know of to emulate bots sending messages as if they're unique players. This was the driving factor for usingDebugRenderer:DrawText2D, as I first tried to hook into the Fun-bot WebUI but found that it conflicted too heavily with the existing implementation. This is still doable, but will require a newvuicbe compiled to support it, and ultimately, still won't be cast via the ingame chat system.'Mention' feature
Bots can dynamically mention other bots or the human player in their lines. When a bot mentions the local player, the entry is rendered with a highlighted style in the BotChatter UI so it stands out. Mentions use sanitized display names and are rate-limited like other lines.
I have also coloured teams' global chat messages to make the difference between team and enemy team chat's stand out using BF3-like colours.
Compatibility / why this PR targets a feature branch
This PR depends on
squad-mates-use-full-vehicle-seats-and-moreonly because of the modified__init__files that bootstrap BotChatter (client/server/shared).If someone wants to add BotChatter to a different branch/build:
ext/Server/BotChatter/**,ext/Client/BotChatterClient.lua,ext/Shared/Names/**andext/Shared/BotChatterConfig.lua.__init__files include the BotChatter bootstrap (Client/Server/Sharedrequirelines).ext/Shared/Constants/BotNames.luais overwritten with my shimmed versionNo other Fun-Bots features are required.
Testing
-debuglog -trace -vexttrace -tracedcKnown limitations
Streak+Kill).Notes
__init__files bootstrap BotChatterext/Shared/Names/NameProvider.lua+ a small shim inShared/Constants/BotNames.luato enable modular name assignmentReviewer checklist
squad-mates-use-full-vehicle-seats-and-moreby @MatiasPastoriFollow-ups (separate PRs if desired)
Shared/Constants/BotNames.luaas it's own pack (or split packs) inext/Shared/Names/packs. Most of the "regular" names from it are already included inglobal_default.luapackScreenshots