Multiplayer: Changing a player to AI

General feedback and discussion of the game.

Moderator: Forum Moderators

Post Reply
jdmp
Posts: 6
Joined: August 14th, 2012, 12:44 pm

Multiplayer: Changing a player to AI

Post by jdmp »

I host multiplayer games a lot, but I can't work out how to switch a player to AI without reloading the game. If a player quits, surrenders or just wants to leave the game, I don't receive a message with the option of switching the player's faction to AI, so need to reload the game and we all need to log in again.

Is there a solution to this?
User avatar
Toranks
Translator
Posts: 168
Joined: October 21st, 2022, 8:59 pm
Location: Sevilla
Contact:

Re: Multiplayer: Changing a player to AI

Post by Toranks »

With Advanced wesnoth wars (fork) it can be done, in the tools section.
Otherwise, you have to code it in the scenario itself. Although I thought that if a player quit, they automatically change to the AI...
User avatar
octalot
General Code Maintainer
Posts: 786
Joined: July 17th, 2010, 7:40 pm
Location: Austria

Re: Multiplayer: Changing a player to AI

Post by octalot »

It can be done (by the host or by the player currently controlling that side) with the :droid command. It takes two optional arguments:
  • the side number
  • on, off or full, where on = enable but retain vision, full = as if it’s controlled by another player.
dwarftough
Posts: 484
Joined: August 4th, 2019, 5:27 pm

Re: Multiplayer: Changing a player to AI

Post by dwarftough »

You should first assume control over the side in question. Let's say it's side 5, then type control 5 jdmp. Then you can droid it with the command droid 5. To type commands, press ":" or you use this menu button
xdgdxgd.png
xdgdxgd.png (61.95 KiB) Viewed 3731 times
Btw, I actually notice that your games are sometimes in the lobby for several days. I wonder if it's connected with that you don't receive a message about someone of yours leaving
Co-founder and current maintainer of IsarFoundation, Afterlife Rated and overall Wesnoth Autohost Project
Developer and maintainer of my fork of World Conquest, Invincibles Conquest II
dwarftough
Posts: 484
Joined: August 4th, 2019, 5:27 pm

Re: Multiplayer: Changing a player to AI

Post by dwarftough »

octalot wrote: July 20th, 2023, 2:15 pm It can be done (by the host or by the player currently controlling that side) with the :droid command. It takes two optional arguments:
  • the side number
  • on, off or full, where on = enable but retain vision, full = as if it’s controlled by another player.
In his situation, I believe, when another player leave, the server doesn't see it and still assumes that player is there, so he couldn't just droid because he'll receive "Can't droid networked side" error
Co-founder and current maintainer of IsarFoundation, Afterlife Rated and overall Wesnoth Autohost Project
Developer and maintainer of my fork of World Conquest, Invincibles Conquest II
User avatar
Pentarctagon
Project Manager
Posts: 5567
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: Multiplayer: Changing a player to AI

Post by Pentarctagon »

There should be a notification about players leaving, so it's strange that's not happening. The host should be able to take over the side and then droid it though.
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
dwarftough
Posts: 484
Joined: August 4th, 2019, 5:27 pm

Re: Multiplayer: Changing a player to AI

Post by dwarftough »

Pentarctagon wrote: July 20th, 2023, 7:09 pm There should be a notification about players leaving, so it's strange that's not happening. The host should be able to take over the side and then droid it though.
I notice that often the first few games in the lobby are there for days or even weeks, and usually it happens with the same people. Like, jdmp's game (topic starter's) often holds for several days. Right now in the 1.16 lobby the top game is "Afterlife 71735" with ronnybee in it. It's not reloaded (if you observe, it goes from the start). And you may ask the bot, it says the game started on July, 5, so it's on for almost 16 days. In the past I remember there were other people whose games were regularly stuck for days, just they are not there right now

I think sometimes (or likely with some players) the server just doesn't recognize that the connection is closed or failed and waits for eternity considering the player still online.

Ofc it's possible that some guys just forget to close Wesnoth and it runs 24/7 for several weeks keeping them online. But I doubt it's the case of many
Co-founder and current maintainer of IsarFoundation, Afterlife Rated and overall Wesnoth Autohost Project
Developer and maintainer of my fork of World Conquest, Invincibles Conquest II
jdmp
Posts: 6
Joined: August 14th, 2012, 12:44 pm

Re: Multiplayer: Changing a player to AI

Post by jdmp »

Thank you very much for all the helpful replies. I hadn't realised that if I take control of a player I can then switch the player to AI. That will make things much easier.

The main reason our games last a long time is that we use large maps and all the other players have long work days (I'm retired so have a more flexible schedule) and we can sometimes only take one or two turns a day. Computers also occasionally disconnect and we all need to log in again. Being able to replace a player with AI will significantly reduce the disconnects. Your suggestions have solved the problem. Thank you.
User avatar
Pentarctagon
Project Manager
Posts: 5567
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: Multiplayer: Changing a player to AI

Post by Pentarctagon »

dwarftough wrote: July 20th, 2023, 10:05 pm
Pentarctagon wrote: July 20th, 2023, 7:09 pm There should be a notification about players leaving, so it's strange that's not happening. The host should be able to take over the side and then droid it though.
I notice that often the first few games in the lobby are there for days or even weeks, and usually it happens with the same people. Like, jdmp's game (topic starter's) often holds for several days. Right now in the 1.16 lobby the top game is "Afterlife 71735" with ronnybee in it. It's not reloaded (if you observe, it goes from the start). And you may ask the bot, it says the game started on July, 5, so it's on for almost 16 days. In the past I remember there were other people whose games were regularly stuck for days, just they are not there right now

I think sometimes (or likely with some players) the server just doesn't recognize that the connection is closed or failed and waits for eternity considering the player still online.

Ofc it's possible that some guys just forget to close Wesnoth and it runs 24/7 for several weeks keeping them online. But I doubt it's the case of many
Well, loonycyborg looked and apparently ronnybee's client is still sending keepalive messages every 10 seconds, so apparently he has actually left his game running for 15 days :shock:
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
dwarftough
Posts: 484
Joined: August 4th, 2019, 5:27 pm

Re: Multiplayer: Changing a player to AI

Post by dwarftough »

Well, looks like I've underestimated the chance of this scenario :lol:
Co-founder and current maintainer of IsarFoundation, Afterlife Rated and overall Wesnoth Autohost Project
Developer and maintainer of my fork of World Conquest, Invincibles Conquest II
wasedtum
Posts: 1
Joined: October 6th, 2023, 12:20 pm

Re: Multiplayer: Changing a player to AI

Post by wasedtum »

I wonder if it's connected with that you don't receive a message about someone of yours leaving download apk

teatv
Post Reply