Week 105: S U G A R

Tough week! But rather productive!

This week I worked on SUGAR almost all week again! But I also made a Pico-8 Doodle!!

But first of all, I want to announce a small change to these weekly recaps! (includes anxiety-related rambling, you can skip to where the text is edited again if not interested in that)

Lately it’s been really difficult to get myself to do write-ups. I’ve been having anxiety problems and in these situations, my confidence automatically goes down. In these moments, I really don’t feel like interacting with the internet and much less telling everyone how I make things because I’m very much afraid that someone will see the fraud that my dumb brain thinks I am. Luckily I’m half-aware of these things and I don’t let it impact my behavior too much. But even then, it is difficult for me to get out there and write extensive explanations like I do in the Doodle Insights or the Patreon-exclusive posts.

That’s how it is and it probably won’t change much until I feel a lot better. There hasn’t been one write-up in April because of it, and there might not be any in May either. But the Weekly Recaps are still here and I think they’re my solution.

My state of mind when writing these recaps is quite the same as when I started writing them over two years ago: I’m writing these for myself and I don’t think (or care) that anyone else is reading them. That makes it a lot easier for me to write these! The Weekly Recaps are important to me and I don’t have to care about whether they’re important to other people.

So my solution is simply to make the weekly recaps more extensive! Not necessarily a lot but simply explaining the different things I did in the week more thoroughly. The Doodle Insights will be on vacation for the time being, but I hope the new Weekly Recaps can make up for that!

And finally, since these will be a little more consequent, I’m going to thank my Patreon supporters, like I would in a Doodle Insights, because it genuinely is thanks to them that I can work the way I do, and it is thanks to them that I can write a Weekly Recap every week, let-alone more extensive ones.

Thank you to all my Patreon supporters, your support means more to me than I could possibly put into words. Here are the names of all the supporters from the 3$ tier and up.

Ryan Malm, Joseph White, Austin East, Marcin Majewski, Zachary Cook, Jefff, Riccardo Straccia, HERVAN, Andreas Bretteville, Bitzawolf, Alan Oliver, Paul Nguyen, Dan Lewis, Christian Östman, Dan Rees-Jones, Reza Esmaili, Thomas Wright, Chris McCluskey, Joel Jorgensen, Marty Kovach, Cole Smith, Giles Graham, Tim and Alexandra Swast, Sasha Bilton, berkfrei, Jearl, Dave Hoffman, Finn Ellis, Egor Dorichev, Jakub Wasilewski, amaris, Brent Werness, Anne Le Clech, Jeremy Bouin, Jesse Bergerstock, Jacel the Thing, Pierre B., Sean S. LeBlanc, C Oakreef, Andrew Reist, vaporstack

If you want to help me on this ridiculous journey of mine, Patreon is definitely the place to do that. Thank you.

Alright, sorry for the wall of text! Let’s go back to what I did this week!


I was thinking about rendering metaballs with SUGAR when I figured out a way that would work perfectly on Pico-8. From there it took me about 30 minutes to get the exact result I wanted!

Basically, I pre-calculate one 64×64 metaball and I put the values in the sprite-sheet memory. But I don’t use sset()! I use poke(), which is considerably faster. And I don’t put two pixel values into one byte, like Pico-8 does, but only one pixel value per byte, so that I can access it with one quick peek().

Since this takes only half the spritesheet, I still have some space to pre-render an animated border for the top and bottom of the screen!

When drawing a smaller metaball on screen, I can take each pixel covered by the ball, scale up its relative coordinates and find the correspondant pixel value on the sprite-sheet. And then I add this value to the pixel that was already on the screen, while capping the total at 15. When the frame is done, the screen is a specter of metaball values, from 0 to 15, higher where metaballs encounter and lower around the more lonely metaballs.

All I have to do then is define a linear palette in a table and cover the 16 Pico-8 colors with these colors I chose, using pal(ca,cb,1). (That third parameter makes the palette swaps only visible on-screen, but not effective on the pixel data)

And there you have it, my third attempt at making metaballs in Pico-8, and in my opinion my best one!

SUGAR metaballs will arrive shortly, probably this next week, and they shall be even better!


This happens to be the only thing I showed of SUGAR’s development this week. Yay for 5k followers on Twitter!

I worked on a few things this week! First of all I implemented circle rendering! I used Wikipedia’s “midpoint circle algorithm” explanation and it needs tweaking but it definitely works! This, with a few other simpler functions, brings the GFX API very close to where I want it. Only missing are sprite rotation and text rendering, both of which I will be tackling this next week!

I also started on a map system, like I mentioned last week. It’s not too big and it will probably be less useful than it is in Pico-8 because I don’t have sprite flags in SUGAR, but at least it should be rather straight-forward to finish.

I added mouse support to the Input System! This was something I thought about a lot when I designed my input system, and I’m glad to say that it fits perfectly with how I built the system! Mouse buttons can be registered as inputs and checked for with btn(id), and mouse coordinates, as well as the mouse wheel, can also be registered as inputs and checked for with btnv(id)!

Finally, I implemented a debug/log system, at long last. This is really something I should have done at the very start of this project. Building the system wasn’t particularly difficult, but going through every system afterward to put informative messages, warning messages and error messages everywhere there were needed, was an absolute pain. I wish I had not put this off for so long, but at least now it’s done!

Ok, I guess I wasn’t super extensive there, but as you can see, there wasn’t much technical stuff that I haven’t already written about in a previous Weekly Recap. Next week will be a little more interesting as I will be writing about text rendering and maybe sprite rotation!

Last week, Egor Dorichev asked that I generate wallpapers with SUGAR, based on an effect they made in Pico-8. So I asked for the maths and here is the result!

This set of wallpaper is completely free, there’s 5 color variants, and every one of them is available in 52 different resolutions! Check it out!


Before leaving you for the week, I want to let you know that I’m going on a vacation for 5 days on Saturday. You might have noticed from the beginning of this post but I really need this. I’m hopeful that it will help me feel better. Either way, I do not plan to work on SUGAR (or anything else) during these 5 days. I’m not sure whether I’ll make the next Weekly Recap before going or after coming back. We’ll see!


This coming week I will still be working on SUGAR! Text rendering and sprite rotation are first on the menu! Audio is for the dessert, if there’s time for it! Hopefully I can put out a new set of wallpapers, this one full of metaballs and with funkier palettes too!

Have a great week!

Take care!


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

Blog at WordPress.com.

Up ↑

%d bloggers like this: