Code refactoring hurts a lot


After a lot of work for the past month doing mostly boring technical stuff, that technical stuff is ready to be released to the world.

I am publishing the dev-log a bit before I actually upload the files to give me a little time to game test. Regardless there may be bugs, especially with some more experimental features that were added.

You see, I was only able to add 1 (one) single gameplay change in this update, and it is: enemies showing up on map, and initiating battle when you collide with them, rather than using purely random generation to decide battle occurence. And that took quite a bit of code, specially synchronization code between the main game render thread and the AI thread, but even that was relatively easy compared to the absolute hell that was code refactoring, and adding some libraries to the game. Enemies now spawn, and de-spawn, and follow the player around when they have line of sight and are in view range, simple.

The other non-technical change, unrelated to gameplay is the fact that now we have a small story intro when we launch the game. 以上.

Oh, and I was able to add an options menu so you can change the volume finally, yay!

Now to the technical updates that took up most of the time:

Enemy information is now stored in YAML files rather than .info files for ease of readabilty, the snakeYaml library for java is not very friendly to work with, but regardless it is working now. If you open enemyList.yaml in the root folder of the game, even if you now absolutely nothing about coding or the inner-workings of the game, you should be able to understand easily what they are defining, and that makes my job a whole lot easier. This was relatively easy, took around 3 days.

Now on to:

<Rant>
Drawing things on screen. If you use a game-engine like Unity or Unreal, or even godot you don't have to worry with: drawing things on screen, you create a gameobject or equivalent and maybe set some flags and masks if you're fancy, add the appropriate game component or equivalent, and then the unity engine or whatever will render your sprite/mesh/demonic-encantation-of-pixels-in-the-form-of-bytes for you.

Now, I admit that I don't have to deal with openGL directly thanks to wonderful libraries; but, either because I am very stoopid, or very unlucky, I created horrendous hard-coded sprite drawing that didn't scale well with resolution scaling and the sort. And so I had both to: mess around with libGdx Cameras and viewports, AND create my own sprite drawing wrapper to make sure things were drawn on-screen in the right place. I tell you it was not fun. It basically takes a set of 0-100 screen coordinates, converts them into actual camera coordinates, adjusts them to the window size and then renders the sprites in their absolute coordinates in order to work seamlessly with the UI camera. And I also had to add some hot-fixes to the world rendering code too so it would render properly. Not only that the whole battle coordinates, and menu coordinates, and dialogue screen coordinates and sizes had to be update to work properly. And the whole button-controlling code had to also be slightly modified to work... and probably some other things that are likely buried deep in my unconscious mind.

</Rant>

Tl;Dr : things no longer strech when you change aspect ratio and resolution of the window. YAY!

I'd like to start working on the game now, hopefully I will be able to. The gameplay is the same pretty much from the initial tech demo, and I would like to have an actually game not just an engine demo soon. Hopefully.

Get Hololive Ultimate: Apocrypha

Leave a comment

Log in with itch.io to leave a comment.