Discussion:
AI controlled interactive robot
mbesney
2012-02-20 23:25:57 UTC
Permalink
Hello,
I am conducting research on the possible integration of an artificial intelligence tool (i.e. jACT-R) with Robocode. The idea is to have the AI tool control an interactive robot and analyze the battle snapshots at the end of each turn in order to decide what to do next. Unfortunately, Flemming indicated (message #1374 from 2008) that it is not possible to control an interactive robot programmatically from an external application. What a game stopper for the project. Can anybody suggest a solution by which this may be possible? Any help would be much appreciated.
Thank you.




------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/Robocode/

<*> Your email settings:
Individual Email | Traditional

<*> To change settings online go to:
http://groups.yahoo.com/group/Robocode/join
(Yahoo! ID required)

<*> To change settings via email:
Robocode-***@yahoogroups.com
Robocode-***@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
Robocode-***@yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
flemmingnlarsen
2012-02-21 22:18:44 UTC
Permalink
Have you tried out the robocode.control.RobocodeEngine, which is able to control Robocode, and let you select the robot that should participate in the battle?

You can read more about the RobocodeEngine here, which also provide a brief example of how it could be used:

http://robocode.sourceforge.net/docs/robocode/robocode/control/package-summary.html
(read the Example section)

I guess you need to keep the battlefield visible by "engine.setVisible(true)", and then let the event handlers keep track of what is happening in the game etc.

Lots of other AI training and also the RoboRumble client uses the RobocodeEngine.

I hope this helps?

Cheers,
- Flemming
Post by mbesney
Hello,
I am conducting research on the possible integration of an artificial intelligence tool (i.e. jACT-R) with Robocode. The idea is to have the AI tool control an interactive robot and analyze the battle snapshots at the end of each turn in order to decide what to do next. Unfortunately, Flemming indicated (message #1374 from 2008) that it is not possible to control an interactive robot programmatically from an external application. What a game stopper for the project. Can anybody suggest a solution by which this may be possible? Any help would be much appreciated.
Thank you.
------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/Robocode/

<*> Your email settings:
Individual Email | Traditional

<*> To change settings online go to:
http://groups.yahoo.com/group/Robocode/join
(Yahoo! ID required)

<*> To change settings via email:
Robocode-***@yahoogroups.com
Robocode-***@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
Robocode-***@yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
Pavel Šavara
2012-02-21 22:31:17 UTC
Permalink
Hi,

to control robot from outside of the engine is probably possible if you
disable security and use control API.
On the other hand it, we made the robot environment isolated from outside
for reason.
The reason s, that by looking at snapshot data on control API you are
gaining more information than robot inside the environment. (for example
location of bullets) which is of course cheating to the game rules.
That's why the robots are in sandbox, to enforce same rules for everyone.

Pavel
Mauricio Noda
2012-02-23 19:55:10 UTC
Permalink
One reason for the bots code running sandboxed is to stop hacker strategies (cheating).

Another reason is the safety/security of the users, so you can download JARs from people all around the world and use them on your machine without having to examine the bytecode first.

But as long as they run their own code only on the engine there is no problem in disabling the sandbox. Only the bot wonŽt be allowed in RoboRumble for the same reasons above.

MN
To: ***@yahoogroups.com
From: ***@gmail.com
Date: Tue, 21 Feb 2012 14:31:17 -0800
Subject: [Robocode] Re: AI controlled interactive robot




























Hi,
to control robot from outside of the engine is probably possible if you disable security and use control API.On the other hand it, we made the robot environment isolated from outside for reason.
The reason s, that by looking at snapshot data on control API you are gaining more information than robot inside the environment. (for example location of bullets) which is of course cheating to the game rules.
That's why the robots are in sandbox, to enforce same rules for everyone.
Pavel
mbesney
2012-02-29 01:46:46 UTC
Permalink
Thanks Mauricio and Pavel for the interesting discussion and
suggestions.

Regards,

Mike
Post by Mauricio Noda
One reason for the bots code running sandboxed is to stop hacker strategies (cheating).
Another reason is the safety/security of the users, so you can
download JARs from people all around the world and use them on your
machine without having to examine the bytecode first.
Post by Mauricio Noda
But as long as they run their own code only on the engine there is no
problem in disabling the sandbox. Only the bot won´t be allowed in
RoboRumble for the same reasons above.
Post by Mauricio Noda
MN
Date: Tue, 21 Feb 2012 14:31:17 -0800
Subject: [Robocode] Re: AI controlled interactive robot
Hi,
to control robot from outside of the engine is probably possible if
you disable security and use control API.On the other hand it, we made
the robot environment isolated from outside for reason.
Post by Mauricio Noda
The reason s, that by looking at snapshot data on control API you are
gaining more information than robot inside the environment. (for example
location of bullets) which is of course cheating to the game rules.
Post by Mauricio Noda
That's why the robots are in sandbox, to enforce same rules for everyone.
Pavel
------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/Robocode/

<*> Your email settings:
Individual Email | Traditional

<*> To change settings online go to:
http://groups.yahoo.com/group/Robocode/join
(Yahoo! ID required)

<*> To change settings via email:
Robocode-***@yahoogroups.com
Robocode-***@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
Robocode-***@yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/

Mauricio Noda
2012-02-23 19:41:51 UTC
Permalink
One way I see is to disable the security manager (already posted here) and then create an adapter which redirect robocode events to your external tool:

public class jACT-RAdapter extends AdvancedRobot {

public void run() {
while (true) {
//pass getter data (battle state) to AI tool
//call AI tool methods (maybe using TCP/IP?)
//pass AI tool data to robocode setter methods
execute();
}
}

public void onScannedRobotEvent(ScannedRobotEvent e) {
//pass getter data to AI tool
//call AI tool methods
//pass AI tool data to robocode setter methods
}

//same idea for all events
}


Using some OS API to integrate the robocode GUI with the external tool through the interactive bot is teoretically possible, but the information will go one way only (AI tool -> OS tool -> robocode engine). Extracting battle state from the engine to the AI tool will be tricky this way.


MN

To: ***@yahoogroups.com
From: ***@nait.ca
Date: Mon, 20 Feb 2012 23:25:57 +0000
Subject: [Robocode] AI controlled interactive robot




























Hello,

I am conducting research on the possible integration of an artificial intelligence tool (i.e. jACT-R) with Robocode. The idea is to have the AI tool control an interactive robot and analyze the battle snapshots at the end of each turn in order to decide what to do next. Unfortunately, Flemming indicated (message #1374 from 2008) that it is not possible to control an interactive robot programmatically from an external application. What a game stopper for the project. Can anybody suggest a solution by which this may be possible? Any help would be much appreciated.

Thank you.
Continue reading on narkive:
Loading...