I've been threatening this for weeks, and am finally getting off my
lazy butt to do something about it. Time to talk about the combat
API. There are now multiple third party products that integrate with
iplaye to load character and even campaign data. They're stunningly
cool - but we can do better.
The basic idea is for iplay4e to be the master source for
character-related combat data, with an arbitrary number of other
products able to simultaneously read from and write to that data in
real-time. I should be able to run a combat using inCombat while
displaying a map using Masterplan, while one of my players is viewing
their character on iplay4e with their iPhone, another is seeing their
sheet embedded on Epic Words, and another is using Google Wave to view
all the characters in the campaign. Furthermore, when a change is
made to a character using any of those mechanisms, it should be
visible in all the products without undue delay.
To pull this off, we'll need a set of APIs, some of which already
exist and are documented, some of which need docs, and some of which
remain to be specified.
These already exist, complete with docs on the main group page:
- Authentication API enabling products to retain iplay4e sessions
using Google Account credentials.
- Search API enabling the listing of campaigns and characters for a
user, the listing of the characters in a campaign, and ad-hoc queries.
These also exist currently but lack documentation (volunteers? ;-):
- Data API describing how to consume character and campaign XML. This
is for static values like max HP, defenses, and so forth. The docs
are currently in the XML itself; I would love for it to move to the
group for consolidation and data size reasons.
- Initialization API describing how to retrieve and consume starting
character state such as current hit points and conditions. Not
documented, but reverse-engineerable because iplay4e itself uses it.
- Update API enabling products to push changes made to characters.
Also reverse engineerable.
Finally, this API is missing:
- Polling API enabling efficient retrieval of state updates for
multiple characters simultaneously.
Before we dive into the specifics of any individual API, I'd like to
nail down this high level list. Am I missing anything?
Cheers,
Andrew
--
To unsubscribe, reply using "remove me" as the subject.
When you go to implement your polling, consider checking out Tornado
(http://www.tornadoweb.org/) for the heavy lifting. You can create a
web server in python in like 5 lines code, but more to point its
designed to handle thousands of incoming connects. SceneGrinder uses
long polling (I know... yuck) but we're ready for html5 websockets
when that matures a tad more. We discovered apache just couldn't
handle it. I don't know how google app engine fairs, though.
Basically, a url gets called to the message server. if there are
messages available, it returns them immediately... they get
processed... and then it goes back and asks again. If there are no
messages pending, the web server just holds on to the connection. We
have it time out in 30 seconds which causes the web client to just try
again. As soon as a message is available, it releases... the web
client processes... and then it tries again.
Long polling is usually a BAD idea... it'll bring a normal web server
to its knees, but Tornado was designed to handle it. I know Google
Wave uses long polling, too, in some cases, so maybe app engine covers
it already.
Jerry
I was going to request exactly this because it's in line with exactly
what my encounter manager tool is going to do. Having iPlay4e handle
the networked bits with the players would be a huge help!
The biggest thing I am interested in which you did not mention, is for
the api to communicate dice rolls from player sheets. I don't know if
this is within the scope of what you're talking about, but that's
definitely my #1 desire.
Thanks,
Greg
Cheers,
Andrew