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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...

Important Information

Your use of this site is governed by our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.