informa
17 min read
article

Creating Logic World's 3D circuit simulations and finding the fun in complexity

Now in Early Access, Logic World aims to expand on the circuitry introduced in games like Minecraft to create an immersive, fun, and more accessible take on building and understanding complex virtual circuits.

Logic World creator Jimmy Cushnie was a Minecraft redstone enthusiast who was a bit frustrated with the Mojang game's relatively slow update speed, and took matters into his own hands. He created his own 3D logic construction game, first called The Ultimate Nerd Game, later rewritten and changed to Logic World, on Steam and Itch.io.

Logic World is, at its core, a circuit simulator where players can use a vast array of tools and computer logic to create different circuits within the game's sandbox world. Similar to its Minecraft inspirations, those circuits are crafted with physical building blocks within a 3D space,  and can be used to create some pretty astounding things.

The Early Access title doesn't shy away from complexity, but that's part of the appeal. Speaking to Game Developer, Cushnie explains that his ultimate goal is to see Logic World teach that complexity in an accessible way, and open those logic-driven creation tools up to new audiences.

Game Developer: For starters, who are you, and what is Logic World?

Cushnie: Hello! My name is Jimmy, and I've spent the last four years creating Logic World. Logic World is a game about building circuits, and it's something I've been dreaming about since I was 11.

How do computers work? How do you build a circuit that can do math? I am utterly fascinated by these questions, and I see a profound, transcendent beauty in the answers. With Logic World, I want to teach and share these complex concepts in a way that's approachable, engaging, and most importantly, fun. I want more people to love logic like I do.

Unlike traditional circuit simulators, Logic World is a bright and colorful 3D world which you explore and interact with from a first-person perspective. It's also fully multiplayer, so you can build and learn together with others. For now, the game is a pure sandbox, but throughout Early Access we'll be adding more game modes and more structured, guided play.

I taught myself to code during the summer of 2017, and I started working on Logic World that October. I've been working full-time on the game since I graduated high school the following June. Logic World is my first serious programming project.

Logic World's prototype, called The Ultimate Nerd Game, is still up on GitHub. Its description says that it was "unsalvageably disastrous." It must have been scary though to abandon your whole codebase up to that part and start over. At what point did you realize it had to be restarted? What did you gain, in terms of design, from restarting?

I started working on Logic World (at the time called The Ultimate Nerd Game) just three months after I wrote my first line of code. This move went directly against the conventional wisdom about new gamedevs and their big complex dream projects -- i.e., don't start working on your big complex dream project until you have significant development experience. While in hindsight I am glad I ignored that advice, I faced significant consequences for doing so. 2017 Jimmy was a terrible programmer. Every time he made a decision on how a system should be implemented, he chose the exact opposite of the correct decision. The codebase was a cobbled-together overly-interdependent mess of barely functional systems, and I suffered for it every day. Implementing new features, changing or extending existing features, and fixing bugs were all slow, painful processes.

In November 2018 I couldn't freaking take it anymore. Everything needed to be refactored. The foundations of the project were laid by a version of myself that had zero experience working on large, complex systems. Now I had over a year of experience working on large, complex systems, and I had a chance to lay vastly better foundations. I took that chance. It didn't feel scary, it felt necessary.

And thank the stars I went through with it. If working with the old codebase was like building a house out of freshly-cooked pasta, working with the new codebase is like building a house out of... normal house parts. With normal house tools. That's not to say I did everything perfectly on my second try; there have been more than a few major refactors since the codebase was rebooted, and I have more than a few complaints about its current state. But since the reboot, I've never felt like I was fighting against my own code. On the contrary, I'm quite often pleasantly surprised by how careful and forward-thinking the code is. Now that I've gotten over the hump of learning good software architecture, it's actually a delight to work with my past self.

The reboot was also an opportunity to expand the scope of the game in ways that weren't possible before. Most notably, the new codebase is built from the ground up for real-time synchronous multiplayer. You just can't tack that on to an existing codebase, especially for a game as complex as Logic World. It has to be part of every system right from the beginning. Another great example is the modding systems. The new codebase loads assets, logic, and data from a GameData folder on disk, rather than hardcoding everything like the old codebase did.

