Back to the Plot
Hey Folks! After wrapping-up a decent ATC chatter and audio for the main menu, it's time to return to the plot system.
My first task today was to finish getting the encounter screen hooked-up to data. I could spawn it based on a context menu click, but all the UI fields were placeholder text. Getting the current encounter description was pretty easy, so that was first. The choices were a bit trickier, though.
First of all, I had to make the choices clickable so the player could choose one. That meant changing the choice line items into a button instead of just plain text. And some layout tweaking was required to get each button/text to be the right height for the text contained within.
Once that was done, I had to figure out how to trigger the appropriate interaction/encounter when a choice was clicked. This was where I struggled the most, as it was sort of an architecture problem rolled inside of a coding problem.
Should each encounter interaction assume the player is "us" and the context menu target as "them?" This is how NEO Scavenger encounters work. I just check flags on the player each step to see what's a valid outcome, load that outcome, and each outcome applies more conditions and loot to the player along with a new set out outcomes. This works, but has some limitations in what I can do behind the scenes.
Alternatively, I could alternate between player and target. This is like the normal interaction system already in the space prototype. Us chats to them, them decides which response to apply, then Us does again, and so on. This ping-ponging doesn't exactly fit the UI, which is showing the full text of the current interaction plus choices for outcome, since when the player is doing something, the only choice is to continue and see the target's reply. However, if we alternate us and them like this, we do get to use the AI code to make NPCs choose replies that "feel good," instead of simple conditional testing.
I ultimately decided on the latter, since I think I could work around the UI weirdness by authoring the data to anticipate this back and forth. Maybe we do get some "continue" nodes in the flow? Or maybe I can just put extra text in the description area to show what the player did, then append the NPC's new reply to that with more outcomes to choose from?
Like, if the player orders a drink, the screen says:
"Player orders a drink.
Bartender asks what kind?"
The "Player orders a drink" is just a simple node without any choices, so it is added to the UI right before the bartender's reply. And now the player is faced with more choices.
Whatever the solution, now navigate an interaction chain two ways. The old way, which is NPCs going back and forth with each other based on their preferences. And the new way, which is back and forth through the encounter UI, pausing for player input any time the player character has a choice.
With this done, I can initiate a plot by right clicking a local bartender, and a remote bartender is generated to fulfill the plot. Then, in talking to the local bartender, I can agree to do the mission. The stage is set for our first mission!
I think the next step is to add some data to the interaction so that when I fly to the remote bartender, I can take action there to complete the mission. And then test it out!
That's all for this week. Hope everyone has a good weekend, and see you Monday!