1. Logic World
  2. News

Logic World News

Logic World Wednesdays: The Pauseable Edition

It’s been a bit of a lighter week for us, with Jimmy’s second-favorite holiday and some very stressful world events. But regardless, we’ve continued to plug away at Logic World, and we’ve got some juicy tidbits to share with you on this fine Wednesday.


Endless Pauseabilities - Jimmy


Over two years after I added it (I checked -- it was October 20, 2018), the pause menu now actually pauses the game! I’ve also added some fancy audio effects to the music in the pause menu.

[previewyoutube][/previewyoutube]

The game only actually pauses if you’re playing by yourself. If there are other players in the world with you, it won’t be paused.


Web split - Felipe


Since I performed the latest web rewrite, the service that served your requests was composed of two parts: the front-end and the back-end. The front-end is written in Vue and is served as static files, whereas the back-end is a single GraphQL endpoint. All of these endpoints were being handled by the same service, which meant that the entire service had to be recreated when I made a change to either part of the service. This is less than ideal, as I want to aim for the lowest possible iteration time, so I set on to split these two “ends” into two separate services: one is a very simple and fast static file server for the frontend, and the other is the same service that was previously serving the API, only with the static files removed.

Although it wasn’t the main goal, this change also brought some significant performance improvements when navigating the site, particularly the initial page load. Additionally, if the API service were to be down for any reason (for example very high loads), the static server should still be running and serving the website to the users, which gives us an opportunity of showing them a nice “the site is down” message instead of just completely breaking.


Notifications: finale - Felipe


Last week I talked about a new notifications system on the front-end of the site, and this week I finished it!



I’ve added a new panel that shows you all your notifications, accessible through the bell in the top navbar. From here you can see all of your notifications, optionally showing only the new ones, which can be clicked on to check them out and mark them as read.

And by the way, email notifications were fixed lol.


Continued work on new player controller - Jimmy


My biggest task this week has been to finish the work I described last week on the player controller. I completed the integration and modifications of the third party library I’m using, Kinematic Character Controller, and I fixed all the glitches that popped up. All the features I described last week are fully implemented, and I just need to fix one last big issue (which has to do with how the controller handles “stepping up” onto ledges) before it’s done.

In addition to everything mentioned last week, I’ve also integrated the character controller with the physics system so it can act like a pseudo physics object. Like moving platforms, physics objects aren’t currently used in the vanilla game, but they can be added by mods and I really want to add gameplay features with them after LW 1.0. Previously, the player controller would treat physics objects as static immovable objects, but now the player can exert forces on physics objects, and physics objects can exert forces on the player. Here’s a quick demo video.

Additionally, I’ve done a big refactor of how the game handles player positions. Previously, your head position (the center of the bobby sphere) was used. But this was awkward in a number of scenarios; for instance, when you teleported to [0, 0, 0] your face would be inside the ground. Now player position is handled using the position of your feet; when you teleport to [0, 0, 0], you are standing on the ground. This has also allowed me to refine flag teleportation: previously, after teleporting via flag, you’d be hovering in mid-air and you’d fall a short distance unless you were flying. Now, however, after flag-teleporting your feet will be resting comfortably on the ground.

And finally, I’ve tweaked the logic of how and when the player controller is simulated to better handle game states. Previously, if you opened a menu (such as a component’s menu, the Selection Menu, or the debug console) the player controller would stop being simulated. You would instantly freeze; if you were jumping or falling, you’d hover in midair. Now, however, the player controller is always simulated: it’s just the input to the controller which is paused. Opening menus is like holding a tablet in front of your face, instead of switching to an entirely separate plane of existence.

As I said before, there’s just one remaining issue to sort out before all this can be merged and marked as completed. I know I said there’d be an extensive video on the player controller this week, but it’ll have to wait a little longer. Probably next week. ¯\\_(ツ)_/¯


