Skip to content

Conversation

@JenkinsTR
Copy link

Base: squad-mates-use-full-vehicle-seats-and-more by @MatiasPastori (not master)
Scope: Add BotChatter system + regional packs

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

  • New server modules: ext/Server/BotChatter/{BotChatter.lua, PackLoader.lua, Personalities.lua, Distort.lua, Util.lua}
  • New chatter packs: ext/Server/BotChatter/Packs/{AU.lua, NZ.lua, UK.lua, CA.lua} + US style Default.lua
  • Name system integration: regional name packs + runtime regional tagger (dynamic and random; not baked into names)
  • Spam control: per-bot rate-limit + per-category cooldowns
  • Lifecycle guards: skip emissions during teardown (Level:Destroy)

Config

ext/Shared/BotChatterConfig.lua

  • defaultPack = "Default"
  • allowPerBotPackByTag = true (maps [AU], [NZ], [UK], [CA] etc to their packs)
  • Personality mode: seeded (deterministic per-bot with seed = 1337)
  • Rate limit: 2 messages / 8s per bot by default (can tighten if preferred)

Rendering rationale (no WebUI changes)

The chat feed is drawn via DebugRenderer:DrawText2D to 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 using DebugRenderer: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 new vuic be 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-more only because of the modified __init__ files that bootstrap BotChatter (client/server/shared).
If someone wants to add BotChatter to a different branch/build:

  1. Copy ext/Server/BotChatter/**, ext/Client/BotChatterClient.lua, ext/Shared/Names/** and ext/Shared/BotChatterConfig.lua.
  2. Ensure the target branch’s __init__ files include the BotChatter bootstrap (Client/Server/Shared require lines).
  3. Make sure that ext/Shared/Constants/BotNames.lua is overwritten with my shimmed version

No other Fun-Bots features are required.

Testing

  • VU Build 20079, multiple full Conquest matches with Fun-Bots
  • Flags: -debuglog -trace -vexttrace -tracedc
  • Result: stable; chatter frequency within targets

Known limitations

  1. Occasional double-send from the same bot when two categories trigger in the same tick (e.g., Streak + Kill).
  2. High bot counts increase volume. With very large bot lobbies (and especially when hosting client + server on one machine) this can stress the overlay and server. This might require some kind of exponential cooldown so that the more bots = less frequent the messages.
  3. Player-mention spacing glitch in the overlay when the local player is highlighted (layout bug; still investigating).
  4. Timing polish: lines are intentionally conservative but can feel a touch “clinical”; happy to adjust jitter and category priorities based on feedback.

Notes

  • All lines ASCII; no hard-coded clan tags in packs (regional tags are applied dynamically and randomly at runtime).
  • Minimal touch to existing code paths:
    • client/server/shared __init__ files bootstrap BotChatter
    • ext/Shared/Names/NameProvider.lua + a small shim in Shared/Constants/BotNames.lua to enable modular name assignment
  • Safe to merge independently of other features.

Reviewer checklist

  • Build & run on squad-mates-use-full-vehicle-seats-and-more by @MatiasPastori
  • Sanity-check rate limiting during a round
  • Verify no chatter during round teardown

Follow-ups (separate PRs if desired)

  • Additional packs (BR/JP/EU etc), variant tone packs (PG-13/banter levels), stricter moderation presets
  • Could add back the names that were originally stored in Shared/Constants/BotNames.lua as it's own pack (or split packs) in ext/Shared/Names/packs. Most of the "regular" names from it are already included in global_default.lua pack

Screenshots

vu_lIIsT4OJx4 Screenshot (5) Screenshot (4) Screenshot (3)

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.
@MatiasPastori
Copy link
Collaborator

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.

@Joe91
Copy link
Owner

Joe91 commented Aug 11, 2025

Hi, looks really nice! Thanks a lot for all the work!
As Matias already mentioned: his branch right now is in a more experimental state and not ready to merge yet. Are you fine with, if I change this MR to the target-branch "dev" or even a new teporary branch based on dev, that can then be tested and implemented into dev if everything works just fine?

@Joe91 Joe91 changed the base branch from squad-mates-use-full-vehicle-seats-and-more to feature/bot_chatter August 11, 2025 14:28
@Joe91 Joe91 changed the base branch from feature/bot_chatter to squad-mates-use-full-vehicle-seats-and-more August 11, 2025 14:29
@Joe91
Copy link
Owner

Joe91 commented Aug 11, 2025

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
From what i've seen so far:

  • I would suggest an option to enable or disable this function in general (in the settings or the Registry)
  • Since you removed all the existing names: the names also contained devs, supportes and contibuters, and those names should still be left, even if the system changes.
  • If you prefere, we could also just provide some informaiton from the bots with events and you could publish this as standalone mod that works out of the box with fun-bots. Since this is very good encapsulated it should be possible without that much effort...

I really like the idea and looking forward to test and play around a little with this 👍

@MatiasPastori
Copy link
Collaborator

I agree on the config to toggle it on or off as desired!

@JenkinsTR
Copy link
Author

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.

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 👍

Hi, looks really nice! Thanks a lot for all the work! As Matias already mentioned: his branch right now is in a more experimental state and not ready to merge yet. Are you fine with, if I change this MR to the target-branch "dev" or even a new teporary branch based on dev, that can then be tested and implemented into dev if everything works just fine?

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 just moved this mr to a new feature-branch in the fun-bot-repository: https://github.com/Joe91/fun-bots/tree/feature/bot_chatter From what i've seen so far:

  • I would suggest an option to enable or disable this function in general (in the settings or the Registry)

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.

  • Since you removed all the existing names: the names also contained devs, supportes and contibuters, and those names should still be left, even if the system changes.

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 [DEVS] Joe91) the system can detect that it already has a clan tag, and it will then use the matching chat lines pool to propagate those bots with the pool of matching lines.
So, for the above example:
ext\Server\BotChatter\Packs\DEVS.lua would contain all of the unique chat lines a [DEVS]* bot would potentially say
ext\Shared\Names\packs\devs.lua would contain the pool of dev names, which can be prefixed with hard coded [DEVS] clan tag, to force the system to only use the DEVS.lua chat line pack with these names.

  • If you prefere, we could also just provide some informaiton from the bots with events and you could publish this as standalone mod that works out of the box with fun-bots. Since this is very good encapsulated it should be possible without that much effort...

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...

I really like the idea and looking forward to test and play around a little with this 👍

Thanks Joe 😊 looking forward to hearing back from you!

@JenkinsTR
Copy link
Author

Spent about 12 hours today implementing those changes plus a few extras:

Commands / UX

  • Added !bc on|off|toggle|status
  • Added chatter “levels” (billiard | cafe | twitch) controlling rate, cooldowns, multi-kill window, and named/reply probs (billiard=quiet, cafe=default, twitch=chatty)
  • Runtime level cmds: !bc level <name> and !bc level (show)

Mentions / names

  • Fixed player-mention spacing; substring highlight now reliable
    vu_qKCxJJSwRz
  • Robust normalizer Util.normalize_name_for_mentions strips BOT_TOKEN and [TAG]/(TAG)/{TAG} (server + client)
  • Final scrub Util.scrub_inline_prefixes in finalizeLine to catch any leftover token/tag in emitted name mention text. This was quiet difficult to solve, but realised I wasn't hooking into the Registry properly 😂
  • Client overlay: precise mention span + ASCII sanitizer; colour-only highlight

Chatter logic

  • Dynamic replies (victim + bystander) with event boosts (revenge/longshot/roadkill)
  • Replies use Replies/RepliesNamed; all named lines pass enemy via normalizer (inc. AllyDown/Cheer)
  • Improved kill logic: multi-kill chain, revenge tracking, longshot distance check, vehicle/roadkill heuristic, streak hype

Packs / config

  • Added back the original names from BotNames.lua as their own legacy packs: (legacy_common.lua, legacy_contributors.lua, legacy_devs.lua, legacy_handles.lua, legacy_supporters.lua, mil_ru_legacy.lua, mil_us_legacy.lua)

Reliability / plumbing

  • Announce path hardened (proper RCON fallback); broadcasts Enable/Clear on toggle
  • Shared util moved to Shared/BotChatter/Util.lua and required on both sides
  • Respects Registry overrides (BOT_CHATTER_ENABLED, BOT_TOKEN) and multiple bot-detection paths
  • Misc safety: visibility filters, nil guards, safer Vec3 checks, per-bot rate limiter + per-category cooldowns; state reset on disable/level change

Follow-ups planned

  • Point-capture/suicide callouts
  • More config via BotChatterConfig + !bc subcommands
  • More regional lines (only Default/US done so far)

Prepping the new PR now 👍

@Joe91
Copy link
Owner

Joe91 commented Aug 14, 2025

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).
Sadly I'm quite limited at the moment, but I will continue there hopefully very soon...

@Joe91
Copy link
Owner

Joe91 commented Aug 14, 2025

Just did a quick test:
bot-chatter.zip
Your Bot-Chatter already runs out of the box as standalone mod with a default-version of fun-bots! This is really nice and makes things much easier than initlally thought.
That being said, if using the chatter just like that, there is no exchange in the used bot-names of the fun-bots mod.
For that I would suggest to expand the Bot-Name-Logic in fun-bots (in the direction of your Name-loader) and provide these bot-names maybe also with events.
There also already is a mechanism in fun-bots to replace the bot-names on the fly with own namesets, but I haven't tested this for a long time... It's diretly using rcon-commands, but we can also provide direct acces with events for that. Maybe that would be even better.
The chatter-mod itself can then be independent of the bot-names as standalone mod with all it's configuration and will connect seamlessly into a default mod-setup. By wish it can replace all Bot-Names, or get the existing onces and do whatever you like with them.

What do you think about this proposal?
Do you want to create an own repository for that?
Once the name-stuff is reworked and we've tested this a little further I would of course link to this mod in the Readme.

@Joe91
Copy link
Owner

Joe91 commented Aug 24, 2025

@JenkinsTR , what do you think about this own mod (see comment above)?
Would you like to create a repository for that?
Then we could finalize the things in this repo directly...

Best regards
Joe

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.

3 participants