#Gaming

Record/History of moves and state of entire game after that move for a

Record/History of moves and state of entire game after that move for a
Written by Chris Lewis

My first question here! 🙂

Im trying to conceptualize how I would go about recording the moves of my players, and also the state of my game after the calculations of that move.

For example, Final Fantasy tactics.

  1. UnitA makes an attack
  2. Calculations will be done
  3. Store the last move, and also the state of the game after that move.

In the example above, for example, I use Firebase firestore to update the players of the state of the game. In that firestore document, i will update it with the latest move and its effects, together with the latest state of game.

My concern is in number 3, where should I put the record of the previous moves and state of the game after those moves. The purpose of this is for example, I want to replay the match. With records of each moves and states of the game after those moves, I will be able to replay the match accurately. My concern is, it seems recording all these seems huge data because, if a unit moves, I would have to store the entire state of the game, which includes all units hp/position in tile map/buffs/ abilities states(cooldown) etc.

What I have thought of so far
Option:
A: (Bad)Store them in same document as the latest document snapshot. Like create an array where it will contain the record of move and snapshot for that move
B: (I think better than A but so many documents will be created) Create one firestore document for each move with the state of the game after that move and store them on a separate firestore collection.

May I ask for advice.

Thanks in advance

EDIT:

The game is a typical turn based game with 2 players (for now, in my plan, i want it to be dynamic, could be 2 teams with multiple players in each team. Or 2 or more teams). But for now, just 2 players playing against each other. Each player controls units. Each unit has several abilities to use.

Abilities may Stun, apply Buff, and/or Damage etc the target unit/units. And those status may linger on on the targeted unit. For example, Silence or Stun for 2 turns. These are just few example of attribute effects, but there are more and could be further increased in the future.

Unit A, and Unit B are allies. Unit X is their enemy. On previous turn, Unit X casted a channeling stun to Unit B. Rendering Unit B unable to move. Now on new turn, Unit A stuns Unit X, freeing Unit B.
This is the example i listed above. Another example is below

Unit A, and Unit B are allies. Unit X is their enemy. On previous turn, Unit X casted silence to Unit B. Now on new turn, Unit A casts a repel buff to Unit B so he can casts spells again.

Reasons why I am considering storing every state per move:

  1. Replay purposes and displaying the state of the game accurately. Say for example, replay can be paused, and the viewer of the replay can check the state of the game (units, buffs, cooldowns, etc)
  2. Debugging purposes, say for example, a bug was reported saying a certain skill isn’t working as expected during a certain condition.

Read original article here: Record/History of moves and state of entire game after that move for a

Read original article here: Record/History of moves and state of entire game after that move for a



Disclaimers and Denial of responsibility..!

Denial of responsibility! TheTopMag.com is an automatic aggregator of all media around the world. In each content, the hyperlink to the primary source is specified. All trademarks belong to their rightful owners, all materials to their authors. If you are the owner of the content and do not want us to publish your materials, please contact us by email – [email protected] . The content will be deleted within 72 hours.

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.