Finally, I think the restarted codebase is a big part of why I've been able to work so well with Felipe, my co-developer. It's hard enough to work with yourself on code; working with someone else on code requires careful planning and organization. Thanks to the careful planning and organization of the new codebase, Felipe and I are able to very smoothly collaborate on features. And when we work separately on different features, we can easily merge our changes together without merge conflict nightmares.


Most people who know games think about circuit logic in terms of Minecraft's redstone. What does Logic World bring to it above redstone?

Logic World is directly inspired by redstone! Redstone is an amazing idea: first-person 3D digital logic simulation with minimal abstraction. I've been in love with that idea since I first played with redstone in 2011, but I've always been dissatisfied with redstone’s execution. For years, I worked on redstone projects while dreaming of a game that could reach the full potential of the concept. Eventually I got tired of waiting for that game and I made it myself. I wrote more about my experiences with redstone, and how they shaped Logic World, in this post on [Reddit's] r/redstone.

Redstone has a lot of cool applications due to its integration with Minecraft. Minecraft is very systemic, and redstone offers a way for players to interact with those systems in novel, automated ways. Railway systems, item sorters, and piston doors are just a few of the ways redstone can enhance the amazing world of Minecraft. But sometimes you don't want to enhance the amazing world of Minecraft. Sometimes you just want to build a computer. And for that kind of pure logic gameplay, redstone is really held back by its unavoidable ties to Minecraft's other mechanics.

Logic World, on the other hand, is laser-focused on pure logic gameplay. There are zero other considerations to worry about. This freedom lets us do things that redstone never could.

There are many ways Logic World improves on redstone, but I think the most important points are:

  • Freedom from voxels. Instead of voxels, Logic World uses discrete objects that can be at any arbitrary position and rotation, not locked to a grid. This makes the world much easier to understand and interact with, because it's closer to how objects in the real world work. I often find that redstone can be confusing because it's unclear how different items connect to each other. Logic World makes these connections explicit, simple, and intuitive.
  • Fast and easy building mechanics. Logic World makes it easy to place, move, edit, duplicate, or delete large groups of objects. Minecraft, on the other hand, requires you to place every single block individually. I think this limitation works well for Minecraft’s other game modes, but it can make logic gameplay very frustrating. Logic World also has undo/redo, which Minecraft lacks.
  • Very high performance. Redstone runs at a locked ten simulation ticks per second, and even at this slow speed, large machines can cause severe lag. Logic World, however, is hyper-optimized for simulation performance, and the simulation speed can be changed. Players commonly simulate massive, complex machines at tens of thousands of ticks per second, and the game maintains a breezy 60fps.

I get messages all the time from redstone enthusiasts who are excited to finally have a better first-person logic medium. I’m grateful to redstone for sparking my passion for logic, and I’m proud of how my team and I have expanded on redstone’s concepts.

I would also like to take this opportunity to brag that one of the developers of Minecraft plays and endorses Logic World!

I'm surprised to note, sometimes, how many things that some people consider work can be turned into interesting games, a philosophy of design going back at least to SimCity. What caused you to consider circuit design for your game?

I love digital logic. To me it's one of the most wondrous and beautiful things in the universe, right up there with the grand structure of the cosmos, the breadth of human art and culture, and the biochemical mechanisms of life itself. When I really stop to appreciate the sublime brilliance of computer chips, I am moved to tears.

But in order to understand this brilliance -- a prerequisite for appreciating it -- I had to read a 400-page book. (CODE by Charles Petzold, highly recommended.) I want more people to see what I see in computer chips, and presently the barrier to entry is way too high. With Logic World, I want to create a toy you can pick up and immediately start having fun with, but which over time will help you understand the advanced concepts behind low-level computer functionality.

Several red and black wires connect to different points within a blocky strucutre.

Sharing the beauty of digital logic is what drives me. I occasionally get messages from people saying that they used to have no interest in computer engineering, but Logic World has ignited a passion for the field in them. Each of these messages makes me outrageously happy.

And, of course, I want to play this game myself! I am bursting with ideas for cool circuits to build, but there isn't yet a circuit-building medium that does everything I want it to. When Logic World hits 1.0, I'm going to celebrate the milestone by playing the game for a solid month :)

