Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

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.

share|improve this question
5  
Please explain downvotes so I can revise the question or vote to close if you feel this question is inappropriate. –  Error 454 Jan 22 '11 at 23:34
1  
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. –  coderanger Jan 23 '11 at 10:32
    
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. –  Error 454 Jan 24 '11 at 1:12
    
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? –  michael.bartnett Jan 24 '11 at 14:33
    
@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. –  Error 454 Jan 25 '11 at 3:14

2 Answers 2

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.

share|improve this answer
    
Thanks for the response. Our of curiosity, what were your original reasons for using GAE? Were server location and scale-out among your criteria? –  Error 454 Jan 28 '11 at 5:07
    
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. –  Blair Holloway Jan 28 '11 at 5:14

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.

share|improve this answer
    
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. –  Kylotan Mar 4 '11 at 19:00
2  
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. –  Error 454 Mar 4 '11 at 21:00

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.