Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleaner player progression tracking #17

Closed
Tracked by #13
jakmeier opened this issue May 30, 2020 · 1 comment
Closed
Tracked by #13

Cleaner player progression tracking #17

jakmeier opened this issue May 30, 2020 · 1 comment
Labels
dev-experiment Exploration of software design discussion looking for new ideas and opinions - anyone is welcome to join the brainstorming frontend Concerns the WASM frontend found in paddler-frontend game-master Concerns the server-side logic found in paddler-game-master
Milestone

Comments

@jakmeier
Copy link
Owner

jakmeier commented May 30, 2020

This issue is related to #13

Current Situation

An enum called StoryState tracks the story/tutorial progress of each player. This enum is shared across modules but what each story state means exactly is not captured at a single location.

To go between different story states, the game-master is programmed to recognize the necessary conditions, such as when a new specific building has been placed. The frontend often has to recognize it must be updated, too. The code for this is currently all over the place, pretty much hand-crafted for each state-transition.

Goals

We need a cleaner design to handle the definition of what each state means and what happens on a transition between states.
It would be great to have a central specification for this inside the shared library. The frontend and the backend could then execute their separate state machines according to the specifications and we could even generate documentation for the wiki.

@jakmeier jakmeier added frontend Concerns the WASM frontend found in paddler-frontend game-master Concerns the server-side logic found in paddler-game-master dev-experiment Exploration of software design discussion looking for new ideas and opinions - anyone is welcome to join the brainstorming labels May 30, 2020
@jakmeier jakmeier mentioned this issue May 30, 2020
4 tasks
@jakmeier jakmeier added this to the 0.2.1 milestone Jan 10, 2021
@jakmeier
Copy link
Owner Author

jakmeier commented Feb 1, 2021

Good progress has been made over the weekend.
An FSM for what transitions are possible and what happens on them is written down in Rust right here: story_transitions.rs
This serves as the ground truth of what we the story progression looks like. It allows to keep using the enum StoryState. A new (compley) enum called StoryAction is now also used. It makes the meaning of what happens on story tansitions centrally defined, rather than defined ad-hoc in each file that contains code for executing such actions.

From the specification, it is now possible to generate a graph like this:
(Link to file in repo)
Generated graph

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dev-experiment Exploration of software design discussion looking for new ideas and opinions - anyone is welcome to join the brainstorming frontend Concerns the WASM frontend found in paddler-frontend game-master Concerns the server-side logic found in paddler-game-master
Projects
None yet
Development

No branches or pull requests

1 participant