Thursday, October 14, 2010

Jingle and Gaming

I've being discussing too much about VoIP on Jingle and we are almost forgetting that Jingle is also very suitable for Realtime Games, that requires very low Latency.
Having Multi-Player games using Jingle doesn't mean all the commands, events and actions will be sent in XMPP Format through IQs.
Jingle can also be used to negotiate direct TCP or UDP ByteStreams which is the most suited for low latency Games like Shooting Games for instance:

<iq from='romeo@3drealms.com/borntobewild'
 id='ph37a419'
 to='juliet@dnforever.com/makemyday'
 type='set'>
    <jingle xmlns='urn:xmpp:jingle:1'
     action='session-initiate'
     initiator='romeo@3drealms.com/borntobewild'
     sid='ohhyeah'>
        <content creator='initiator' name='dukenukem'>
            <description
             xmlns='http://dukenukemonline.com'
             media='game'>
                <payload-type id='1' type='controller'/>
            </description>
            <transport
             xmlns='urn:xmpp:jingle:transports:tcp'
             pwd='asd88fgpdd777uzjYhagZg'
             ufrag='8hhy'>
                <candidate component='1'
                 foundation='2'
                 generation='0'
                 id='y3s2b30v3r'
                 ip='192.0.2.3'
                 network='1'
                 port='45664'
                 priority='1694498815'
                 protocol='tcp'
                 rel-addr='10.0.1.1'
                 rel-port='8998'
                 type='srflx'/>
            </transport>
        </content>
    </jingle>
</iq>


So if you are looking forward to build Multiplayer Games, you may consider ejabberd or Openfire a ready to use platform for such.
This is an insight post, so please fell free to send question and ideas as comments.

1 comment:

  1. Being a game developer wannabe myself, I've seen this potential ever since I realised that Jingle just sends bytestreams over a network. :) However, the concept can be taken much further...

    Today the gaming industry is more and more focusing on the social bit, every other game released you have your own contact list and buddies, unless it's released over Steam or Microsoft Live or any other of the big actors. The problem with this is that there is a huge reinvention of the wheel, and needless fragmentation of the same service.

    Something I'd like to see, therefore, is a way to invite your buddies to a game, alternatively to join their game, directly in your Jabber Client. That way you get the social bit automagicly through XMPP, plus the voice (and maybe even video?) parts. I'm interested in developing a Gajim plugin providing the invitation bit and a lib that handles the in-game specific parts, but right now I don't have the time for such a project... :/

    I do believe it would be an awesome addition though. Imagine you sit there at home and all of a sudden you get an invite for Quake, you press "Yes" and all of a sudden you're logged into a game and nailing your buddies left and right with a railgun... :)

    A few questionmarks and things to get started:

    * There should only be one MUC per game. Teamchat should be sent to specific resources (if you're part of team blue you send to muc@example.com/blue and only your teammembers sees it)
    * How to handle more than two people playing?
    * How to make things secure?
    * How to add games to the list?
    * Use pubsub/PEP to publish games you're currently in?

    There are quite a few things here to consider... But it's still an awesome idea. :)

    ReplyDelete