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

CP3108: Game Component #1058

Merged
merged 45 commits into from
May 20, 2020
Merged

Conversation

wltan
Copy link
Contributor

@wltan wltan commented Apr 10, 2020

Maintain game component #857

Our team focused on two main items:

Staff authoring experience

Teaching staff (profs and possibly avengers) are responsible for writing and publishing the story scripts that narrate the game. However, without a proper sandbox for testing bleeding edge stories, story authoring is extremely slow, especially during the semester when students are already going through the story in the live production environment.

We have extended the existing game system to enable the loading of stories from alternative locations for non-student users. We have also made use of the existing Materials component so that staff may easily save and load freshly edited story scripts. This allows staff to write and test stories which are saved to Materials, without affecting the stories currently experienced by students in the production environment.

Staff will also be able to test the story under various conditions. They will be able to customize the testing scenario, such as varying the user's game state data and simulating the current date to control which stories are unlocked.

Student game experience

Game state data for users (e.g. collectibles, quest progress) was previously stored locally. Should the user clear their browsing data or switch devices, this data is lost, causing the user to lose their progress and creating a discontinuity in the game experience.

We have extended the backend (cadet) to accommodate the storage of the user's game state data, and also tweaked the frontend to load and save data from the backend instead of local storage. The persistent storage of game data will provide a more cohesive game experience for students.


For further documentation, please see: https://github.com/source-academy/cadet-frontend/wiki/Game

@coveralls
Copy link

coveralls commented Apr 10, 2020

Pull Request Test Coverage Report for Build 4893

  • 181 of 591 (30.63%) changed or added relevant lines in 37 files are covered.
  • 5 unchanged lines in 4 files lost coverage.
  • Overall coverage increased (+0.03%) to 37.4%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/actions/game.ts 2 3 66.67%
src/components/academy/game/game.js 0 1 0.0%
src/components/academy/game/object-manager/object-manager.js 1 2 50.0%
src/components/academy/game/quest-manager/quest-manager.js 1 2 50.0%
src/containers/groundControl/GroundControlContainer.ts 8 9 88.89%
src/reducers/session.ts 0 1 0.0%
src/components/academy/game/backend/user.js 1 3 33.33%
src/components/academy/game/create-initializer.js 0 6 0.0%
src/components/academy/game/story-manager/story-manager.js 0 6 0.0%
src/containers/game-dev/StoryUploadContainer.ts 7 14 50.0%
Files with Coverage Reduction New Missed Lines %
src/components/academy/game/index.tsx 1 11.36%
src/components/academy/game/object-manager/object-manager.js 1 6.9%
src/components/academy/game/story-manager/story-manager.js 1 2.71%
src/components/academy/game/save-manager/save-manager.js 2 5.88%
Totals Coverage Status
Change from base Build 4886: 0.03%
Covered Lines: 3205
Relevant Lines: 7581

💛 - Coveralls

@martin-henz martin-henz changed the title CP3108: Game Component [WIP] CP3108: Game Component Apr 10, 2020
@Liu-2001 Liu-2001 closed this Apr 13, 2020
@wltan
Copy link
Contributor Author

wltan commented Apr 29, 2020

Final internal PR has been merged. Ready to begin the review process.

Note that the last few commits include work from the Staff Dashboard team. We will deconflict with them as necessary.

@wltan wltan reopened this Apr 29, 2020
@wltan wltan marked this pull request as ready for review April 29, 2020 05:53
@wltan wltan changed the title [WIP] CP3108: Game Component CP3108: Game Component Apr 29, 2020
wltan and others added 22 commits May 2, 2020 13:16
- Move ASSETS_HOST to within constants.js
- Add a backend directory to facilitate future communication with the backend
- Add ability to toggle asset hosts
Includes implementation to manage active stories
Dev users will first attempt to pull from the test bucket. If it fails, then try the live bucket.

Student users will always pull from the live bucket.
Tried pixijs/pixijs#4769 after encountering TypeError: Cannot set property 'fillStyle' of null
It solved the problem with the game-dev component.
Saving and loading of quest and collectibles will come through the user data or from overriding data.
- Fixed bug with regards to missing stories, testers now use default story if they have not overriden the game.

- Potential bug fixed With no missions available,  will return leaving a black screen, instead of crashing.

- Fixed bug that stops the game from compiling when the last mission has closed, will now only show last opened mission.

- Added minor documentation
@jetkan-yk jetkan-yk self-requested a review May 12, 2020 16:16
@jetkan-yk jetkan-yk added the game All game related ideas, bugs, fixes label May 19, 2020
@jetkan-yk
Copy link
Contributor

Most features are up and working.

@jetkan-yk jetkan-yk merged commit 128e5c1 into source-academy:sa_2021 May 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
game All game related ideas, bugs, fixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants