Skip to content
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

(Re)Hosting a Skirmish AI has impossible conditions in cooperative game types #1727

Open
Arch-Shaman opened this issue Oct 12, 2024 · 2 comments

Comments

@Arch-Shaman
Copy link
Contributor

Reading the source code, only allied players can host a new skirmish AI. This presents a problem for coop vs AI games with skirmish AIs. Since all players are on one allyteam against all the AIs on either the same or different allyTeams, the AI cannot be "restarted" when a player leaves and rejoins nor can other players elect to host the AI themselves in the event of an AI host leaving. This is due to this check here. The only recourse is for players to /cheat which might as well be a game reset in an untrusted multiplayer setting.

Could a modrule be added to dictate whether or not enemies could host skirmish AIs on teams without leaders (or perhaps move the logic completely to modrules)? Perhaps the original host could start an AI under any condition on the team? The main issue this causes is when ai hosts rejoin a match they spam a bunch of errors like this:

[t=00:40:18.580288][f=0002419] Player ShamanDev sent invalid SkirmishAI ID 1 in AICOMMAND 14

And the ai is effectively bricked as it can no longer issue commands.

@lostsquirrel1
Copy link
Collaborator

So the confirm the issue: the AI works fine for a comp-stomp (all players vs all AIs), but if a player client leaves the match then the control of any AIs that player's client was controlling cannot be transferred to another player?

@Arch-Shaman
Copy link
Contributor Author

To clarify: AI works fine until someone disconnects then it can't be rehosted if everyone is on a different team than the AI that you're trying to rehost. The current rules make sense for Player + AI vs Player + AI matches, but not for Player vs AI matches or Player vs Player vs AI or other FFA scenarios.

Take this as an example:

Player 0 is the host of AI 1, 2, and 3. Player 1 is the host of AI 0. The teams are:

AllyTeam 0:
Player 0
Player 1

vs

Allyteam 1:
AI 0
AI 1
AI 2
AI 3

If player 0 disconnects, player 1 cannot rehost their AIs because of the current rules. If player 0 reconnects, their AIs will spam errors (because of the current rules).

In another scenario:

Player 0 is the AI host of AI 0 and player 1 is the AI host of AI 1. The allyteams look like this:

AllyTeam0:
Player0
AI0

vs
Allyteam 1:
Player1
AI1

In this scenario if player 1 disconnects and player 0 pauses and waits for the other player to rejoin, then the AI can be rehosted without issues.

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

No branches or pull requests

2 participants