Logic World Wednesdays: The Foolish Edition

by @MouseHatGames 2020-04-02

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.

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.

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!

More Logic World Wednesdays


10 comments
@woox2k 2020-04-02

I truly hope you just made AND gate configurable not just add 3 more items that shouldn’t be there into the component menu.

PS. Thanks but no thanks for the obvious joke about game coming out in a month.

@Jimmy 2020-04-02

Unfortunately, as @Ry said, currently components cannot have variable input/output counts. Lifting this restriction is among the refactors planned for 1.1. After that’s happened, all existing AND gates will be converted to configurable AND gates. Similarly, all existing Panel Displays will be converted to a single Panel Display component type with variable input count.

@woox2k 2020-04-02

Fair enough

@Ry 2020-04-02

Jimmy said that until 1.1 when you can change the number of pegs on a component in game that’s impossible. I also think when 1.1 comes out he can do that

@Nerd 2020-04-02

What is the price of DLC with dragons and such?

@Broyojo 2020-04-02

Love the dragons AND such

@Nik 2020-04-02

fuckin serpentines.

@Ry 2020-04-02

Logic World 2 More Dragons And Such LOL