Tigase:MUG 尚未实施,下一步是什么?
我正在开始为 iPhone/iPad 开发一款多人游戏,我正在考虑使用 Tigase 作为游戏服务器的 XMMP 服务器。然而,Tigase 似乎尚未实现 MUG XEP。无论如何,对于我想要实现的简单任务来说,MUG 太复杂了。
游戏基本流程如下:
- 每场比赛最多可有 4 名玩家。
- 每个玩家都可以在任何时刻执行一个动作,唯一的游戏规则是向比赛中的每个玩家转发一个数据包,告知用户所做的动作以及是否是一个好动作。
这是我想要实现它的方式:
- 重用MUC组件来模拟多人游戏房间。
- 每个房间都会有一个 Bot 成员:所有数据包将直接发送给该 BOT:BOT 将检查动作(这将是基本消息包)的有效性,并将适当的消息发送给房间中的所有玩家。
我认为这可能有效。如果您认为这是一个可行的解决方案:
- What is the best way to write the BOT。我应该为每个房间配备一个 BOT 吗?我如何检测何时创建新房间以便我可以创建 BOT?
I'm starting the development of a multiplayer game for iPhone/iPad and i was thinking of using Tigase as XMMP server for the game server. However it seems like Tigase not yet implement MUG XEP. Anyway MUG is too complex for the simple task i'm trying to achieve so.
Here is the game basic:
- Each Match may have up to 4 players.
- Each player may perform at any moment a move and the only game rule is to forward a packet to each player in the match that tell the move the user mades and weither or not is is a good move or not.
Here is the way i want to implement it:
- Reuse the MUC component to simulate the Multi-player room.
- Each room will have a Bot member: all packet will me addressed to that BOT directly: the BOT will check the moves (which will be basic message packets) for validity and sent the appropriate message to all Player in the room.
I think this may work. If you think this is a viable solution:
- What is the best way to write the BOT. Should i have one BOT per room? how can i detect when a new room is created so i can create the BOT?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
显然,最简单的方法是为 MUC 组件构建一个插件。 MUC 和 MUG 组件非常相似,因此它们提供了多人游戏所需的大部分机制。
Apparently, the most simple way to do this is to build a plug-in to the MUC component. The MUC and MUG components are very similar so it provide most of the mecanism a multiplayer game needs.