agentx Posted May 27, 2014 Report Share Posted May 27, 2014 There seems to be no way to let bots communicate with each other like the way humans do by team chat. Actually in a 2v2 game, humans v. bots, humans can exchange info and tactics, bots can't - so chatting is cheating.Imagine sending "attack in 20 sec" to your bot ally to launch a synced attack. Or "need 2000 metal" to force a tribute. Mixed teams would add a new level to the game.Is it a big problem to put two way chat on the API? Sending is already there. Just listening is missing. Quote Link to comment Share on other sites More sharing options...
RoekeloosNL Posted May 27, 2014 Report Share Posted May 27, 2014 you mean give your allied bot commands i must say that can work. Quote Link to comment Share on other sites More sharing options...
niektb Posted May 27, 2014 Report Share Posted May 27, 2014 I think even more: that two allied bots coƶperate with eachother through communication. Sounds cool. Quote Link to comment Share on other sites More sharing options...
sanderd17 Posted May 27, 2014 Report Share Posted May 27, 2014 The API is only an experiment that grew by accident. So you can let it grow more. Normally, the first AI programmer to want a feature is the one who adds it to the API. But do watch out for localisation. An AI can chat to the player in his local language. So the AI should somehow be able to accept local messages back, without causing problems when multiple people in a game have a different language. Quote Link to comment Share on other sites More sharing options...
Lion.Kanzen Posted May 27, 2014 Report Share Posted May 27, 2014 Do it man can be funny. In many rts thesis ally or enemy try to menace or intimidate enemies or simple ask for help. Quote Link to comment Share on other sites More sharing options...
thamlett Posted May 28, 2014 Report Share Posted May 28, 2014 I have often wished this could happen. It is more likely to get implemented with Petra than Aegis (the rumors are that Aegis is getting replaced by Petra). I wonder what Wraitii thinks about it? Quote Link to comment Share on other sites More sharing options...
Loki1950 Posted May 28, 2014 Report Share Posted May 28, 2014 I wonder what Wraitii thinks about it?He was the one who suggested it Enjoy the Choice Quote Link to comment Share on other sites More sharing options...
agentx Posted May 28, 2014 Author Report Share Posted May 28, 2014 Normally, the first AI programmer to want a feature is the one who adds it to the API.Are you proposing different binaries for different AIs? Quote Link to comment Share on other sites More sharing options...
sanderd17 Posted May 28, 2014 Report Share Posted May 28, 2014 The API is scripted too (for the biggest part). And if you add something, just give us a patch. If it doesn't break other code (which is unlikely when only adding a feature), it will get committed. Quote Link to comment Share on other sites More sharing options...
agentx Posted May 28, 2014 Author Report Share Posted May 28, 2014 Yes, but in this case scripting can not add bot chat as feature. The most important part of the API is written in C++.Is bot chat really more difficult than e.g. barterprices? An object with player id as key and message as value would be sufficient. Quote Link to comment Share on other sites More sharing options...
sanderd17 Posted May 29, 2014 Report Share Posted May 29, 2014 You should be able to reroute the chat from the GuiInterface to the AiInterface (in public/simulation/components), and pas the message on to the ai like that.Well go through the cpp part, but that's very liberal. It just clones objects (which is needed for future parallelism), and passes them on. Quote Link to comment Share on other sites More sharing options...
agentx Posted May 29, 2014 Author Report Share Posted May 29, 2014 Challenge accepted. I found all (human/bot) chat messages go through GuiInterface.prototype.PushNotification. What do you mean by "reroute" ?A wild guess would be:collect messages in PushNotification add a new event type e.g. "chat" in AIInterface.prototype.EventNames use AIInterface.prototype.GetNonEntityRepresentation to ask GUI for collected messagesanything more?Not clear is how to deal with network chat and recognize team chat. Quote Link to comment Share on other sites More sharing options...
sanderd17 Posted May 29, 2014 Report Share Posted May 29, 2014 You can send them from the GUIInterface to the AIInterface directly, like this:GuiInterface.prototype.PushNotification = function(notification){ this.notifications.push(notification); var cmpAIInterface = Engine.QueryInterface(SYSTEM_ENTITY, IID_AIInterface); if (cmpAIInterface) cmpAIInterface.PushEvent("Notification", notification);};Querying them from the AIInterface also works. But then you need to figure out when the messages are pushed and when they get flushed again (they disappear from that list when they get in the GUI I think).I think the notification.type should be "chat" in case of a chat. But you'll also get all other sorts of notifications (like building failed notification).I don't know much of the AI code, so I can't check if these events come through. But if you know it's working, I can commit your patch. 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.