Piecewise Blog

Build chat bots with blocks.

Piecewise 22.02.7 has been released. The 3.3~3.5 MB update is available from your itch.io download page, or will be applied automatically by Steam. The changes include:

  • Fixed “🔔 channel” showing an invalid context warning when used within the “🗣️ when [interaction type] with name (name)” block
  • Removed the “allow only” connection from the “🗣️ when [interaction type] with name (name)” block due to an abrupt Discord API change. A future version of Piecewise will allow for the specification of a default permissions set for slash commands. In the meantime, permissions should be checked within the slash command's body, using blocks like “user can” or “user has role”. On project load, the project compatibility patcher will place blocks previously connected to the “allow only” connection on the first workspace with a comment. Apologies for the inconvenience!

Piecewise 22.02.6 has been released. The 1.3~1.4 MB update is available from your itch.io download page, or will be applied automatically by Steam. The changes include:

  • Fixed the Discord role drawer showing up blank

Piecewise 22.02.5 has been released. The 1.9~2.5MB update is available from your itch.io download page, or will be applied automatically by Steam. The changes include:

  • Fixed freezing in Your First Bot tutorial
  • Fixed piece.ws blocks not opening properly (showing a blank canvas)
  • Fixed some blocks not working because of missing Discord intents
  • Fixed some miscellaneous issues

Piecewise 22.02.4 has been released. The 1~90MB update is available from your itch.io download page, or will be applied automatically by Steam. The changes include:

  • Fixed code stripping issue causing Discord bots to crash when run within the editor

Piecewise 22.01.4 and 22.02.3 have been released. The 2~59MB updates are available from your itch.io download page, or will be applied automatically by Steam. The changes include:

  • Fixed some Discord role blocks preventing bots from building properly
  • Fixed issues running Piecewise in some special cases – e.g. via piece.ws links
  • [22.02.3 only] Upgraded Electron to 17.1.2

Piecewise 22.01.3 and 22.02.2 have been released. The 2~109MB updates are available from your itch.io download page, or will be applied automatically by Steam. The changes include:

  • Fixed templates from Workshop addons not showing up properly in-app
  • Fixed the feedback tool freezing or crashing due to inefficient screenshot-taking; a different, quicker method is now used instead
  • [22.02.2 only] Changed “View source” to “View Source” to match the other context menu items
  • [22.02.2 only] Fixed a dependency being stripped unnecessarily from exported bots

Steam Build ID: 8281209, 8281230

Piecewise RSS Feeds dd5ccaa has been released. The 1KB update is available from your itch.io download page, or will be applied automatically by Steam. The changes include:

  • Fixed templates

Piecewise 22.02.1 has been released. The 57~103MB update is available from your itch.io download page, or will be applied automatically by Steam. The changes include:

  • Upgraded Electron to 17.0.1, which may fix “random” crashing issues on Windows and macOS
  • Fixed overzealous code stripping that broke the RSS Feeds DLC

Steam Build ID: 8278762

Hi everyone – sorry for the week-late release!

Changes to the release cadence

Before I get into the release notes, I'd like to go over some changes I'll be making to how often Piecewise updates will be released.

After sticking to once-monthly releases over the past 4 months, I've been figuring out that this sort of forced cadence is hurting the quality of Piecewise, for two big reasons:

  • Features are being stalled for a particular release unnecessarily, due to personal bandwidth and a strictly-planned feature set for each milestone, and
  • Features are rushed to hit a particular milestone, and they turn out to be buggy and/or low-quality.

That being said, I've decided to switch to a more flexible six-to-eight week schedule, where a release will ship when the features I have planned for it are finished. I plan on setting a soft target for release dates and use that date for the version number, and updates get closer to release, potentially write micro-blog posts that go over the features as I finish them.

Each release will continue to take place on a Tuesday, and updates will be much bigger, but they may take longer to come out. Piecewise 22.02.0 – this update – will be the last release following the “monthly” cadence. Ideally I would like to work towards another release in mid-March – exact dates TBD.

