Code Monkey home page Code Monkey logo

anitab-org / powerup-scenario-builder Goto Github PK

View Code? Open in Web Editor NEW
6.0 7.0 9.0 2.69 MB

PowerUp Scenario Builder allows graphing and exporting question and answer tables for PowerUp, a text-adventure style mobile game by AnitaB.org Open Source.

Home Page: https://anitab-org.github.io/powerup-scenario-builder/

License: GNU General Public License v3.0

CSS 0.47% HTML 2.78% JavaScript 65.55% TypeScript 31.19%
react gojs typescript javascript jsx

powerup-scenario-builder's Introduction

PowerUp Scenario Builder

Created by: @justKD


Live App via CodeSandbox


PowerUp Scenario Builder is a web app for creating question and answer tables for PowerUp (iOS, Android), a text-adventure style mobile game by AnitaB.org Open Source.

PowerUp Scenario Builder

Best experienced in Chrome. Also works in Safari and Firefox. Possibly with quirks.


Changelog

v1.1.0

  • Moved development to create-react-app environment
  • Most UI components recreated with React and Material-UI.
  • Replaced live app URL with a build via CodeSandbox.

v1.0.0

  • Initial release

Contents


Setup

Set the Scenario ID

Each graph represents the questions and answers for a single scenario in PowerUp.

When starting a new graph, the first thing you'll want to do is set your scenario ID.

The first card in every graph is unique. It serves as the first question presented to the player, but it also sets the ScenarioID for all subsequent cards.

Double-click on the value next to ScenarioID and change it to match the ScenarioID of the scenario you're working on.

You can edit the values of non-italicized text by double-clicking on it.

  • This is an important first step when you start a new work session.
    • This value is inherited by subsequent question cards.
    • It also creates a name space for numbering questions and answers.
    • If you forget to set it first, you may need to manually update the IDs for some cards.

Set the Text for the First Question

Double-click on the text at the top of the first card to edit it.

You don't need to set the QuestionID at this time.

Add your first answer card, and it will automatically set the starting QuestionID.


Cards

Adding and Editing Cards

Add a New Card

Click the plus icon to add a new child card.

  • Cards will automatically alternate type (question or answer).
  • Every question can have multiple answer cards attached to either end.
  • Each answer card can only have one question attached to either end.
    • This is to simplify Q&A relationships in order to avoid mistakes or unnecessary redundancies.
  • Cards can not be linked in a way that would ever create an infinite loop. This rule is further enforced when re-linking.
  • Cards will attempt to automatically set their ID fields.
  • Questions will attempt to update the NextQID field of parent answers.

You can manually edit the values in these fields, but doing so may result in undesired behavior from the automatic numbering system. Always check your work if you make manual edits.

Editing Fields

Double-click on non-italicized text to change it.

Like the starting card, the text at the top of each card is the actual Question or Answer text. Change the default "new" to be the appropriate text that should appear in PowerUp.

Moving Cards

To move a card, click and drag on an empty area inside the card.

You can move a card anywhere within the work area, but overlapping cards will be automatically re-positioned.

Deleting Cards

To delete a card, click inside any empty space in the card to select it, and press your delete key.

Card Types

  • Question Cards
    • QuestionID is a unique numerical identifier for that particular question card.
  • Answer Cards
    • AnswerID is a unique numerical identifier for that particular answer card.
      • When adding an answer, the AnswerID will be automatically assigned based on the ScenarioID set in the starting card.
      • This value can be manually changed if necessary, but new answers will continue to use the internal counter to set the default AnswerID.
    • QuestionID is the identifier for the preceding question.
      • It should always match the QuestionID of the question card connected to the left port of the answer card.
    • NextQID is the identifier for the resulting question.
      • It should always match the QuestionID of the question card connected to the right port of the answer card.
      • This value is automatically assigned when a question is connected.
      • This field must be manually set in order to end the scenario. - A terminating answer should not be connected to a child question.
    • PopupID determines if selecting this answer will launch a popup event.
      • These are popup events managed by the PowerUp class PopupEventPlayer.
      • This value should match the appropriate value in Popups.json, found in the PowerUp repository.
      • Set this value to a non-numerical character if there is no popup associated with this answer. - e.g. &
    • Points is the amount of karma points given to the player when this answer is selected.
      • Defaults to 2.

Re-linking Cards

You can delete a link by clicking to select it and pressing your Delete key.

Click and drag on the plus icon (right-side port of a card) to start re-linking a card.

Drag the new link to the left-side port of the target card, and release to create the link.

Re-linking follows the same rules as adding cards. Attempts to create illegal links are ignored.

Manually create links in order to assign multiple answers to the left-side port of a question.


Ending the Scenario

End a scenario by manually setting the appropriate value in the NextQID field of a terminating answer.

  • Set this value to a negative integer to end the scenario and launch a mini-game.
    • Each mini-game has a unique negative integer as an identifier.
      • As of Aug. 1, 2018:
        • -1 - Minesweeper
        • -2 - Sink to Swim
        • -3 - Vocab Matching
  • Set this value to a non-numerical character to end the scenario without a mini-game.
    • e.g. $

