Encounter Triggering

Hey Folks! I managed to get two pretty significant features roughed-in today: starting an encounter via context menu, and encounter screens loading text and choices from data. Both were a bit nebulous to figure out, but I think now that they're in place, I should be able to build around them more safely.

The first bit was a bit more abstract, since I wasn't sure how players would initiate a plot, or how the game would go from potential plots to a shorter list of plots that apply to this case. I ultimately decided that the same context menu used on items in game would make a good place to insert potential plot hooks. In this case, "order a drink" begins a plot where the player can do a snitch job for the bartender. (Our test case from the past couple blog entries.)

Basically, the game has a list of all possible plots, and it'll go through that list when the player right clicks on an NPC. It finds plots that would work on that player and that target, which involve fulfilling certain requirements like flags on either party, and relationships either party must have. It also optionally generates said relationships if desired, so we can ensure the plot has the required cast of characters waiting. (As mentioned yesterday, these are usually based on existing NPCs, to try and layer history and social networks into NPCs where possible.)

If any of the above plots work in this situation, their "starting interaction" is inserted into the context menu as an interaction. And choosing that interaction starts the plot (which basically applies a series of flags to all cast members).

Once I had a way to start an interaction and plot, I needed to make the game launch the encounter UI with that interaction/plot info. This was more practical troubleshooting than abstract, as I discovered several bugs along the way. Issues with pathfinding, countdown timers, missing flags or other data, etc.

But once I got most of those sorted out, I arrived at the UI we see in today's shot. The main encounter text is in the top left, and the possible outcomes in the lower right. (Full disclosure, the top right of the image is an inset I edited in afterward just to show the context menu.) NEO Scavenger players will recognize this setup, and it'll likely work the same way. I still need to do string replacing for the tokens like "us" and "them," and there will likely be linked tooltip text, and maybe some other indications of items lost/gained with choices.

Also, I think I'll probably pause the game at this point, (again, like NS), so players can read without the game doing stuff behind the UI.

Picking-up here tomorrow will likely be pretty easy, though I may also switch gears temporarily to audio. Michael's moving along on the air traffic control chatter script, and it might be a good idea to get some framework setup to consume that and test it out soon. I might even be able to use what I learned in the procedural music system I worked on with Josh Culler last year (since it used randomly selected, but carefully-timed bits of audio to make a larger stream of procgen audio.)

Should be a few interesting days ahead!