Bugs Fixed This Week


  • Fixed Hue slider being 0-255 instead of 0-360
  • Fixed being able to scroll in the InputFields of some InputSliders
  • Fixed text links still changing color if you click on a part of the text that is not a link
  • Fixed a rare fatal error when trying to press a Key from a specific angle
  • Fixed footstep sounds not playing
  • Fixed weird scaling issues with the player controller if you spammed the crouch key fast enough
  • Fixed physics objects being unstable when resting on the ground in Gridlands and Grasslands
  • Fixed the server commands simulation.pause and simulation.resume not working

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

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.

View this post on logicworld.net

More Logic World Wednesdays

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

Logic World Wednesdays: The Smooth Edition

Smooth Scrollin’ - Jimmy


I’ve added smooth scrolling, and added some options to customize the feel of the scroll to exactly how you like it.

[previewyoutube][/previewyoutube]

I’ve wanted to add smooth scrolling FOREVER. Here’s a forum thread from June 2019 where I asked about it, and I have development notes that say “add smooth scrolling” from all the way back in October 2018. It feels SO GOOD to finally have it in the game.


Notifications - Felipe


There are several reasons why logicworld.net might need to send you a notification about something. When somebody replies to your comment, when you’re mentioned by username, or when there’s a new post in a forum you follow, you want to know about it. In the future we might also have notifications for things like friend requests or private messages. Therefore, we need a robust system for sending notifications to users.

This week I’ve started working on merging the notifications system with the website itself, allowing you to see and interact with them. This will include real-time communication, making sure you get to see your notifications as soon as they are created. Unfortunately, almost all work I’ve done so far has been in the backend, thus I have nothing to show. Be sure to tune in next week though, as I will hopefully have finished the frontend!

For each type of notification, you’ll be able to choose whether or not to get a web UI notification, a browser notification, and an email about the notification.


Player Controller Overhaul - Jimmy


This week I’ve been working on an overhaul of the systems for moving your character around in the world. Here are some advantages of the new system over the previous system:

  • Much smoother and more reliable collision detection, and better handling of edge cases like sloped hallways
  • More customizability to the user: parameters like step up height, max stable slope angle, stick to ground force ect can now be tweaked to preference
  • The ability to rotate the character, so world types with custom gravitational geometry -- like a spherical planet -- can finally be added
  • Way way way WAY better modding support. It is now crazy ridiculously easy to implement custom character movement logic.
  • The ability for players to stand on platforms that are moving and rotating, with momentum handled properly as you jump on or off of them. This is unused in Logic World for the moment -- at least, without mods -- but it’s needed for some stuff we want to do after 1.0.


This stuff is really f****** complicated and so I wasn’t able to finish it for this week. But look out next week for a video showing off the new controller, featuring some of that custom gravity I mentioned :)


Color Picker Refresh - Jimmy


I added dark outlines to all parts of the Color Picker UI, to bring it inline with the new Logic World UI style.



I’m really surprised by how much better this looks. I was originally planning to not even mention it in this blog, but it looks so good that I can’t help but show it off.

I also took the opportunity to finally add anti-aliasing to the Color Picker Triangle, fixing its ugly jagged edges. Nobody has ever pointed them out, and I might be the only one who even noticed; but regardless, it’s all nice and smooth now :D




Bugs Fixed This Week


  • Fixed being able to exceed the maximum CircuitBoard size using the Board Drawing mechanic
  • Fixed being able to exceed the maximum CircuitBoard size using the "snap resizing size to square" mechanic
  • Fixed intro screen text not changing color with UI palette
  • Fixed SUCC newline escapes not working properly
  • Fixed various issues with clickable links in setting descriptions and the about menu tabs
  • Fixed various typos in the localization files
  • Fixed not being able to hold down Buttons and Keys with the mouse while in a Chair


Happy Halloween from Mouse Hat Games!


Happy Halloween, friends! May your haunts be spookish and your candies multitudinous.



Please enjoy this SHINY BOBBY pumpkin, from the incredible mind and workshop of Jimmy’s Dad.



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

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.

View this post on logicworld.net

More Logic World Wednesdays

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

Logic World Wednesdays: The Optimized Edition

Welcome back to Logic World Wednesday! We’re hard at work on your game, and this week we’ve been focused on optimization.


