Ramblings of arcade machines, code, and other general musings of my world

Tuesday, January 24, 2023

     So over the last week, I finished implementing the module things, at least this rough version of them. I read up on classloading and all that magic, and I'm fairly sure that the stuff works. I'm going to need to write some sort of tool to generate NBT fires (maybe using maven?) and then write up a simple enough API to have this hacky module shown working. I think I'm going to do that next week, because this week has me in a spot I didn't think I would hit this early into development. The main reason why I put so much work into the module system is because it's the main feature of almost every other feature the RenderEngine will have, and the biggest feature that a lot of other things rely on is the rendering components. And the big thing that I really wanted to push is the modularity of the RenderEngine, including which rendering backend to use. And that's where the issue lies:

    The two main rendering backends I want to support, OpenGL and Vulkan, have vastly different workflows.

    In order to support both, I need to come up with an API that is flexible enough to make it not a complete dumpster fire to work with. OpenGL is easy, it's just a large state machine that has decades of documentation and tutorials and all kinds of everything written for it. Vulkan is the opposite, with it being fairly new and most definitely not a state machine. Their APIs aren't even remotely similar (in most cases at least), so to have me support both would mean that I would have to write a LOT of boilerplate code just to get a high enough API ready for the RenderEngine to give to people using it that it makes my brain do very unhappy things. And I'm not a guru when it comes to any of this shit, this is just a hobby project and I don't want to spend years fucking with it to get it to a point where I'm where I want to be by the end of this year.

    So what do I do? The obvious choice would be to support one or the other solely, writing the RenderEngine's higher level APIs around the lower levels calls and workflows needed to support it. This, in turn, will lock the graphics library to whatever is chosen, and I'm going to have to live with that choice because I don't want to try and support both. So, what do I choose?

    The latest release of OpenGL was back in 2017 with version 4.6. It's stable and has a lot of really good features, and when paired with OpenCL, it makes a fairly buff graphics stack that does a lot. But, it's been radio silent on anything dealing with new versions. Even the latest blog post on the OpenGL website was from 2021. It honestly seems like it's in maintenance mode, and might be heading towards being sunset sooner or later. Like I said before, it's heavily documented and there's a lot on the subject matter on how it all works and tips and tricks, and a metric boatload of libraries on how to use it, but should I commit myself to a library that will become obsolete a lot sooner than I want it to? Do I want to commit myself to developing a personal project that has literally a handful of other, better designed and far superior engines use?

    Or do I want to commit to Vulkan? I'm going to alienate a lot of possible platforms because most GPUs before 2017 don't have Vulkan support, but the workflow is a lot more inline with how Java as a programming language operates. There's going to be a lot of learning experiences and hurtles, but the RenderEngine will be one of the first Vulkan-only game engines in Java, even if it's only used for my game developments. Plus, it's in active development, so I don't have to worry about needing to refactor the RenderEngine in any major way to force something else in, unless there's major Vulkan API changes that require it, like I would need to do to move from OpenGL to Vulkan down the road. Also assuming that I won't make the RenderEngine's rendering API library independent, which as of this blog post isn't a high probability.

    So it sounds like I'm heavily leaning into using Vulkan, I hear you say. And honestly, yeah, I think I'm going to. But that has it's own, very major issue: My current development computer (mid 2015 Macbook Pro Retina) doesn't support Vulkan, so I would need to buy a new development computer to actually do Vulkan development. And decent laptops that support a newest version of Vulkan is ~$600. So it's going to be a decent chunk of change to do major development. And I do have a desktop, however that needs a new GPU, and those are god awful expensive as well. so no matter what, if I want to do Vulkan, I need to pay for a new something to do so. Which sucks.

    So I'm going to leave it off here this week, and I'm probably going to work on some more engine features and test suites over the next week as I mull over what I want to do. As always, I appreciate all of you taking a moment out of your day to read my rambles, and I hope you come back next week.

Categories: , ,