Weekly Update - Character Switching, Behavior Editor

This week I started work on an editor for AI Behaviors, with as many questions rising from the work as solutions. I also spent some time working on the user interfaces and restored the switch characters function.

In last week's post I included a list of items that need to be added or improved to get combat working in Antilia. This week I focused on one of those items - AI Behaviors, and took a few detours along the way.

Character Switching

When I added AI Behaviors to Antilia in July last year I included a design mock-up of a new character management page in the game's menus. This replaced a previous screen that was very similar in appearance and functionality to the Select Character screen that appears when you connect to a server. With that change the "switch between characters" functionality was broken, as the new mock-up did not implement it.



For reference: the Character UI mock-up created in July 2022.

This week I revisited that interface while trying to determine "is this really how AI behaviors will work?" and ended up replacing it. The new layout restores the switch characters functionality, but doesn't do anything else yet.



The new work-in-progress Characters screen which replaces the 2022 mock-up.


Switching between characters is enabled again via the Characters screen! (Note: In this animated GIF I removed most of the loading screen frames to keep the file size small.)

The new Characters screen will focus more on providing an overall "character sheet" with basic information like status and reputation. At this point I was straying pretty far from tasks required for combat, so we'll have to revisit this screen later.

AI Behavior Manager

Another system that received a lot of development attention this week is the server's "Behavior Manager" service. In the future this service will responsible for loading all the AI behaviors at startup and then notifying creatures and characters if a behavior they are using has been changed. There isn't much to say about this that isn't highly technical, so I'll just leave it at "work needed to be done".

AI Behavior Editor (Early Work-in-Progress)

As I reviewed the mock-up from July 2022 (first image above), I came to some conclusions. I'd like to see something that is simple to use for players, perhaps similar to that mock-up with very basic behaviors like "heal party members" or "attack hostile targets". This wouldn't be an editor - but rather a few options with drop-down selection lists, or maybe slots with "Behavior Cards" that can be dropped into them. As you play the game perhaps new behaviors can be unlocked via the Skill Grid. (For example training in fishing might unlock a new Fishing Behavior that you can place in an "idle" slot.)

But I still need an editor, and so long as I am making one I'd like to make it accessible to server admins and/or modders.

The next question was "where should it live"? The obvious answer might seem to be adding it to the Antilia Editor, but that has some significant drawbacks. Unlike the other editors there isn't a way to preview AI behaviors outside of the game. After making a change you'd need to export it, restart the client, load up a save game and observe. It could work, but I don't like the idea of adding it to the Antilia Editor because of this slow turn-around time on changes.

The next idea (which I suggested in last week's post) would be to add it to the HTTP Admin. The HTTP Admin is part of the server, so changes made in it could take place immediately. I could change the behavior for "iichii", and then follow some iichii around in the world and see if the changes work as intended. But the HTTP admin pages are intended for monitoring and administrating the server - not for creating content with.

Which leaves the game client as the final and perhaps most sensible option.

I tried moving the Characters screen mock-up off into a separate interface and started transforming it into the editor. At any time I can hit F6 to toggle the editor on or off, and can easily follow characters and creatures around to see how they've changed. As I was working with it I grew to dislike the "tree view" layout I started out with. As behaviors grow more complex the majority of nodes end up as children nested inside other nodes, making it slow and confusing to navigate. Eventually I encountered a scenario where I wanted two nodes to link to the same child node, and then it became really confusing.

At this point it was becoming obvious that editing AI behaviors wasn't going to be as user-friendly as I had hoped. Over the week it has become apparent that I need something more along the lines of a developer tool than a player-accessible system. Which is probably for the best in more ways than one.

With the realization that this wasn't going to be a good systems to present to players I started experimenting with the old flow-chart widget in the engine looking for a better interface than a giant nested tree.



The evolving AI Behavior Editor, here I am experimenting with using the flow chart widget as the primary interface.

So far I like this direction better. It looks more like a visual programming language, but I believe it will make a better tool for those of us that want or need to use it.

That's all for this week, thanks for reading!