1. Logic World
  2. News

Logic World News

Logic World Wednesdays: The Mystic Edition

A New Pursuit - Markku

Happy Wednesday everyone! This week I'm glad to share a sample of my piece called 'A New Pursuit'. It is somewhat of a departure from the musical style that I've adhered to over the past few weeks but it still maintains a few key musical elements that unify each piece. I hope you enjoy this piece as much as I did making it.

[previewyoutube][/previewyoutube]

Smooth Grids - Jimmy

Last week I made the world grid extend into the horizon. The astute reader will notice that I also changed the world grid from a checkerboard pattern to a solid color. I did this to hide some visual artifacts that were newly noticeable with the extended horizon.

The cause of these artifacts is somewhat complex, and has to do with how computer screens are made of a finite number of pixels. When the renderer looks at the grid, it has to decide what color each pixel is. With the colored grid, the color of a pixel can be one of the two grid colors. The problems arise when grid cells are very distant, and so appear small on the screen -- smaller than a pixel. When a pixel encompasses multiple cells of different colors, it only samples the color of one cell; thus, information about how the grid is supposed to look is lost and distorted.

The solution is to slowly bleed the colors of the cells into each other over distance. The smaller a cell appears on-screen, the less you render it as its appropriate color; gradually, you transition from two binary colors to a single color which is the average of the two.

This week I implemented this solution, and checkerboard worlds now look good from all angles!





Modding System Fun - Felipe

This week I’ve been working on an overhaul of Logic World’s modding system. Up until now, mods contained C# code that had previously been compiled into a DLL file. However, this means that our cloud system would have to compile mods when the user uploaded them, putting quite a bit of strain on our servers. In the new system I’m working on, mods will now instead contain the code in .csx files, which are C# script files.

When the client/server loads a mod, it will now automatically compile the mod’s raw source code in-memory and run it, removing the need for any DLL files. All Logic World mods are now distributed as source code; it’s impossible to hide malicious things in mod code, and it’s a built-in feature that you can easily modify and learn from the source code of mods you download.

Mods will now also be able to contain LogicScript files (.lsx) to use when defining logic components. I talked about this more in last week’s Wednesday.

The Oracle - Jimmy

This week I’ve added a highly requested component to Logic World: Oracles, which generate a random value when powered.

[previewyoutube][/previewyoutube]

I struggled for a while with whether to add these or not. It is possible, and very interesting, to build circuits which generate pseudorandom numbers. I worried that adding a component to generate random values would take away the need for that. I worried that fun and interesting gameplay would be eliminated.

Ultimately, however, I’ve decided that Oracles open more doors than they close. Besides, pseudorandom circuitry isn’t 100% obsolete; you still need it if you want your sequence of random values to be deterministic.

Bobby’s Birthday is this Friday!

Bobby, Logic World’s beloved protagonist and mascot, will turn one year old this Friday, April 10th. As we mentioned a few weeks ago, the lovely and talented @Red_3D is working on a celebratory short film to mark the occasion.



So, get excited for that, friends! Join us in the Logic World Discord this Friday to celebrate Bobby’s birthday and to watch the premier of the film.

---------------------------------------------

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 or join the official Discord, and of course you can wishlist and follow the game right here on Steam.

See you next Wednesday!

View this post on logicworld​.net. More Logic World Wednesdays

https://store.steampowered.com/app/1054340/Logic_World/


Logic World Wednesdays: The Foolish Edition

New Horizons - Jimmy

I wrote some fancy code that lets us extend the world super far into the distance. The horizon looks much better now, and it no longer gets closer when you move closer to it.

[previewyoutube][/previewyoutube]

Logic Scripting - Felipe

Mods in Logic World are mainly made in C#, including the code behind custom components’ logic. However, it can be a bit overkill having to compile an entire C# library for making a single NAND component, not to mention insecure as C# code can do pretty much anything. This is the reason I came up with LogicScript, a domain-specific language built for programming pure logic components, like logic gates, memory cells, etc.

Here’s a snippet showing off the language’s current features:

