-
nidhish
Hi, We want to create a cross platform board game app, the moves are communicated between players using Qxmpp after moves validation in local client. How feasible is this idea? And do we have to setup a xmpp server in further stages when we want to develop plugins for existing xmpp client?✎ -
nidhish
Hi, We want to create a cross platform board game app, the moves are communicated between players using Qxmpp after their validation in local client. How feasible is this idea? And do we have to setup a xmpp server in further stages when we want to develop plugins for existing xmpp client? ✏
-
moparisthebest
nidhish: it's perfectly feasible to use XMPP as your message passing layer, in fact, that's literally what it was designed for
-
moparisthebest
Not sure what you are asking about re: server or plugins, it's highly likely you won't need to do anything with the server, plain XMPP should be fine
-
nidhish
moparisthebest: ok thanks, can you point me to few code examples?✎ -
nidhish
moparisthebest: ok thanks, can you point me to few code examples involving a board game? ✏
-
nidhish
regarding 2nd question is client to client communication possible without any server in xmpp? or can I do like this: when first client starts it automtically becomes server and other clients can connect and communicate through chat system?
-
Benson
nidhish: Welcome
-
Benson
There is a jingle protocol that is used to initiate direct synchronous communication such as video calls between two clients. However, for asynchronous communication, a server is needed to store messages. The protocol is quite flexible in content that can be sent and stored, though the specification is large, and choosing appropriate and widely implemented XEPs to send game state information requires some research.
-
nidhish
is this ever done in the past, can you point me to any code base or resources?
-
Benson
An IoT example http://www.xmpp-iot.org/tutorials/python-philiphshue/ though still looking for a FOSS game example.
-
Guus
I think there's a XEP out there that describes how you can implement simple turn based games with XMPP. The Spark client implements some very basic games, like tic tac toe, but I don't think it uses that XEP.
-
Guus
There are other examples of games that use XMPP internally (like Fortnite, Quake Live, League of Legends), but I don't think there's much documentation around their implementation.
-
Guus
Although I believe that there's a paper on scalability that was written by the LoL people a few years ago.
-
Guus
I also recall that there was an (OSS?) game that had a booth next to us at FOSDEM a few years ago. I think they used XMPP only for in-game chat.
-
Guus
Don't recall the name
-
Benson
Spark client has game plugins https://github.com/igniterealtime/Spark/tree/master/plugins Thanks
-
nidhish
Benson: how about using xmpp for chats and websockets for the moves transfer (but they both need servers)?✎ -
nidhish
Benson: how about using xmpp for chats, presence and websockets for the gameplay (but they both need servers)? ✏
-
Benson
nidhish: There are already many XMPP servers deployed. Reusing them also for gameplay is helpful as some games can take a long time, so players may go offline. Deploying an extra server that is under light use is inefficient.
-
pulkomandy
The game using XMPP for chat was probably 0 A.D.
-
nidhish
Benson: I can do like this the players will send inviation over multi user chat and after inviation acceptance, the private chat terminal is establish between them where moves will be exchanged and reflected over board( server required for all this) ?✎ -
nidhish
Benson: can we do like this, the players will send inviation over multi user chat and after inviation acceptance, the private chat terminal is establish between them where moves will be exchanged and reflected over board( server required for all this) ? ✏
-
Benson
nidhish: May also be helpful - https://oneminutedistraction.wordpress.com/2013/01/29/implementing-a-multi-player-xmpp-game-part-1/ - https://sourceforge.net/p/rbxmpp-games/code/ci/master/tree/ - https://xmpp.org/extensions/inbox/tictactoe.html - https://pypi.org/project/jubatu-chess - https://pypi.org/project/jubatu
-
Benson
- https://xmpp.org/extensions/inbox/instant-gaming.html - https://www.ijcaonline.org/archives/volume178/number51/30903-2019919434/
-
nidhish
Thanks
💯 1 -
singpolyma
For a custom game the benefits of using a xep a probably low. So use it if it makes sense, but be aware you can put any XML you want in your own namespace in the message to pass whatever you need
-
nidhish
singpolyma, the game is not very complex and latency is not that critical for gameplay.
-
singpolyma
Right. So putting any XML you want in either message or iq is probably fine
-
singpolyma
(if using message with correct marker to say if you want to be in offline archives or not)
-
moparisthebest
If you want it to work even when clients temporarily go offline you'll want message that is archived :)
-
singpolyma
Right. It depends on the kind of game :) for a turn based game archived message could make sense for example
-
pulkomandy