Standard chat protocol for AIs?

Get some help with creating maps or modding.
Need a map editor or other tools, look here!
User avatar
NoQ
Special
Special
Posts: 6225
Joined: 24 Dec 2009, 11:35
Location: /var/zone

Standard chat protocol for AIs?

Post by NoQ » 01 Dec 2012, 17:20

We will now hopefully have many AIs with chat capabilities, so probably it's a good idea to make a single standard of how should they interact with each other via chat messages.

For instance, i've just made NullBot aware that Nexus AI reacts on "help me!!" private message with a beacon. It also says something longer, like "Could use some help here!", when talking to humans. If there is another AI around, NullBot should learn his language as well to properly interact. Even though it's possible to figure out what AI we're talking to (via playerData array lookup), it would be easier if all AIs obeyed a certain single protocol, and i'm proposing to somehow define one in this thread.

While not yet having anything in particular in my mind, i could say that probably we, first of all, need a way to distinguish between universally accepted commands and commands that make sense only for a specific AI. For example, commands like "!help", "!go", etc., could be forced upon all AIs, while commands like "!nb res machineguns", "!nb who", etc., could be made nullbot-specific.

User avatar
Andrie
Regular
Regular
Posts: 533
Joined: 20 Jun 2012, 14:11
Location: Suid Afrika

Re: Standard chat protocol for AIs?

Post by Andrie » 01 Dec 2012, 18:07

Please wright a communicate language for NullBot.
"My IRC en multiplay naam is Andrie"

Groete Andrie

User avatar
Shadow Wolf TJC
Regular
Regular
Posts: 1047
Joined: 16 Apr 2011, 05:12
Location: Raleigh, NC

Re: Standard chat protocol for AIs?

Post by Shadow Wolf TJC » 01 Dec 2012, 22:21

What AIs say to human players doesn't need to be uniform or standard, but communication between AIs should probably be private, uniform, and simple indeed (though doesn't need to be comprehensible to humans). For example, while I could program ShadowBot to say "I could use some help over here!" to all of its allies, it wouldn't have any effect on how other AIs behave, and would just be flavor text. On the other hand, I could have ShadowBot send private messages to other AIs, and these messages would probably be short, generic ones such as:

- "!help": order other AIs to destroy enemy units assaulting the AI's base.
- "!attackHere": order other AIs to perform an assault maneuver on beacon location.
- "!attackTarget" + target.id: order other AIs to take out designated target id.
- "!defendHere": order other AIs to send droids to defend the area, possibly even build an outpost and/or defenses there.
- "!rallyHere": order other AIs to send droids to a location in preparation for a coordinated assault.
- "!askIfReady": ask the other AIs if they're in position to carry out the operation.
- "!waitForMe": inform other AIs that the AI needs more time before it can carry out the operation.
- "!ready": inform other AIs that it's ready to carry out the operation.
- "!needTruck": ask other AIs for a truck.
- "!needPower": ask other AIs for more power.
- "!no": tell the other AIs that it refuses to comply with the order.
...and possibly more.

Since they're private, they would not be seen by human players.

By the way, it wouldn't hurt to have a .js file that all AIs would access, that would contain a list of messages, that human players would probably say to its allies, to watch for and respond to. Since this game is played in multiple languages, such as Spanish, French, Russian, Brazilian, etc., the list would probably need to be multilingual since I believe that players using different language versions may play with eachother, alongside some AI allies.
Creator of Warzone 2100: Contingency!
Founder of Wikizone 2100: http://wikizone2100.wikia.com/wiki/Wikizone_2100

User avatar
aubergine
Professional
Professional
Posts: 3459
Joined: 10 Oct 2010, 00:58
Contact:

Re: Standard chat protocol for AIs?

Post by aubergine » 02 Dec 2012, 00:29

I like the idea of simple messages, but wonder if they will be extensible in the future? In particular, we need a reliable way to pass JS API objects around via chat, also something that's extensible for more complex things we might want to do in future. Maybe we could use JSON (provided by the JS environment used in WZ JS API) for messages?
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO

User avatar
aubergine
Professional
Professional
Posts: 3459
Joined: 10 Oct 2010, 00:58
Contact:

Re: Standard chat protocol for AIs?

Post by aubergine » 02 Dec 2012, 02:24

I think there should always be an AI id after the "!" to make coding easier. That way you always know the message is immediately after the first space, and what's before the first space is AI id.

For standard vocabulary, maybe we have "!ai" prefix?
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO

User avatar
NoQ
Special
Special
Posts: 6225
Joined: 24 Dec 2009, 11:35
Location: /var/zone

