Hi. I recently studying web-development to make a game like o-game. I read a book about REST and some articles. Still, however, I don't know how to apply ROA(Resource oriented architecture) to design my game. Anyway, is ROA fit for the game application? I'm not sure about it's because of my ignorance of REST or it's really not fit for the game application style. For example, Ordering troops to attack enemy's territory, how this command maps to ROA? If I make troops as resource, which method map to attack? POST? then there are many other commands to chage its state. To figure it out, I have to add other query. But I think it's like RPC style. Somebody advice me. Thank you for reading.
on 2009-04-17 14:11
on 2009-04-17 14:26
serenobs wrote: > For example, > Ordering troops to attack enemy's territory, how this command maps to > ROA? > If I make troops as resource, which method map to attack? > POST? then there are many other commands to chage its state. > To figure it out, I have to add other query. But I think it's like RPC > style. If you have to ask... The first issue is there's two kinds of games: - thoughtful turn-based strategy games - thoughtless eye-hand-coordination games You can do the first kind at ordinary HTTP speed (CGI or Ajax hits to a web server). The second kind requires an out-of-band server connection, for higher speed reflexes, and it requires much more processing inside the user's browser. Here's an example of the first kind: http://64squar.es/ . It's chess. Use Flash for the second kind - that makes it essentially Not a Rails Problem. The next issue is: To create either game you need to build a game engine. That's one of the hardest tasks in programming. The engine must be... - efficient - secure - smart - object-oriented - event-driven - configurable - autonomous - synchronized. To play against the computer you need AI, and to play against another human you need a perfect data bus that provides exactly the same details, simultaneously, at both ends of the wire. To map all that onto REST, let's say you have player records and faction records. One division of an army is a player belonging to a faction. To attack, you send a POST containing an "intent" variable containing "attack", and a "target" containing the player id of the defender. But you can see that these design details are trivial once you have all the hard parts in place! -- Phlip