Super Speedy Save Loading - Jimmy


I’ve improved the time it takes to load into a saved game by about 50%.

[previewyoutube][/previewyoutube]

There’s still more work to be done to improve this further, but I’m very happy with the progress so far.


Socket Slowdown Solution - Jimmy


Sockets are a component that lets you plug circuits into other circuits. When a socket’s conductive blue part is touching the conductive blue part of another socket, they form a connection, and signals can be transmitted through them.

Whenever a socket is placed, moved, or rotated, it needs to check whether it’s touching any other sockets, to determine if it should form a connection with them. Until this week, this was done by checking against every single socket in the world. This, obviously, is terrible; it means that the complexity of checking for socket connections increases exponentially as more sockets are added to the world. In nerdspeak, the operation was O(n^2).

Now, sockets only check against other sockets that are nearby. The world is divided into a 3D grid of cubic cells, and all sockets are indexed by which cell they are in. When checking for connections, a socket checks only against sockets in its own cell and in the 26 surrounding cells that have a point of contact with the base cell.

While this system is somewhat slower when you’re in a world with just a few sockets, it critically does not get slower as more sockets are added to the world. There’s a hard upper limit to how slow the operation can get; in nerdspeak, the operation is now O(1). When you have a world with several thousand sockets, testing for connections is now massively, massively faster.



Fixing this fixed a lot of the slowdown when loading worlds, as can be seen above.


Even More Web Fun - Felipe


This week I’ve been working on a bunch of minor website improvements:
  • All timestamps are now updated every 30 seconds to more accurately show the age of recent posts and comments.
  • The scroll position will now be properly saved and restored once the page is fully loaded when navigating to and from pages, or reloading.
  • Comment permalinks now work properly
  • Fixed quote formatting not working
  • Fixed comments not being sorted by date.
  • You can now edit comments, and the date and time of a comment’s last edit will now be displayed alongside the original post date.
  • Added “Related posts” column to all posts with a list of the newest posts in the forum that the current post is in.

Yet More Web Fun coming soon! I’m having a great time working on the site, and I look forward to making it ever more awesome.


Cubic Chunks - Jimmy


All objects in Logic World are divided into “chunks”. A chunk is a single, solid, giant chunk of geometry in the shape of many smaller objects. You stupid, gullible players are tricked into thinking there are thousands of objects in a world, but in reality there are only a few dozen. Chunking is the major reason why we’re able to have thousands of components and wires in a world without lag; GPUs are much better at rendering a small number of complex objects than a large number of simple objects.

Before this week, chunks were assigned along a 2D axis. Picture a checkerboard grid on a plane within the 3D world. Each chunk existed as a column: finite along two axes, but expanding infinitely into space along the Y axis. But this week I’ve overhauled the system to work properly in 3D: a 3D system for a 3D world.

This is an important step for optimization, and it’s already sped up performance somewhat by allowing for better frustrum culling in some situations. It’s also absolutely necessary to properly support world types that have a non-standard floor shape -- such as a spherical planet, or the inside of a giant cylinder -- which is something I really want to do.

I’ve also added a debug mode that colors all objects in a chunk with a random color, so you can visualize where the cunk boundaries are. I think it looks quite pretty :)





In the process of adding 3D chunks, I did a particularly satisfying refactor of our WorldRenderer class, which had grown very bloated and nasty in the ~1.5 years since it had been created. WorldRenderer used to be about 600 lines and do several different things; now it’s been split into four smaller, more focused classes, each 100-200 lines.


Packet Compression - Jimmy


This week I’ve implemented LZ4 compression on many of the network packets sent between the Logic World server and the client. LZ4 is an extremely efficient compression library: it makes data way smaller in exchange for a very small performance impact.

However, the performance impact is not zero: it’s around 10% slower to serialize or deserialize a packet when using compression. So compression should only be used in the specific situations where the increased serialization time is outweighed by the decreased packet size.

I spent about a day trying to build a system that would automatically detect whether compression should be used for every single packet. However, this ended up being insanely convoluted and not worth the effort at all. Instead, we’re now using a simple system where some packet types are always compressed, and some packet types are never compressed.