This won't change how the bleeding-edge (“aimer”) branch operates. Every time I push code online, a new version of Piecewise is built and distributed via Steam (the “aimer” branch) or itch.io (the “Bleeding Edge” file). If you're looking for the latest features and are okay with a few sharp edges in between releases, that is the way to go.

This update

This month's content is based mainly on performance and stability fixes. That didn't stop me from shipping a few new features, though. I'll go over each of these categories in more detail.

Performance fixes

The biggest thing I did this month involved significantly overhauling the way Piecewise loads itself. As a result, the application itself should take significantly less time to load – especially for people on hard drives (as opposed to SSDs) and people who use Windows.

Additionally, I worked a lot on reducing the size of bots in a bunch of ways. Bots should consume significantly less RAM, require less dependency downloads when installing, and be a bit tinier in raw code size. This was accomplished by running a preprocessor that simply strips out unnecessary items from the exported bot, based on the blocks you actually have placed in your workspaces. For example, if you're building a bot that works with Mastodon only, you do not need any of the Discord or Matrix functionality – so these features are stripped entirely from the bot that is run or exported.

I applied the above principle to a similar concept with Discord called “intents.” In short, intents describe what kinds of data your bot wants to receive from Discord. Previously, Piecewise used to essentially request all intents – i.e. all of the data – from Discord, which would consume unnecessary amounts of RAM and CPU. Now, Piecewise will infer the intents you'll need to request from Discord based on the blocks in your workspace.

I've worked with and have bots in production that run these changes, but if something doesn't work the way you expect, turn off code stripping in the settings menu and let me know through the feedback menu.

Stability fixes

With this update, I've fixed a ton of bugs with help from people who have tried Piecewise via the Discord server. The Misskey integration in particular has been improved significantly, and now operates in a more predictable and bug-free manner, while the Discord integration has also seen a few bug fixes. Additionally, installing FFmpeg should now work properly on Windows.

New features

Amidst all of the effort put into stability and performance this month, I also managed to get a few new features shipped:

Discord: Context menu items

Piecewise will now allow you to create right-click context menu items. As they share a lot with slash commands, you can create them with the when [command type] do... block.

when command type do

Misskey: Now supported by token generator

The Mastodon/Pleroma token generator now supports Misskey instances, and was renamed to indicate such.

Editor: New splash screen

I've taken the time to spruce up Piecewise's splash screen again. In addition to the new design, I also implemented icons that tell you what is loading and when, which may be useful for debugging issues starting Piecewise.

  • The lightbulb indicates that the splash screen has loaded.
  • The two networked computers indicate that platform integration (i.e. Steam) has loaded.
  • The full cardboard box indicate that any addons or extension packs have been loaded.
  • The mini audio player indicates that Piecewise has searched for audio components.
  • The notepad indicates that the editor itself has loaded.
  • The terminal indicates that system information has been collected (will be used if you submit feedback).

new splash

Mastodon/Pleroma/Misskey: Profile editing

You can now edit your bot's name or description (“note”) straight from Piecewise.

profile editing

Editor: Block inspector

Should you decide to develop add-on blocks for Piecewise, or move into writing your own bots directly in JavaScript, the “View source” tool gives you insightful info into how blocks are created and code generated. Access it by right-clicking any custom Piecewise block and click “View source...”

block inspector

Looking ahead

I feel like the Mastodon and Discord integrations are at the level they should be for general use, so for the next update, I'd like to get the long-neglected Matrix integration up to speed. Long-term, I'd also like to get source control working, and a more robust system for addons and their dependencies, but those are secondary.

Thanks for using Piecewise!

Piecewise 21.12.9 and 22.01.2 have been released. The 1.4~1.7MB updates are available from your itch.io download page, or will be applied automatically by Steam. The changes include:

  • Steam only: Fixed subscribed Steam Workshop items not appearing within Piecewise
  • Fixed Discord slash command manager not scrolling properly