s
Português English

Programming

Web_Logo_Title_1500-1024x273.png
2022.12.01

Flax Engine

In a year full of personal experimentation in other careers (like running for congress, for example :), I still programmed a lot. I invested a lot of time studying Docker and containers, Kubernetes, Home Assistant, and hosting web systems myself (like Nextcloud).

But game design is a passion.

I constantly get annoyed with Unity3D and the latest events on the business side, which had me worry even more. I tried to use Godot and failed. C# is far better in terms of easy-to-use and safety compared to C++ and even more to custom scripting languages. It’s more organized and well-documented. And I have years of accumulated experience. And Godot-C# integration is buggy, unstable, and full of gotchas. The way they re-implemented C# in the upcoming Godot 4 created so many artifacts to properly work that I got even more frustrated. I could not use Lists<>!

After watching a curious review on the GameFromScratch channel, I tried a new kid in town: Flax Engine. It’s a C++/C# engine heavily inspired by Unity. The from-to process is straightforward. After just a few of weeks playing with it, now I decided to invest in it. I am planning to port my closest-to-finish game I have to it by the end of the year. It’s 1 step back, 2 steps forward.

Cons

👎 Like Godot, there is no way, currently, to drag-and-drop assets and actors with a specific class. I always have to ask for a generic Actor in the editor and check if has the given class in the code. Annoying and error-prone.

👎 Still lacking several common features, compared to Unity and Unreal. It’s evolving and, most importantly, their competitors pave the way for inspired clones like Flax.

👎 Minuscule community compared to other game engines, even the indie ones. Recent GitHub reports the biggest Open Source projects do not place Flax into the top 10.

Neutral

😐 Not FLOSS. It’s open source but it’s not free. The license requires paying royalties. It’s very close to what Unreal asks but more generous. I would love to see it converting to a full FLOSS model in the future.

👎 Old C#/.Net version. A branch with the newest .NET 7 was created and developed. The current version uses .Net Framework 4.8 and it is a pain to install on Linux.

👎 Still lacking Docker image for CI/CD (well, Unity and Unreal also do not have official ones). I may implement a repository myself, inspired by GameCI ;)

Pros

👍 1-1 adaptation from a Unity developer. It’s not as feature-rich, but it’s very competent.

👍 Open community. A lot of issues and Merge Requests on the project’s GitHub page. I’ve been talking to devs in a Discord channel and they are receptive.

👍 Small footprint. The editor is only a couple of megabytes and the “cooked” game is also small. If possible, running it in an Alpine-like image will create a minuscule image to use CI/CD.

netlify-cms.png
2022.03.19

Netlify CMS

I do maintain, for almost 10 years now, a personal journal. A diary. It’s self-psychotherapy. It’s a way to express my thoughts and feelings.

First, I used Google Docs. I created dozens and dozens of files, one for each day. Eventually, I realized that Google was not supposed to be trusted with confidential and personal information. Their spiders crawl and index everything. These thoughts may be still there, even after I delete all the files. Who knows.

Then I migrated to a secondary solution: WordPress. I hosted a blog and used an add-on to lock it up, allowing just me to see. It’s wonderful for blogging, with a lot of tools. I designed some extra add-ons to manage some aspects of the journal, like a word count and a title generator (based on the post date).

However, maintaining an up-to-date WordPress installation is critical. Due to its popularity, and broad usage for e-commerce, WordPress is a target for many, many hackers. I started to think that I could let hacked and let all my stuff be exposed. So I decided to export all posts and move once again.

I tried to only maintain it offline, on my computer. It’s, for sure, the most secure way. Anything that is on the internet, even if it’s secured, could be hacked. But sometimes I want to write while away from home. On a trip, for instance.

I looked for a solution that was hosted online, secure (bonus if it was encrypted), and versatile (super bonus if it was open source). I tried some days using SimpleNote, and then Notion. Notion is very nice, and I was using it not only to write my journal, but also I started to use it to track some daily routines, like checking weight, sleep time, and amount of water that I’ve consumed.

But again I was not very confident about security. So, I’ve exported everything and decided to host it only on my computer. This time, with a caveat: I was liking the usage of Hugo static site generator, so I designed a blog front end and only enable it locally. And use git to track changes and host at GitLab. If eventually I’m not at home and want to write, I could find an app to connect to the repository and write. Months passed, but I’ve never found a mobile app. So I was locked to just write locally or access the repository using VS Code or whatever.

Finally, the Main Topic

The other day I decided to check Netlify CMS. Created by Netlify hosting service, it tries to create a dynamic admin front end to manage static websites. The result will still be very much static, but the admin section is a single page with a JavaScript script that will do everything. It will communicate with an online git repository and commit any new post. The authentication is done through the git service, GitLab in my case. It could be GitHub or any other git service. If the user does not have access to the repository, the admin page will be blank. It reads the source in real-time.

Besides, I could also host the final journal online using GitLab pages, but with settings that are only visible to maintainers. The same authentication would be required to see both the front-end and admin pages. Nice solution.

