Trick to making bots work with "shared" spawn room?

Draco18s

L9: Fashionable Member
Sep 19, 2009
622
136
So I have a Payload map with a single center respawn room that has its ownership transfer from red to blue after the cart reaches a certain point.

Once it does, however, the blue bots almost never leave the spawn room, unless a red bot/myself happens nearby and triggers their attacking code (and they follow me out).

Is there some trick to getting the bots to realize that this is THEIR spawnroom and not an enemy spawn room? As I've noticed that bots do have the behavior of not trying to path into enemy spawn rooms unless the round was won.
 

Jeremy

L11: Posh Member
Oct 24, 2010
829
299
Does the func_spawnroom change from RED to BLU? Or does the RED one disable and a BLU one enable? Does the final RED spawnroom have a func_spawnroom that is enabled?

Bots tend to act a bit buggy unless both teams have at least one func_spawnroom each.
 

Draco18s

L9: Fashionable Member
Sep 19, 2009
622
136
Does the func_spawnroom change from RED to BLU? Or does the RED one disable and a BLU one enable? Does the final RED spawnroom have a func_spawnroom that is enabled?

Bots tend to act a bit buggy unless both teams have at least one func_spawnroom each.

I'm setting the team, via the SetTeam input, changing the one func_spawnroom from one team to the other. I have a bit of delay between when red loses it and when blue gains it* (as well as killing anyone inside the room, for good measure). Red gains a new spawn room when they lose this middle one, and blue loses their original spawn (disabled) when they gain this one (happens in the same game tick).

All of the info_player_teamspawn entities are team-switched the same way.

The thing is, SOME bots are ok with the change (demomen, for instance) others are not (spies are notoriously at Not Leaving).

*Step 1: disable
Step 2: kill anyone inside
Step 3: SetTeam (blue)
Step 4: Enable
 

Draco18s

L9: Fashionable Member
Sep 19, 2009
622
136
As an update, I ended up rebuilding the room a bit (making it deeper) and ended up with a slightly...different problem.

Red bots: leave the room just fine
Blue bots: cluster in the corner nearest the exit (if there wasn't a WALL IN THE WAY*) as if they're ignoring the nav mesh.

*The exit is to the right and up a ramp to the left, so the bots cluster in the corner to the left, which is below the ramp's walkable surface.

Edit:
Altered the nav, such that the corner contains nav mesh zones with connections leading only away from the corner (that is, a lot of little areas with one-way connections).

The bots will still navigate into the corner and get stuck.
 
Last edited:

Jeremy

L11: Posh Member
Oct 24, 2010
829
299
You could try modifying the nav mesh - it's probably causing the bots to think they can go that way when they can't.
 

grazr

Old Man Mutant Ninja Turtle
aa
Mar 4, 2008
5,441
3,814
I'm setting the team, via the SetTeam input, changing the one func_spawnroom from one team to the other. I have a bit of delay between when red loses it and when blue gains it* (as well as killing anyone inside the room, for good measure). Red gains a new spawn room when they lose this middle one, and blue loses their original spawn (disabled) when they gain this one (happens in the same game tick).

All of the info_player_teamspawn entities are team-switched the same way.

The thing is, SOME bots are ok with the change (demomen, for instance) others are not (spies are notoriously at Not Leaving).

*Step 1: disable
Step 2: kill anyone inside
Step 3: SetTeam (blue)
Step 4: Enable

That's not the right way to do it and often when there are I/O commands available, they are redundant features that have been replaced by actual features within the respective entity's options. Better to use badwater as a reference. Shared spawns are awkward to deal with when you don't have the benefit of a round switch to reset your logic.
 

Draco18s

L9: Fashionable Member
Sep 19, 2009
622
136
You could try modifying the nav mesh - it's probably causing the bots to think they can go that way when they can't.

I'd tried, they ignored it.

That's not the right way to do it and often when there are I/O commands available, they are redundant features that have been replaced by actual features within the respective entity's options. Better to use badwater as a reference. Shared spawns are awkward to deal with when you don't have the benefit of a round switch to reset your logic.

Thanks, I'll take a look.
Edit:
Badwater doesn't help, as the two teams never share a spawn room.
 
Last edited: