Introduction
Hi! I'm 0array, the lead developer of the game client of Kubeo. First of all I'd like to say welcome to kubeo's blogs! In blogs we will be regularly publishing updates & news relating Kubeo. I'll be publishing all types of news and updates we would be making to the Kubeo workshop. In this blog post I'd like to talk about the progress of Kubeo's Workshop. At the end I will also mention the other features I want to add by release.
Background
If you're not aware, Kubeo is using Godot's latest build as its game-engine. Kubeo also utilizes LuaU which is a fast (100 - 10,000 times faster as compared to MoonSharp!), small, safe, gradually typed scripting language derived from Lua. But why did we opt for this? Well, many platforms make use of MoonSharp which is basically a interpreter for the Lua language however written in C#. MoonSharp is also very slow as compared to the original Lua C Interpreter. Kubeo using LuaU allows us to have very fast execution for the scripts written by the community. The game-server when sending game-file to a client will convert high-level LuaU code to Byte-code so when comes the time to run the script: the code is executed blazing fast as the part of lexical analysis in a cycle of a interpreter is entirely skipped. This is entirely safe as LuaU internally does not allow access to specific dangerous methods in classes like os. Another reason why we opted for LuaU is because users if they want to could make use of static-typing.
Kubeo's workshop makes use of only C# strictly and no-use of GDScript. But why? In .NET 8.0 compiling C# code Ahead-of-time was introduced which means compiling the code to machine code on the time of building the program. This allows a smaller size in binary, faster code-execution and resource-protection unlike the regular JIT (Just-In-Time compilation). This also means Kubeo makes use of no reflections in the runtime.
Diving in
So lets dive in the features we're very proud to offer in the workshop!
The built-in code editor
Kubeo's workshop has a built-in code editor. This means you are not required to make use of a external code editor like visual studio code or any. Our code editor make's use of the LuaU LSP which allows the code-editor to have multiple features for example:
- Syntax highlight
- Fast diagnostics giving warnings and errors or hints
- Fast code-completion entirely built-in
- Find References
- Go To Definition
- Hover
These features are not completely implemented yet. We've implemented syntax highlight, diagnostics and code-completion which still need more improvements. In the image below you can see a preview:
Here the code-editor is giving a type-error. But why? This is because it knows that the variable called "MyInstance" is nil and nil basically means something non-existent. So you can't really get a property from something non-existent.
Below is a GIF which demonstrates the code-completion:
Right now the diagnostics system does not have a delay which will be implemented soon. The code editor also offers a mini-map at the top-right as you could see in the GIF.
You can also make use of Ctrl + Mouse wheel to adjust the font-size in the code-editor. This is also automatically saved when you exit the workshop!
The gizmos
Just like every workshop/editor we too have gizmos to allow users to manipulate the transform of a dynamic-instance. Here is a preview for the move gizmo kubeo's workshop will offer:
Obviously it is not the perfect right now. In this preview remember I was making use of the Ctrl key to enable snapping. Anyways we also got a rotation gizmo and a scale gizmo!
In the preview of rotation gizmo and scale gizmo you can see on how the studs are VERY weird. I was working on this issue but I wanted to release a blog post first.
The gizmos also have support for multi-selection of dynamic instances:
The sky moves!
Kubeo by default will enable a 24 hour day-night system. This can be disabled in the workshops environment settings.
Clouds move!
Complete workshop UI preview
Some icons in the game-explorer are missing because they are not yet done. The properties window The properties window is simple and easy to use. Changes apply to the instance immediately, so you don’t need to press Enter each time you type—ta-da!
The game-explorer
The game explorer is a main component of the workshop. It displays all the instances in the game and includes a fast search bar. Clicking any tree item in the game explorer selects the instance.
The output
The output panel is quite simple it outputs all of the messages for-example when a internal crash happens within the output it is reported to the output so the user could see and make a bug report relating it. It also outputs the runtime scripts print() statements when we are inside the play-mode
The extreme-left sidebar
The icons on buttons are very self-explanatory for-example the green icon with three cubes indicate a Model instance and clicking on it will instance a Model into the game.
The top-bar
The top-bar features quick actions like undo or redo with access to the internal clipboard which could be used to copy, paste a already copied instance, cut a selected instance and a delete button. The second group in the top-bar features quick actions for play-testing related. The third group is to manage any selected Part. This group of button are only enabled when a instance of type Part is selected.
Behind the Scenes: Overcoming Technical Challenges
Avoiding Reflection & Enhancing Performance
Since the Kubeo workshop is compiled AOT we couldn't make use of runtime-reflections which is basically dynamically invoking or getting properties without knowing about them at the compile time. This means we could not give every datamodel property a attribute hence we ended up making a virtual property which is a hashmap for all the exposed properties and methods to LuaU. This also allows a very easy use of properties as when a instance is selected a loop runs instancing proper properties. Most likely there is more room for improvements maybe even a house haha - but we are actively working on optimizing the kubeo workshop and adding more features.
Talking about the features which I intend to add
Team-create
Team-create is a feature I've been wanting to work on from a while. It would work in a very simple way. The creator of the game can add specific users on Kubeo from the on-site game settings (maximum 7). This will automatically enable team-create. But what is the difference behind the curtains? Kubeo will specifically deploy a team-create server to keep the game-state synchronized between developers working at the same time. I don't really intend to allow 2 or more people writing code in the same script however this may be a feature in the team-create too however not sure and same goes for selected instances. However the creator of the game will be able to enforce kick a developer who is inside the code-editor or if someone has selected a instance. Team-create will be available to all of the users and will not be a premium feature.
Talking about the supported platforms
On release Kubeo's workshop will most likely have support for the following platforms:
- MacOS
- Windows
- Linux
However for the Kubeo game/player client it may also have support for the Android operating system. Workshop for android operating system is not planned.
Before Wrapping up: The Roadmap
Before wrapping this blog up, I'd also like to talk about the road-map like what I have planned and when will I be doing it. Currently I am a little slow with development for personal reasons. After this blog, I'll be working on the game-file deserializer which will run on a separate thread and then work on the functionality to make the code-editor be a popup. Kubeo is also currently debating if it should use Vulkan or OpenGL based rendering method. But why? Well as I had stated we do plan to make a android build and if it supports OpenGL many older android phones would be able to play Kubeo very smooth.
Wrapping Up
Alright guys. This was all which I wanted to cover and make public to the users. Make sure to be on a look-out because I sure will be publishing more blogs! Maybe every week. Unfortunately I was not able to mention all of the features and plans I have for the workshop well obviously so I could post them in separate blogs and keep you guys hooked haha. Anyways thank you so much for reading this blog and I hope the blog did not disappoint.