GAE no process can run for more than a few seconds, so you'd have to use
some polling tricks on the client to ask what happened and have a chron job
run the main thread every few seconds... This would Be HUGELY expensive.
Not impossible to do... I don't have an good leads for where you'd get help
with this. GAE just isn't designed for this kind of thing, and I think we
are back where I started of You'd have to have a "Client" that was Jscript
or Flash and it would talk to the Python backend via essentially web pages
or ajax or what ever data format you like but as port 80 text/binary
content... Not a Telnet like session. And You'd have to ask for updates not
just have them pushed like the old muds would do.
I'd start a project like this writing a Chat program. You say "Hello
World" and someone else receives it. From there you could start Tracking
what room people are in, and introduce small commands... You'd basically be
programming in GQL queries of "Who is in the room" and "what messages does
user have. The amount of "Python" will be pretty small.
Hope this is help ful.
I actually *am* building something like one of these (using Java).
The biggest problem I've got is that GAE has no synchronisation
mechanisms. None. There are transactions, but as they only work on
single entities they're useless. This means that it's very hard to run
game logic that needs to synchronously touch the global database.
To work round this I've implemented my own semaphore backed by the
datastore; it's extremely nasty but does actually work. I then read the
entire game database out of a blob in a single entity into RAM, run the
game logic, write the database back again, and release the semaphore.
That is also extremely nasty but it does all actually work. (My game's
actually intended to be run on a standalone server, not GAE, but the
persistence layers are all abstracted out to let me host on GAE for
development purposes.) It'll congest rather badly but by the time
congestion becomes an issue I should have a more suitable server.
Performance isn't bad; I'm usually getting request times of about 500ms
when the server's hot. That breaks down to:
startup: anything from 10 to 5000ms
db load: 50ms
game logic: <50ms
build client update: 50ms (varies according to the size of the update)
db save: 100ms
Startup time is very strange. Sometimes it's practically nil, usually
it's 100ms or so, and if the server's not hot it something takes many
seconds (together with weird warnings about failing to start the
finalisation thread). It's all out of my control --- it happens before
the app starts.
Note that the cheapest part of the whole process is actually running the
game logic! Most of the time most requests take 0ms, as nothing will
have actually happened since the last request...
> GAE no process can run for more than a few seconds, so you'd have to use
> some polling tricks on the client to ask what happened and have a chron job
> run the main thread every few seconds...
I'm running the game logic asynchronously on-demand. After all, you only
need to change things when someone's looking! This works beautifully,
but if it's been a couple of days since the last request it can take a
while; I'm planning to use a cron job to update the server every half
hour or so to avoid this.
If you're writing a text-based game things will be both easier and
harder. Easier, in that you don't have to do all the complex database
synchronisation between the client and the server that I'm doing, and
harder, because the game logic itself will be more complex and the
client will need to poll much more frequently. (I can get away with a
poll every ten minutes or so. A MUD can't.)
--
┌─── dg@cowlark.com ───── http://www.cowlark.com ─────
│
│ "They laughed at Newton. They laughed at Einstein. Of course, they
│ also laughed at Bozo the Clown." --- Carl Sagan
I actually *am* building something like one of these (using Java).
Brandon N. Wirtz wrote:
> You could build one of these... You'd go broke running it. A MUD is always
> running.. It handles multiple threads and not only accepts requests but
> sends them to the user..
The biggest problem I've got is that GAE has no synchronisation
mechanisms. None. There are transactions, but as they only work on
single entities they're useless. This means that it's very hard to run
game logic that needs to synchronously touch the global database.
Is it possible to directly access entities in a group other than the
root one? I was under the impression not (but I could well be wrong).
And I'm afraid it still wouldn't help --- I'd still need synchronisation
between different groups when dealing with multiple areas on the map;
and AppEngine's transactions are optimistic rather than blocking, which
are no use to me.
In addition the overhead to performing a single database access appears
to be so high that it's *much* faster to read and write the entire
database in two accesses than it is to read parts of it using multiple
queries! Although that may change as the database size grows.
Nick Johnson (Google) wrote:
[...]
> Not true - Transactions can encompass entire entity groups. With theIs it possible to directly access entities in a group other than the
> correct entity group configuration, you could perform updates on local
> areas of the map transactionally.
root one? I was under the impression not (but I could well be wrong).
And I'm afraid it still wouldn't help --- I'd still need synchronisation
between different groups when dealing with multiple areas on the map;
and AppEngine's transactions are optimistic rather than blocking, which
are no use to me.
In addition the overhead to performing a single database access appears
to be so high that it's *much* faster to read and write the entire
database in two accesses than it is to read parts of it using multiple
queries! Although that may change as the database size grows.
--
┌─── dg@cowlark.com ───── http://www.cowlark.com ─────
│
│ "They laughed at Newton. They laughed at Einstein. Of course, they
│ also laughed at Bozo the Clown." --- Carl Sagan
... Not a Telnet like session. . .
On Tuesday, September 8, 2009 at 6:54:26 AM UTC+2, Brandon Wirtz wrote:... Not a Telnet like session. . .Have similar telnet-related question.
Is GAE able to accept incoming telnet connection ?
Or any google's service ?
For my game is telnet compatibility neccessary.
--
You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-appengi...@googlegroups.com.
To post to this group, send email to google-a...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-appengine.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-appengine/73420740-08a9-4e66-93f4-ccaae3ff9c71%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
You may want to look at Google Compute Engine.