This is a followup to this question. To sum: I'm implementing an AI contest site, where each user may submit several AI implementations for different games. Think about Google AI Challenge but instead of just having a big event once a year, I would like it more on a league fashion, with all virtual players playing with each other every some close period of time.

I want to support as many programming languages as possible. I've seen that contest sites (like codeforces) ask you to submit a source code and interact through stdin and stdout. The first question is: what is the best way of supporting multiple languages?

As I see it, I can either ask people to upload some binary/script, and interact either through stdin/stdout, or sockets, or the file system; or ask people to submit source code, and wrap it with whatever is necessary for the interaction. I would like to skip the need to compile the code by myself (in the server, I mean), but I am willing to do it if its the "best" choice. I need to comunicate virtual players with each other, or even better, with some intermediary arbiter.

The second question is regarding security. If I'm going to be running user code in my server, I want to ensure strict security conditions, like no file system access, no networking, etc. Otherwise it would be a safe heaven for hackers.

I will be implementing the engine/arbiter in .NET. I would like to support at least C#, C++, Java and Python for the user's implementations. I'm willing to write interfaces for each of these languages to simplify the user interaction with the system.

Thanks in advance.

  • \$\begingroup\$ I've only glanced at your question but hopefully this project I used to work on may help github.com/siggame/Megaminer-7 \$\endgroup\$ – Alex Shepard Nov 6 '12 at 23:06
  • 2
    \$\begingroup\$ would expose a list of commands with parameter etc. for each action a client can perform. Then, a client AI just need to send a socket containing this command and do the traitement on the server side. This way, AI can be wrote using any language that supports sockets. This is pretty safe since AI only send commands, it reduce the possibilities of cheating, all the traitements are made on the server side \$\endgroup\$ – nathan Nov 7 '12 at 11:41
  • \$\begingroup\$ Also is there a reason why you want to execute user code on the server and do not use a standard client-server approach where AI would be the clients sending commands to your server that would update the game area? \$\endgroup\$ – nathan Nov 7 '12 at 11:56
  • \$\begingroup\$ @nathan As I want to run competitions continuously, I don't want to require that users stay connected all day. I want they to upload their AIs and then let them play, and just check every once in a while their agents status. So yes, I prefer to run the code by myself, although the client-server approach is very interesting. Thanks for the reply. \$\endgroup\$ – Alejandro Piad Nov 7 '12 at 13:02
  • \$\begingroup\$ @AlejandroPiad ho ok, i did not get the fact that you wanted to do continuous competition with uploaded AI's. I though of more a kind of ladder where you can tune your AI and then use a kind of matchmaking to find opponents and then after each battle you could think, ho yes my AI lack of this, i should improve this etc. made the improvements and then fight again :) \$\endgroup\$ – nathan Nov 7 '12 at 13:09

I think the socket approach is the most flexible. I suggest you have a close look at the arimaa bot interface. It seems to me those guys faced roughly the same problem you have.

  • \$\begingroup\$ Indeed, but I was looking around the website and didn't found the technical explanation of the programming interface, and other details. Do you have any idea where I can find this information? \$\endgroup\$ – Alejandro Piad Nov 11 '12 at 3:09
  • 1
    \$\begingroup\$ Seems to be all exposed in python source: arimaa.janzert.com/aei \$\endgroup\$ – Willem Dec 11 '12 at 15:26
  • \$\begingroup\$ In the end I'll be going with the client-server approach, using some text protocol (perhaps HTTP with data formatted in JSON), and drop the requirement of continuous competition. Thanks everyone for guiding me towards this idea. \$\endgroup\$ – Alejandro Piad Dec 20 '12 at 18:18

There is simple and free tool that helps creating satellite assemblies to compiled applications.



Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.