-
Notifications
You must be signed in to change notification settings - Fork 4
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
LevelCompletedNode level #73
Comments
I don't feel strongly. But I wouldn't bother changing because: (1) Zero-based indexing in the model is the most common approach in general. (2) It's documented correctly and clearly in
(3) Zero-based level is used throughout vegas. E.g., |
Here's the suspicious-looking code in area-model-common that was identified during the review, context is GameAreaScreenView (I changed the formatting to paste here) new LevelCompletedNode( level.number - 1, ...) I'm also wondering if we have to worry about PhET-iO naming. If it shown as "level 1" on the screen but the phet-io variable name is "level0" it could be confusing. |
The problem in area-model-common isn't with LevelCompletedNode. The problem is lack of documentation about level numbering. Apparently the model in this sim uses 1-based numbering for the levels, but doesn't document that. I looked around and could find no documentation, just redundant comments like these: // GameAreaModel.js
// @public {Property.<AreaLevel|null>} - The current level
this.currentLevelProperty = new Property( null,
// AreaLevel.js
// @public {number}
this.number = number; In Equality Explorer, I made this same choice, but documented it extensively. E.g.:
|
+1 on @pixelzoom's comments. Whether to use 0- or 1-based indexing is a decision that is always fraught with tradeoffs, and in my opinion there is never a clearly superior choice. Vegas uses 0-based, and you can change it if you want, but as @pixelzoom says it should be consistent throughout the library. It doesn't seem worth it to me, and the approach of using 1-based in the sim and documenting it clearly sounds better, but I'd be okay with it either way. |
It's because it is labeled as / called "Level 1" on the screen and in all associated documentation about the sim and its design. Nowhere is it called "Level 0", so it makes sense for its level number to be 1.
What is the advantage of 0-based numbers here? They are NOT indices, particularly in this case as we have "Variables" and "Numbers" levels. They are now on different screens, but there used to be two level 5s on the same screen (one "Variables" and one "Numbers"). So to me, any argument related to indexing (why 0 is usually nice) doesn't apply here.
Not just confusing, but it seems like we're going out of our way to make it complicated (having to subtract 1 from level numbers to pass to VEGAS, which then has to add 1 everywhere output is required).
I agree. This is something I could accomplish as part of the cleanup related to Area Model if desired? Might be beneficial to discuss at the dev meeting, marking. |
Imo, this issue would be sufficiently addresses by simply including the above comment somewhere in the internal documentation and/or implementation-notes.md. |
Documented in the above commit in area-model. I'll be fine with either approach chosen. |
That's my main consideration as well. |
@jbphet noted in today's developer meeting that it made sense to be consistent, and he will take care of the refactoring at some point. |
…no assumptions about it being an index, see phetsims/vegas#73
…no assumptions about it being an index, see phetsims/vegas#73
…no assumptions about it being an index, see phetsims/vegas#73
…no assumptions about it being an index, see phetsims/vegas#73
…no assumptions about it being an index, see phetsims/vegas#73
…no assumptions about it being an index, see phetsims/vegas#73
…no assumptions about it being an index, see phetsims/vegas#73
…no assumptions about it being an index, see phetsims/vegas#73
…no assumptions about it being an index, see #73
…no assumptions about it being an index, see phetsims/vegas#73
The sims updated to address this issue should be tested to make sure that the level is displayed correctly (or, in some cases, not at all). They are listed below, and I'll assign QA to check them. I spot checked several and they all looked good. To test, please play the game at some arbitrary level (not always 1) and verify that the level value is either displayed correctly or not displayed at all. Here is the list of sims:
Here is an example of a level value that is incorrect, which I captured while making this update: When this is done (assuming there are no problems), please assign to @jonathanolson for review. |
@jbphet, Jacob looked at the sims in #73 (comment), and he didn't see incorrect level numbering. I looked at all of the first levels, and I didn't see Level 0. |
From #73 (comment):
This doesn't tell me what you decided. What did you decide? Are we using 1-based levels throughout vegas? |
Sorry! It was decided that we'd use the actual level numbers (1-based) throughout vegas. |
From #73 (comment):
I only see changes to LevelCompletedNode. Are we changing this throughout vegas? If so, who is doing that? If not, why? |
@jbphet what is required to close this issue? |
I think it has been fully addressed and tested. |
Currently the value provided to the
level
field is not the level number, but 1 less than that (the level index, usually).@samreid noted in the code review for Area Model (phetsims/area-model-common#99) that it would simplify things to have LevelCompletedNode given the actual level number instead, so that the value given is displayed.
@pixelzoom and @jbphet thoughts?
The text was updated successfully, but these errors were encountered: