Potential Features

Fractal Explorer: GPU Acceleration

Short description:
Smooth zooming and panning, 50x render speed increase
Remaining work:
About 2 weeks

Long description

50x

"50x render speed increase" is not an exaggeration. More... I have this feature about 70% complete, with the rendering itself working, and it does actually render *most* views in one fiftieth the amount of time, depending on whether "rendered" means all pixels are rendered, or most are, or something. It might make more sense to say that in most views it renders 50 times as many pixels in the same amount of time. It starts losing its advantage as the number of pixels to render decreases.

No iteration limit combined with GPU speed

There are a lot of GPU based renderers at this point, and a lot of them are available instantly in your browser. The "no iteration limit" technique that I use, on the other hand, is a lot harder to find. I'm pretty sure I've found it before, but I don't remember where. My way of avoiding the iteration limit isn't exactly revolutionary, but it removes the greatest annoyance in most fractal rendering, which is constantly adjusting the iteration limit manually (or hoping that the automatic iteration adjustments work well enough). It's a simple improvement that probably seems obvious once you actually know how it works. I'm not going to describe it in detail here, but what I'm getting at is that I may have now created the only browser-based fractal explorer that uses GPU acceleration *and* has no iteration limit. There are some challenges to making this work, so it wouldn't be too surprising.

What's currently missing

I say that the GPU rendering is working but that this feature is only 70% complete because in the process I completely overhauled the Fractal Explorer, which means it is missing some of the original features. I'd like to complete those features before replacing the existing version entirely, but I am also considering releasing a "beta" version that people can try out while the current version is still available.

Zoom limit tradeoff

The largest remaining obstacle is that the limitations of the GPU make it tricky to get to the same zoom level. I have partially solved this with what is known as "perturbation theory", but it doesn't quite bring it up to par with my current version of the Fractal Explorer. What I might do is have it switchover to the slower renderer once the GPU based one reaches its current zoom limit, at least until I successfully work around the GPU limitations.

GPU explanation

For anyone who is unfamiliar, it might be worth explaining a little bit about how the GPU acceleration works. Usually the GPU (Graphics Processing Unit) in your computer makes graphics faster "because that's what it's for", in a manner of speaking. This usually means turning a 3D model into a picture, which requires doing a lot of calculations at once, but in the case of fractal rendering, it's being used to do a lot of calculations that don't immediately result in an image. Some of that information then goes back through the GPU again to turn those calculations into an image.

I explained this to my kids like this: Imagine you have one really fast person, and 1,000 normal people. If you have a pile of bricks and you want to move it from one place to the other, it would probably be much faster to get the 1,000 normal people to move it, because it is a simple task that requires doing almost exactly the same thing many times.

