gpt4 book ai didi

html - 如何将谷歌云服务用于 HTML5 游戏?

转载 作者:太空狗 更新时间:2023-10-29 16:07:33 25 4
gpt4 key购买 nike

我正在开发一款 HTML5 多人游戏。谷歌最近一直在做一些这样的事情,但没有发布任何关于他们是如何制作它们的信息。

  • 我希望客户端和服务器之间的连接是套接字;不是旧的长轮询 hack。

  • 存储应该是 nosql/google datastore。

  • 框架应该是Python或者JS。

现在,我不能将 websockets 与 Google App Engine 一起使用,这意味着我必须使用 Google Compute Engine (GCE)。我应该在 Compute Engine 上运行多少服务; 100% 或仅套接字和 AppEngine 后端的其余部分。这似乎是个好方法,但 GCE 在欧洲,而 App Engine 尚不支持此位置,这意味着 GCE 必须在大西洋上来回对话。

另一方面,我可以在 GCE 上开发整个解决方案,但我应该使用什么存储和开发人员库?我可以使用新的谷歌云数据存储,但如果我理解正确的话,它就像一个用于与数据存储对话的低级 API。我喜欢 ndb 在模型方面的高水平并负责缓存。至于解决方案,我应该使用 nodejs、django 还是其他什么?

最佳答案

在 App Engine 上运行您的 Web 前端,同时在 Compute Engine 上管理 websocket 连接,这与 Google 为最近的 Chrome web 实验所做的类似(请参阅此 blog post 的结尾)

Check out the amazing World Wide Maze Chrome Experiment, developed by the Chrome team in Japan. This game converts any web site of your choice into an interactive, three dimensional maze, navigated remotely via your smartphone. Compute Engine virtual machines run Node.js to manage the game state and synchronization with the mobile device, while Google App Engine hosts the game’s web UI. This application provides an excellent example of the new kinds of rich, high performance back end services enabled by Google Cloud Platform.

填写以下 form 后,您还应该能够在欧洲创建 App Engine 应用程序或注册 premier account .

Google Cloud Datastore允许您在 App Engine(如果您使用 Python,则使用 NDB)和 Compute Engine(使用低级 API)之间共享数据。

可以关注this issue关于 NDB 对 Google Cloud Datastore 的支持。

关于html - 如何将谷歌云服务用于 HTML5 游戏?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16813109/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com