Back in college I had a couple of courses in computer architecture, and for a class project I was asked to design and construct a four-digit binary multiplier out of wires and logic gates, and there was a moment where, because I had neglected to plug in one wire out of dozens, it didn't work. Fortunately for my grade, after about five minutes of staring at the nest of worms I had made, I found my error. Does Logic World provide any tools to help players reduce the complexity of their designs, to help them track large projects?

Organizing and keeping track of large projects is part of the challenge! You can't just slap together circuits haphazardly, you have to carefully architect them. Building circuits is hard, and building clean circuits is even harder, but design difficulties are where the fun comes from. Players can even build in-game debugging tools -- this oscilloscope is a great example.

Ultimately my goal is to maximize available fun. I don't want to add a built-in oscilloscope tool because it would take away the fun of building your own oscilloscope. But maybe there are tools that should be built-in. Like with your college experience, Logic World players do sometimes struggle with misplaced wires, and tracking down these errors is not fun. If I can add a feature that prevents these errors or makes them easier to find, it would probably be a good addition to the game.

I'm still pondering this area of design. I want to be very thoughtful and deliberate with every feature I add to Logic World. I need to be sure that each feature has a net positive effect on fun.

Logic World presents its circuits in a 3D kind of world. What does it gain, would you say, from using that as a display method, instead of just a 2D interface like a spreadsheet?

There are three areas where I believe the third dimension makes Logic World far more awesome:

1. Increased possibility-space. The additional spatial dimension affords players exponentially more design options. I am constantly surprised by the novel and innovative ways players structure their circuits. You don't see that kind of thing in 2D circuit sims.

2. Emergent puzzles. Related to the above point: when you arrange 3D objects in novel ways, novel problems crop up. Objects in Logic World cannot intersect, and wires must have an unobstructed line-of-sight between the two pegs they connect. From these restrictions emerge interesting geometry puzzles, as players must work around them to arrange their circuits in a compact and organized manner. It's almost like a spatial reasoning minigame inside the main logic game. These emergent puzzles wouldn't be nearly as interesting or complex in a 2D world.

3. Immersion and intuition. Humans are hard-wired to understand 3D worlds and think in 3D space. It's easier for us to accept a world is "real" when that world is 3D. I believe a large part of Logic World's appeal is its immersiveness, and a 2D game wouldn't be nearly as immersive. The first-person camera perspective also helps a lot with this.

Logic World supports internet multiplayer, which is pretty awesome. What are the challenges you faced in keeping the game's systems synced up across all players?

I don't even know where to begin. Multiplayer is so fuckin' hard, man. The decision to make this game multiplayer easily doubled the development time. Maybe tripled.

We faced (and continue to face) both technical and architectural challenges. Logic World is a complex game with a lot of interconnected systems. Synchronizing everything across the server and an arbitrary number of connected clients is a crazy complicated process. Multiplayer affects everything in a game like this; even the simplest features need to be looked at through the lens of "how will this work in a networked multiplayer context?"

Consider the common scenario of placing an object in the game world. Here's how that works in Logic World's old singleplayer-only prototype:

  1. A running poll detects that the player has pressed the "place object" button.
  2. The desired object is instantiated in the game world.

Meanwhile, here's what happens when you place an object in modern, multiplayer-capable Logic World:

  1. A running poll detects that the player has pressed the "place object" button.
  2. Data is collected about the desired object, then serialized into a binary format.
  3. The binary data is prepended with a byte which tells the server what kind of packet this is -- namely, a request to place an object.
  4. The finished packet is sent to the server over the network.
  5. The client instantiates a "placeholder ghost" object. This placement hasn't yet been confirmed, but we want to show the new object immediately. It's an anticipation of the server's response, without which there would be some nasty visual flickering.
  6. The server receives the packet and queues it for processing.
  7. On the next server tick, the server decodes this packet, revealing that the client wants to place an object of some kind.
  8. The server checks to make sure this is an acceptable request -- i.e. that the object data is valid and the requesting client has the necessary permissions for this placement.
  9. The server adds the new object to its local copy of the world data and initializes the object within the circuit simulation model.
  10. The server sends a packet to all connected clients about this update to the world data.
  11. The server sends a packet to the specific client that requested this object placement to let them know that their placement request was accepted.
  12. Clients receive the world data update packet, and update their local copies of the world data accordingly.
  13. Clients instantiate the new object in the game world, corresponding to the updated world data.
  14. The client which requested this object placement removes their "placeholder ghost" object.

