1
\$\begingroup\$

I would like to create a framework that would allow user to compete with his AI code against other player AI online.

The problem is that I don't know how should server simulate the fight online. If users send their AI codes to server I don't know how would I eliminate security risks without completely interpreting the AI code. Also I thought about the option that AI code would be running on client.

What's the best way? Is it by using some specific script language for AI and interpreting it by server or something else?

\$\endgroup\$
1
  • \$\begingroup\$ Never trust a user. You'll have to run everything on the server and send the results to them so that they can display it. \$\endgroup\$ – Vaillancourt Mar 3 '16 at 20:58
1
\$\begingroup\$

Running on the client is asking for cheating. Especially considering that with such games you are targeting a demographic of enthusiastic and competitive programmers. So there is no way around running it on the server.

When you decide to make up your own scripting language, that language would be highly specialized. So unless you build some serious bugs (and that risk exists in any server application) this should be save.

When you decide to use an existing scripting language (choices are endless) make sure that this language can be properly sandboxed to control what it can and can't do.

\$\endgroup\$

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.