Ordering troops to attack enemy’s territory, how this command maps to
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
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
server). The second kind requires an out-of-band server connection, for
speed reflexes, and it requires much more processing inside the user’s
Here’s an example of the first kind: http://64squar.es/ . It’s chess.
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
one of the hardest tasks in programming. The engine must be…
To play against the computer you need AI, and to play against another
need a perfect data bus that provides exactly the same details,
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
you send a POST containing an “intent” variable containing “attack”, and
“target” containing the player id of the defender. But you can see that
design details are trivial once you have all the hard parts in place!