This is a simplified overview, but it’s a taste of the huge degree of complexity introduced by networked multiplayer. All the toughest programming challenges in Logic World were related to multiplayer. All the worst, most anguish-inducing bugs happened thanks to the complexity of multiplayer systems.

Three players collaborate on a complex circuit built in an open, sandbox world.

Dealing with all the networking shenanigans was very painful. Throughout development, I constantly questioned whether it was worth the struggle. Now that we've released, however, I can say with certainty that it was. Each time I join a server and see people playing and learning together, I see how valuable the shared experience is. Building circuits is extra fun when you get to do it with your friends.

We're still working on making multiplayer a better experience, particularly for large servers. For example, we're going to add a granular and location-based permissions system that allows for things like plot servers, where a player can build in their designated area but not in others' areas. I'm really excited about the future of Logic World multiplayer, and I'm so glad we put in the extra effort to make it possible.

Logic World feels a bit like a more detailed version of the kind of circuit design used in Nintendo's Game Builder Garage. GBG is much more "gameish" though, and even offers an artificial kind of progression, unlocking parts of the documentation as the player works through tutorials. I notice Logic World has a campaign mode planned; what are your thoughts about the form such a thing should take?

Designing Logic World's campaign is a daunting challenge. There's a huge amount of knowledge that must be taught to the player, but it has to be taught in a way that's accessible, engaging, and fun. Playing the campaign shouldn't feel like you're reading a textbook. It should feel like you're playing around, experimenting, and discovering for yourself.

It's a difficult balance to strike. If the player has too much freedom, they'll be lost and directionless. But if they're given too much direction, they'll be bored and frustrated. Many complex games have successfully struck this balance, and I hope to learn from them. Kerbal Space Program comes to mind; that game teaches you literal rocket science, but in an incremental and mostly self-directed way. Within the realm of circuit simulators, I've heard great things about the campaigns of NandGame and Turing Complete, though I've yet to play either.

I have pages of notes on how to design Logic World's campaign, but tangible work on it has not yet begun. For the first few Early Access updates, our focus is 100 percent on the sandbox experience.

When the time comes, I believe the most important factor in designing the campaign will be playtesting. As I iterate on the campaign, I'll be continuously putting it in front of players who are new to Logic World and digital logic in general. Watching them follow the campaign, and interviewing them about their experiences, will help me see what works well and what needs to change.

Do you think of Logic World as more of a game, or of a learning tool? How does that design goal inform the work you do on it?

It's definitely a game first, and a simulator/educational tool second. My goal with Logic World is to create a wonderful experience. I want people to play Logic World, not just use it.

To that end, a lot of work has been put into making Logic World feel real and a little bit magical. The sky has fluffy clouds and a bright shining sun. The ground is grassy, with occasional flowers. There are diegetic sound effects for all the building mechanics, and for when players walk and jump on things. The players themselves are goofy, grinning, colorful characters. There's a beautiful original soundtrack. All these elements contribute to making Logic World an immersive, compelling experience. A place where you don't just learn, you have fun learning.

For a feature to land in Logic World, it doesn't have to provide educational value. It just has to bring happiness to the people who play the game.

Latest Jobs

Treyarch

Playa Vista, California
6.20.22
Audio Engineer

Digital Extremes

London, Ontario, Canada
6.20.22
Communications Director

High Moon Studios

Carlsbad, California
6.20.22
Senior Producer

Build a Rocket Boy Games

Edinburgh, Scotland
6.20.22
Lead UI Programmer
More Jobs   

CONNECT WITH US

Register for a
Subscribe to
Follow us

Game Developer Account

Game Developer Newsletter

@gamedevdotcom

Register for a

Game Developer Account

Gain full access to resources (events, white paper, webinars, reports, etc)
Single sign-on to all Informa products

Register
Subscribe to

Game Developer Newsletter

Get daily Game Developer top stories every morning straight into your inbox

Subscribe
Follow us

@gamedevdotcom

Follow us @gamedevdotcom to stay up-to-date with the latest news & insider information about events & more