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

SB3 Output #28

Closed
20 tasks done
towerofnix opened this issue Feb 11, 2020 · 9 comments · Fixed by #33
Closed
20 tasks done

SB3 Output #28

towerofnix opened this issue Feb 11, 2020 · 9 comments · Fixed by #33
Assignees

Comments

@towerofnix
Copy link
Member

towerofnix commented Feb 11, 2020

Input an SB3, output an SB3! Here's the todo list:

  • Loads of research
  • Sprite data & costumes
  • Most basic blocks
  • Structural changes to support sb3 (IDs for sounds & costumes, minor name changes for consistency, etc)
  • The rest of the input types & shadow blocks
    • Data gathering:
    • Per-block input to default value mapping, to fill in obscured shadow blocks (this isn't sb3-specific)
    • Per-block input to shadow block (primitive & non-primitive) mapping
    • Add remaining extension opcodes (music, etc) to known blocks & above mappings
      • AFAIK extensions always have primitive types & no fields
      • Above might be false for micro:bit grid input though? micro:bit doesn't exist in sb-edit yet anyway, but investigate how that input works to get a better understanding of extensions
    • Logic:
    • Fill in primitive values for unobscured shadow blocks
    • Fill in non-primitive values for unobscured shadow blocks
    • Fill in basic default values for obscured shadow blocks
    • For obscured costumes & sounds, replace default value with the corresponding first name in the sprite
    • Construct broadcast ID-name mapping when broadcast inputs encountered (they're internally stored as variables now)
  • Custom procedures
  • Code finalization
    • Testing lots and lots of projects
    • Extend code documentation
    • Add snapshot test
    • Prettify code
    • Make pull request

There is already a partially-complete implementation for sb3 output; it should be completed, so that projects loaded from any format can be converted into the most common output format. (As of present, our only (mostly) complete output is scratch-js.) Implementing a working SB3 output will also let us have a basis for implementing new similar output formats, like SB2: the code structure will likely be similar, and the understanding from solving problems in SB3 will probably be useful going forward.

I've begun an SB2 output format here, but I ran into some peculiarities whose solutions would probably be highlighted by completing an SB3 format. SB3 is also the format which sb-edit is natively based on, with its selection of opcodes and code structure—while implementing SB3 prompts questions like "how do we handle assets?", SB2 implies those in addition to complex questions about backporting blocks, etc. It'd be better to handle one bunch of questions at a time, so: SB3 before SB2.

I'm happy to start work on this myself, since I've already worked with sb-edit a fair bit and don't have any current project in relation to it.

@PullJosh
Copy link
Collaborator

PullJosh commented Feb 11, 2020

I'm happy to start work on this myself, since I've already worked with sb-edit a fair bit and don't have any current project in relation to it.

That would be wonderful!

I imagine that working on a second output type will make the shortcomings of the current code base much clearer, so feel free to take some artistic liberties while you work. I'm not at all opposed to ripping out and replacing some of sb-edit's ugly innards, when you feel it's appropriate.

@towerofnix
Copy link
Member Author

Oh btw @PullJosh, do you mind setting the issue assignment to me? :P

@PullJosh
Copy link
Collaborator

Oh btw @PullJosh, do you mind setting the issue assignment to me? :P

Alright, that's done. Do you think it would make sense to move scratch-js and sb-edit into an organization? That way you and @adroitwhiz could be members and gain some autonomy...

@towerofnix
Copy link
Member Author

@PullJosh I'm in agreement there! No particular thoughts on what it should be called, though. :P

PS: I don't want to be a bother but have you seen leopard-js/leopard#43 (comment)? Not to say we're moving discussion/issue-tracking there - we aren't - but we've been hanging out and sharing progress there; you'd certainly be welcomed :P

@PullJosh
Copy link
Collaborator

we've been hanging out and sharing progress there; you'd certainly be welcomed :P

That sounds fun, but I have found that when I join a Discord server (or equivalent), my productivity plummets. You all are way too interesting. I think for the sake of progress (on life, school, and programming), I should probably abstain. :P

@adroitwhiz
Copy link
Collaborator

A while ago I created a GitHub organization called Adjacent Topics--would you like to join + move this stuff there?

@towerofnix
Copy link
Member Author

@PullJosh That is 100% fair and understandable! :P (@adroitwhiz 👀 if PullJosh agrees that seems like a good place to me!)

@PullJosh
Copy link
Collaborator

Totally on board with moving scratch-js, scratch-js-website, and sb-edit to the Adjacent Topics org. Just need an invite, @adroitwhiz! ;)

@towerofnix
Copy link
Member Author

FYI, this is 95% complete! PR incoming once I've tested a bunch more projects and ironed out any remaining kinks. (Also, mental fyi: the PR will be huge. sb3 turned out to be a much larger project than sb2.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants