Hi MLS, Sounds like an interesting project!
On Sat, Oct 2, 2010 at 4:02 AM, MLS <[email protected]> wrote: > My friend and I are looking to rewrite an old BBS MUD. > > The game is a few thousand rooms and purely text based with commands > issued by individual players and the game responding and updating > players stats based on the results of their commands. > > I do not have a programming background, and I'm wondering about the > best way to approach writing it for GAE. > > Attempting to translate the game to objects, I have the following > layout: > > World object holds all of the zone objects, zone objects hold rooms, > room objects hold players, player objects hold inventory objects, > spellbook objects, and attributes. Then write appropriate methods for > manipulating the objects appropriately and returning the results. > If by 'A holds B', you mean 'B has a reference to A', then yes, this sounds sensible. You only want to use parent/child relationships when you need to be able to update multiple entities in a single transaction. If you need this support, consider reducing the scope - eg, each zone could have an entity group containing all its rooms, and each player can form an entity group holding all their items. > I have a few questions though: > > 1. Is this a technically correct way of approaching the problem? If > not, what would be better? (keep in mind, I am not a professional > programmer by any means. I can find my way if I have something already > written to make changes, but I've never written anything from scratch > before). Would I populate all these objects, then write world to the > db and retrieve it for each player action? Yes, that's right. You wouldn't generally write the whole world at once, though - just the modified bits! > I have no idea how servlets > work to store state, or really how they work in general really. > App servers are expected to be stateless on App Engine. All your state should be stored in the datastore or memcache. Basically, how would I be storing and retrieving stored player > statistics which are constantly changing many times a second as > players play the game. > This is another reason to limit the size of your transaction (entity) groups. A single entity group can be updated at most a few times a second. > > 2. A key issue is the ability to push updates to players in real time, > and track individuals who are connected. For example, I would like the > ability to be able to call something like > room[someroomnum].sendtoall("Some message here"); to push a message to > all players in that room, or player[someplayernum].send("some message > here"); to send replies to players directly. > I understand this is a complex issue with the stateless http protocol, > but I have read some about the upcoming channel API which sounds like > it may offer this ability but I don't know enough to be certain. > Yes, the channels API is exactly what you need for this. > > Overall I'm looking to avoid devoting countless hours to this project > if it is going to be beyond my abilities to complete successfully. > Have you considered language? Your mention of servlets implies you're considering using Java. If you're already familiar with Java, by all means use it, but if you're new to both Java and Python, I'd highly recommend starting with Python - you'll find a lot less boilerplate to deal with. Of course, I'm partisan. ;) -Nick Johnson > > > Thanks very much for your time and consideration, > > MLS > > -- > You received this message because you are subscribed to the Google Groups > "Google App Engine for Java" group. > To post to this group, send email to > [email protected]. > To unsubscribe from this group, send email to > [email protected]<google-appengine-java%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/google-appengine-java?hl=en. > > -- Nick Johnson, Developer Programs Engineer, App Engine Google Ireland Ltd. :: Registered in Dublin, Ireland, Registration Number: 368047 Google Ireland Ltd. :: Registered in Dublin, Ireland, Registration Number: 368047 -- You received this message because you are subscribed to the Google Groups "Google App Engine for Java" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.
