Jump to content
Sign in to follow this  
casp0or

Game "move" question

Recommended Posts

Hi,

and another question... after carefully reading your specs multiple times, I wonder if I can only save "game moves" or can I save the army of a user in a move too?

Sample: A user registers at the game and logs in the first time. After his first login, the games provide him a starter army with one or two units.

Question: Can the game trigger a name update and the user has to accept this like a transaction to a smart contract with MetaMask or has the user to trigger a name update somehow and at this first "move" I can set the army for him?

Like your "More complicated example" shows, I would do something like this:

  {
    "g":
      {
        "myGame":
          {
            "army": [[100,1,100,0,1,0,0,], [200,1,0,0,1,100,0,], null, null, null, null],
            "currency": 1000,
            "currentPlanet": null
            "lastMove":[]
          }
      }
  }

From this example and Xaya-Game-Behavior, I have only to set this information above once and can read from the block which contains this information until the user changes his army/currency and so on. . . 

I am right or do I missed something ?

Share this post


Link to post
Share on other sites

I'm not completely sure I fully understood the question, but I think you have a slight misunderstanding of how the Xaya "game state" works.  For things that are automatic (e.g. a new user gets some kind of starting army), you don't need a move at all - this is just something that your game logic will do automatically and put into the game state (which is not explicitly stored in the blockchain).

Moves are only needed whenever the player has a real input - e.g. says to move one of her fighters somewhere or, perhaps, has a choice of where the starting army is positioned (but then it should typically not be sent automatically by the game but instead triggered by an explicit user action).  Also, there should be a move where the player explicitly joins your game, which then triggers the starting army.

The example JSON you showed above looks to me more like what the game state would be, not the move of the player.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×