My original code for this was kinda trash ngl, but as he often does, Felipe swooped in and made my code way cleaner and better organized. In the process, he also allowed mods to specify that their packet types should be sent compressed. Thanks Felipe!

Because of packet compression, it is now about 75% faster to download world updates from the server and to upload your world changes to the server.


Hotbar Customization - Jimmy


I’ve started adding some customization options for your hotbar! The hotbar is some of the most used and most important user interface in Logic World, and it’s important that everyone is able to set it up exactly how they want it.



This is all part of my endeavor to refactor the hotbar code. The hotbar code is some of the oldest and worst code in Logic World, written at a time when I knew a lot less about coding and a lot less about coding user interface. It desperately needs to be cleaned up if I’m to add features to it.


Bugs Fixed This Week


  • Fixed sometimes not getting your position set by the server properly when you load into a world
  • LogicSettings: fixed being unable to save or load settings with a value of null
  • The game won't complain anymore if you've added files to the Backups folder that don't conform to its expected folder structure

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

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.

View this post on logicworld.net

More Logic World Wednesdays

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

Logic World Wednesdays: Bits and Bobbies

We’ve had a productive week, working on various odds and ends throughout the game.

Multiplayer Menu - Jimmy


I’ve been working on one of our last big pieces of user interface, the multiplayer menu!



(WIP!)

I’ve also been working with Felipe on the code for learning information about a server before connecting to it, such as the MOTD and player count, for displaying in this UI. Unfortunately that stuff is really hard and we weren’t able to finish it for today. Once that’s all done and integrated with the UI, I’ll likely do a video showing off some neat features of this menu :)

Web Fun - Felipe


This week I’ve been plugging away at our logicworld.net website, fixing bugs and adding features. I started by creating a temporary user page, like this one. It’s still very much barebones though, I pretty much added it just to get rid of the 404 error you’d get otherwise. I will be improving it over the coming days, allowing you to edit your bio as well as showing your post history. Last week I added comment deletion, however a bug prevented the delete icon from showing. I fixed this bug, and I then added post deletion and editing, with comment editing coming soon as well!



More Robust Save Loading - Jimmy


All components in Logic World have a standard set of data: the position in the world, the rotation in the world, et cetera. But many component types have additional custom data that they must save and load. For example, a Circuit Board must save its width, length, and color. A Switch must save its color and whether it is on or off.

For every component with custom data, that data is stored as raw binary, both in memory and in the save file. Every component has a CustomData byte array. This array is null for components without custom data, and full of binary for components that do have custom data.

For handling this on the API side, Logic World uses a very clever system: we define an interface type with the custom data that the component has, and at runtime, binary serializers and deserializers are generated for all the properties of that interface.

interface ICircuitBoardData
{
int Height { get; set; }
int Width { get; set; }
Color24 Color { get; set; }
}

class CircuitBoard : ComponentClientCode
{
public void SetDimensions(int width, int height)
{
// These calls to the Width and Height setters automatically
// invoke the binary serializer.
Data.Width = width;
Data.Height = height;
}

public void RageQuitIfBoardIsBlue()
{
// This call to the Color getter automatically invokes the
// binary deserializer.
if (Data.Color == Color24.Blue)
Application.Quit();
}
}

For a long time, there’s been a major flaw with the custom data system: the automatic serializers and deserializers had no way to detect bad binary data. If a component tried to deserialize the binary data and ran into a problem, then best case scenario the data would be totally wrong, but most of the time there would just be an extremely unhelpful error and the save would fail to load. This would usually come up when loading an old save after we changed the custom data structure of a component -- for example, it happened to several of our beta testers recently when we added two new properties to the Flag custom data, the flag name and the option to include it in the teleport list.

This week I added some validation code when deserializing a component’s binary CustomData. Before and after deserialization, the save loader will validate that everything looks okay. If it doesn’t, then that component is reset to its default data values.

With this change, game saves are even more robustly protected against corruption and against breaking changes from us and from mods. It’s been on my todo list for a long time, and I’m very happy to have finally implemented it.

