Version 1.0.2 update (now supports Android)


Well, I was hoping to move onto another project, but then remembered that I needed to  check if my sound system would work on Android, so here is another ranty and wandering dev-log. Huzzah!

My sound system requires SDL2 (which makes porting super user-friendly) and libvorbisfile... which I've never tried to compile on Android. 

Thankfully it wasn't that complicated.

Of course I had to code in some touch controls, but thankfully I've done this before, so I just reread some of my old code and looked over the SDL2 documentation. It took a little playing around with, but it wasn't too much of a hassle.

Since I was coding new input methods, I decided to allow for a gamepad option. I'm not sure how good it is, since I find playing an FPS with a controller very odd, but it wasn't much of a hassle...

...until I tried it on the Android side. It turns out some android devices detect a pseudo-controller (I think it's the gyroscope or something), so it would detect the fictional controller and attempt to apply the default settings I coded in, then crash because it would try to get button data for buttons that did not exist.  I solved this by not considering any controller with less than a certain amount of buttons "valid" and doing a check before gathering data from the controller. A bit clunky, but I think it works.

The biggest issue I had was the game did NOT run smoothly. When I saw this, I figured I'd just make the port as a learning experience and not release it, but when I showed it to my partner, she said something like-"Oh, so I can play KatzenKlein on my phone? That's cool".

Well, I didn't want to say "no, not really", so I rewrote the way the map and decals are rendered. I originally wrote KKR to render streamed chunks, which is not optimal since it requires many draw calls, so now everything is batched to minimise draw calls. I also pushed all the decals into a texture atlas, so it doesn't require texture switching for rendering the decals.

Unfortunately the way sprites are rendered still causes some slow downs... this can really be noticed on Android in level 3. If I was to start again; I would of placed all the sprites into four-or-so texture atlases of the same size, so that I could batch the depth sorted sprites together and use one draw call, but that feels like a lot of work for this project. Definitely something I'll think about in the future.

There are lots of other small things I had to fiddle around with, like allowing more frame capping options and a max-samples cap for the sound player (my rather old Android Tablet would drop many frames when multiple spawn sounds occurred), but I'm not sure if any of this is that interesting.

Unfortunately I did see a new bug in the collision system... I was able to clip out of bounds on the fourth map in the stair well, but I was only able to do this once... Somewhat disappointing, but I hope I can write a better collision system next time.

If you've read this, thanks for your interest.

-K. A. Laherty  21/08/2024

Files

KKR_linux_1_0_2.tar.gz 10 MB
27 days ago
KKR_win_1_0_2.zip 9.9 MB
27 days ago
KKR_1_0_2.apk 12 MB
27 days ago

Get KatzenKlein Redux

Download NowName your own price

Leave a comment

Log in with itch.io to leave a comment.