Help with thinking about Phases, Stages, and Turns #1120
Replies: 1 comment 1 reply
-
If it helps, I've been wondering the same thing. I'm working on a game (my first) with simultaneous turns, where both players arrange a set of orders during a 'turn'. It's made to be ideal for a correspondence game, where you make one move a day. I have a 'resolution' step at the end of each turn where players are waiting for the other player to make their move and/or a response from the server, which will resolve the set of commands each player submitted. turn: {
onBegin: ({ events }) => {
events.setActivePlayers({
all: 'planning',
});
},
stages: {
planning: {
moves: { ...omitted... },
next: 'resolution',
},
resolution: {},
},
endIf: ({ ctx }) => {
if (ctx.activePlayers)
return Object.values(ctx.activePlayers).every(
(p) => p === 'resolution'
);
},
onEnd: ({ G }) => {
return orderResolver({ G });
},
}, I've been fretting over the idea that my stages should be a turn as well, but I think I feel pretty comfortable with how this fits my game now. I guess in your case, if you're going to go one level deeper and have a "stack" or allow responses to cards, those seem like the intention for stages. Maybe in your case you could add state for innings/outs to overarching game state, and add logic for ticking those up after each pitch? Then 1 pitch is captured by 1 turn? Hard to say what's best, given this is my own first game with the framework and I don't know everything you have planned. Either way, best of luck! |
Beta Was this translation helpful? Give feedback.
-
I am starting to play around with implementing a baseball card game. Thank you for all your work. It's easy to jump in and get something working with minimal effort. The Code below is to talk about flaws or misunderstandings in using stages, phases, or turns. I noticed an item on the roadmap related to better guiding people on the uses of turns, phases, and stages. As I started laying out my game, I realized I was leaning heavily on "stages" and created a concept of "waiting" as a stage.
I'm sure I will leave out meaningful detail here, but let me know, and I'll update this post. I'd appreciate it if anyone has any time and likes providing feedback.
Turn:
Right now I am using a single "Turn" to represent a half inning in baseball. I consider it a player's turn while they are on offense and have less than 3 outs. When they get 3 outs. Their turn ends and it's now the opposing players turn.
Phases:
Not currently using any
Stages:
It feels like I'm ignoring the concept of phases and turns. It could just be that this game doesn't need to fit neatly into the box of "turns" (where my brain is right now), but the fact that I've completely ignored phases here makes me think I've missed something.
This is based on a card game designed by Wizards of the Coast, so the direction I'm headed with this is to implement "the stack." However, before I start to sort that piece out, I want to make sure the foundational pieces here make the most sense. I'm guessing that this is going to turn into a cluster when I create the rules for the stack.
Beta Was this translation helpful? Give feedback.
All reactions