The site works well right now, however it’s a little rough around the edges. Namely, there is sometimes a flash right after the page is loaded. I’m also tweaking the cache times in the server, so if you ever want to make sure you have the latest content you can press CTRL+R. I’ll keep improving it over the next few days, and please report any bugs you may find.\n\n
We’ll keep releasing these weekly updates right up until the game comes out. To make sure you don’t miss them, you can sign up for our newsletter. Be sure also to wishlist Logic World on Steam and join the official Discord.\n\n
See you next Wednesday!\n\n
More Logic World Wednesdays\n","uglytitle":"logic-world-wednesdays-the-zerotick-edition","thumbnail":"https://assets.logicworld.net/upload/d6620aed13c3f149526a"}},"error":null}}
Relays are extremely useful components, but they’ve also – since their original implementation – been the slowest components in the game to simulate.
Relays used to work using the same systems that regular peg-wire connections used. When a relay “opened”, it would create an invisible secret wire between its two side pegs, then the cached graph of the simulation would be recalculated. When a relay “closed”, it would destroy that invisible secret wire, and the cached graph of the simulation would be recalculated once again.
Unfortunately, this approach was very slow. To update the simulation graph, every connected peg and wire needs to be walked through and dealt with, and a bunch of node objects need to be created and destroyed. The system is designed to make running a simulation on the graph blazing fast; modifying the graph is the part with low performance, because it’s caching tons of information about the graph state. The performance is perfectly adequate for any reasonable modification you’d make while building, but when you have thousands of Relays updating thousands of times per second each, it’s simply way too slow.
That, of course, sucks. You should be able to build giant Relay-heavy contraptions and run them at high tickrates. This week I had a goal of making Relays way faster. I thought long and hard about how to do it, and I’m happy to say that I’ve found a pretty excellent solution.
On top of the existing circuit graph, I’ve added another layer that stores information about instant connections between different nodes of the graph. I call this the “Linker layer.” After the regular circuit simulation update, the Linker layer propagates signals between connected nodes. If one part of the graph is in the On state, the Linker layer will propagate that signal to its connected nodes, and then to those nodes’ connected nodes, etc.
The benefit of the Linker layer is that it’s extremely fast to modify. Compared to everything I described above for modifications to the Graph layer, the Linker layer is modified just by adding or removing a reference connecting two nodes of the graph. It’s somewhat slower to propagate signals through the Linker layer – after all, the Graph layer is hyper-optimized for this – but it’s orders of magnitude faster to make modifications to the Linker layer.
That’s a very high level overview of what’s happening, but hopefully it makes sense to you!
I haven’t done any formal benchmarking because I am very lazy, but I tried out a few test cases with Relays and observed speedups of 250x - 500x. Relay circuitry is now only about 1.5x-2x slower than “normal” circuitry. I’m extremely happy with this improvement, and there are definitely opportunities for further speedups so things will only get better from here.
But, as I was working on these new systems, something extraordinary dawned on me. The Linker layer is lovely and fast at propagating signals through two-way instant connections. But, there’s no reason it couldn’t also work for one-way instant connections…
I’ve finally done it. Zero-tick, instant, one-way signal transmission in Logic World, without a major performance impact!
I am so freaking pumped about this. I had accepted long ago that I just couldn’t figure out a way to have reasonably-performant instant diodes, and I would have to live with a Logic World missing that feature. But as it turns out, I’m actually incredibly fucking awesome, because I found a way to do it after all. (Some details on how it works are described in the section above, if you’re curious but skipped it)
In light of this glorious new development, I have a few questions for you:
After I’d initially determined that performant instant diodes were not practical, I came up with a sort of halfway solution that allowed for some of the same types of circuits. This feature was called Exclusive Pegs; here’s a video of how they work, one of the first Logic World dev videos I ever made. Essentially, it allowed for instant diode transmission but only to a single peg.
Now that we have true, universal instant diodes, I am planning to remove Exclusive Pegs. I want to simplify the gameplay, and have only one way of achieving this functionality. Exclusive Pegs have been a notoriously confusing feature for folks, but in comparison the instant diode components are much easier to intuitively understand. I’ve also seen some testers accidentally make an input exclusive, but not realize it, and get confused about why their circuit doesn’t work. It’s often hard to tell if an input is exclusive, especially in very dense or layered circuits. Plus, removing them would simplify a lot of code, from many parts of the game (simulation/rendering/saving/etc).
For all these reasons, I feel good about removing Exclusive Pegs now. However, they’re a pretty major feature, and they were one of the first promises I made about Logic World. So before I do it, I want to check with you: Do you think Exclusive Pegs should remain in the game, even though we have instant diodes now? If so, why?
What should the name of this new component be? I’ve been referring to it as an “instant diode” here, but I don’t want to use that terminology in the game. “Diode” is a name explicitly about electronics, and Logic World is explicitly not a simulation of electricity. Currently in the game it’s called a “Lock”, but I’m not satisfied with that name either; it feels too vague, like it could reasonably refer to a bunch of other functionality.
Do you have a suggestion for what to name this new component? Here are some more things to think about:
Here are some terms I’ve been considering:
Let me know if any of those strike you as particularly good, or if you have alternative ideas :)
For example, Discord can now recognize the contents of the post and even show the first image in the post:
The site works well right now, however it’s a little rough around the edges. Namely, there is sometimes a flash right after the page is loaded. I’m also tweaking the cache times in the server, so if you ever want to make sure you have the latest content you can press CTRL+R. I’ll keep improving it over the next few days, and please report any bugs you may find.
We’ll keep releasing these weekly updates right up until the game comes out. To make sure you don’t miss them, you can sign up for our newsletter. Be sure also to wishlist Logic World on Steam and join the official Discord.
See you next Wednesday!