简体   繁体   English

Vert.x Java 多人游戏

[英]Vert.x Java for multiplayer game

i want make a simple quiz game with a lobby system.我想做一个带有大厅系统的简单问答游戏。 I have some doubts about the architecture to use in my system, my idea was to use a central server to manage the lobbies and every time a lobby is created, instantiate a new LobbyVerticle, the communication between client and server was entrusted to the event Vert.x bus The game must respect scalability and distribution.我对在我的系统中使用的架构有一些疑问,我的想法是使用中央服务器来管理大厅,每次创建大厅时,实例化一个新的 LobbyVerticle,客户端和服务器之间的通信委托给事件 Vert .x 总线 游戏必须尊重可扩展性和分布。 Thanks for your suggestions.感谢您的建议。

vertx does not implement a strict actor model, therefore, you wont have actor specific features like mail boxes and persistent actors, with that said, i would opt for an approach where you have N lobby verticles instances where n=2*cpu cores,each of the verticles can handle any existing lobby, i would then share lobby state using clusterd shared-data-api (requires cluster manager like hz) if persistance is required you could write a verticle that persists data in a write-behind fashion. vertx 没有实现严格的actor model,因此,你不会有actor特定的功能,比如邮箱和持久actor,话虽如此,我会选择一种方法,你有N个大厅verticles实例,其中n = 2 * cpu核心,每个的verticles可以处理任何现有的大厅,然后我将使用集群共享数据api(需要像hz这样的集群管理器)共享大厅state,如果需要持久性,您可以编写一个以后写方式保存数据的verticle。

If you want to go for a actor oriented approach choose another tool like lightbend akka如果您想 go 用于面向演员的方法,请选择其他工具,如 lightbend akka

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

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