如何开发Android WLAN多人游戏?

发布于 2024-12-13 21:12:43 字数 377 浏览 2 评论 0原文

我目前正在尝试为 Android 开发一款多人纸牌游戏。

计划:

使用java套接字通过WLAN进行通信。

游戏:

第 1 步。启动屏幕(显示的第一个画布)要求输入昵称。

步骤2.搜索/加入可用的游戏房间或创建游戏房间。

步骤 3. 玩

问题: 1. 这可能吗?创建房间的设备将作为服务器运行,任何连接的人都将作为客户端(这一切都是在 WLAN 中完成的)。

  1. 如何搜索/广播可用的游戏室?

  2. 有人可以给我指点一个好的教程吗?我发现了很多,但没有帮助。这是我第一次开发游戏。非常感谢有关任何回合制纸牌游戏的教程。

谢谢你们!

I'm currently trying to develop a multiplayer card game for Android.

Plan:

use java sockets for communication through WLAN.

The Game:

step 1.the splash screen(first canvas to display) asks for a nickname.

step 2.search/join available game room or create a game room.

step 3. play

questions :
1. Is this possible? The device who created a room will run as the server and anyone connecting will be client (this is all done in WLAN).

  1. How can I search/broadcast the available game rooms?

  2. Can anyone point me to a good tutorial? I found plenty but didn't help. This is my first time developing a game. A tutorial about any turn-based card game is very much appreciated.

thanks guys!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

余生再见 2024-12-20 21:12:43

如果您想使用 Wifi 连接,则需要考虑到该设备没有不同的 IP 地址,因此您只能进行近距离多人游戏(在同一 Wifi 网络上),但我想这不是结果你想要实现的目标。

可以创建您所描述的内容。为了拥有游戏室并拥有真正的在线多人游戏功能,您必须使用服务器,所有客户端都将与服务器进行通信并获取更新的信息。现在,这听起来很可怕,但您不需要发明轮子,您可以使用现有的游戏服务器(例如 Skiller 多人游戏 SDK)。下载地址:http://dev.skiller-games.com 令人惊讶的是,您不必下载服务器,他们会负责托管)。

既然我们已经确定连接不是问题,我可以告诉您,真正的挑战是创建一个有吸引力的多人游戏逻辑。尝试让你的游戏快速(这样用户就不必等待很长一段时间才能看到彼此的动作)并始终引起用户的兴趣(当打开新游戏并等待其他用户加入时,用户可以与计算机一起玩) ?)

希望我有帮助。

If you want to use the Wifi connectivity you need to take into consideration the fact that the device does not have a distinct IP address so you could only make close proximity multiplayer (on the same Wifi network), but i guess that is not the result you want to achieve.

It is possible to create what you have described. In order to have game rooms and have a real online multiplayer capabilities, you would have to use server, which all clients would communicate with and get the updated information. Now, that sounds scary but you do not need to invent the wheel and you can use an existing game sever (ex. Skiller multiplayer SDK. download from: http://dev.skiller-games.com and surprisingly, you do not have to download the server, they take care of the hosting).

Now that we have established that the connectivity in not a problem, i can tell you that the real challenge is to create an appealing a multiplayer game logic. Try to make your game quick (so users wouldn't have to wait long periods of time for each others moves) and always interest the user (when opening a new game and waiting for another user to join, the user can play with the computer?)

Hope i helped.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文