Take Your Protein Pills and Put Your Helmet On

Well, we don't have any protein pills yet, but the helmet's getting there!

Today was all about the equipment system, and getting the game to handle equipping items into specific slots. I added some new features to items to define how they should affect a condition owner (CO) when installed in a slot. And to complete that system, a feature on COs that defines which slots they have.

So now, my crew have a slot called "helmet" defined. And the helmet item has a slot usage that looks something like this:

"mapSlotUsage" : [ "helmet","CONDHelmet01,CrewHead:CrewHelmet03" ],

In English, this is saying that the helmet item can be equipped in the "helmet" slot, it will grand the "CONDHelmet01" list of conditions if equipped there, and it will replace the crew's helmet clothing sprite ("CrewHead") with "CrewHelmet03." Currently, CONDHelmet01 is just a 100% chance of "IsAirtight," but that's a placeholder until I figure out how to handle helmet stats/logic.

So far, this is partially working. In today's image, we see the helmet on the player near the top. There are still a few things to work out, though.

First of all, I'm just using a debug command to SlotItem() the helmet on the player. The final game will need something more versatile for the player to use. First instinct here is to right-click on an item lying on the ground, and choosing some sort of "equip" action on it. Which would send the currently-selected crew over there to retrieve it and equip it.

However, that has some hurdles to overcome. For one thing, the right-click menu is entirely composed of interactions, and I don't really have a way to equip items via interaction. Picking up, yes. Even giving or dropping is covered. But this is a really special case, in that you're not only picking-up the item, but putting it into a specific place.

Also, what about items that can be equipped in more than one place? Like held in the hand or worn? How does the user do that? Do they have a context menu item for each viable slot? Or is there a more generic "equip" button that opens a subsequent UI for choosing where?

Once I figure that out, there's also the reverse process to consider. How does one unequip an item? Currently, the only items on a crew are technically inside the crew, like Bender's compartment in his torso. A crew is a container, and picking up an item puts that item into the crew. This list of contents is then shown in a UI scroll area in the screen's lower right, where the user has a "drop" button next to each item.

It's crude, but did the job.

Now, however, we have more complexity to deal with. Do I remove the crew "container" and find another way to add items? In NEO Scavenger, creatures didn't have containers either, but rather slots which could have items attached to them, and said items could be containers. This still makes a lot of sense here, but I'd have to give the player some sort of UI access to these items. And I'm trying to avoid building an entire paper doll UI for this. At least for now, as it's a huge undertaking that would delay the ultimate task I'm trying to do here: add tools that can be used to salvaging a derelict.

Anyway, a lot to think about. But the cool thing is that once this works, we have a pretty major hurdle out of the way. It'll then be possible to add more slots and item effects just as easily as in NEO Scavenger, by simply adding some new lines to the data files.

Tags: Ostranauts


Rovlad's picture

I'd probably keep crew members as containers since it's "good enough for now".
It'll definitely require an overhaul of the system later on but since your current main task is building an interesting game loop, this can wait until you're sure it's worth spending time on.
And who knows, maybe you'll get more interesting ideas than paperdolls along the way.

dcfedor's picture

I think for the purposes of carrying things, the simplified container approach can stay as-is.

However, for items that are typically equipped, the slot approach is probably necessary to avoid ambiguity and/or weird stacking effects. Like, if we're looting a crate full of fur coats from a derelict, we don't want the player to boil to death from the trapped body heat of wearing the entire crate at once :)

Dan Fedor - Founder, Blue Bottle Games

Rovlad's picture

Can be worked around with prioritizing items for now. Like, SUV is "better" than a t-shirt so it gets applied automatically ignoring the rest. Will need rework later on, sure, but this can later on accomplish other things, like NPCs automatically picking up and equipping better things.

That will need work with "held" or "used" items though. Maybe use whatever the player ordered for the duration of the task and then "equip" best item again afterwards... Yeah, you're actually right, I can already see how it could lead to strange things happening. :)