Menu Options

  • ? Opens and closes the quick help panel.
    • The quick help panel is scrollable.
  • Save downloads a local copy of your current work session to your normal web downloads folder.
    • The file is a representation of the current state of your work session, including all values and card positions.
    • The file name defaults to powerup-map.json, but, after downloading, it can be renamed to something more descriptive.
  • Layout automatically cleans up the layout of your work area.
    • Beware, this will undo any intentional manual layout changes.
  • Load will open a file finder dialog.
    • Select a previously saved JSON downloaded with the Save JSON option, and the work session will be restored.
    • The file name does not matter. Only the structure of the JSON data.
  • Export Answers will download all answers as a CSV table.
    • This format matches the database in the Android version of PowerUp.
    • For the iOS version, the table will need to be imported into the SQLite database.
    • The easiest way is probably to use a GUI editor such as DB Browser for SQLite.
  • Export Questions will download all questions as a CSV table.
    • Otherwise, the details are the same as Export Answers.
  • Export SVG will download the current work session as an editable SVG.
    • The exported SVG can not be imported, so any editing done to the SVG map is strictly for convenience.
    • This feature is meant to make it easier to embed the map in other documents, or to share with other reviewers/editors.
    • Large maps may not be printer-friendly. The SVG can be split up into smaller sections using most vector graphics editors.
  • Export PDF will download the current work session as a PDF image.
    • This feature serves a similar purpose as the Export SVG option.
    • Unless there is a reason to share SVG, this option will typically be better for viewing a static map.

Navigating the Work Area

  • Pan - Click and drag in empty white space - Arrow keys
  • Zoom
    • Middle mouse wheel to zoom
    • Zoom in/out gestures on a touch pad - ctrl + and ctrl -
  • Undo - ctrl z or cmd z on macOS
  • Redo - ctrl y or cmd y on macOS
  • Zoom-To-Fit
    • shift z

powerup-scenario-builder's People

Contributors

rossoskull avatar sunjunkie avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

powerup-scenario-builder's Issues

Move to a new hosting platform

Description

Currently the Powerup Scenario Builder example live app is hosted on Rawgit. This platform is shutting down so the example app must be hosted on a different platform. See Rawgit home page.

Acceptance Criteria

Update [Required]

  • Update the project so that the sample live app is hosted on a supported platform.

Definition of Done

  • All of the required items are completed.
  • Approval by 1 mentor.

Creating a collaborative cloud based work space

Description

This should work similar to the planned PowerUp Story Designer functionality, and should use the same cloud space/database.

See issue #7 for PowerUp Story Designer for more details.

I think the issue for this app is secondary, and should be implemented in similar manner after it is implemented in PowerUp Story Designer.

Acceptance Criteria

Update [Required]

  • Implement this feature in similar manner to how it ends up in PowerUp Story Designer

Definition of Done

  • All of the required items are completed.
  • Approval by 1 mentor.

Work Session vs Individual Scenarios

Description

The current working model for the app is that every work session represents a single scenario.

We should move to a model similar to the PowerUp Story Designer.

Each work space should have access to a list of saved states representing a scenario model, and a user should be able to save and restore their work from those states.

Aside from building the UI, this should be easier to implement due to how GoJS works. We should only need to save and load different versions of the GoJS model.

Also see issue #6 from PowerUp Story Designer concerning unlimited saved state options. While this saved state functionality should be similar to PowerUp Story Designer, please make sure to go the route of unlimited slots.

Acceptance Criteria

Update [Required]

  • Add functionality to handle saving/loading saved states similar to PowerUp Story Designer
  • Create mockups for potential UI options
  • Develop UI for managing saved states
  • Update the Save JSON and Open JSON options to handle the new work session format
  • Update documentation relevant to all affected parts (in primary repo readme and gh-pages readme)

Definition of Done

  • All of the required items are completed.
  • Approval by 1 mentor.

Exposing a future cloud option for PowerUp Story Designer to PowerUp Scenario Builder

Description

See issue #7 for PowerUp Story Designer.

The database being referenced there should be exposed to this app.

The goal here would be that a scenario work space would know about intro/outro options, so that they could be listed for use in the NextQID slot.

Acceptance Criteria

Update [Required]

  • Work on this issue along with or after the relevant issue in Story Designer is completed
  • Provide UI mockups
  • Implement a method for collecting and providing a list of available Story Sequences to use in the NextQID slot.

Definition of Done

  • All of the required items are completed.
  • Approval by 1 mentor.

Licence is missing

According to opensource.guide:

By definition, every open source project must have an open source license. If the project does not have a license, it is not open source.

Guide on choosing a licence: https://choosealicense.com/

I'm aware most of Systers projects have GPL license, is this the licence that should be added here?

Per scenario notebook

Description

When working on a large scenario, it could be useful to be able to keep notes attached to a specific working map. This could be a convenient place to keep ideas or todo items, especially when collaborating on a map.

I think it could start as a pop-out window (maybe similar to but opposite of the quick help), and basically be an editable text area. The text in that area should then be saved and restored with that scenarios work space.

Acceptance Criteria

Update [Required]

  • Create mockups for potential options
  • Add a notebook functionality that is saved/restored per scenario work space

Definition of Done

  • All of the required items are completed.
  • Approval by 1 mentor.

Update UI Colors

Description

The colors for cards and such are a bit gaudy.

It would be nice to find and add a better color scheme.

Acceptance Criteria

Update [Required]

  • Suggest a new color scheme with hex values.
  • Update the card colors.

Definition of Done

  • All of the required items are completed.
  • Approval by 1 mentor.

Responsiveness for Menu

Description

The menu at the bottom is just using html to float.

It should be wrapped in a container that uses flex boxes to handle wrapping, so that buttons aren't lost if the window is resized.

Acceptance Criteria

Update [Required]

  • Fix the wrapping for menu bar buttons when the window is sized small.

Definition of Done

  • All of the required items are completed.
  • Approval by 1 mentor.

Better styling for menu

Description

The menu is pretty basic right now. For users, it would probably be better if it was styled to be more attractive, or if it was more isolated and featured at the top of the map space, similar to the app-wide menus for most other apps. (See your browser top menu for an example.)

Acceptance Criteria

Update [Required]

  • Provide mockups for potential options
  • Updating the menu bar styling to be more usable and attractive

Definition of Done

  • All of the required items are completed.
  • Approval by 1 mentor.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.