Logic World Wednesdays: Loggy Loggy Log Log Log Glog Glog

by @MouseHatGames 2020-06-04

Time and Science - Markku

Hello everyone! I hope you enjoy my piece for the Logic World OST called ‘Time and Science’.

In addition to writing new music, I’ve recently been working on polishing some of my previous pieces for this soundtrack. I’m now completely done with 20 minutes of music for Logic World. The full soundtrack will be 40 minutes, so we’re officially halfway finished! I’m looking forward to the next half and I hope that you’re there with me on Logic World Wednesdays to hear some new tunes!

Loggy Loggy Log Log Log Log that’s fun to say out loud - Felipe

This week I’ve been working on making the game log the stuff it’s doing. Right now all the game’s output is printed directly to the in-game console (or the server console), meaning that if you, for example, wanted to print an error, you’d have to explicitly specify the message’s color every time you print it. I’ve been working on a system that abstracts this, instead it lets you say “print an error”, and it will automatically print it to the console with the appropriate color, as well as to a file on disk. Mods will get their own dedicated logger, which means that it will be easy to distinguish between mods’ log messages. This is what the logs in the server look like:

logs 1.png

Knowing the message’s “importance” level (trace, debug, information, warning, error or fatal) also lets us write some pretty logs to a file:

logs 2.png

I’ve added a command that lets you change the log level (which by default is the information level), so that you can see the tracing messages that are hidden by default.

Now that we have a proper logging system, it will be much easier to diagnose and fix bugs and crashes. Logs should also be a big help to modders who are trying to fix their mods.

In-game mods menu - Felipe

I’ve also been working on a menu that shows all loaded mods. It’s not complete yet, currently it shows you some details about the mod like its name, ID, version and priority:

mods menu wip.png

(The artifacts you see in the details panel are just some Unity Editor shenanigans)

Logic Maker progress - Felipe

I’ve also been progressing on Logic Maker, the tool you will be able to use when working on your own mods. I’ve decided to drop the GUI option (at least for 1.0 release), since I think it won’t be necessary as the CLI app is very easy to use.

I spent a while looking for a library for parsing command line arguments, but none managed to quite convince me. The closest one was Fluent Command Line Parser, however it still doesn’t fully support subcommands (like git fetch -a, for example). This is the reason I am developing Yaclip (Yet Another Command LIne Parser), a library for parsing arguments with a completely fluent interface. It’s also able to automatically generate pretty help messages, this is Logic Maker’s help message (so far):

logic maker help.png

Currently, Logic Maker allows you to create new mod projects from templates that you will be able to provide, as well as a default template that allows you to configure what you want and don’t want to include in the mod. You’ll also be able to add new components to your existing mod, although this will probably be overkill for simple components.

Editable Display Configurations - Jimmy

Building on last week’s work on Global Display Configurations, this week I’ve added some fancy menus for editing those configurations!


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


16 comments
@Ry 2020-06-04

Loggy Loggy Log Log Log Glog Glog

Rest Of Comment Removed B/c It Was Blocking The Other Comments
@Nerd 2020-06-04

I’m duplicating a question from the Steam forum that you haven’t reply: > Is it still the plan to have these challenges to build all the components of a computer, culminating in a full computer? > -Zednaught

@deltabooq 2020-06-04

God when I see all this it makes me wanna create so many logic stuff.. :D

@Ecconia 2020-06-04

Nice, sweet color GUI.

