Skip to main content

Velaptor Release v1.0.0-preview.32

· 7 min read
Calvin Wilkinson
Creator and Maintainer of Velaptor (and other projects)

Hello and welcome to another Velaptor release!!

This release brings you some small performance improvements, the start of your mocking library migration, some API deprecations, and some bug fixes.

Release notes

A quick thanks to the following contributors for their contributions to this release:

Quick Overview

This release of Velaptor brings you the following:

  1. Small performance improvements related to fonts and rendering text.
  2. Small performance improvement to OpenGL buffering.
  3. The start of the mocking library migration process.
  4. Removal of internal use of deprecated Velaptor UI Control API.
  5. A small bug fix was discovered during development.
  6. Internal dependency updates.

Perf Improvements

In the realm of game development, performance is a perpetual pursuit. We’re constantly on the lookout for opportunities to boost the performance of Velaptor. This time, we’ve made a couple of minor enhancements.

While these modifications might seem small, they were straightforward to implement and have contributed to the overall performance improvement. Specifically, we’ve optimized the way we interact with OpenGL and transitioned the FontStats struct to a readonly struct, resulting in more efficient operations.

Please note that even the smallest performance improvements can accumulate over time, leading to a significantly smoother and faster gaming experience. Stay tuned as we will as we continue to enhance Velaptor’s performance!

Mocking Library Migration

This is not going to affect any users of Velaptor, but this will affect contributors and maintainers.

Migration Details

This is related to refactoring all of our unit test code from using the moq library to the NSubstitute library. This is going to take a while but all of the issues related to this are created and ready to go. We will be working on releasing at least one of these issues or more per release.

Rationale Behind the Migration

The decision to migrate from Moq to NSubstitute is influenced by several factors. Like many .NET developers, I’ve used the Moq library for mocking for a considerable period and have found it to be a reliable tool.

However, as Velaptor has grown in complexity, so too have the verbosity and intricacy of the unit tests. While this is not inherently negative, it does pose challenges in terms of maintenance and comprehension.

Over time, I began exploring NSubstitute and found it to be a promising alternative as well as not as verbose and more readable. A recent incident within the Moq community was the catalyst to finally deciding to make the switch.

For those interested in the specifics of this incident, you can read about it here and watch it here.

While I have my personal views on this matter, I choose to keep them private. I firmly believe in the inherent fallibility of people and do not think it was intentional.

However, it’s important to note that the decision to switch was not solely based on this incident. There are multiple reasons, all aimed at improving the quality and maintainability of Velaptor.

Deprecated UI Usage Removal

We deprecated the Velaptor UI Control API in the last release which was version v1.0.0-preview.31.

In our last release, version v1.0.0-preview.31, we deprecated the Velaptor UI Control API. This change doesn’t imply the removal of the deprecated API from Velaptor itself, but rather its usage within our internal codebase, specifically in projects used for manual testing of Velaptor.

We have an internal project named VelaptorTesting that is part of the codebase. This project, which is part of the main codebase, was utilizing the deprecated UI API to provide a user interface for testing Velaptor.

NOTE

Changes to this project do not affect Velaptor in any way.

To replace the UI in the VelaptorTesting project, we decided to use the ImGui.NET library. This library is a popular and battle-tested solution that has been around for a long time, making it an obvious choice for our needs. With the replacement of the UI API with ImGui.NET in the VelaptorTesting project, we are now in a position to fully remove the deprecated control UI API from the Velaptor codebase when the time is right.

Reasons for deprecation

The decision to deprecate the Velaptor UI Control API was a significant one that I’ve been contemplating for some time. This API, which enables the creation of UI controls like buttons and text boxes, proved to be quite labor-intensive during its development. As I delved deeper into the API, I realized the enormity of the task at hand. Maintaining a UI library for a game framework, where there is no consistent UI design across games, seemed daunting. The complexity and diversity of game UIs made the prospect of a universal solution increasingly challenging.

Initially, I envisioned Velaptor as a tool not just for games, but also for creating cross-platform UI apps. While this is technically feasible, it requires a substantial amount of work. I didn’t want to compromise the quality of the rest of the library, which is primarily geared towards game development.

Given these considerations, I decided it would be best to deprecate the UI Control API before we reach v1.0.0 and solidify the API. This decision allows us to focus on enhancing the core functionalities of Velaptor. However, this doesn’t rule out the possibility of revisiting this direction in the future.

Timeline for full removal?

While the Velaptor UI Control API is currently deprecated, it remains functional. As you continue to use the API, you’ll notice deprecation warnings in your preferred IDE or text editor.

If we were beyond v1.0.0 and the API had a substantial user base, we would delay its removal. However, given that we’re still in the preview phase and the user base is relatively small, we plan to remove it in an upcoming release. The exact release for this removal is yet to be determined.

The removal could happen as soon as two releases from now, or it might be delayed until ten releases later. Given that the API is not primarily used for game UI but for UI apps, the likelihood of it being actively used is quite low.

Recommendation

We recommend updating your code as soon as possible.

Bug Squashing!!

Let’s be honest, there’s a certain satisfaction in squashing bugs, especially during development. It’s like getting a bonus when you discover a bug while working on something else. This is precisely what happened in our case.

Then comes the realization that the bug has been lurking there for a while, making you wonder how it slipped past you or why no one has reported it. But no matter how minor or improbable the bug, We are always ready to tackle it head-on!

This particular bug was quite unlikely to occur. It was related to an incorrect null reference exception that would occur if you invoked the Window.Show() or Window.ShowAsync() method to start your game after you had disposed of the game object using the Window.Dispose() method. One might wonder, why would anyone do that? Regardless, the bug is now fixed. If you attempt to do this, you will receive a proper ObjectDisposedException message.

Dependency Updates

We keep our dependencies up to date as much as possible. This release is no different.

  1. SimpleInjector updated from v5.4.3 to v5.4.4.
    • This is used for all of our dependency injection needs.
  2. SixLabors.ImageSharp updated from v3.1.1 to v3.1.2.
    • This is used for loading image data from disk before being uploaded to the GPU.

Wrap Up!!

Well, that is it for the release!! If you want to know more details of the changes of any release, it is all public and open source!!

If you are interested in contributing to the project, please check out the project on GitHub or join the Discord server and say hi!! We would love to hear from you.

Until the next release!!

Join Our Community

We believe that everyone has something unique to offer, and we invite you to contribute to Velaptor and the KinsonDigital organization.

Interested?
Open for more information
  1. Contribute Your Skills: Whether you're a seasoned developer or just starting, your unique skills can truly make a difference. Your power to contribute is immense, and you can do so by:

    • Picking up issues and submitting pull requests with code improvements, bug fixes, or new features.
    • Providing feedback, reporting issues, or suggesting enhancements through GitHub issues.
  2. Support Us Financially: Consider supporting us financially if you can. Your contributions can help us cover expenses like hosting and infrastructure costs, and support the ongoing development and maintenance of all KinsonDigital projects. You can donate or sponsor us on:

Remember, every contribution, no matter how small, is valuable and appreciated. By contributing, you're not just helping us; you're helping the entire community by making game development better and more efficient. Join us on this and be involved in making something amazing and unique together!