Netlify CMS is VERY simple. I can only imagine how complex is under the hook, but the final experience for users is simplistic. However, it does the job: I can now access and write my journals from anywhere, including the browser on my phone.

The system relies on a monolithic configuration file that is hosted side by side with the content in the git repository. Traversing all the posts from a remote git repository is very slow and not efficient. I cannot imagine dealing with a more complex team structure using it at the same time.

A neat feature is the draft mode: it creates automatically a fork with the draft content. Only when the user clicks “Release”, it merges the content into the main branch and publishes. Netlify CMS does not require Netlify itself, but they are nicely integrated if you decided to use it.

After the successful first experience with my diary, I implemented it in my blog. By the way, this very post was written using this pseudo-CMS!

logo_large_monochrome_light.png
2022.02.10

Godot Jam Review

At the beginning of the year, I posted about the retrial of Godot, the most popular free and open source game engine around.

I’ve posted some pros and cons at the time. I then decided to enter into a JAM to motivate myself to try to use it myself for a real complete project. Even if it is a jam-like game.

Now it’s time to write a review the whole process.

TLDR: I failed to complete the game. I tried to create a pipeline to build a nightly version for the latest version, with C# support. It is partially running ok.

Bootstrapping

The Jam theme was “ocean”. Bonus points if:

  1. All sounds in-game are made with your mouth(s)
  2. Include a fishing mini-game
  3. Include your favorite quote or pun in-game

So I started. As previously said, I’ve planned to implement an old game of mine as the main game. The advantage was that I knew what was needed and the general need. Another plus was the fact that the game was abstract, so I could save a lot of resources and time on the presentation. And by doing the sound effects with the mouth, I could neglect this front until the end.

For the mini-game, I looked for a small board game that I could easily implement in digital form. After some research, I settled with Leaky Boat, a fast-paced pen-and-paper game with dice.

So I started to code. But the problems with the C# integration were getting on my nerves. Godot editor crashed more than 30 times on the very first night of coding. It was not blocking the path, but it was making it very, very difficult.

New Version from Scratch

As a potential solution, I checked if the undergoing development of Godot 4 (I was using the “stable” version of Godot 3.5) had any nightly build available. I’ve found a guy that was creating these nightly builds! But only the original non-C# version. The repository was open, so I checked if anything was possible to salvage. Not much.

So, as a detour, I decided to build a pipeline on GitLab that would compile the source code and build it. Eventually, I would schedule it to run every night. However, the process of creating a build pipeline online is very tedious and laborious: on every change, I had to run online. In the case of Godot, trigger the code compilation to eventually discover that 30 min the build started, it failed due to some dependency on the build stack was not fun. It took me a whole day to spend my CPU quota doing this.

So, as a second detour, I decided to host a local GitLab instance on my computer. It would allow me to develop the pipeline itself. Once ok, I would migrate back to the online service. It took me 2 days to set this. I first decided to go with local Kubernetes, but it was getting too complicated. Then I migrated to a solution that I am more familiar with: Docker-compose inside a virtual machine. I created it inside VirtualBox (instead of KVM) because I planned to reuse it when I decided to use Windows.

Downloading and building several docker images takes a lot of space! I had to resize the VMs to a much bigger size than originally planned to accommodate a dozen images created/downloaded.

The plan was to create a helper image with all the tools needed to compile the code with or without C#, host/register inside GitLab itself, and reuse it in the main pipeline. This step was working fine, but the actual build was failing time after time.

To check if the steps were right, I decided to compile them inside my machine. I did not want this to not pollute my pc. But worked. Since I “wasted” a couple of days on this detour, I decided to use this local compilation in my project again.

New Version, Old Problems

Godot 4 renamed vaious classes. Also, it changed countless small things internally, and it took me a couple of hours to migrate to the new environment. Good thing is that I did not have much to convert. Done. And the game was working the same as before.

Now it was time to continue the development. But the problems continue the same way: the editor was crashing time after time. I managed to make both the game and the mini-game functional, but with restrictions. The pace was slow because I had to investigate the way of doing things all the time. And the documentation was definitively not comprehensive for C# users.

After 5 days, I gave up. 😞 I could theoretically finish the game in a certain state, but I decided to focus my attention on other projects instead. I might try to go with this engine later in the future, but for now, I will return to Unity until I finish one of my projects.

A couple of days after the end of the jam, Godot 4 alpha 1 was released. I still think that, if the devs do not provide a nightly version by themselves, my project has some space.


Despite the failure, I’ve learned a lot about Godot, GitLab, and Kubernetes. Especially, the latter two. I will use it in the future for sure, so I do not feel the pressure of failure.

All the code, even incomplete, is open source in my GitLab profile.

Also, they are organizing a Jam every month. I can reuse all to the new jam, for certain.

logo_large_monochrome_light.png
2022.01.13

Trying Godot Engine Again

It’s about 10 years since I discovered Unity and fell in love. The editor was great, but I liked programming in C#. It allowed me to be both organized and creative.

Despite being among the top 2 suites in the world, I’m increasingly annoyed by them. It became big spyware, heavy and full of annoyances. In addition to being super expensive (for Brazilian standards), the pricing model is much less indie-friendly than its nemesis, Epic’s Unreal Engine. Users pay upfront instead of paying royalties for their success.