@pipe01 this comment is for your section :) Btw: Please fix the bug, that lets me write a comment again if it uses html-tags :( Just escape them on first submit and on edit.

Oh gosh I am having nightmares when it comes to Logs in MC, I hope you will spare me, here some thoughts and questions use them wisely:

  • Colors Which console window is that? Does it support colors/ANSI? If you are using colors in it, which ANSI command are you specifically using? Are we allowed to use colors in our command output, if so which format?

  • Time Is the time in UCT or Local? If its not in UCT, you should add a +-(hours) thingy to the time-section. Makes parsing the logs much more helpful, thanks. If a server runs for example 247 it might be nice to have the time (not necessarily date) in the console as prefix.

  • Prefix/Multiline Are Mods allowed to have multiline console output? - That would be okay, but not nice. Is there any way for mods to write a message without a prefix? If so, please don’t recommend/accept that. Personally I don’t like the fact that mods can choose whatever name they want to appear as a prefix. For that I would suggest to prefix each name in the log with [Mod|…] or [Mod][…] or whatever looks nice, just to ensure everyone can detect at first glance, that its a mod spamming or whatever the console. For example a policy must contain ‘mod’ in name is not a good solution imho.

~Ecconia

@pipe01 2020-06-04

Btw: Please fix the bug, that lets me write a comment again if it uses html-tags :( Just escape them on first submit and on edit.

I’m not exactly sure what the bug is, but currently I’m dedicating all my webdev power to the new site so it may take a while to get it fixed, sorry.

Which console window is that?

That’s the stdout for the server, on Windows it’d be the usual terminal window.

Does it support colors/ANSI? If you are using colors in it, which ANSI command are you specifically using?

It supports 24-bit color on Windows using VTConsole through this library, and on Linux it supports the standard 16 colors. You also always have the option to make it completely plain text output through a command line flag.

Are we allowed to use colors in our command output, if so which format?

All these color and output stuff is handled by LICC, and, in the case of the server, the LICC.Console frontend. This means that mods will be able to use the same LConsole we use and write messages with whatever colors they want. Colors in LICC are handled with the CColor type, which represents a 24-bit color with the option of converting from classic ConsoleColors.

Is the time in UCT or Local?

It’s all in UTC.

If a server runs for example 247 it might be nice to have the time (not necessarily date) in the console as prefix.

That’s a great idea, I didn’t think of that. I’ll probably add a command for toggling it.

Are Mods allowed to have multiline console output?

There’s nothing preventing them from inserting a to the message, so they currently can.

Is there any way for mods to write a message without a prefix?

They can use the raw LConsole I mentioned earlier to write messages directly to the console without any prefixes, although the recommended method is to use their logger instance which adds all the pretty stuff like the prefix and also logs the message to the log file.

In the bottom of the console picture in the post you can see a couple log messages from a mod, which have the mod’s name as the prefix: console

Now that you say it, I should probably add a Mod/... prefix to those prefixes, because currently it only contains the mod’s name.

@shamus030 2020-06-04

Logic Maker looks cool. For command line apps, I swear by cobra (though it’s for Go). I haven’t tried building one in .NET yet! I think I’ll still prefer Go over .NET Core for CLI tools, since the final executable is much smaller than a .NET equivalent with the --self-contained flag.

I’m interested in how Logic Maker works under the hood. Are you embedding template files in the executable and processing them kind of like Yeoman, or are you doing something else?

@pipe01 2020-06-04

the final executable is much smaller than a .NET equivalent with the –self-contained flag.

That’s very true, in fact at first I started building Logic Maker on Go, but I decided to go back to .NET because it was a lot easier to interface with all the code and libraries we have.

Are you embedding template files in the executable and processing them kind of like Yeoman, or are you doing something else?

That’s also what I was doing at first, however I decided to store templates as ZIP files under a folder besides the app to let users create custom templates.

@shamus030 2020-06-05

Nice! Thanks for the response.

@Nik 2020-06-04

Ooh, for the rainbow displays, can you add another setting to make the hue change the opposite direction? like purple > blue > green > yellow > red

@Jimmy 2020-06-04

Great idea, thank you!

@tokumei 2020-06-04

Also worth considering: hue is a circular/repeating value space, so it should also be valid to make ranges that wrap around what is currently considered the min/max values, 0 and 360. For example, If I wanted to make a range centered around reds, I think that wouldn’t be possible with this UI, I’d have to make it manually.

Maybe we could have a circular range picker based on the HSV color wheel? That would be an interesting way to do it.

@Jimmy 2020-06-05

What you describe is actually currently possible by setting the min hue higher than max hue. In fact, I demonstrate this at the very end of the video.

However, I really like your idea about a circular range picker! That would be a much nicer UI.

@Nik 2020-06-04

Damn, this is a nice update.

Pretty funny you showcased a bug at 1:09 in the display config video, the last color changed unexpectedly lol

@Jimmy 2020-06-04

Haha yep, I noticed that but I decided to get LWW out quickly rather than stop to fix it :P