Now imagine you want to write a story. What would happen if you asked 1,000 people to write the story together? It might make for an interesting experiment, but it might also just take a long time, or result in a really dysfunctional story. It would make a lot more sense to ask the really fast person (assuming they're also really fast at writing stories, for some reason), because in this case you can't easily split the task into little peices that can all happen at the same time.

The CPU is the really fast person, and the GPU is the 1,000 normal people. This is why the CPU is better at some things, and the GPU is better at others. Some GPU's are literally 1,000 little processors, but each one is around one tenth the speed of the CPU, and may have other limitations that make it even slower than that, depending on the task. And coordinating 1,000 of anything to perform a complicated task can be incredibly difficult and counterproductive.

For this reason, when the Fractal Explorer is presented with a screen full of pixels to calculate, which can easily be 1,000,000 pixels, the GPU will actually get through 500 pixels after the CPU has only completed 10 of them. But when there are only 100 pixels left, and they require more and more iterations, the CPU starts being able to compete with the GPU. And if there is 1 pixel left that needs to be iterated 1,000,000,000 (one billion) times, with some well optimized compiled code, the CPU might actually be able to complete this in one second, whereas it would take the GPU ten seconds or more.

Another interesting thing about using the GPU in anything browser based, is that it is running compiled code, which means that it might be just as fast as an app that you install on your computer. Usually browser based apps use javascript, which is pretty fast, but is not compiled, and therefore can still be quite a bit slower for certain tasks than a native app. In this case the browser is still using javascript, but it's using javascript to do the "easy" parts, which means it doesn't really make much difference that it isn't compiled. The GPU is doing the "heavy lifting", which is what would also be happening with an installed app. (There are ways to run entirely compiled code in the browser, but in this case the limitation is in the iterations, and the fastest way to calculate them is using the GPU anyway.)

2048: Public Custom Themes

Short description:
Option to share a custom theme with everyone
Remaining work:
About 2 weeks

Long description

Hundreds of themes

There are currently about 400 custom themes, but you can only play them if someone sends you a link. More... What if people could share their themes with everyone? You would be able to browse through a gallery of those themes and play them all. That is, until the point where the themes are being made faster than you can play them, which actually might not be that far off. Especially if you're good at 2048 and your games take a long time. Unless you're so good that you do really well and play really fast. But also if you're bad but play very, very slowly, or if you use Adjustable 2048 to make really big boards. Or if you use the "KEEP GOING ANYWAY" button a lot. Or use "undo" a lot. What was I talking about again?

Privacy

Your theme won't be shared publicly unless you intentionally choose to. Either we'll prompt you with two options when you save the theme, or we'll have a setting where the default is to not share publicly.

We will also be checking themes before they are allowed to be public. Right now private themes are shareable immediately, and we take them down if we see a problem, but we'll be more strict with public themes so that people can browse them without fear of bad stuff, and so that nobody will end up in a public theme unless they are already well known. This means you won't be able to make a theme public if it has your friends in it. You'll thank us later.

More everything

We're hoping that more people will visit the site if they can play a lot of custom themes, and the more people visit, the more time we will be able to spend making the site better. Because if the site doesn't make enough money, we'll have to go back to doing something boring to pay the bills :(

Latest Updates

Negatives Annihilate

October 15, 2021

Don't you just love the word annihilate? It sounds so ominous. I like that it gets used in physics, and that the thing it is used for in physics is as crazy as it sounds. In physics, it refers to the fact that when matter and antimatter meet, they literally turn into energy. Literally in the literal sense. And it becomes a surprising amount of energy. One milligram of antimatter combined with regular matter would release enough energy to send a space probe to Pluto and back, or power a car for 100,000 years, or, if you don't contain it, cause an explosion similar to a nuclear bomb.

In this case the annihilation is not really very frightening, unless you are trying to get a 2048 tile and you have a 1024 tile near a -1024 tile, because with this new setting in Adjustable 2048 turned on, they would merge and disappear. (But no energy is produced, unless you count the energy released into your forehead when you hit it with your hand.)

That's right, in Adjustable 2048, there is a new setting called "Negatives Annihilate". Any negative number will merge with its equivalent positive number, become zero, and then vanish. The ability to make negative numbers spawn has existed all along, but they weren't doing much except making it even more difficult to keep your board from locking up, unless you were playing with only negative numbers, in which case it would have been just like a positive game, but with a different color scheme.

Incidentally, the negative color scheme is actually the negative of the regular color scheme. The red, green, and blue levels are "reversed", as in, a lot of red and a little green with no blue becomes a little red and a lot of green with maximum blue.

Anyway, if you turn on Negatives Annihilate and add -2 and -4 to the spawn tiles with probabilities that are the same as the regular game, what you get is sort of the opposite of a normal game. That is, it's still hard to get a 2048 (possibly harder), but the difficulty is no longer in keeping the board from filling up, but in keeping any given tile on the board at all. In fact, one challenge you can try out is to just fill up the board. It's not very easy.

I hope to soon make it so that you can save your settings for Adjustable 2048 and share them, just like you would Custom Themes. It's sometimes surprising how different the game can be just by combining settings in a new way.

- cesoid

Show/Hide Labels for Custom 2048 Themes

October 4, 2021

It has come to our attention that a lot of the custom themes are just interesting stylings of the numbers, which leads one to ask: Why have the numbers also appear in the corner? In support of this phenomenon, you can now turn the number labels off for your custom theme. Now your numbers will appear alone, in their full glory!

But also I've wanted to add that setting for a while. It's actually the way I prefer to play most themes, and it has always been available for the player to set it, but, aside from our own Birthday Cake theme, it is always turned on by default.

Why you ask? Well, let me tell you a story. Back in the early days of 2048, probably before you were born (no really, it might have been), when (to my knowledge) the first "Build Your Own 2048" was launched at usvsth3m.com (don't go looking for it they took it down a long time ago), my memory is that it had no little captions telling you what number a tile was. You had to just remember. Which was part of the fun. But then these darn newfangled sites came along and decided to put the little labels in the corner. I didn't like it, but then again on some themes there was no clear order to the tiles and it took a lot of the meditative aspect away from the game when you had to puzzle over whether you're going to screw up your game by thinking you're about to make one tile when really you're about to make another one.

So, by the time this site got going in earnest, back in January or December, it seemed to be the expectation that there would be number labels, so I reluctantly put them in.

But some custom themes are created with the intention of the user being confused and entertained by other numbers and letters that show up as a substitution for the numbers, and I'm all about creating weird (but tasteful) confusing things. This setting is especially useful if you want to be incredibly annoying/hilarious and make tiles that are all indistinguishable, or have the normal numbers but in the wrong order.

In addition to those things, I have a particular love for themes where the images have a logical order. For example, our Solar System theme, where you start at the center of the solar system – the Sun – and work your way outwards, through Mercury, Venus, Earth, Mars, Ceres (yup, Ceres), Jupiter, Saturn, Uranus (stop giggling, that's childish), Neptune, and Pluto. (It actually contains more things after Pluto, but, I digress.) I think ordered themes are better to play without the number labels, because it's fun to remember what order these things are in, and could theoretically even teach you something. And odds are probably about 50/50 that you're actually supposed to be learning something RIGHT NOW.

Seriously. 2048 is not a good substitute for school. If history class is boring just imagine what kind of meme a given historical event could fit into. I want a 5 page essay on that by tomorrow.

Wait, I forgot what I was talking about. Oh yeah, the Build Your Own 2048 "Show numbers" setting. That's a thing now. Have fun. But not too much fun, and, if you happen to be a student, not in the middle of class unless it involves learning what you're supposed to learn in class.

- cesoid

Fractal Explorer Reeeeaaallly Sharp on some Displays, and More Readable Instructions on Mobile

August 22, 2021

While making the instructions more readable on mobile devices, I stumbled upon something. The reason they were tiny on phone screens was because the whole page was just getting scaled tinier, and the fractal explorer didn't even know it, so it was using the wrong resolution for high resolution displays (anything referred to as "retina" and basically every phone).

To be more specific, it was using a much lower resolution on my MacBook Pro (and probably every laptop with a similar display), and a resolution on my phone that was at least a little bit lower, and possibly A LOT lower. For the laptop it was probably operating at about half the actual resolution, which means the pixels were twice as big as they needed to be. On the phone...it's hard to tell.

Like a lot of phones, my phone's display has such tiny pixels that I can't even tell when it's displaying a checkboard pattern where the squares are one pixel wide. It just looks like a solid color. And with high resolution displays, writing a web app that figures out the resolution is not much better than squinting at the screen, because ... well, it's a long and arduous story, which I'm not going to try to explain right now.

It suffices to say that if you use the fractal explorer with a mid-range phone screen made any time after 2015 or so (in my case a Nexus 6), you might have to wait a while for the view to sufficiently render - depending on the area you're looking at and how sharp you want it to be, anywhere from 1 to 10 minutes - but it's worth the wait. Usually when I make an improvement to something on my website and get really excited about how great it looks, I show it to my wife and she says, "I think I see what you're talking about." This time I showed her a view of a fractal on my phone and her eyes went wide, and she said, "WHOA! That's so sharp!"

So, yeah, it is now REALLY REALLY REALLY sharp on phones. Like, it's scary.

It's also really sharp on high resolution laptop displays, which is more cool in terms of the fact that you can see it better and see a wider area because the screen is bigger. But the sharpness is really ****ing insane on a phone. Yeah, I said "****ing".

Also, the instructions are now much easier to read on the phone too, so there's that.

Fractal Explorer mobile controls

August 20, 2021

The Fractal Explorer is pretty slow on phones, but a lot of views are still tolerable especially since it uses incremental levels of iteration (without ever having an actual iteration limit) and calculates a sparse grid of points before filling in everything. And it turns out that a lot of visitors are using phones. But up until now you could only re-center a view on the phone, never zooming in or out. Now you can do that with "pinch" gesture and "spread" gesture (the opposite of a pinch). You can also move with swipes in addition to re-centering with a tap (which can be awkward at times).

Unfortunately, it is quite slow to respond to gestures (at least on my phone). I haven't tested this on other phones or any tablets, so I can't guarantee that the gestures work, but they are likely to work, because I based them on the same methods that I use for 2048. So you might just have to be patient. One pinch or spread changes the zoom by a factor of 2, and it probably will work, it just might take 5 seconds to react. There is also some chance that it will perform a "fake" zoom, similar to what happens on pages like this one when you want to magnify the text. In this case you'll end up magnifying the pixels instead of seeing more detail in the Mandelbrot. This came up in testing, but only if I moved my fingers very fast, so don't do that.

I am likely to be working on making it respond faster today or tomorrow, so be sure to check back soon.

Fractal Explorer palettes and click centering

August 18, 2021

As can be seen in the new instructions, the Fractal Explorer now has two palettes (color schemes) which can be toggled with the "P" key. The palettes look similar at first, but quickly become different as you zoom in. Usually one of the two palettes looks better than the other. Initally the original palette shows. The second palette is much better for areas where there is a lot of "noise" because a there are many different colors right next to each other. It cycles mostly with one color (green) for a while, which means the noise at least looks green, but then as it goes on it develops a blue tinge, which cycles on a much deeper scale, and ultimately it cycles red very, very slowly. It takes a phenomenal 312,500 iterations for a full cycle (red going back up and then all the way back down as part of the mix of colors), which really shows off the unlimited iterations of this fractal viewer, as it is possible to see situations where the red dominates.

In addition to the extra palette, you can now click with the left mouse button to center the view to your click. This is especially useful when you want to zoom into a particular spot and the keyboard doesn't give you enough control for it.

Fractal Explorer Extreme Zoom Fuzziness and Facebook Login

August 11, 2021

Fractal Explorer

As most fractal enthusiasts are aware, if you zoom in far enough on a fractal, you reach a limit as to how accurately computers can store a normal decimal (technically floating point) number. At this point you have something like 2.1234123412341234 and you add something like 0.000000000001 to it, and you get the same number again, sort of like running out of space on a piece of paper when you're writing down digits and deciding that it's better to just give up on the addition. If your computer tries to store extra digits on another piece of paper (to continue the metaphor), it becomes much, much slower, because the processor is constructed to handle the, um, smaller pieces of paper.

Usually what happens is that the fractal image starts to have big rectangles of colors rather than more details (like pixels, but sometimes not square). For my fractal explorer it was doing this weird ghostlike overlay of multiple distorted views of the fractal. This looks kind of crummy, so I fixed it to do the rectangles.

Facebook Login

You can now login using Facebook. Currently, the login only relates to creating custom 2048 themes (where you choose the images on the tiles), because you are required to have a login to do that. To prevent people from doing stupid things.

2048 Custom Tile Images

August 8, 2021

Some months ago I said, "One thing I'm not going to do is make something for people to add their own images to 2048 tiles. That would be asking for trouble." Today I'm proving myself wrong. I did, however, make it so that you have to make an account, which means it won't be a complete free-for-all.

Making an account is pretty easy, because in addition to the standard email address login you can also choose Google Sign In and have an account more-or-less instantly. I may add Facebook or other login possibilities if people want them.

As an added bonus, now that people can make accounts, there are all sorts of other fun things that I may be able to add to the site...if I get enough traffic to justify it. I could have people compete for best theme, save games more permanently, or save and share the Customizable Rules 2048 variations. It also brings us much closer to having high score boards.

cesoid.com isn't the only place you can make custom themes, but it does do some things that other sites don't. Just to name a few:

  • You can use your theme to play Tunneling 2048.
  • Like our own tile themes, the images will display bigger when your browser is bigger, so you can see more detail in the pictures.
  • You can save your theme and edit or delete it later.
  • You will have a list of all the themes you've made.
  • We will probably be able to keep themes around for a long time even when they don't get played.

So, yeah, have fun. But not too much fun.

Fractal Explorer

July 28, 2021

This doesn't take much explanation. [Edit: But as you can see below I wrote a lot of words anyway.] You can explore a fractal with panning and zooming. There are a lot of these out there, and actually I have two of them, and maybe I'll release the other one later. There are a few things I like about mine that others do not have. The one I'm putting up now is the "slow" fractal (Mandelbrot set, in case you care about that sort of thing) explorer. The "fast" one (which is literally about 100 times faster) doesn't have some of the things the slow one has, because I learned about how to make it go really really really fast after I made the first one, and I haven't had time to apply the same features to the fast one, partly because it's harder. But, as I was saying, here's what's cool about my fractal (Mandelbrot set) explorer:

  1. Most of these, at least on the internet, have an "iteration limit". Mine doesn't. An iteration limit is basically a limit on how many calculations it does for each pixel before moving onto the next one. The reason there is a limit, is because the whole visualization (and the definition of the Mandelbrot set) is based on whether the calculations for a point get high enough to "escape", or not. But if they don't escape, you might literally never know, so you'll just be calculating forever just to see. If you don't put an iteration limit on it, it will get stuck on a pixel whose calculations don't "escape" and never get to drawing the rest of the image. The iteration limit solves this problem, but the annoying thing about this is that it leaves uncolored blotches that would get filled in if you just tried for longer. I get around this fact by having mine do a small number of calculations for each pixel, and when it gets through all of the pixels, it goes back and continues where it left off, nudging the calculations for each pixel a little further. Some of the pixels "escape", which leaves us more time to process the ones that haven't escaped. The result is that it doesn't give up until it finds an escape calculation for every pixel. Since some pixels in the Mandebrot set don't ever escape, it might never stop calculating. But usually you get pretty close to having every pixel that will eventually escape actually escaping (and, therefore, getting color), and you end up with things filled in way more. This is a long thing to write as an item in a list.
  2. If you leave and come back later, you'll start where you left off. It just automatically remembers (like a Google Doc).
  3. Unlike most web-based fractal explorers, mine takes up the whole browser window, and can be made full screen if you want. Like you're diving into the fractal. (You make it full screen by just making the browser full screen, which is usually something like View -> Fill Screen.)
  4. In the parts that are harder to calculate it fills in the colors in a way that was unintentional but turned out to be cool. Well, part of it wasn't unintentional. First it concentrates a lot of processing power an a sparse grid of a small number of pixels so that you can see some results much earlier than if it just went through all of them at once. Then it refines it further by filling in more and more dots. I've seen a lot of fractal viewers that do this by making really big pixels and refining them to make them smaller and smaller, but I kind of like my way better. It's darker.

By the way, this will use up a lot of processing power, so if your computer slows down and starts making a lot of noise (because of the fan), that's why. If you have a laptop and it isn't plugged in it will probably run down the battery much faster than normal. However, this is nothing compared to what happens with the "fast" version that I will (hopefully) put up later. That one requires a warning up front, because, for reasons I'll explain later, it cranks up the fan in my computer faster than I've ever heard it before, and starts making basic parts of the interface harder to use. It's kind of like when Arthur Dent asks the ship computer to make him a cup of tea.

Oh, and another thing, in case you're one of the crazy people who reads all the way through these things: If you zoom in "too far" you start getting double images or blurry images. That happens because the numbers that your computer is calculating are so close together that the computer is having trouble telling them apart. Cheers!

Graphical Programming

July 26, 2021

I'm clearing out the backlog of things that I started but then didn't feel confident enough to publish on the site. This is mainly because this website is failing to get enough traffic to sustain work on it 😢   I have a grand finale lined up to go live in two weeks: Custom tile images for 2048. It is, by far, the most likely thing to bring people to the site. I know this partly because my site shows up in a Google search for things like "Customizable 2048", and is ranked higher than some sites that claim to have hundreds of themes being created per day. I do have a "Custom 2048", but it's for customizing the rules. Most people seem to want to customize the tile images. At any rate, either that will take off like a rocket or flop, or somewhere in between. If it doesn't take off, unless a miracle happens within the next few days, this will be the second month straight of traffic slumping instead of exponentially rising. But I can't release custom tile images now, because I'm going camping in Cape Cod for a week and this custom tiles feature has the potential of requiring heavy moderation and immediate bug fixes. So if I want to bring in some traffic this week, it's got to be something else.

Anyway, here is a screenshot of the thing I'm supposed to be talking about right now:

So, this is a potentially awesome thing, but it is more of a toy or learning tool at this point. If I can get it into a more complete state, you could use it to program real projects, and in my incredibly not humble opinion, it is worth a trillion dollars.

As is the case for most things, This Has Been Done Before™, but all the examples I could find were either not taken seriously and just used to teach children programming (though mine isn't even capable of that yet), or were not refined enough to be user friendly, or just basically amounted to taking normal code, putting it into blocks, and connecting them to each other in a way that is more confusing to look at than typing it into a text file. Of course, I'm biased at this point.

What you see in the screenshot above is a "code" block. You can get a blank code block by clicking the "code" button. It's the most fun part of this tool because as you drag numbers and things into the code block (into the outer box made of dotted lines), actually functioning javascript appears and changes as you make changes above. To a programmer, (or at least to this programmer) it's a bit startling and seems impossible at first, like you've photoshopped a picture of yourself to make your hair purple and your actual hair turns purple. In this case, I think what's weird about it isn't that it's generating code so much as the fact that changing the 5 in the graphical part affects one particular number in the code, and it's not clear how they're connected, like some kind of quantum entanglement. To add to that weirdness, if you change the code, the graphical part changes to match. (It's actually not that weird, it's regenerating the code every time you make a change, and it just does it in a consistent way. I don't remember how it works in reverse. It probably pretends like it's going to generate code and then uses the code it was about to generate to figure out what number in the code affects what box with a number in it.)

It's greatest shortcoming can be seen by looking at the code that is produced. It does nothing. Some very important elements are missing, most notably: variables, input, and output. The program amounts to a sort of calculator with hardcoded numbers. (I partially implemented variables, but they are very buggy. You can't access them graphically, there are no buttons for them, but you can type them into the code, and the resulting graphical changes may or may not make sense.) It is, as they say, unfinished, which is why it has been moldering. At any rate, if enough people like it in its unfinished state, maybe people will share it with others and it will get a bunch of visits and it will justify developing it further.

Older Updates