when in = 1010
# Set individual output bits
out[0] = 1
out[2] = 0
out[1] = in[2]

# Set all the output bits
out = 1010
out = 14' #The ' denotes that it's a decimal number instead of a binary one
end

# Other example case statements:
# when in = (1, 0, in[1], 1)
# when in = 12'
# when (in[0], in[1]) = 10
# when (in[2], in[1]) = 3'

I also plan on adding binary operators and some kind of memory registers for storing numbers.

The library as-is can execute the above script in 0.0003 ms, thus it can run 3,333,333 times per second. This means that, while it probably won’t be as fast as hard-coded C#, it’s still pretty damn fast. Even then, I still have a lot to do to optimize it, so that number will probably go up.

LogicScript will make it easy and fast to add new logic components, and it will make for more trustworthy mods, as there’s no way for LogicScript code to install a virus on your computer. We’ll still support C# logic components if you need to do something really crazy -- LogicScript isn’t a replacement, it’s an additional option.

AND, AND, and AND- Jimmy

This week I added two new AND gates to Logic World.

[previewyoutube][/previewyoutube]

Thanks to our beta testers for noticing this gap in logic capabilities. Anti-thanks for the serpentine creatures for interrupting production on that video several times.

I also modified the logic code for AND gates to support any number of inputs. This makes it super easy to mod in AND gates with even more inputs.


---------------------------------------------

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 or join the official Discord, and of course you can wishlist and follow the game right here on Steam.

See you next Wednesday!

View this post on logicworld​.net. More Logic World Wednesdays

https://store.steampowered.com/app/1054340/Logic_World/

Logic World Wednesdays: The Instrumental Edition

Instrument Sounds - Jimmy

My main project this week has been an overhaul of the code and assets we use to generate music sounds in Logic World.
[previewyoutube][/previewyoutube]
This was exactly what I needed after a month of working almost exclusively on boring stuff. I've had a really fun week, learning about audio synthesis and trying out different instrument sounds. I feel more motivated than ever to work on Logic World and to get it out into your hands.

Audio synthesis is a very complex subject, and I had a lot of help working on it this week. A huge thank you to Drogomir Smolken and the awesome SFZ community for maintaining a fantastic open standard and for being super friendly and helpful to noobs like myself. Thank you also to Sam Gossner from Versilian Studios for recording high quality instrument samples and generously releasing them for free. Finally, thanks to my dad, who helped me with some of the more difficult math :)

Settings Profiles - Jimmy

We’ve had UI for ages for switching your settings profile. This week, I finally made that UI functional.



Each settings profile is an independent list of settings. When you edit your settings on profile 2, your settings on profile 1 are unaffected.

Unexciting Things - Felipe

This week I’ve kept working on some unexciting things, namely optimizing SECCS (it can now serialize and deserialize around 10-20 times faster) and dealing with the cloud builds situation. For the last week or so the cloud builds have been failing due to Unity not correctly activating its license. We’ve contacted Unity support and hopefully we’ll have a solution for it soon.

Bobby’s Birthday

Bobby, Logic World’s beloved protagonist and mascot, will turn one year old on April 10th. The lovely and talented @Red_3D is working on a celebratory short film to mark the occasion, and it is looking very very awesome.



Red is posting daily updates on the project to their blog, which you should definitely go read right now!!

---------------------------------------------

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 or join the official Discord, and of course you can wishlist and follow the game right here on Steam.

See you next Wednesday!

View this post on logicworld​.net. More Logic World Wednesdays

https://store.steampowered.com/app/1054340/Logic_World/

Logic World Wednesdays: The Thursday Edition V

The world flounders, but a beacon of stability shines brightly through the fog of panic and pandemic. That beacon is Logic World Wednesdays: ever on time, ever organized, ever punctilious. We are here for you when you need something dependable in your life.

Settings Menu Polish - Jimmy

This week I’ve made a number of improvements to the settings menu.

[previewyoutube][/previewyoutube]

The machine in that video was built by the lovely @woox2k :)

Tracker Improvements - Felipe

This week I’ve been working on improving the tracker website that the beta testers are currently using for reporting bugs and other feedback.

