Giter VIP home page Giter VIP logo

ttt-bots-2's Introduction

Please leave any bug reports or feature requests in the Issues section. THANK YOU to all the bug reporters that have helped me improve this project!

TTT Bots Header

What is this?

This is a player bot addon for the Trouble in Terrorist Town game mode in Garry's Mod.

It is designed to be as modular as possible, allowing easy customization and expansion. It is designed for TTT2 while being fully playable in regular TTT.

๐Ÿ“ Note: Please stick to the main branch. Most other branches are either unstable or significantly behind.

How to use

  1. Download the latest version from the Steam Workshop.
  2. Start a Peer-to-Peer or SRCDS with sufficient player slots on a map with a navmesh or one of the included maps.
  3. As a super admin, either type !botadd X in chat or write ttt_bot_add X in the console.
  4. You're done!

Role Support

This add-on supports a wide range of roles. Here are some that have explicit compatibility:

  • Jester
  • Jackal
  • Sidekick
  • Hitman (needs work)
  • Serial Killer
  • Survivalist

The mod also auto-generates compatibility with custom roles, but it is imperfect. It does not comprehend most 'public killer' roles (e.g., 'Speedrunner').

Usage and Commands

A basic usage guide can be found on the wiki. It will give you all the info you need for 90% of cases. A more in-depth set of guides are constantly a WIP.

Vague to-do list

  • Complete everything in the Issues section (impossible)
  • Create some more bot maps as separate addons, but link them here.
  • Implement the !botmenu: blacklist/whitelist certain traits, change bot count, etc.
  • Have bots be able to use the DNA scanner (maybe)

For developers

Check out the developer guide.

Please help me document/improve the codebase! I would highly appreciate it. And you can have bots get named after you!

License

First and foremost, this open-source software is provided as-is, with no warranty or guarantee of functionality.

I am committed to keeping this project open-source and easily accessible to everyone. I want developers and bot enthusiasts to be able to examine my code, offer feedback, and contribute. However, I have invested much time and effort into developing this project to its current state. Therefore, I have licensed it under CC-BY-SA 4.0, which allows you to clone, use, modify, and redistribute my content freely as long as you give me credit upon using significant portions of my code.

^ You can find the proper legalese for the CC-BY-SA license in the LICENSE.txt file.

ttt-bots-2's People

Contributors

entrancejew avatar thebigsleepjoe avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

ttt-bots-2's Issues

[FEATURE] Allow players to be controlled by bots if AFK

What is the new feature?

A player should be able to do !botafk or, if a cvar is enabled, have their character be controlled by a bot until they interact with the game again.

Purpose/motivation

It would be a small but valuable QOL feature that would prevent situations where players are AFK during a round and thus must be RDM'd to play usually.

Additional context

This is low-priority and may require a bit of refactoring, but it may be worth it if people want it.

[FEATURE] Walking into a stationary bot should "push" them

What is the new feature?

When a bot is being walked into by a player, the bot should move out of the way to allow the other to walk past.

Purpose/motivation

Bots may occasionally cause traffic congestion at doorways due to temporary pauses or halts for various reasons. Therefore, a lot of traffic congestion could be solved by bots simply moving out of the way.

Additional context

image

[FEATURE] auto-nav-bake

What is the new feature? (required)

when bots should spawn, attempt to run nav_generate_cheap_expanded from Navmesh Optimizer, because it's cheap and inoffensive enough that it's accurate like 99% of the time

if you do include any logic for that then you will get slightly better navmeshes if you provide player spawn positions as seeds as I have done in my side addon:

local bigNegativeZ = Vector( 0, 0, -3000 )
local function snappedToFloor( pos )
	local traceDat = {
		mask = MASK_SOLID,
		start = pos,
		endpos = pos + bigNegativeZ
	}

	local trace = util.TraceLine( traceDat )
	if not trace.Hit then return nil, nil end

	local snapped = trace.HitPos
	if not util.IsInWorld( snapped ) then return nil, nil end

	return true, snapped, trace
end

