简体   繁体   English

用于Web应用程序的服务器端AI

[英]server-side AI for web application

sorry if this question sounds kinda weird, but I haven't managed to get a satisfying answer yet. 抱歉,如果这个问题听起来有点怪异,但我还没有得到令人满意的答案。

The thing is, I am making( or willing to make ) a web-browser based game where people have their own company, trade, build etc.. And the game will also include bots. 问题是,我正在制作(或愿意制作)基于网络浏览器的游戏,人们在这里拥有自己的公司,贸易,公司等。该游戏还将包括机器人程序。 Because there will be quite a lot happening, it would be good for the bots to run at all times and react to various situations. 因为将会发生很多事情,所以使机器人始终运行并对各种情况做出反应将是一件好事。

But.. I don't know how to make it happen server-side. 但是..我不知道如何使其在服务器端实现。 Is there a way to make a script run on a server (like VPS)? 有没有办法让脚本在服务器(例如VPS)上运行? Or is there a way to make some kind of application that would run on the server and communicate with the database and send answers? 还是有一种方法可以使某种应用程序在服务器上运行并与数据库通信并发送答案?

Thank you :) 谢谢 :)

Of course there is a way to do this server-side - you "just" have to create a server, using any language/framework/platform that enables you to create a proper server application (this could be C++, Java, you could even stay in the JavaScript realm by using Node.js). 当然,有一种方法可以在服务器端进行操作-您只需使用任何一种语言/框架/平台来创建服务器,即可使用它来创建适当的服务器应用程序(可以是C ++,Java,甚至可以通过使用Node.js保持在JavaScript领域)。

You would have to provide some kind of communication channel between web clients and your server. 您将必须在Web客户端和服务器之间提供某种通信渠道。 For that, you could use either Websockets (TCP) or WebRTC (UDP), simple AJAX could be an option too, but I wouldn't recommend it for persistent communication channel. 为此,您可以使用Websockets(TCP)或WebRTC(UDP),也可以选择简单的AJAX,但我不建议将其用于持久性通信通道。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM