AI Chat Commands
Moderators: hoijui, Moderators
AI Chat Commands
Two new Skirmish AI related chat commands have been added. They are both usefull for Users and for AI devs.
aikill
Kill a Skirmish AI controlling a team.
The team itsself will remain alive,
unless a second argument is given,
which specifies an active team
that will receive all the units of the AI team.
usage: /aikill teamToKill [teamToReceiveUnits]
mantis: http://springrts.com/mantis/view.php?id=1516
commit: 601c2455ff1d2925fae516a239e628e5185708ee
aicontrol
Let a Skirmish AI take over control of a team.
usage: /aicontrol teamToControl aiShortName [aiVersion]
mantis: http://springrts.com/mantis/view.php?id=1517
commit: 5dde1d3f0a04b930041b20d36a76fd8c640b13d4
aicontrol will probably be extended, to be able to specify a display name and options for the AI.
aikill should work well already, while aicontrol is still pretty buggy. The command itsself seems to work fine, but most AIs seem to crash instantly or soon after they got initialized mid-game.
For AI devs:
aicontrol initializes the AI in the same way it it happens at game start, but after the Init event, it will additionally receive a UnitFinished event for each Unit of the team it took over control.
I tested RAI and E323AI, which both work sometimes, and sometimes crash after some events. KAIK always instantly crashed for me. So i call uppon AI devs, to work together with me to make their AIs fit for aicontrol, and help me finding errors.
aikill
Kill a Skirmish AI controlling a team.
The team itsself will remain alive,
unless a second argument is given,
which specifies an active team
that will receive all the units of the AI team.
usage: /aikill teamToKill [teamToReceiveUnits]
mantis: http://springrts.com/mantis/view.php?id=1516
commit: 601c2455ff1d2925fae516a239e628e5185708ee
aicontrol
Let a Skirmish AI take over control of a team.
usage: /aicontrol teamToControl aiShortName [aiVersion]
mantis: http://springrts.com/mantis/view.php?id=1517
commit: 5dde1d3f0a04b930041b20d36a76fd8c640b13d4
aicontrol will probably be extended, to be able to specify a display name and options for the AI.
aikill should work well already, while aicontrol is still pretty buggy. The command itsself seems to work fine, but most AIs seem to crash instantly or soon after they got initialized mid-game.
For AI devs:
aicontrol initializes the AI in the same way it it happens at game start, but after the Init event, it will additionally receive a UnitFinished event for each Unit of the team it took over control.
I tested RAI and E323AI, which both work sometimes, and sometimes crash after some events. KAIK always instantly crashed for me. So i call uppon AI devs, to work together with me to make their AIs fit for aicontrol, and help me finding errors.
Re: AI Chat Commands
/aitake was renamed to /aicontrol to prevent confusion, because it does something totally different then /take for AI -> /aitake suggests.
With help of Auswaschbar, i made the two commands synced (untested yet), so they should work for online games too.
With help of Auswaschbar, i made the two commands synced (untested yet), so they should work for online games too.
Re: AI Chat Commands
These are very useful ideas.
One issue, though. Current skirmish AIs generally think they're supposed to be involved in initialization. Can an AI be assigned to a "team" that doesn't get any Units assigned, so that it's initialized and ready to operate?
One issue, though. Current skirmish AIs generally think they're supposed to be involved in initialization. Can an AI be assigned to a "team" that doesn't get any Units assigned, so that it's initialized and ready to operate?
Re: AI Chat Commands
most spring AIs today seem to crash when initialized midgame with /aicontrol, but it might need just minor adjustments.
the problem wiht what you want ot do is not the AI, but the mod/game logic.
a team with no units is a dead team. you could give the team a useles invulnerable unit, so it stays alive.
The propper way to do what you want would be implementing a modular win condition system in spring, so mods could eg define when a team is dead or not.
the problem wiht what you want ot do is not the AI, but the mod/game logic.
a team with no units is a dead team. you could give the team a useles invulnerable unit, so it stays alive.
The propper way to do what you want would be implementing a modular win condition system in spring, so mods could eg define when a team is dead or not.
Re: AI Chat Commands
why would /aicontrol need to be synced?
shouldn't the skirmish AI only be running on one computer?
shouldn't the skirmish AI only be running on one computer?
Re: AI Chat Commands
the server and clients need to know who - or what - controls a player for gameover detection, or something like that.
Re: AI Chat Commands
Also, AI-controlled teams get special permissions to execute certain commands.
Re: AI Chat Commands
[ 347769] /aikill 4 6
[ 347769] Team to kill: player societal is not allowed to kill Skirmish AI controlling team 4 (try with /cheat)
[ 347769] ------------------------------------------------
[ 347769] Kill a Skirmish AI controlling a team.
[ 347769] The team itsself will remain alive,
[ 347769] unless a second argument is given,
[ 347769] which specifies an active team
[ 347769] that will receive all the units of the AI team.
[ 347769] usage: /aikill teamToKill [teamToReceiveUnits]
[ 347780] /cheat
[ 347780] Cheating!
[ 347780] /aikill 4 6
[ 347780] Failed to remove Skirmish AI from team 4.
[ 347780] Spectator societal tried to hack the game (spoofed TEAMMSG_GIVEAWAY)
[ 349627] /aikill 4
[ 349627] Successfully removed Skirmish AI from team 4.
As a dead team I can kill AI bots but not take over their units. I know that spoofing protection has got in the way in the past when I tried to switch from bot to bot so I could set up their commander's initial queue of build orders with the hopes of spectating the result. I know I saw a feature request from a modder that the spoofing protection be disabled with /cheat 1 for this sort of testing.
[ 347769] Team to kill: player societal is not allowed to kill Skirmish AI controlling team 4 (try with /cheat)
[ 347769] ------------------------------------------------
[ 347769] Kill a Skirmish AI controlling a team.
[ 347769] The team itsself will remain alive,
[ 347769] unless a second argument is given,
[ 347769] which specifies an active team
[ 347769] that will receive all the units of the AI team.
[ 347769] usage: /aikill teamToKill [teamToReceiveUnits]
[ 347780] /cheat
[ 347780] Cheating!
[ 347780] /aikill 4 6
[ 347780] Failed to remove Skirmish AI from team 4.
[ 347780] Spectator societal tried to hack the game (spoofed TEAMMSG_GIVEAWAY)
[ 349627] /aikill 4
[ 349627] Successfully removed Skirmish AI from team 4.
As a dead team I can kill AI bots but not take over their units. I know that spoofing protection has got in the way in the past when I tried to switch from bot to bot so I could set up their commander's initial queue of build orders with the hopes of spectating the result. I know I saw a feature request from a modder that the spoofing protection be disabled with /cheat 1 for this sort of testing.
Re: AI Chat Commands
should be fixed (in current master) with commit:
8f3af87f0eec0fbe26c390cec9bdf052f9b4bbab
8f3af87f0eec0fbe26c390cec9bdf052f9b4bbab
allways allow /team X, RESIGN and "Give Everything To" in single-player games
Re: AI Chat Commands
I have a Lua AI. I truely doubt /aicontrol will magically know it needs to relaunch a certain gadget, so how do I make that gadget aware that /aicontrol was issued?
Re: AI Chat Commands
needs an engine->widget call AIInit(someThings), and also AIDie(teamId).
Profiling possibilities
(only partly related to AI Chat Commands)
In current spring master, when playing spring with AIs, and pressing B, you can now see the total CPU time spent for Skirmish AIs, and for each Skirmish AI instance. You should only look at the time, as the percentage value is only the average over the last 0.5 seconds, and therefore totally unreliable.
The same info that can be seen when pressing B, can be printed to the chat section (and therefore appear in infoglo.txt) in textual form, when writing:
In current spring master, when playing spring with AIs, and pressing B, you can now see the total CPU time spent for Skirmish AIs, and for each Skirmish AI instance. You should only look at the time, as the percentage value is only the average over the last 0.5 seconds, and therefore totally unreliable.
The same info that can be seen when pressing B, can be printed to the chat section (and therefore appear in infoglo.txt) in textual form, when writing:
Code: Select all
/debuginfo profiling
Re: Profiling possibilities
Sweet! :)hoijui wrote:In current spring master, when playing spring with AIs, and pressing 'B', you can now see the total CPU time spent for Skirmish AIs, and for each Skirmish AI instance.
Btw. , what is the AI:PFS thing when I press 'B' ? :D
Re: AI Chat Commands
this is the engine internal Path Manager, and the "AI" in there .. i guess is meant to signal that it is a complex algorithm or so.
These functions can be called from a Skimrihs AI, but are also used by the engine itsself and are callable from Lua.
Therefore, i renamed it from AI:PFS to just PFS, to prevent confusion (smae confusion happend to me to
).
These functions can be called from a Skimrihs AI, but are also used by the engine itsself and are callable from Lua.
Therefore, i renamed it from AI:PFS to just PFS, to prevent confusion (smae confusion happend to me to
