feat: add dynamic BotChatter system with regional packs (AU/NZ/UK/CA/US)
Base:
squad-mates-use-full-vehicle-seats-and-moreby @MatiasPastori (notmaster) 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 styleDefault.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 withseed = 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:
- Copy
ext/Server/BotChatter/**,ext/Client/BotChatterClient.lua,ext/Shared/Names/**andext/Shared/BotChatterConfig.lua. - Ensure the target branch’s
__init__files include the BotChatter bootstrap (Client/Server/Sharedrequirelines). - Make sure that
ext/Shared/Constants/BotNames.luais 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
- Occasional double-send from the same bot when two categories trigger in the same tick (e.g.,
Streak+Kill). - 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.
- Player-mention spacing glitch in the overlay when the local player is highlighted (layout bug; still investigating).
- 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 inShared/Constants/BotNames.luato enable modular name assignment
- client/server/shared
- Safe to merge independently of other features.
Reviewer checklist
- Build & run on
squad-mates-use-full-vehicle-seats-and-moreby @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.luaas it's own pack (or split packs) inext/Shared/Names/packs. Most of the "regular" names from it are already included inglobal_default.luapack