Home Creators Posts Import Register Favorites Logout

Videos

  • Dynamic Portrait Demo 2.mp4
  • Dynamic Portrait Demo 1.mp4

Downloads

Content

Hello everyone! After a grueling development process, the Dynamic Portraits system has finally been completed!

■ Current Progress

If you haven't been keeping up with the previous two Devlogs, essentially, it is now possible for the dialogue portraits to display player-chosen outfits during dialogue without defaulting to the main outfit.

As a player, this might seem like a relatively minor change, but there was actually quite a bit involved in making it work properly.

I went over some of the difficulties and benefits of this approach in the prior logs, but the main advantage is that the portrait no longer needs a completely separate image for every possible outfit combination. Instead, the portrait is now assembled dynamically from several layers.

If you're familiar with RPG Maker, or even if you aren't, this is the difference between how player-selected outfits were handled for a single line of dialogue before and how they are handled now:

As you can see, it is massive.

How Dynamic Portraits work

To explain why this is such a significant change, it's worth looking at how the previous implementation handled portraits.

The previous system was built around using a "bust" image and then controlling that bust through separate commands.

Changing an expression meant telling the bust which expression to use by a text code such as:

\bust[6] \bustExpression[6, 0]

There were separate controls for essentially every aspect of the bust: expressions, fading, opacity, movement, scaling, tones, and so on. It works perfectly well for most purposes, but not for ours.

When changing outfits, the previous approach essentially requires a separate, complete bust image for each variation. As more outfits and combinations are added, the number of images and the amount of setup required grows very quickly.

DynamicPortraits approaches this differently by breaking the portrait into reusable layers and assembling them when needed.

Here's an example of one of the new commands:

LL_DynamicPortrait processChar \F[soriel]\FH[ON]\Exp[1]\Out[v]\Over[v]

\F[soriel] selects Soriel's portrait.

\FH[ON] displays it.

\Exp[1] selects Expression 1.

\Out[v] selects the Outfit based on the outfit variable.

\Over[v] does the same for the Over layer.

When the player changes outfits, The outfit variable is given the corresponding outfit value, and DynamicPortrait uses that value to select the appropriate layer.

It also makes the actual scripting considerably simpler. With the previous system, different aspects of the bust were generally controlled through separate text codes, so setting up a particular state could mean adding several commands one after another.

The new system can define the portrait and its layers together in a single command, while variables can handle parts that need to change automatically.

Since the variable is already being used to control the main standing picture you see on the map, a good amount of the systems I had already put together could remain untouched as well.

I've also had to work on a number of additional compatibility plugins to retain the functions of the previous setup. Those ended up being a much better solution than trying to force everything into the original implementation.

Portrait Dim

The previous system applied the tint directly to the portrait image, so the process was relatively straightforward. With DynamicPortraits, however, the portrait is no longer one image; it is several separate sprites being assembled together.

My first attempt at reproducing the same effect ended up applying the tint to each individual layer instead of the completed portrait as a whole.

The result looked rather terrible, to say the least. Unfortunately, I couldn't back up the older attempt to show as an example.

I then tried going in a different direction by lowering the opacity of the individual portrait layers whenever Soriel wasn't speaking. Since it was only meant to be a subtle indication, I figured it didn't necessarily need to be a dimming effect specifically.

That didn't work either.

The problem was that each layer was still being treated independently, which made the effect much more noticeable than it should have been.

Eventually, it occurred to me that I didn't actually need to approach this in such a roundabout way at all.

Instead, I could treat the DynamicPortrait as one finished image by placing a semi-transparent black layer over it.

This means I don't have to tint or change the opacity of the individual layers, the dimming effect is applied to the finished portrait instead. The current implementation builds an alpha mask from the actually rendered portrait contents, then uses that mask to clip the black image to the visible portrait rather than filling the transparent space around it.

The system also needed to keep track of what is currently being displayed, account for layers being added or removed, follow changes to the portrait, handle transitions between layer selections, and remain correctly positioned on top of the portrait as it moves, scales, rotates, or otherwise changes.

That ended up requiring quite a bit more work than simply putting a black image over the screen, but the result is much cleaner than trying to modify every individual component.

Portrait Snapshot

This was a quicker implementation, but it solved another small issue caused by having two separate plugins working together.

LL_StandingPicture handles the actual standing-picture display and its appearing/disappearing transitions, while DynamicPortrait handles the additional layers that are assembled on top of that standing picture.

Because those systems are being updated separately, there was a point during the disappearing animation where the portrait could briefly lose its Outfit layer while the individual DynamicPortrait layers were being rebuilt or faded.

It wasn't completely broken, but it could be noticeable, especially when one part of the portrait continued moving while another part disappeared.

The solution was to take a temporary "snapshot" of the completed portrait immediately before the transition begins.

Rather than animating several separate layers during that transition, the system temporarily renders the assembled portrait as one flat image and uses that image for the existing standing-picture animation. Once the transition is finished, the normal DynamicPortrait layers are restored and continue functioning as usual.

The snapshot only exists for the duration of the transition, so it isn't creating a permanent duplicate of the portrait or keeping an additional copy around.

You can see the before and after comparisons from the first and second Dynamic Portrait demos in the attachments.

■ Roadmap

The brunt of the work has been completed!

I should also note that the current focus has been solely on making this feature fully functional. I will be addressing dialogue changes, presentation improvements, and other related details in future updates.

■ Next Stage of Development

Now I'll be focusing on actually overhauling the previous system.

As mentioned in Devlog #2, this is a very tedious process because of the way the original plugin was created to display portraits. So, steps 4 and 5 will be worked on simultaneously, more or less.

The v0.3 update will be available soon!

Thank you so much for reading and your ongoing support!

Files

Comments

No comments found for this post.