Time to explore new grounds! To be honest, I try new stuff all the time. It’s time to land on new grounds! Some criteria to consider:

  • Open source preferred, almost required.
  • Avoid C++ (because my games would leak memory of certain). JavaScript is discarded due to its performance. Rust is hot, but an engine supporting it is probably super beta.
  • Small footprint if possible.
  • Pro developer tools, like CI/CD headless compilation.
  • Big community or organization supporting it. The lack of big support is an abandoned project wannabe.

So for the past months, I tried to play with several options. Notably:

  • Unreal is unbearably gigantic (7gb+), which hits especially hard on CI/CD. And the Linux editor is buggy.
  • I was excited by Stride/Xenko, but months after put as open source, it was abandoned as far I can tell.
  • Godot has that annoying scripting language embedded, but the no-go was the lack of an equivalent of ScriptableObject to create data assets.
  • O3DE is a possibility for the future. Lua as a scripting language is a personal nostalgia.

Spark of hope

Then I read an article about creating data assets in Godot. It used C#. It was not a trick or complex. Pretty straightforward. I decided to try it again. Less than 100 Mb later, with no need to install or register, I started my -again- the first project. The goal was to load data from an asset created using C# code, just like a ScriptableObject in Unity. The test was a success.

So it’s time to try to create a full prototype game! I’m planning to join one of the several jams they organize to motivate myself to finish. No prizes are involved, just for the challenge. Things to explore to be conformable with:

  • Client-server multiplayer.
  • Scene streaming.
  • Animations.

Another idea is to recreate an old game of mine: PICubic. It was not commercially released, so it might be a good way to learn and expect results.

Some general thoughts

After a week that I’m playing with it. Some thoughts:

Cons

👎 The design principle is that each node has only one script attached instead of the super common component-driven approach lacks. Especially trying to design complex systems using small parts, like the microservices in web development. I heard once that there is a spin-off that implements this, but there is no traction in the community.

👎 C# integration is still not good. At least on my computer, the editor crashes each 30 min at a random time I hit play. Also, the editor does not display custom C# classes in the inspector. I design several vanilla classes to organize the code, but I had to transform them into Resources to be able to edit their data.

👎 Linking assets in the editor does not respect the class restriction. One could insert a Player asset instead Weapon and the editor will not complain. I have to check before using an external variable every time.

Neutral

😐 Refereeing nodes in the hierarchy and the asset folder are two distinct things. Nodes in the hierarchy are accessed by NodePath while prefabs (here called PackedScenes) have a different type.

😐 GDScript: focusing on a custom language instead of vanilla widespread like C# or C++ is a waste of both newbies’ and Godot’s own developer’s energy.

Pros

👍 The everything is a scene approach fascinates me. I always thought this way in Unity: scenes are just a special prefab.

👍 Creating an automatic build pipeline on GitLab was a breeze. Due to the smaller container and less complexity, it takes less than 2 minutes to create a build on any platform. An empty Unity project takes this time just to download the 4gb+ image and at least 5 more minutes to compile.

The project development is somewhat slow for my taste, but they are receiving more and more financial support in the last months that might enable them to accelerate the pace. I’m especially interested in the new external language integration for the upcoming Godot 4.

2021.11.11

GitOps Lifestyle Conversion

I’m currently fascinated with GitLab’s handbooks. I heard of companies trying to be more open to the public, but the extent that GitLab is doing is unprecedented. They are documenting everything publicly. Most, if not all, internal processes are getting written for everyone to see.

  • How we admit new people? It’s there.
  • How and when do employees are bonuses? It’s there too.
  • What is the ERP used? It’s there.
  • In fact, what is the whole list of external software and service used? It’s there too.
  • The scripts used to manage their own site? They are there too.
  • Personal information, like employees’ actual salaries? Of course, they are not there.

Too much information? Maybe. But it’s definitively inspiring.

Another source of personal inspiration comes from a guy on Twitter: Keijiro Takahashi. This Japanese programmer does several mini-tools for himself but publishes everything on GitHub with minimalist licenses like MIT.

In contrast, I was checking my LinkedIn the other day when I decided to share my GitLab and GitHub accounts. There are so many projects over there. #ButNot. Most, almost all, were private! Many game prototypes, and small side projects. All locked. Some are live backups since are not been updated for ages. So I decided to do a couple of things:

  1. Open some of the closed projects
  2. Git-fy some of my personal and professional projects
  3. Documentation as code for my new company

The first is pretty straightforward. Mostly checking a box. Sometimes adding small README or LICENSE files. Few times making real changes.

The second is a new mindset: I have dozens of small projects, from games to personal scripts, that I’ve never used git to track changes. But not only I could get better control of it, but also I could share it with the world. You will see more and more projects popping up on my GitLab account page.

The third, follow partially GitLab’s way. I’m considering documenting most of the processes in git-like wikis. It will not only be good to share the knowledge with other employees and partners. It’s also good for tracking the business decisions that changed these processes. A rather clever approach.

Bruno MASSA