Firstly, this week I’ve beautified the main page. You can now see each ticket’s creation date, type, status and ID.



I’ve also added another property to tickets: it’s priority. It ranges from 0 to 5, from least to most important.



Thanks to these changes, it’s much easier for us to manage a large number of tickets. We can easily see what needs addressing.

More SECCS - Felipe


Last week I told you I was working on a rewrite of SECCS, our library for converterting arbitrary C# data into binary and back. This week I’ve continued this work and integrated the new SECCS into Logic World. It’s now correctly reading and writing all the packets, while also being much cleaner and easier to maintain! The next step is making it fast, since up to this point I’ve been focusing on readability over speed.

Robust Initialization - Jimmy

When Logic World connects to a server, there is a process of initialization wherein the connection is verified and established. Previously this process was very haphazard and error-prone; there were a number of cases where the initialization process would not complete properly and you’d get stuck on an infinite loading screen when you tried to connect.

This week I worked out and implemented a robust and reliable protocol for initialization. It’s a careful back-and-forth with verification at every step. It looks like this:
  1. Client requests connection with server. It sends approval information like the game version and the mods installed.
  2. Server approves connection
  3. Client verifies that the connection has been established
  4. Server sends the information needed to load into the game, such as the contents of the world and the other players currently on the server
  5. Client pauses processing of all incoming network messages (such as updates to the world) until it has fully loaded into the game
  6. Client informs the server that all is well and it has loaded into the game

This is on top of the UDP message reliability features built into Lidgren, our networking library.

Thanks to this new protocol, all the bugs with connection are fixed. You can connect to a server with other players in it, you can connect to a server with a huge world loaded, you can connect while someone else is disconnecting -- it all works as it should, and I am a very satisfied developer.

---------------------------------------------

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 or join the official Discord, and of course you can wishlist and follow the game right here on Steam.

See you next Wednesday!

View this post on logicworld​.net. More Logic World Wednesdays

https://store.steampowered.com/app/1054340/Logic_World/

Logic World Wednesdays: Self-Reflection

Welcome back to another Logic World Wednesday! It’s been a busy week for Mouse Hat Games and we’ve got a lot to talk about.

But first! This week the Youtube algorithm blessed us with an auto-generated channel for Logic World. Check it out here, and be sure to subscribe. All future LW videos will be found there -- videos from us, from beta testers, and from anyone after May 1st who makes a LW video.

VLOG - Jimmy and Markku

We met up this weekend to hash out some details about the soundtrack, and we made a vlog!

[previewyoutube][/previewyoutube]

A New Wave - Markku

Happy Wednesday everyone! This week I'm happy to share the full version of my piece heard in the vlog above. I hope you enjoy.

[previewyoutube][/previewyoutube]

Player Presence - Jimmy

I was sick of making responsible use of my time, so this week I made it so you can see your reflection in other players when they have SHINY BOBBY enabled.



Now that we were rendering your own player model, I was also able to let you see your own shadow.



But honestly this feels pretty weird. The shadow is a solid and unmoving circle, which we humans are very not used to seeing as our shadow. So I made it an optional setting, which is turned off by default.

Faster load times - Felipe

Some beta testers were reporting some ridiculously long loading times when connecting to a server. We presumed this was a SECCS performance issue. SECCS is my open source library for converting arbitrary C# data into binary and back. We use it for serializing and deserializing all the network packets, so when it was taking a long time to send a packet SECCS was the obvious culprit.

So I set on to investigate. Using a profiling tool for .NET I was able to find out the culprit for this, which to my surprise was the System.Array.Resize method. It turns out that Lidgren -- our networking library -- was allocating a buffer smaller than some big packets’ size, so every time some data was written to it it would have to expand, calling the method I mentioned. This lead to a lot of memory and CPU usage, as the runtime had to create a new array and then copy the contents over from the old one every time it resized.

I solved this by introducing a mechanism for approximately calculating an object’s size and creating a buffer big enough to fit it, reducing these resizings to 0. As a result, load times for saves have been enormously improved. In some cases this is as high as a factor of 10.

