Back to Blog

Delvers Inc Update and a Caution with Cinemachine

Delvers Inc Update and a Caution with Cinemachine

Delvers Inc Update! Also, be careful with Cinemachine

Hello everyone, Arakiel here with a new update on Delvers Inc.

You may remember from last week's post that I had managed to give myself a ton of extra work by forgetting that A.I isn't I. Well I finally managed to fix all that. It took all day and then some but I got there and cleaned up the horrible code problems. Things make sense again! Huzzah!

While I was in there cleaning up the disastrous refactor, I got equipment equipping again. Then I went on a cleaning spree. We now have TownData which will be and is, used to define what a town IS and what resources are available to the guildmaster in a given town. Moved from that, on to a camera problem I was experiencing. That one is actually worth a slight side trip to talk about honestly, but first...let's finish the project status update.

Health potions! Got a basic usage system finally put into place so you can now buy and use a health potion if your cleric can't keep up.

health-potion

And yesterday I finished up the basic party management panel.
party-management

No more do I have to live with the party of 4 "Starter" delvers that I set up months ago. Long live Varro Duskrun!

I have the basics of a party formation system in place but that is not fleshed out very well and I am honestly not sure if it will make it for the 1.0 of the game. That might come later.

The Camera Problem

Shortly after getting the dungeons working and the Delvers delving, it became obvious that I hadn't considered the follow camera showing areas outside the map. The camera would always keep the party of delvers centered as it followed them around but that means as they got close to an outside wall, it would show the... "void" the blank area or unused space in the scene. Very ugly.

I set about finding a way to keep the camera within bounds and quickly hit upon several topics from folks recommending Cinemachine for it. This was a great idea, Cinemachine could also handle the follow logic very well and I could get rid of the camera update code I was using to track the party. In addition, Cinemachine has a Confiner component which will do exactly what I was looking for...keep the camera within a boundary.

I got the latest Cinemachine installed into the project and got to setting it all up only to find that it wasn't working. As soon as I would set the boundary, the main camera would get "lost" off screen. The Cinemachine camera was fine but it's the main camera that wasn't. Cue lots of debugging and hair pulling. I watched many tutorials, I read the documentation, I experimented, poked and prodded and... nothing.

The tutorials I had been watching were all for the 2.x version of Cinemachine so I had to do a little translation since Cinemachine was now on 3.x starting back in September of 2024 but that was fine. It was mostly just component name changes and some slight inspector differences. So it should have still worked, but I couldn't get it to. I then shelved it for a time, I would get back to it later with a clear head.

The Cleaning Spree

During my 'post-refactor-refactor' cleaning spree I decided that I had lived without a bound camera for long enough and that I was finally going to get that sorted. After diving back in I immediately hit the same wall that I had weeks ago. Everything was setup correctly. I had double, triple and quadruple checked all the settings, revisited the code a dozen times, cleared caches, everything I could think of and it simply refused to work.

The "Fix"

That's when I decided to downgrade. It was my last desperate attempt to get this to work before I junked the whole thing and wrote my own bound camera logic from scratch. I downgraded to the last 2.x version (2.10.3 if you're keeping track). I had to revert everything back to 2.x namespace and components but that was easy enough and done quickly. I hit the magic buttton aaand.... it just worked. I sat, rather dumbfounded, staring at the screen as my delvers moved around the side of a dungeon and the camera stayed within the dungeon boundaries I had setup. It...just worked...

I posted it to the Unity Discussion forums just in case it was a bug or something with the 3.x versions of Cinemachine since that's certainly how it feels on my end, but for myself I am going to stay on v2.10.3. Someone from Unity responded yesterday and asked for a sample project that shows the error, but I haven't put one together yet since I have a million other things to do. I'll get to it at some point. In the meantime, watch out for Cinemachine. Seems like they aren't yet at feature parity with the 2.x versions.

What's Next For Delvers Inc.

Next up on the docket is more work on the delvers themselves. I need to get special actions working, I need to come to a final conclusion on whether or not I want delvers to have classes or not because I still waffle on that. Then I need to be able to upgrade the delvers quality tier, not just their level.

That's all for now. We'll talk again next week and in the meantime, follow us on X and Facebook for updates or sign up for our newsletter so that you don't miss a post!