Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Rethinking Interactables: Making Interaction Better

First, I wanna start off with a shout out to my new follower! Not sure if you'll actually read this, but yes, I'm paying attention here.

Now let's dive in to today's work. After finishing up yesterday a few things occurred to me about the way I implemented interactable objects. I had absolutely no control over them. They just worked, as much as the player wanted, as often as possible. That's fine to start, but I wanted more control. So, I started by deciding how I wanted to deal with this. I set an interaction limit, and a reset option.

Pretty simple stuff at first. Most of the code changes I made myself in the beginning. That is, until it became too complicated for me. But we'll get there. So, I started by hooking my interactable into the time handler for reset, added a simple limit, and off I went. It seemed perfect, I could interact up to my limit and it would then stop working until reset. But that wasn't good enough, because of the way the player character works with interactables.

I wanted to be able to completely hide the interaction prompt, but that wasn't exactly possible with the way things were already setup. So I talked to my good friend Gemini and we worked through it. It took a few tries, Gemini did a bad job of guessing, but in the end I got what I wanted. There's still more to do, eventually, but for now this is a great step!

So, the interaction prompt disappears when the object can't be interacted with, and appears when it can. It's smart enough to know when the player is in range when this happens. It was troublesome getting that logic working just right. But now the player can be next to an object, or across the world, and it updates properly. I had to make some slight changes to the player character script as well. To account for targeting something it shouldn't. But that was quick work, no AI help there.

The last thing, still left to do, is changing the interactable's skin, but I'm not there yet. I've added a simple enumerator and and will eventually flesh that out to control how the skin looks, but for now I'm happy with my limits in place. I think I'll eventually make some other changes to allow for requiring certain skill levels or attributes or something for interactions as well, but with this current system in place that will be a cake walk. I can just take what I've already built and modify it slightly to work with any amount of limits I want.

I guess this means my next step really is going to be my dialogue system. That one is going to be a beast, probably taking multiple sessions to really get working. It's going to involve updating existing systems (hooking into the UI Manager and data manager for example) and building new ones (a new UI, new resource definition, and more). And worst of all, I'm going to have to mess with UI elements, which always sucks. It is so hard in Godot to get UI stuff to appear the way I want. I'm so accustomed to the way Unity does it that Godot's approach just doesn't feel right. But that's an issue for next time!

Support this post

Did you like this post? Tell us

Leave a comment

Log in with your itch.io account to leave a comment.