Click to Interact and Launch UI

Hey Folks! Finally got back to some gamedev today. I returned to work on the ship equipment UI system, and I think I have a working prototype now, albeit with minor issues to sort out.

Basically, I've setup a way for the game to launch different UIs based on what the AI is doing at the time. This is the precursor to controlling important ship actions using the crew.

The way it works is that the player left-clicks the crew they want to use, then right-clicks the target item. The game will first check for any valid interactions between the AI and the item. If it finds one, it'll check to see if the AI can pathfind to that interaction's specified point on the ship (usually next to the item). If that passes, the AI is ordered to walk to the item and the interaction is queued for when it gets there.

If that interaction has a GUI specified, the interaction will raise that GUI with any parameters that were specified in the interaction's data. These params will define things like label names, min and max values, and probably, which items and stats to connect to which UI elements.

And so far, it works! I have a simple charge meter UI setup for the battery, and choosing an AI and then right-clicking on the battery causes the AI to walk across the ship, opening doors as needed. When it gets to the battery, a charge meter opens on the screen, showing real-time battery charge. Pretty cool!

Of course, it has some kinks to work out. For one thing, the UI appears as the AI is finishing the interaction, instead of when it starts interacting. Also, the UI never goes away. Also, the UI is just the first valid interaction, and should probably have some list of options present for the player to choose from (in cases where more than one UI is possible).

Also, as evidenced in this discussion from an earlier post, I have a lot of thinking to do about how the player controls the crew.

There are pros and cons to each approach, and likely, I'll have to try them out to see which feels the best. For now, the easiest will be to have the AIs autonomously self-care (i.e. eat, sleep) but have the player direct them to do more complex stuff (e.g. steer ship, change life support settings). But there may be compelling reasons to make the AI handle those more UI-centric tasks, in which case I'll need to work on a way for AIs to do these widget tasks.

Anyway, progress! This is a subtle upgrade with serious power potential. Lots of cool shipboard items to interact with through widgets now!


Anase Skyrider's picture
Anase Skyrider

Hopefully you can find a balance between interaction and simulation. Because assuming you can make perfectly intelligent AI, the question becomes whether or not that's interesting or fun to sit there and watch everyone do their thing automatically. The AI shouldn't be children, yeah, but you probably don't want them to be like a player who's a master at the game. Because at that point, that's boring. Minimal input from the player would suck. Which is why I'm hoping that having a main character works out; it gives you something more to do and it immerses more in that world.

matsy's picture

I think having to get the AI to check individual battery's to see their charge level temporarily would become mundane, annoying, and a frustrating task in the long run. Especially on a bigger ship. Reminds me of parts of NEO Scavenger I didn't enjoy, like when you were wanting to craft large amounts at once, you had to do it one by one, lots of redundant clicking about.

I like the idea of having to get an AI to go to say a console, which then displays a list of power status's / reliability, and the date/time it was last serviced?. Thinking green screen, pip-boy esk.

Then I feel that what you mention above in this post works perfectly for things you would expect to be unknown. E.g. A broken pipe as part of the infrastructure, or damaged stuff. As I would expect a crew member to have to work on it to identify the issue.

ra1's picture

I like it when games early-on make you micro-manage, and then upgrades later on make the process more automated (as you move on to bigger concerns).

In the case of a battery, you could require that it be checked by hand, and then an upgrade would allow a display or configurable alarm. (You could still check it manually later, but there would be no need)

Malacodor's picture

I think playing the game should feel like actually being a captain. When being alone one has to do everything by oneself, but the more crewmen there are there more things can be delegated. The bigger the crew the less ordinary tasks need to be done manually, but at the same time more supervisory activity is needed.

Ran around with a clown mask before it was cool

ra1's picture

I really like this idea.

The question is how to implement it? How do you make an AI "want" to check a pressure monitor? Is it a task that must be initially delegated, then will be automatically performed by that specific AI? At what interval? At what priority compared to other tasks?

Once they have checked the monitor and see that the pressure is too high, how do you make them want to turn a valve off to reduce that pressure? Then, after all this, what if you (the captain) want them to NOT turn off that valve for a while (to keep a fire from spreading or something).

dcfedor's picture

@Anase Skywriter, I agree. The trick will be finding that balance, and if it requires AI handling complex tasks, figuring out how to make them smart enough :)

Re: batteries, yeah totally. The battery example was just for testing, as it was easy to setup using existing parts. Ideally, there would be a master console on the ship to see all system statuses (or at least all within a subsystem).

At worst, it may be up to the player to build their ship with such a console, and wiring it to the desired devices, or else they’ll have to march all over the ship to get readings all the time.

@Malacodor & ra1, this is basically the crux of the problem. We want to do away with tedium, and allow for delegation. But at the same time, we don’t want to rob the player of interesting tasks, and I also have to figure out how to make AI want to and be able to do more complex stuff.

Not going to be a trivial task :)

Dan Fedor - Founder, Blue Bottle Games