Sending messages to another bot

AI discussion, ideas, and SDK help.
Post Reply
User avatar
SunTzu
Lux Cartographer
Posts: 1586
Joined: Sat Jan 14, 2006 1:48 am
Location: Maryland

Sending messages to another bot

Post by SunTzu » Wed Sep 19, 2007 12:02 pm

Is it possible for one bot to send a message to another bot via the message(String message, Object data) method in the LuxAgent interface?

Obviously we wouldn't want bots to be able to send offical Lux messages like attackNotice, youLose or chat, but could bots send other generic messages? It would then be up to the other bot on how to act on those messages.

User avatar
dustin
Lux Creator
Lux Creator
Posts: 10930
Joined: Thu May 15, 2003 2:01 am
Location: Cascadia
Contact:

Post by dustin » Wed Sep 19, 2007 1:59 pm

I would advise you to use the chat methods to send messages between bots.

User avatar
SunTzu
Lux Cartographer
Posts: 1586
Joined: Sat Jan 14, 2006 1:48 am
Location: Maryland

Post by SunTzu » Wed Sep 19, 2007 2:15 pm

But then you couldn't send data, such as a list of countries they should target...

User avatar
dustin
Lux Creator
Lux Creator
Posts: 10930
Joined: Thu May 15, 2003 2:01 am
Location: Cascadia
Contact:

Post by dustin » Wed Sep 19, 2007 2:55 pm

Couldn't you?

CleverAI: target-codes 3,14,20,33

User avatar
SunTzu
Lux Cartographer
Posts: 1586
Joined: Sat Jan 14, 2006 1:48 am
Location: Maryland

Post by SunTzu » Wed Sep 19, 2007 3:00 pm

Are bots able to read the chat if the game isn't checked "Allow other players to join?"

Also, the chat might get very busy & annoying...

User avatar
dustin
Lux Creator
Lux Creator
Posts: 10930
Joined: Thu May 15, 2003 2:01 am
Location: Cascadia
Contact:

Post by dustin » Wed Sep 19, 2007 11:37 pm

SunTzu wrote:Are bots able to read the chat if the game isn't checked "Allow other players to join?"
No, they don't (I am pretty sure).

You could use the message() method if you can get a reference to the bot you want to send a message to, but Lux gives you no way of getting that.

User avatar
Scad
Lux Elder
Posts: 2521
Joined: Sun Aug 13, 2006 6:53 am
Location: Walking through the woods on a snowy evening
Contact:

Post by Scad » Thu Sep 20, 2007 12:14 am

dustin wrote:(I am pretty sure).
With absolutely no offense intended, I love it when programmers say things like this about their programs. It suggests a level of complexity at which the program is no longer reacting to our desires, but rather we to it...

User avatar
Sylocat
Lux Veteran
Posts: 1404
Joined: Mon Sep 11, 2006 2:59 pm
Location: Wisconsin
Contact:

Post by Sylocat » Thu Sep 20, 2007 12:52 am

It's creepy, isn't it? :shock:

Remember that Dilbert cartoon where Dogbert said "every living thing is made up of simpler, less complex life forms, therefore a supreme being must be our future rather than our origin. What if 'God' is the consciousness that will be created when enough of us are connected by the internet?"

User avatar
Kef
Lux Translator
Posts: 4471
Joined: Tue Feb 24, 2004 11:23 am
Location: in j0r f0rumz, Tr0||in j0r t0pixzz
Contact:

Post by Kef » Thu Sep 20, 2007 4:40 am

Then 90% of God would be a retard, just look at myspace and youtube to see what I mean

User avatar
SunTzu
Lux Cartographer
Posts: 1586
Joined: Sat Jan 14, 2006 1:48 am
Location: Maryland

Post by SunTzu » Thu Sep 20, 2007 8:56 am

dustin wrote:
SunTzu wrote:Are bots able to read the chat if the game isn't checked "Allow other players to join?"
No, they don't (I am pretty sure).
I just checked, and bots can't read chat messages if the "Allow other players to join" isn't selected.

dustin wrote:You could use the message() method if you can get a reference to the bot you want to send a message to, but Lux gives you no way of getting that.
Would it be too much of a security issue if you provided a way for bots to get the references to other bots?

User avatar
GregM
Luxer
Posts: 252
Joined: Wed Jun 01, 2005 4:33 pm

Post by GregM » Thu Sep 20, 2007 10:52 am

If all the bots in question are of the same class, you can just use static variables.

You could declare a global variable like:

class MyBot {
static Vector<Country> teamTargets;
...
}


and then each instance of MyBot has access to the same teamTargets variable.

User avatar
SunTzu
Lux Cartographer
Posts: 1586
Joined: Sat Jan 14, 2006 1:48 am
Location: Maryland

Post by SunTzu » Thu Sep 20, 2007 12:57 pm

Thanks for the tip Greg, but the variables I want to pass will be for different bots.

I'm working on creating a bot that can read advanced starting scenarios and then pass specific data (alliances, target countries, etc.) to another bot.

User avatar
Bertrand
Reaper Creator
Posts: 568
Joined: Mon Nov 28, 2005 4:35 pm
Location: Montreal

Post by Bertrand » Thu Sep 20, 2007 1:43 pm

You could create a new class that only contains static variables. This new class would have to be instantiated by the different AI. Each AI would then have access to the same static variables.

The only potential problem with this is what will happen if many games are running simultaneously? Will all the AI from the different games share the same static variables?

Hmmmm, thinking about this, maybe Reaper has this problem: he does use static variables to handle teaming. When Dustin runs many games at the same time on his server, if all the Reapers share the same variables then that could lead to chaos...

User avatar
dustin
Lux Creator
Lux Creator
Posts: 10930
Joined: Thu May 15, 2003 2:01 am
Location: Cascadia
Contact:

Post by dustin » Thu Sep 20, 2007 7:45 pm

I run multiple instances of Lux, so I think they all have their own static variables in this case.

User avatar
Enokrad
Dark Spawn
Posts: 3367
Joined: Thu Aug 23, 2007 4:16 am
Location: New York
Contact:

Post by Enokrad » Tue Oct 02, 2007 11:33 am

Sylocat wrote:It's creepy, isn't it? :shock:

Remember that Dilbert cartoon where Dogbert said "every living thing is made up of simpler, less complex life forms, therefore a supreme being must be our future rather than our origin. What if 'God' is the consciousness that will be created when enough of us are connected by the internet?"
Kef wrote:Then 90% of God would be a retard, just look at myspace and youtube to see what I mean

:arrow: LOL :D

User avatar
Sir Holo
Old Skool Lurker
Posts: 333
Joined: Wed Jul 28, 2004 9:54 am
Location: USA
Contact:

Post by Sir Holo » Thu Nov 01, 2007 10:24 pm

SunTzu wrote:Also, the chat might get very busy & annoying...
That doesn't happen already with humans?

User avatar
dustin
Lux Creator
Lux Creator
Posts: 10930
Joined: Thu May 15, 2003 2:01 am
Location: Cascadia
Contact:

Post by dustin » Fri Nov 21, 2008 8:42 pm

You could send messages between bots by writing/reading from a file on the filesystem (code example here).

Post Reply