Convertible Boards - Jimmy


A few weeks ago I spoke of a new system for force-loading worlds that have potential issues. Well, this week I ported that system to work with saved boards as well!



This ensures that your saved boards will always work; when our future game updates break them, there is already code and UI in place to convert them.

Persistent Hotbars - Jimmy


In Logic World, before you place an item in the world, you must add it to your hotbar.



Previously, the items on your hotbar would be reset every time you loaded into a game. But this week I’ve made hotbars persistent! The data is stored in the save file in a nice human-readable format, alongside other player data such as a player’s position in the world and the direction they’re looking.

I’ve also started work on the backend code for saving and loading hotbars, which is a feature I hope to add soon :)


Bugs Fixed This Week
  • Fixed "Cannot initialize Cloth: scale is zero!" issues
  • Fixed a rare memory leak related to the music player system
  • Fixed not being able to auto-delete old backups that were made with suffixes
  • Fixed your settings being reset every time you start the game
  • Fixed a save-conversion log message not being triggered when it should be
  • Fixed worlds being force-loaded always instead of just in appropriate situations
  • Fixed disconnecting while placing a loaded board creating permanent "phantom components" that cannot be interacted with but nonetheless lag up the world

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

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.

View this post on logicworld.net

More Logic World Wednesdays

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

Logic World Wednesdays: The Reorderable Edition

Reorderable Lists - Jimmy

I’ve added a slick new system for reordering a list of items using click and drag.

[previewyoutube][/previewyoutube]

Heavy UI Polish - Jimmy

While implementing the reorderable lists, I noticed many small inconsistencies and annoyances with Logic World’s menus. Elements that were misaligned by a few pixels; scrollbars that had a tiny amount of slack where they should be fully expanded; state flows that required more mouse movement than I would like; buttons in inconvenient or ugly places. Because I’m a crazy perfectionist, I spent about a day going through my list of grievances and fixing many of the issues.

I’m pretty happy with the improvements. To me, at least -- because I know what to look for -- the UI is noticeably nicer to use.

I’m rewriting the website again lol - Felipe

I have decided to rewrite the logicworld.net website completely from scratch one more time.

To help you understand how I arrived at this decision -- and how The Vuening will be superior to all the iterations before it -- let me tell you the story of my journey as a web developer...

[h2]The History of Logicworld.net[/h2]
Way back before we even announced Logic World (around October 2018), I started writing the logicworld.net website for the first time. I made it in C# using the ASP.NET Core framework and plain old server-side HTML templating. The server was completely monolithic, meaning there was a single executable that handled everything, from storing data in the database to sending the site to the users. The more I worked on it though, the more I was becoming limited by the technology I was using: the HTML pages were littered with Razor interpolations, and it was very ugly. For this and some other reasons, I decided to rewrite the site, this time using an SPA framework called Vue.js on March 21, 2019.

SPA means “Single-Page Application”, and you can read in-depth about them on Wikipedia. A typical website has many separate pages, each of which must be loaded independently by the browser. SPAs, on the other hand, load a single page and then dynamically update that page’s contents based on what the user is doing.

The new, SPA-based logicworld.net was much nicer, the code was cleaner and everybody was happy, however the backend was still the same as the original. That code was also getting quite unmaintainable (after all, this was only the second web project I’d ever done!), so the need of rewriting that as well was quickly growing.

[h2]The Kubening: The Final Form of Logicworld.net[/h2]
At this point, I scrapped every single line of code I had written for the website and started on a fresh new repository. I knew I wanted to go with a microservice architecture, since I started using it on the previous version (albeit too late) and I quite liked it, so a core part of the new system would be Kubernetes. Kubernetes is sort of a “competitor” to Docker Swarm, which is the service we were using previously and that took care of managing containers and spreading the workload over multiple machines. Docker Swarm is built-in to Docker, while Kubernetes is a completely separate system, and they both have one thing in common: their job is ultimately to create and destroy Docker containers.

