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.
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 = 1 out = 0 out = in # 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) # when in = 12' # when (in, in) = 10 # when (in, in) = 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.
This week I added two new AND gates to Logic World.
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. Be sure also to wishlist Logic World on Steam and join the official Discord.
See you next Wednesday!