hook.Add("navoptimizer_comprehensiveseedpositions_postbuilt", "NavMeshGen_postbuilt", function(donePositions)
	local spawnPoints = plyspawn.GetPlayerSpawnPoints()
	for _, spawn in ipairs(spawnPoints) do
		local didSnap, pos = snappedToFloor(spawn.pos)
		if didSnap then
			donePositions[#donePositions + 1] = pos
		end
	end
end)

Purpose/motivation (required)

my server is a testing server largely, so not having any players on at all breaks things, including the ability to conduct a mapvote since a round never starts. this isn't the most intelligent way to handle things but even so, if a map doesn't have a nav it is still a better experience to try and make one for a player when one joins

How would you add this feature? (optional)

wherever that print about navmeshes happens, make it do this instead if navmesh optimizer exists

Context

navvmesh optimizer's incremental one might not be the perfect navmesh but it is surprisingly competent for someone like me who would never bother to go in and even begin authoring one for all the maps we have in rotation if it didn't cover 99% of the problem areas for me

and more importantly it doesn't require a map reload and a bunch of extra shit that could potentially disable a whole server as it generates

Utility functions + TTTBots table need to be on shared realm

Game version/server type

  • SERVER TYPE (PICK ONE): SRCDS, but probably also ALL
  • WHICH TTT (PICK ONE): TTT/2
  • WHAT VERSION OF BOTS: v0.9.0

Describe the bug
Key utility functions/resources are absent in the client realm, causing multiple errors and increasing technical debt.

Stack trace/error
N/A

To Reproduce
N/A

Expected behavior
N/A

[FEATURE] Update Maps to include traitor traps

What is the new feature?

Adding traitor traps into the base maps built in with the addon

Adding traitor traps or a traitor room to some of the maps would make them have more replay value and could link with adding more features to the bots like giving them the ability to use traitor traps for their specific maps.

Purpose/motivation

The purpose of why this should be added is for more replay-ability and enjoyment on the default maps.

[BUG] Traitor bots staring through walls due to radar

Game version/server type

  • SERVER TYPE (PICK ONE): ALL
  • WHICH TTT (PICK ONE): ALL
  • WHAT VERSION OF BOTS: v1.2

Describe the bug

Bots will stare at their targets through walls because their radar occasionally tells them where their enemy is.

Stack trace/error

No error, silent behavioral bug.

Reproducing the bug

  1. Load into a game, preferably on a large map.
  2. Add more than a few bots
  3. Wait

Expected behavior

This should only occur when the bot is close to their target or if they have recently seen them.

Screenshots

image
^ Screenshot is taken from a video sent to me by EntranceJew

Additional context

N/A

[BUG] Check `minhealthdmg` on props to determine if they are breakable

Game version/server type

  • SERVER TYPE: ALL
  • WHICH TTT: BOTH
  • WHAT VERSION OF BOTS: v1.12-roles (6cf6ae6)

Describe the bug

Some maps have breakable props that aren't static but have minhealthdmg set extremely high to make them unbreakable. Bots will get stuck trying to break them.

The only map I know has these props is ttt_forest_final
(navmesh for convenience, most of it has the fence props avoided, but there are still some spots where they get stuck trying to break a fence)

Stack trace/error

N/A

Reproducing the bug

  1. Play on ttt_forest_final
  2. Wait for a bot to get stuck trying to break a fence

Expected behavior

The prop's minhealthdmg key value is checked (entity:GetInternalVariable("minhealthdmg")) for either 0 or if its within the damage of the weapon.

Screenshots

gmod_12-31-23_11-48-53.mp4

[FEATURE] Bots using Traitor Traps on certain maps

Bots use Traitor Traps

A Feature that makes bots use Traitor Traps for certain maps

You could also add traitor traps into your ttt bot maps

Purpose/motivation

To make the bots feel more real, and harder to deal with if you are standing in the wrong spots

[BUG] retrying clients causes bots to behave strangely

Game version/server type

  • SERVER TYPE (PICK ONE): SRCDS
  • WHICH TTT (PICK ONE): TTT2
  • WHAT VERSION OF BOTS: v1.11-roles

Describe the bug

Creating bots broken after forced retry.

Stack trace/error

The error, if any. Example:

CreatePlayerBot: Unable to create bot [BOT] Pootis - CreateFakeClient() returned NULL.

[TTT Bots 2.0] lua/tttbots2/components/sv_locomotor.lua:52: attempt to index local 'bot' (a nil value)
  1. Initialize - lua/tttbots2/components/sv_locomotor.lua:52
   2. New - lua/tttbots2/components/sv_locomotor.lua:21
    3. CreateBot - lua/tttbots2/lib/sh_botlib.lua:829
     4. serverCallback - lua/tttbots2/commands/sh_concommands.lua:65
      5. unknown - lua/tttbots2/commands/sh_concommands.lua:50
       6. unknown - lua/includes/modules/concommand.lua:54

CreatePlayerBot: Unable to create bot [BOT] Hugh Mungus - CreateFakeClient() returned NULL.

[TTT Bots 2.0] lua/tttbots2/components/sv_locomotor.lua:52: attempt to index local 'bot' (a nil value)
  1. Initialize - lua/tttbots2/components/sv_locomotor.lua:52
   2. New - lua/tttbots2/components/sv_locomotor.lua:21
    3. CreateBot - lua/tttbots2/lib/sh_botlib.lua:829
     4. serverCallback - lua/tttbots2/commands/sh_concommands.lua:65
      5. unknown - lua/tttbots2/commands/sh_concommands.lua:50
       6. unknown - lua/includes/modules/concommand.lua:54

Reproducing the bug

Steps to reproduce the behavior:

  1. Enter a round with bots.
  2. Force all clients to retry in console.
  3. Bots will be punted from a dormant server.
  4. Clients rejoin
  5. Bots repopulate
  6. Errors occur

Expected behavior

No errors

[BUG] Bots not Auto Switching Weapons Consistently

Game version/server type

  • SERVER TYPE (PICK ONE): P2P, probably also SRCDS
  • WHICH TTT (PICK ONE): TTT2, but probably both.
  • WHAT VERSION OF BOTS: v1.2.1-meta

Describe the bug

Bots will not auto switch between weapons that are in their inventory. The behavior is very inconsistent--sometimes bots will use their weapons properly, while others will stick to the crowbar or a pistol for the whole match.

Stack trace/error

No apparent errors.

Reproducing the bug

Steps to reproduce the behavior:

  1. Load into a standard TTT2 match
  2. Add multiple bots
  3. Observe how some pick up weapons but do not switch to them.

Expected behavior

Bots will switch to their primary weapon if it has ammo, otherwise they will use their secondary.

Screenshots

image
^ Annoying bastard

Extra context

This seems to only happen AFTER the 1st round.

[BUG] inventory bug

Game version/server type

  • SERVER TYPE (PICK ONE): SRCDS
  • WHICH TTT (PICK ONE): TTT2
  • WHAT VERSION OF BOTS: v1.13-roles (workshop)

Describe the bug

A clear and concise description of what the bug is.

Stack trace/error

The error, if any. Example:

[TTT Bots 2.0] lua/tttbots2/components/sv_inventory.lua:187: bad argument #1 to 'ceil' (number expected, got nil)
  1. ceil - [C]:-1
   2. GetHeldWeaponInfo - lua/tttbots2/components/sv_inventory.lua:187
    3. StartCommand - lua/tttbots2/components/sv_locomotor.lua:1452
     4. fn - lua/tttbots2/sh_tttbots2.lua:139
      5. unknown - lua/ulib/shared/hook.lua:109

Reproducing the bug

Steps to reproduce the behavior:

  1. Reload the game files a few times in a live refresh.
  2. Roll the dice.

Expected behavior

This doesn't happen.

Additional context

Hard to say what really triggers it but the latest version of TTT2 on git causes it a lot.

[BUG] null entity reference in personality

Game version/server type

  • SERVER TYPE (PICK ONE): SRCDS
  • WHICH TTT (PICK ONE): TTT2
  • WHAT VERSION OF BOTS: v0.9.5b (12/22/23)

Describe the bug

Bots throw error unexpectedly.

Stack trace/error

The error, if any. Example:

ServerLog: Round ended.
ServerLog: Result: traitors wins.
ServerLog: Round proper has begun...
ServerLog: 00:00.02 - KILL:	 [BOT] PIMPIN' PIGEON [innocent] killed [BOT] PIMPIN' PIGEON [innocent]
Dropped [BOT] PIMPIN' PIGEON from server (Disconnect by user)

[ttt-bots-2] addons/ttt-bots-2/lua/tttbots2/lib/sh_botlib.lua:243: Tried to use a NULL entity!
  1. GetPos - [C]:-1
   2. GetAllWitnessesBasic - addons/ttt-bots-2/lua/tttbots2/lib/sh_botlib.lua:243
    3. unknown - addons/ttt-bots-2/lua/tttbots2/components/sv_personality.lua:548

Timer Failed! [TTTBots.Personality.RDM][@addons/ttt-bots-2/lua/tttbots2/components/sv_personality.lua (line 532)]
[BOT] hotdogglemin: corpse

โš ๏ธ If there is no error, please ensure you remove the triple backticks, or else your formatting will break.

Reproducing the bug

Steps to reproduce the behavior:

  1. Play round.
  2. Bots do their thing.
  3. See error

Expected behavior

Bots don't have errors.

[BUG] SRCDS some concommands do not work

Describe the bug
ttt_bot_kick does not appear to function properly on SRCDS

Stack trace/error
Consistently fails silently.

To Reproduce

  1. Add a bot in a SRCDS server
  2. Run "ttt_bot_kick botname" on a bot.
  3. Fails

Expected behavior
The bot should be kicked from the game with a message printed in chat.

[FEATURE] BodyGuard Support

What is the new feature?

What should happen as a result of Adding built-in support for the Bodyguard role?: It would allow for someone to Bodyguard a bot, or vice versa, and not have to worry about being RDM'd by their target or killed by their target if they're a traitor.

Purpose/motivation

What is the purpose of this request? Why should it behave this way? What is the reason for your suggestion?: Bodyguard Role adds a role that gives a guaranteed cooperative experience between two people. With bots, while you no longer have the person-to-person aspect, it can be fun to have backup or be fun to try and back up a bot in whatever they do.

How would you add this feature? (optional)

Probably something simple as just saying "If the Bodyguard is assigned to X, and X is a bot, make sure X (And any potential teammates) also sees the Guard as a teammate." Probably something as simple as checking what team the Bodyguard is on, since TTT2 does recognize a Guard assisting a traitor as being on the traitor team.

[BUG] breaking entity on map causes error

Game version/server type

  • SERVER TYPE (PICK ONE): SRCDS
  • WHICH TTT (PICK ONE): TTT2
  • WHAT VERSION OF BOTS: v1.1-roles

Describe the bug

Breaking a map entity causes errors.

Stack trace/error

The error, if any. Example:

[TTT Bots 2.0] lua/tttbots2/components/sv_memory.lua:537: Tried to use a NULL entity!
  1. GetOwner - [C]:-1
   2. fn - lua/tttbots2/components/sv_memory.lua:537
    3. unknown - lua/ulib/shared/hook.lua:109

โš ๏ธ If there is no error, please ensure you remove the triple backticks, or else your formatting will break.

Reproducing the bug

Steps to reproduce the behavior:

  1. Go to ttt_batonrouge
  2. Find a radio that is playing music.
  3. Break it.
  4. See error

Expected behavior

Breaking radios works normally.

[BUG] Traitor bots placing several bombs in same spot

Game version/server type

  • SERVER TYPE (PICK ONE): ALL
  • WHICH TTT (PICK ONE): TTT/2
  • WHAT VERSION OF BOTS: v0.9.5 (12/20/23)

Describe the bug

Bots will place multiple C4 bombs atop one another, due to this not being devalued in their bomb selection heuristic.

Stack trace/error

Not applicable.

Reproducing the bug

  1. Play a few matches with a few traitor bots
  2. The bots will often place C4 in the same location

Expected behavior

The bots should spread out the C4 somewhat reasonably.

[FEATURE] Bots interaction with smoke grenades

What is the new feature?

This new feature is to add bot interaction with smoke grenades.

What should happen is that the AI would struggle to see the player in the smoke most likely allowing them to strategically get away with murder in populated areas and get away without losing the majority of their health. I am presuming that coding this little feature would be challenging so instead a workaround idea may be that if the AI is trying to shoot at the player or another bot which is behind smoke their aiming skills would be greatly reduced until the smoke disappears simulating them unable to see.

Purpose/motivation

The purpose is to add more strategy of getting away with murder without using the credit shop and to add more purpose for the use of smoke grenades in the game without it being used on players. My reason for this suggestion is for the players in the game to use less generic weapons like the M16 but to experiment with grenades and also to make the bots more easier to fight with while they are grouped together.

Additional context

image

[FEATURE] Necromancer Support

What is the new feature?

Role support for the necromancer role. Why this is different from the normal neutral killer roles is that the necromancer uses a zombie difib to bring back dead bodies back to life to fight for him.

The necromancer should avoid fights until he has gathered enough bodies to bring back alive as teammates for him. This would be different from the serial killer who stalks people and jackal who works with his partner by the necromancer using the magneto stick to drag bodies to a secluded area and reviving them. To help him with this he has a radar for dead bodies which is built in the role itself.

Purpose/motivation

The purpose of the request is to add more creative behaviour branches that can be used for other roles with defibs like; mesmerist, doctor, sacrifice and more. While also adding a unique feature/playstyle for the bots to one of the most liked roles in TTT2. This would also make the game more interesting as in some rounds if a necromancer gathers a lot of bodies and brings back a zombie horde it would make the game more diverse and lot more fun.

Additional context

image

[FEATURE] Refactor behavior tree

What is the new feature?

The behavior tree should be refactored to be sorted by subrole string (or another useful equivalent), and should have utility functions to add behaviors, get current tree layouts, etc.

Purpose/motivation

To allow modders to extend the functionality of the TTT bots for custom roles that require more specialized behaviors.

[FEATURE] Randomize Playermodels for Bots

Allow to change the playermodel of an bot

Allow an admin or owner of the server to pick playermodels for bots, to make them feel more real.

Purpose/motivation

to make them feel more realistic and to act like real players

[BUG] cannot resume dead coroutine

Game version/server type

  • SERVER TYPE (PICK ONE): SRCDS
  • WHICH TTT (PICK ONE): TTT2
  • WHAT VERSION OF BOTS: TTTBots version: v0.9.4 (12/18/23)

Describe the bug

Bot AI freezes

Stack trace/error

Had errors generating;  cannot resume dead coroutine
Had errors generating;  addons/ttt-bots-2/lua/tttbots2/lib/sv_pathmanager.lua:897: attempt to index local 'destination' (a nil value)
Had errors generating;  cannot resume dead coroutine
Had errors generating;  addons/ttt-bots-2/lua/tttbots2/lib/sv_pathmanager.lua:897: attempt to index local 'destination' (a nil value)
Had errors generating;  cannot resume dead coroutine
Had errors generating;  addons/ttt-bots-2/lua/tttbots2/lib/sv_pathmanager.lua:897: attempt to index local 'destination' (a nil value)

โš ๏ธ If there is no error, please ensure you remove the triple backticks, or else your formatting will break.

Reproducing the bug

Steps to reproduce the behavior:

  1. Go to ttt_mc_skylandv5
  2. Generate a basic navmesh
  3. Bots freak out
  4. See error

Expected behavior

Bots behave as usual.

Additional context

Happens even after a map reload.

client convars don't exist, cause errors

affected convars:

ttt_bot_pfps
ttt_bot_pfps_humanlike
ttt_bot_emulate_ping

I stubbed out these checks locally with true or prior to the check, and can confirm that the bots are fully compatible with TTT2.

image

Except this error:

[ttt-bots-2] addons/ttt-bots-2/lua/tttbots2/commands/concommands.lua:24: attempt to call method 'Nick' (a nil value)
  1. unknown - addons/ttt-bots-2/lua/tttbots2/commands/concommands.lua:24
   2. unknown - lua/includes/modules/concommand.lua:54

But that could be an incompatibility with something else I've got.

[FEATURE] Auto-generate nav ladders via console command

What is the new feature?

Console command for automatic nav building would greatly speed up navmesh building, making use easier.

A good name would be ttt_bot_nav_buildladders

Purpose/motivation

It would speed up the preparation stage and enable func_useableladder to be made into a proper ladder on the navmesh, without the use of external tools.

[BUG] Ladders are problematic

Game version/server type

  • SERVER TYPE: ALL
  • WHICH TTT: TTT/2
  • WHAT VERSION OF BOTS: 0.9.1 (12/16/23)

Describe the bug

  • Bots should not attempt to use a ladder if there is already someone else on it to avoid piling up on the ladder
  • Assumptions are being made on how to dismount the ladder if the top of it ends with a walkable surface, but does not check if said surface is accessible (screenshot 1 and 2), the top connected node should be used instead.
  • Bots try to crouch jump to dismount a ladder when going down (screenshot 3) (may be specific to func_useableladder?)

Screenshots

Bot trying to pathfind off a ladder through a wall instead of
The walkable surface through the wall
Bot stuck crouch jumping trying to dismount a ladder

Additional context

Navmesh has manually created ladder nodes (via navmesh.CreateNavLadder) as func_useableladder is not recognized by the navigation editor.
ttt_bb_teenroom_b2.nav.zip

[BUG] Custom roles do not target each other

Describe the bug
Add on roles which are not part of the innocent and traitor team will co-operate with the traitors and will not fight each-other stopping the round from progressing as its a never ending stalemate. This also affects the ai by having neutral killers follow traitor plans like gather.d

Stack trace/error
There does not seem to be a error for this issue when it occurs.

To Reproduce
Steps to reproduce the behavior:

  1. Go on and start a normal match
  2. Play a couple of matches until traitors and neutral killer/s are also only alive e.g Jackal or Serial killer
  3. See as the ai walk past each other and refuse to fight stalling the round until either the person uses sv_cheats to kill them or forces a round restart

Expected behavior
What most likely should happen is that both the enemy AI teams should fight and murder each other or they might team up until they are the last ones left alive.

Screenshots
Teaming bug
image

Additional context
This Bug doesn't seem to affect No-team roles like medic or amnesiac which side with the innocents.

I hope this helps to improve the mod

[FEATURE] Leech Role Support

What is the new feature? (required)

Role support for the TTT2 Leech role

Purpose/motivation (required)

Relatively easy to do, as it's a neutral role that just follows people around.

Request by @EntranceJew
image

How would you add this feature? (optional)

Follow a random nearby person and protect itself from anyone trying to hurt it.

[BUG] Inconsistent healing on health stations

Game version/server type

  • SERVER TYPE (PICK ONE): ALL
  • WHICH TTT (PICK ONE): TTT/2
  • WHAT VERSION OF BOTS: v0.9.0

Describe the bug
Bots will walk up to health stations and heal from it periodically instead of constantly

Stack trace/error
This is a silent problem.

To Reproduce
Steps to reproduce the behavior:

  1. Have a bot or player place a health station
  2. Damage a bot or wait for one to get damaged
  3. Watch them go up to the health station and use it every couple of seconds, instead of using it constantly

Expected behavior
A bot should walk up to the health station and heal (unless interrupted) until full. Currently they take much longer than a human would.

[BUG] Quota not working in SRCDS

Describe the bug
Quota does not appear to manage bots in SRCDS dedicated servers

Stack trace/error
Appears to fail silently

To Reproduce
Start a server and set the ttt_bot_quota cvar

[FEATURE] Module (menu) tab for adding custom/vanilla shop items for bots to use

What is the new feature? (required)

a separate tab for all existing shop items for players to enable or customize shop items to be used by bots (that are not implemented yet) by selecting what type of weapon and how they would use it.
What should happen as a result of _____? Why? Be as specific as possible.
when you open this menu, (can be bind to f1 and found in its own ttt/2 tab or by typing "!tttbotshopmenu") a list of all the shop items would appear with details if it has support or not. you can then click on a item that would then pop up an option to add support.

you can then choose how they would handle it (do they use it as a rifle (shoot people with it); do they use it as a melee weapon; do they use it as a health station,(throw it on the ground) a defib( find a body and revive/eat it,, etc..
Example:
the silenced pistol can be purchased from the shop and can have bots use it like a regular pistol or they can purchase the cannibalism item which players can customize it so bots will use it like a defib ( find a dead body and click/hold mouse1)

these new weapons would be used the same way when a traitor has picked a target to kill, it will use the world weapons for random amount of time. after a set amount of time has passed, it will role a random chance to pull out the weapon (if it is selected to be used as a rifle/pistol/melee weapon) to then shoot/ beat down there target, then conceal it.
If it results from an error or other (obviously) unintended, please submit a bug report.

Purpose/motivation (required)

What is the purpose of this request? Why should ____ behave this way? What is the reason for your suggestion?
The purpose of this feature is to give bots more options to play against players without to much complication by just mimicking how they would use current implemented world/shop items. (example silenced m4a1 could mimic prototype UMP). This would also be used as a foundation for others to implement support for new custom roles that have there own set of weapons (ex: link role).

How would you add this feature? (optional)

Even if you're not a programmer, please draft an overview of how these changes can be made. It doesn't have to be overly technical -- in other words, just make it obvious what you want, and how you would go about adding this if it were your mod.

Note: This section is optional, as some feature requests are self-explanatory. Including this section can be helpful for certain requests to prevent misunderstandings. Feel free to completely remove this section and its header.

Additional context (optional)

You may add any other context or screenshots about the feature request here. Here are some examples of what you could include: your inspirations related to this, any shortcomings in the mod you've noticed, or even a shout-out to your mom. This section is optional.

Concept art of topic of intrest

[BUG] Bots leaving the game will speak as Console

Game version/server type

  • SERVER TYPE (PICK ONE): SRCDS
  • WHICH TTT (PICK ONE): TTT/@
  • WHAT VERSION OF BOTS: v0.9.1

Describe the bug

Very infrequently when a bot is posting a VoluntaryDisconnect message, the message will be appear to be posted by Console when it shouldn't have. My anticipated reason for this is that the Player that :Say is being called on is NULL, which defaults to speaking as Console.

Stack trace/error

Silent failure

Reproducing the bug

Steps to reproduce the behavior:

  1. Play with many bots for a long time with voluntary disconnecting enabled.
  2. Wait.

[BUG] ArcCW weapons break TTT bots

Game version/server type

  • SERVER TYPE (PICK ONE): P2P
  • WHICH TTT (PICK ONE): TTT
  • WHAT VERSION OF BOTS: v1.0.2 (12/24/23)

Describe the bug

If a bot has a ArcCW weapon in their hands, they will send errors to the console and do nothing.

Stack trace/error

The error, if any. Example:

[TTT Bots 2.0] lua/tttbots2/components/sv_inventory.lua:187: attempt to perform arithmetic on field 'Delay' (a nil value)
  1. unknown - lua/tttbots2/sh_tttbots2.lua:129

โš ๏ธ If there is no error, please ensure you remove the triple backticks, or else your formatting will break.

Reproducing the bug

Steps to reproduce the behavior:

  1. Subscribe to the ArcCW base
  2. Subscribe to a ArcCW gun pack (I used Gunsmith Offensive)
  3. Have a bot pick up a ArcCW weapon (indicated by white text)
  4. See error

Expected behavior

Bots should be able to fire the ArcCW weapon normally and not throw out errors and stand still.

EDIT: Like #11, but specific.

[BUG] Bots have staring contests when using certain modded weapons

Game version/server type

  • SERVER TYPE (PICK ONE): SRCDS
  • WHICH TTT (PICK ONE): TTT2
  • WHAT VERSION OF BOTS: 0.9.1 (12/16/23)

Describe the bug
Bots will stare at one another and not shoot with certain modded weapons.

Stack trace/error
No error; the issue is silent

To Reproduce

  1. Install modded weapons
  2. Play until two bots inevitably have a staring contest
  3. Be sad because the round is stalling

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
image

Additional context
The bots will use the weapons properly, but some guns do not allow this action when they want to hold the attack key.

A potential solution would be to release IN_ATTACK to prevent this problem occasionally.

[BUG] New Roles Support Not Working

Game version/server type

  • SERVER TYPE (PICK ONE): P2P
  • WHICH TTT (PICK ONE): TTT2
  • WHAT VERSION OF BOTS: Run the ttt_bot_version command to see the current version.
    Current steam version (I dont get these errors while playing with the 1.1roles branch version of github)

Describe the bug

The new code for the roles are not-working on the steam port.

Stack trace/error

The error, if any. Example:

[TTT Bots 2.0] lua/tttbots2/components/sv_locomotor.lua:1579: attempt to index field 'DebugServer' (a nil value)
    1. unknown - lua/tttbots2/components/sv_locomotor.lua:1579
[TTT Bots 2.0] lua/tttbots2/roles/hitman.lua:6: table index is nil
    1. unknown - lua/tttbots2/roles/hitman.lua:6
        2. include - [C]:-1
            3. IncludeDirectory - lua/tttbots2/lib/sh_botlib.lua:554
                4. unknown - lua/tttbots2/lib/sv_roles.lua:141
                    5. include - [C]:-1
                        6. includeServer - lua/tttbots2/sh_tttbots2.lua:41
                            7. Reload - lua/tttbots2/sh_tttbots2.lua:92
                                8. unknown - lua/tttbots2/sh_tttbots2.lua:219
    [TTT Bots 2.0] lua/tttbots2/roles/jackal.lua:5: table index is nil
    1. unknown - lua/tttbots2/roles/jackal.lua:5
        2. include - [C]:-1
            3. IncludeDirectory - lua/tttbots2/lib/sh_botlib.lua:554
                4. unknown - lua/tttbots2/lib/sv_roles.lua:141
                    5. include - [C]:-1
                        6. includeServer - lua/tttbots2/sh_tttbots2.lua:41
                            7. Reload - lua/tttbots2/sh_tttbots2.lua:92
                                8. unknown - lua/tttbots2/sh_tttbots2.lua:219
    [TTT Bots 2.0] lua/tttbots2/roles/sidekick.lua:5: table index is nil
    1. unknown - lua/tttbots2/roles/sidekick.lua:5
        2. include - [C]:-1
            3. IncludeDirectory - lua/tttbots2/lib/sh_botlib.lua:554
                4. unknown - lua/tttbots2/lib/sv_roles.lua:141
                    5. include - [C]:-1
                        6. includeServer - lua/tttbots2/sh_tttbots2.lua:41
                            7. Reload - lua/tttbots2/sh_tttbots2.lua:92
                                8. unknown - lua/tttbots2/sh_tttbots2.lua:219

โš ๏ธ If there is no error, please ensure you remove the triple backticks, or else your formatting will break.

Reproducing the bug

Steps to reproduce the behavior:

  1. Go to a p2p match
  2. expirence the game using steam version
  3. see bot code not working

Expected behavior

The sidekick should not teamkill you. Jackal/serial killer should 1v1 at the end with any last player which only sometimes happen.

E.g., "There should not be any errors thrown," or "The bots shouldn't die after sending a chat message."

Screenshots

Screenshots are always appreciated but not required (depending on the bug)
image

Additional context

Providing extra context, including a mod collection or simple mod list, can hugely boost the speed at which your report gets addressed/resolved.

[BUG] Broken Spawn Points

Game version/server type

  • SERVER TYPE: ALL
  • WHICH TTT: BOTH
  • WHAT VERSION OF BOTS: V1.2

Describe the bug

Certain spawn points on ttt_bots_v5 are bugged causing who ever spawns there to remain stuck for the whole round.

Stack trace/error

No console error

Reproducing the bug

Steps to reproduce the behavior:

  1. Start a round on ttt_bots_v5
  2. Play until you spawn stuck/unable to move or see a bot who is stuck

Expected behavior

When a player or bot spawns on the map they shouldn't be stuck.

Screenshots

20240211022211_1
20240211024749_1
20240211025613_1

Additional context

The Trouble in Terrorist Town Bots addon is the only one enabled. There are more spawns that are bugged but I only have these three screenshots.

[FEATURE] Jackal and Sidekick Support

What is the new feature?

This feature is to add support for the AI to be able to use the sidekick deagle and convert enemy bots to their side.

What should happen is that either the jackal bot has a special task to look for a AI who isn't part of the large group of bots and then convert them or that there would be a special interaction of the jackal bot convincing the unsuspecting victim to follow them in which after getting in a secluded area they would turn them. To be more specific the AI who would become the sidekick might have a couple different reactions to the turning.
Number 1: they might try to kill the Jackal.
Number 2: They might allow the Jackal to turn them.
Number 3: They might run away from them and put a KOS on them.

Purpose/motivation

The purpose or motivation as why this should be implemented and why the bots should be able to use this is because the jackal and sidekick by far are the most downloaded and used roles on the workshop with over 75k downloads. Meaning that there is a massive overlap with the TTT-Bots-2 addon and jackal/sidekick addons. Which overall means that adding this quality of life addition would enhance the general gameplay of the addon and make the bots more human like which also link with [FEATURE] Refactor behavior tree. The reason of why this should be added into the addon rather to be implemented with the Refactor behavior tree is because The Jackal role is a large part of TTT2 being nearly half the downloads of the TTT2 base itself.

Additional context

image

[BUG] stackoverflow analyzing mesh

Game version/server type

  • SERVER TYPE (PICK ONE): SRCDS
  • WHICH TTT (PICK ONE): TTT2
  • WHAT VERSION OF BOTS: TTTBots version: 0.9.1 (12/16/23)

Describe the bug

Error on map load srcds64

Stack trace/error

[ttt-bots-2] stack overflow
  1. GetAdjacentAreas - [C]:-1
   2. AddAdjacentsToRegion - addons/ttt-bots-2/lua/tttbots2/lib/sh_botlib.lua:444
    3. AddAdjacentsToRegion - addons/ttt-bots-2/lua/tttbots2/lib/sh_botlib.lua:446
     4. AddAdjacentsToRegion - addons/ttt-bots-2/lua/tttbots2/lib/sh_botlib.lua:446
      5. AddAdjacentsToRegion - addons/ttt-bots-2/lua/tttbots2/lib/sh_botlib.lua:446
       6. AddAdjacentsToRegion - addons/ttt-bots-2/lua/tttbots2/lib/sh_botlib.lua:446
        7. AddAdjacentsToRegion - addons/ttt-bots-2/lua/tttbots2/lib/sh_botlib.lua:446
         8. AddAdjacentsToRegion - addons/ttt-bots-2/lua/tttbots2/lib/sh_botlib.lua:446
          9. AddAdjacentsToRegion - addons/ttt-bots-2/lua/tttbots2/lib/sh_botlib.lua:446
           10. AddAdjacentsToRegion - addons/ttt-bots-2/lua/tttbots2/lib/sh_botlib.lua:446
            11. AddAdjacentsToRegion - addons/ttt-bots-2/lua/tttbots2/lib/sh_botlib.lua:446
             12. AddAdjacentsToRegion - addons/ttt-bots-2/lua/tttbots2/lib/sh_botlib.lua:446
   Timer Failed! [Simple][@addons/ttt-bots-2/lua/tttbots2/sh_tttbots2.lua (line 211)]

Reproducing the bug

  1. Play game
  2. Map change
  3. Error occurs before first client finishes connecting.

Expected behavior

This shouldn't happen.

Screenshots

image

Additional context

Map is nt_vtol, navmesh existed, TTT2 spawn entities were manually placed in this map.

files aren't namespaced

sorry to interrupt, but having all your files outside of a namespaced folder might open it up for collisions with other addons; for example, the file includes/lib/languages.lua is pretty generic, same with autorun/client/debugui.lua -- and since all addons mount on top of each other, someone could very likely overwrite one or more of your files.

my suggestion would be to minimize your footprint to one very unique autorun filename, and then move all your files into lua/ttt-bots-2/*

[BUG] Bot-Planted C4 Cannot be Defused

Game version/server type

  • SERVER TYPE (PICK ONE): P2P
  • WHICH TTT (PICK ONE): TTT2
  • WHAT VERSION OF BOTS: Run the ttt_bot_version command to see the current version.
    1.2 and master

Describe the bug

A c4 is armed but when you try to enter the menu it says you cant.

Stack trace/error

The error, if any. Example: Silent

Reproducing the bug

Steps to reproduce the behavior:

  1. Play matches with bots until they plant bomb
    2

Expected behavior

The bomb should be able to be defused rather for a non-working plant menu after its planted

Screenshots

image

Additional context

[BUG] witnesses and weapons cause mortal terror

Game version/server type

  • SERVER TYPE (PICK ONE): SRCDS
  • WHICH TTT (PICK ONE): TTT2
  • WHAT VERSION OF BOTS: v1.1-roles

Describe the bug

Some bots when there's no navmesh get really upset about the thing that killed something.

Stack trace/error

The error, if any. Example:

[TTT Bots 2.0] lua/tttbots2/components/sv_morality.lua:292: attempt to index field 'Roles' (a nil value)
  1. OnWitnessKill - lua/tttbots2/components/sv_morality.lua:292
   2. fn - lua/tttbots2/components/sv_morality.lua:344
    3. unknown - lua/ulib/shared/hook.lua:109
     4. FireBullets - [C]:-1
      5. ShootBullet - addons/ttt2/gamemodes/terrortown/entities/weapons/weapon_tttbase.lua:701
       6. PrimaryAttack - addons/ttt2/gamemodes/terrortown/entities/weapons/weapon_tttbase.lua:601
        7. unknown - gamemodes/terrortown/entities/weapons/weapon_ttt_sg550.lua:54
[...]
[TTT Bots 2.0] lua/tttbots2/components/sv_morality.lua:267: attempt to index field 'Roles' (a nil value)
  1. OnWitnessHurtIfAlly - lua/tttbots2/components/sv_morality.lua:267
   2. OnWitnessHurt - lua/tttbots2/components/sv_morality.lua:352
    3. fn - lua/tttbots2/components/sv_morality.lua:458
     4. unknown - lua/ulib/shared/hook.lua:109
      5. FireBullets - [C]:-1
       6. ShootBullet - addons/ttt2/gamemodes/terrortown/entities/weapons/weapon_tttbase.lua:701
        7. unknown - addons/ttt2/gamemodes/terrortown/entities/weapons/weapon_tttbase.lua:601

Reproducing the bug

Steps to reproduce the behavior:

  1. See a bot
  2. Kill a bot
  3. Have a bot see that also

Expected behavior

No errors

[FEATURE] Utilize TTT2's Hook for Bot Avatar Fetches

What is the new feature? (required)

Utilize the TTT2 hook for bot avatar fetching when a body is searched.

Purpose/motivation (required)

Improve "immersion"

Additional context (optional)

Thanks to EntranceJew for making the relevant hook exist. (I don't remember what the hook is called)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.