Re: Standard chat protocol for AIs?

Post by NoQ » 02 Dec 2012, 07:02

I think there should always be an AI id after the "!" to make coding easier.
This could be nice, but i feel sometimes players will get annoyed to type even one extra letter. I even feel like omitting the ! sign completely (since it's pretty hard to type on your normal keyboard). For the same reason, i'd rather not use capital letters and rather make it all case-insensitive.

P.S. This is all concerning commands that are designed to be issuable both by humans and by other AIs. If we want some commands to be only used for inter-AI communications, then, of course, they need to be as long as complicated as possible :lol2:

Originway
Trained
Trained
Posts: 412
Joined: 08 Aug 2012, 06:22

Re: Standard chat protocol for AIs?

Post by Originway » 02 Dec 2012, 08:37

how do you tell which ai to do what?

User avatar
NoQ
Special
Special
Posts: 6225
Joined: 24 Dec 2009, 11:35
Location: /var/zone

Re: Standard chat protocol for AIs?

Post by NoQ » 02 Dec 2012, 09:02

With private messages?

Code: Select all

1!get over there
2!make love not war
The AI won't react on what it doesn't hear (obvious).

User avatar
aubergine
Professional
Professional
Posts: 3459
Joined: 10 Oct 2010, 00:58
Contact:

Re: Standard chat protocol for AIs?

Post by aubergine » 02 Dec 2012, 09:53

For messages that players send, I agree it needs to be super short messages. But I think we shouldn't let that limit what AI's can send to other AIs - so maybe two formats of message, one for human interaction, one for AI-to-AI interaction?

On the AI-to-AI interaction front, where we could benefit from sending data objects with messages, I've written a quick API to help with sending messages between AIs...

https://warzone.atlassian.net/wiki/disp ... /Babel+API

Used as a black box, it helps compile/decompile enhanced chat messages that can include: message, dialect ("nb", "cb", etc), and data too :) Intelligently handles transfer of game objects via chat(), as well as all other types of JS API object and any custom JS objects, arrays, strings, numbers, booleans, etc. It lets you handle different dialects in a nice way.

Hoping to get it up to github later today once I've completed unit testing it (ie. debugged it). Oh, and it also runs on WZ 3.1 (obviously chat messages don't get sent, but means it can safely be used in current AI scripts).

BTW, is there a guide to using in-game chat anywhere? I was looking for one the other day but couldn't find anything. From what I understand starting a message with a "." will only send to allies, starting with a number will only send to specific player -- is that correct? are there others?
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO

User avatar
NoQ
Special
Special
Posts: 6225
Joined: 24 Dec 2009, 11:35
Location: /var/zone

Re: Standard chat protocol for AIs?

Post by NoQ » 02 Dec 2012, 12:19

aubergine wrote:BTW, is there a guide to using in-game chat anywhere? I was looking for one the other day but couldn't find anything. From what I understand starting a message with a "." will only send to allies, starting with a number will only send to specific player -- is that correct? are there others?
There's the @ symbol as well, i think we just discussed it. There's also client list menu with channel buttons to enable or disable specific players.

User avatar
Iluvalar
Regular
Regular
Posts: 1798
Joined: 02 Oct 2010, 18:44

Re: Standard chat protocol for AIs?

Post by Iluvalar » 02 Dec 2012, 18:52

NRS AI
-Help
-i'm ok
-ally me
-"truck ?"
-"power ?"

It also drop beacon on a group of enemies bigger than his own. Sometime asking for ally to intercept it.
Heretic 2.3 improver and proud of it.

User avatar
aubergine
Professional
Professional
Posts: 3459
Joined: 10 Oct 2010, 00:58
Contact:

Re: Standard chat protocol for AIs?

Post by aubergine » 02 Dec 2012, 21:56

"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO

User avatar
aubergine
Professional
Professional
Posts: 3459
Joined: 10 Oct 2010, 00:58
Contact:

Re: Standard chat protocol for AIs?

Post by aubergine » 04 Dec 2012, 20:44

"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO

themac
Trained
Trained
Posts: 362
Joined: 17 Jul 2009, 19:14
Location: Germany

Re: Standard chat protocol for AIs?

Post by themac » 20 Dec 2012, 14:41

I often play some sort of a robot war using the cheat mode and autogame on. When my Nexus AI calles "help me!" the allied NullBot never does. :-/

User avatar
NoQ
Special
Special
Posts: 6225
Joined: 24 Dec 2009, 11:35
Location: /var/zone

Re: Standard chat protocol for AIs?

Post by NoQ » 20 Dec 2012, 14:47

Since v2.0, on git master, it should (?)

Post Reply