This new system, with Kubernetes being very scalable and “modular”, allowed me to start writing the many services that would make up our cloud infrastructure (which were of course written in Go). When I started to write the main web service, I was faced with a decision: should I use an SPA framework like the old site, or a pure HTML based solution?

I started to contemplate the pros and cons of each solution and, as you might already know, ended up choosing the pure HTML way. It was not an easy, straightforward decision, but I chose pure HTML for the following reasons:
  • SPA sites are heavier on the first load than HTML sites. Since the main use for the site (at least right now) is to read LWWs you are unlikely to navigate much around the site, so the SPA’s benefits of only loading assets once doesn’t give it an advantage over plain HTML, and in fact makes it a bit worse.
  • Some people have JS disabled on their browsers (usually for privacy reasons), which makes an SPA completely unusable.
  • An SPA is a bit overkill for a game’s website.
  • An SPA communicates with the server via an API, which also has to be developed and maintained.

So, I got to work on the new site with plain old HTML and a Go backend. As time went on though, I found development on the site to be really slow, and the HTML templates were getting as complicated as they were in the very first C# version of the site. The user experience also wasn’t very good, with the page reloading for every action you wanted to take. This brought me to reconsider the reasons I decided to go for the HTML solution.

[h2]The Vuening: The True Final Form of Logicworld.net[/h2]
After much consideration, I finally arrived at the following conclusions:
  • While it is true that the initial load time of an SPA is slower than a pure HTML site (sending 3-4 times the quantity of data), this advantage disappears once you’ve navigated to a couple more pages. Our envisioned future for logicworld.net is one where most people are doing a lot of page navigation, browsing forum posts and uploaded creations. When you consider that as the typical use case, the SPA actually wins for total data sent and total time spent loading pages.
  • Only a [very small percentage of people](https://deliberatedigital.com/blockmetry/javascript-disabled) have JavaScript disabled, so making such a huge decision to appeal to that small fraction of people does not make sense. While we support folks’ efforts to retain more privacy online, we ourselves are not actually stealing any data using JS, and the most important thing is that we have a functional website at all:
  • An SPA is
  • much* faster to develop new features for, see the below paragraph. I think that in the future when we introduce workshop features I will be very glad to be using one.
  • My worries about maintaining an API were partially extinguished when I decided to use GraphQL, which I will talk more about down below.

For these reasons, I decided to rewrite the site into an SPA using the new Vue 3 and GraphQL as the main libraries. To be clear though, this is only a rewrite of the *website* part of the whole system. Absolutely none of the other services (such as the forum database backend or the user account authentication service) had a line of code changed, which is a big part of the reason I was able to perform this rewrite so quickly. I wrote the new site *in less than a week* (I started shortly after publishing last week’s LWW). I was able to write the boilerplate code in a day and after that, progress was silky smooth, I had a functioning forum in a couple days. This is a huge deal, as it means we are now able to iterate on and improve the site very quickly, fixing issues in a much shorter time than before.

The new SPA does have some additional advantages, for example quicker navigation between pages and the future possibility of having new comments and posts appear in real time. Additionally, since we are now using a GraphQL API, third-party applications are now able to utilise it in case you *really* don’t like JS (keep in mind we won’t support them though).

We want logicworld.net to be a central hub for community discussions, with more depth and persistence than is possible with the real-time chat of Discord. We want it to be the best place to share your creations and mods with others. I’m feeling excited and confident that this new website architecture will allow us to achieve this vision.

Check out our shiny new website -- it really is quite awesome.

Bugs Fixed This Week
  • Fixed other players not affecting flag cloth physics
  • Fixed not being able to see your own reflection in SHINY BOBBY
  • Fixed the loading screen not displaying when connecting to an external server
  • Fixed the "Disconnected" screen becoming stuck on if you used the console to connect to a server while on the disconnected screen
  • LogicUI: fixed HoverButton still registering ClickBegin events when EnableButton is set to false
  • Fixed some color picker menus not playing nice with menu resizing
  • Fixed being able to set the size of the Edit Display Configurations menu to so small that the UI would glitch out

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

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.

View this post on logicworld.net

More Logic World Wednesdays

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