SECCS Rewrite - Felipe

While investigating the performance issue above I realized that the SECCS codebase has become a nightmare of Expressions and unreadable code, so I set out to completely rewrite it, this time with a clear goal of what the library should do and what it should look like. Plus, this time I’m focusing on writing tests for everything, so changes shouldn’t break anything.

This is pretty satisfying to see:



Color Accuracy - Jimmy

Before this week, the lighting of the scene had a BIG effect on the color of objects. You would choose a color, and the object would be a completely different color from the one you chose.



This has been bothering me, and this week I set about fixing it. I did some fancy graphics things and now colors are much more accurate.



Networking Abstractions - Felipe

This week I’ve also been working on abstracting the network system we use for communicating between the client and the server. This means that the game won’t tightly depend on Lidgren for networking, so mods will be able to plug in their own systems to either expand or completely replace the original system. For example, a mod could create a system on top of the existing one that encrypts the packets, or another system that uses a method for transporting packets which offers less latency at the expense of dropping packets. You could even use carrier pigeons if you wanted to!

We will use this abstraction in the integrated server, where we will be communicating between the client and the server using named pipes instead of UDP Lidgren connections. Named pipes are streams of data that two or more processes can attach to, sending and receiving data to and from other processes. This method has less overhead than a full UDP “connection”, which will allow the game to use less resources.

Analytics - Felipe

In recent weeks we’ve been getting a LOT of visits to logicworld.net. You can see this for yourself at https://status.logicworld.net/. In order to better understand why this is happening and how we can encourage it, this week I’ve been working on some internal analytics tools.

I added a service that reads Traefik (our edge proxy)’s logs and registers every request to a MongoDB database. MongoDB is a very flexible NoSQL DBMS oriented towards big data that allows us to execute some powerful queries. For example, we can take out the number of requests per referrer domain:



This flexibility will allow us to investigate traffic spikes and correlate them with other events.

For transparency, we are now collecting the following data about your visits to logicworld.net:



This data is purely for our own use in helping us grow Logic World. We will never give or sell your data to a third party.

Save Converters - Jimmy

This week we had to make some changes to the file format Logic World uses for saved worlds and boards. Our testers were very understanding towards the prospect of their saves breaking, but I wanted to avoid that, and I knew we were going to have more changes to the format in the future. So I took the time to add support for converters from one save format to another.

The update with the new save format shipped with a converter from the old format, and no saves were broken. In the future, it will be extremely easy for us to add a converter for new save format versions.

Server-side component data - Jimmy

This section is long and technical, so if that’s not your jam feel free to skip it. TLDR: I made the game faster.

Still reading? Okay, buckle up. Many component types in Logic World have custom data associated with them. Displays store their colors, Mounts store their height, Keys store what key they’re bound to, et cetera. For managing this custom data, we have a clever system where we supply a list of custom data types and the game automatically handles all the annoying bits where that data is turned into binary and synchronized between the server and all connected clients.

This system is easy to use, but unfortunately it is not terribly speedy. We were running into problems using it with Delayers. Most components only change their custom data rarely, when a player opens the menu to edit them. But Delayers’ custom data changes every simulation tick, because they are constantly counting how long they have been powered or unpowered for. Because of this, not only were Delayers far more CPU-heavy than necessary, but they were also flooding connected clients with data updates. Clients don’t need to know how long a delayer has been powered for; that data is only necessary for computing the state of the simulation, which is all done server-side.

So this week I set about making a technical upgrade to our custom data system. Now, server-side logic components can mark some custom data as being used purely for the simulation. For these variables, the component uses a standard C# field to store the data. Then, when the game is saved, the component serializes that field as binary. At no point is the value ever sent to the client.

Thanks to these changes, Delayers are more than 10x faster and the game uses massively less bandwidth when delayers are running. This was a lot of work but I am very satisfied with the results.

---------------------------------------------

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 or join the official Discord, and of course you can wishlist and follow the game right here on Steam.

See you next Wednesday!

View this post on logicworld​.net. More Logic World Wednesdays

https://store.steampowered.com/app/1054340/Logic_World/