6
\$\begingroup\$

I am considering different game server architectures that use GAE. The types of games I am considering are turn-based where the world status would need to be updated about once per minute.

I am looking for an answer that persuades me to either perform the world update on the google servers OR an authoritative server that syncs with the datastore. The main goal here would be to minimize GAE daily quotas.

For some rough numbers, I am assuming 10,000 entities requiring updates. Each entity update would require:

  • Reading 5 private entity variables (fetched from datastore)
  • Fetching as many as 20 static variables (from datastore or persisted in server memory)
  • Writing 5 entity variables

Clients of the game would authenticate and set state directly against GAE as well as pull the latest world state from GAE.

Running the update on GAE would consist of a cron job launched every minute. This would update all of the entities and save the results to the datastore. This would be more CPU intensive for GAE.

Running the update on an authoritative server would consist of fetching entity data from the GAE datastore, calculating the new entity states and pushing the new state variables back to the datastore. This would be more bandwidth intensive for the datastore.

\$\endgroup\$
7
  • 5
    \$\begingroup\$ Please explain downvotes so I can revise the question or vote to close if you feel this question is inappropriate. \$\endgroup\$
    – Error 454
    Jan 22, 2011 at 23:34
  • 1
    \$\begingroup\$ Not sure what the difference between GAE and an "authoritative server" here is. Are you suggesting you want to transfer all your game data to a remote server every minute? Google will probably object to that more than slightly. \$\endgroup\$
    – coderanger
    Jan 23, 2011 at 10:32
  • \$\begingroup\$ An authoritative servers is simply a server running a process which is able to get full authority to the database. The server maintains the current world state, pulling in state variables from the database to calculate the next world state. In client-centric network models, sometimes this is called an authoritative client because it extends some control over the overall state of the game world. Whether authoritative server is the proper term or not, it's simply a server with full DB access. \$\endgroup\$
    – Error 454
    Jan 24, 2011 at 1:12
  • \$\begingroup\$ Just gonna comment since I don't have much experience with this. The idea makes sense to me. But do you know for sure that a world update is too CPU intensive for GAE? And what would stop you from making your GAE app incrementally send updates to the authoritative server so GAE doesn't have to handle a big request every time you update the world? \$\endgroup\$ Jan 24, 2011 at 14:33
  • \$\begingroup\$ @bearcdp I don't know for sure. I just know a handful of the algorithms that are floating point heavy. My fear is that the CPU will be the most highly used resource and I'd like to avoid paying further down the road. Sending incremental updates to the AS is a good idea, although I may need to pull from GAE to the server, not sure if I can open an outgoing connection. It sounds like I may be the first person here going down the path of running MMO world logic in GAE. \$\endgroup\$
    – Error 454
    Jan 25, 2011 at 3:14

2 Answers 2

2
\$\begingroup\$

From my (limited) experience with GAE, while database reads are trivial, database writes are expensive. We've got a database of around 20,000 GAE entities; when measured, writes are taking around 0.3 - 0.5 billable seconds. Updating our entire datastore takes ~2.5 billable CPU hours.

It's perfectly possible to use GAE to run an authoritative server, but given the cost, I wouldn't want to -- a cloud-hosted VM server would be more flexible and would likely cost less.

\$\endgroup\$
2
  • \$\begingroup\$ Thanks for the response. Our of curiosity, what were your original reasons for using GAE? Were server location and scale-out among your criteria? \$\endgroup\$
    – Error 454
    Jan 28, 2011 at 5:07
  • \$\begingroup\$ It was more that it was easy to get something up and running quickly for prototyping purposes, and that we didn't want to spend effort setting up and maintaining a server. Python was also a factor. \$\endgroup\$ Jan 28, 2011 at 5:14
0
\$\begingroup\$

I am new to developing Games and this may sound naive, but somehow having 10,000 entities or more to describe a world sounds like a lot. I would rethink the database and the patterns that place those entities in your world. The Text and Blob datatypes are saved as binary by default although they are retrieved as a string.

\$\endgroup\$
2
  • \$\begingroup\$ In a massively multiplayer game you might have a couple of thousand players, and it's not unusual for there to be several monsters per player. So 10,000 is not an unusual figure. \$\endgroup\$
    – Kylotan
    Mar 4, 2011 at 19:00
  • 2
    \$\begingroup\$ The types of entities you have depend on the style of game you are creating. You might be thinking of an entity in terms of a visual model in the game world. For my application, an entity can be as simple as a statistic (strength, agility). These entities need to be updated based on equipped items, character buffs/ailments etc. So if you consider for a single character that you have 10 equipment slots, 10 affect slots (for buffs/spells) and 8 stats, that's 28 entities. 500 players would give you 14,000 entities. For a real-time game this is unrealistic, for my turn-based game it is not. \$\endgroup\$
    – Error 454
    Mar 4, 2011 at 21:00

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .