Logic World Wednesdays: We’re Back!

by @MouseHatGames 2020-09-03

Hello Logicians! We are back from our break, and so are our Wednesdays. We’re more excited than ever to be making your game, and we’re hard at work on the remaining features and polish needed to get it into your hands.

We don’t have anything to announce right now with regards to Logic World’s release date. Please be patient with us; as soon as we know, you will know as well.

Balance at Last - Markku

Hello, all! Great to be back with some more music for the Logic World OST. This piece of mine is for solo piano and it is called ‘Balance at Last’. It is about the mental clarity and fulfillment that we experience after overcoming something difficult. I hope you enjoy, and that you all are doing well.

Better Delayers - Jimmy

Delayers are components that allow you to intentionally insert delay into a circuit, for clocks and for precise timing logic. When I’ve previously shown them off, delayers used a peculiar system: the length of a delay was chosen as a multiple of some constant coefficient. There was a delayer that delayed in increments of 10 ticks, a delayer that delayed in increments of 100 ticks, and a delayer that delayed in increments of 1000 ticks.

However, after extensive playtesting by myself and our testers, I’ve realized that this system just isn’t fun.

With every mechanic I add to Logic World, my goal is to enable possibilities. I want to create many different pathways for solving a given problem, each with its advantages and disadvantages. I want to open the door for people to find inventive solutions. When you’re playing Logic World, I want each little part of your contraption to be a meaningful and interesting decision.

But in the case of the old Delayers, there was no decision-making or problem-solving. There was a single, objectively best way of creating a desired delay: stack up delayers in decreasing magnitude until you had the total length you wanted. This was tedious, uninteresting, and frankly it created some ugly circuitry.

I’ve been thinking on the problem of delay for a while, and I think I’ve settled on a good solution. I’ve removed Long Delayers and Very Long Delayers, and regular delayers can now have a delay length of anything between 10 and 100 ticks – they are no longer locked to multiples of 10.

The tedium of chaining together delayers of different types has now been streamlined, as you can now easily set the precise delay length you want. For short, precision-timing delays of just a few ticks, Short Delayers (1 tick each) are generally the ideal solution. And for the longer delays of many seconds and beyond, you’re now incentivized to build some kind of counter circuit.

In my playtesting I’ve found this to be infinitely nicer than the old system. The time I spend fiddling with delay lengths is minimized, which means I spend more time doing the interesting, fun parts of circuit building.

Server refactoring - Felipe

After coming back from my break, I decided that the server’s code was too ugly, so I decided to refactor a lot of it.

Since the server is made up of many more-or-less individual parts (for example, a save manager, a simulation manager, a network manager, etc), I set on to use Microsoft.Extensions.Hosting. This library is regularly found on ASP.Net Core, and it is used to manage many of an application’s aspects, from startup to shutdown. It also comes with a Dependency Injection utility, which allows us to join the previously mentioned parts of the server together, while keeping them decoupled to allow for easy replacement and testing.

Another perk of the new system is that the server can now generate a graph of the inner relationships between services:

(Dashed lines represent that the dependency is lazy in order to prevent cyclic dependencies)

Visualizing our architecture helps us to understand where things are messy and need better organization.

Saving Refactoring - Jimmy

When I removed Long Delayers and Very Long Delayers (see above), I was faced with a problem. The game had no support for the removal of existing components. If you tried to load a save that contained component types that were missing from the game files, it would stubbornly refuse, insisting that you must be missing a mod. I had to add an option to load the save anyway, and in doing so delete all components of the offending types.

However, as I dug into the code for loading saves, I was faced with an unfortunate reality: that code sucked. It was messy, it was tightly coupled, it was hard to read and hard to extend. There was also a lot of repeated/copied code between the server-side Load Sandbox functions and the client-side Load Board functions. I realized that I could either hack this new feature into the existing messy saving code, creating headaches and probably some bugs, or I could rewrite the whole damn thing.

Well, I decided to rewrite the whole damn thing. What was formerly one of the smelliest parts of our codebase is now clean and shiny and easy to use. Among the benefits of this rewrite are:

  • Faster save load times, particularly on machines with slower hard drives
  • We can now check if a save file is corrupted before loading it
  • Without loading the save, we can now extract various metadata, such as the number of components/wires in the save
  • Save format converters (discussed here) now also work with saved boards, in addition to worlds

So now that that’s done with, I can add that feature I was talking about in paragraph one. I’ll also be able to do a number of save-related things that have been on my wishlist for a while – check back next week for those things :)


As some of you may have noticed, the website you’re (probably) reading this on is far from finished, and you are completely right. Since I remade logicworld.net a while ago, it was launched with a bunch of missing features, like user profile pictures. I have started work again on the site, so it will get better soon.

We want logicworld.net to be a central hub for this community, a fluid and easy-to-use place to share your ideas and your creations. Thank you for all your feedback on what’s still needed for that to be true. I’m working on it – just sit tight :)

And by the way, in case you haven’t seen it, a while back I added a changelog section to the site, so you can check that regularly for updates (although I will also talk about them here!).

See you next Wednesday!

More Logic World Wednesdays

@Daniel 2020-09-03

Awesome to hear about both the delayers and the save load times - I currently have a world I estimate will take over 30 minutes to open, so it was well needed. Glad to have you all back!

@shamus030 2020-09-03

Glad to hear you had a good break! Even more glad to see a LWW… That graph is awesome!! How did you generate it? Is it something you wrote yourself by inspecting the DI registrations, or is it a built in function I can access somewhere? I guess it would be pretty easy to inspect the ServiceCollection and generate GraphViz output…

@pipe01 2020-09-03

Glad to be back too!

How did you generate it?

As you guessed, we’re just iterating the ServiceCollection and finding the services we defined, then we get its constructor and see what it requires, then just output that to a simple graphviz file. It’s some quick and dirty code I wrote, however it works fine and it’s pretty short.