Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a very simple Bubble Layer template that doesn't move, or parameters to disable move #2247

Open
hsandt opened this issue May 21, 2024 · 1 comment
Labels
Enhance ⚡ Improve a feature's workflow.

Comments

@hsandt
Copy link

hsandt commented May 21, 2024

Is your feature request related to a problem? Please describe.
There is only one text Layer that tracks a character's head, which is the Bubble Layer and it's very elaborate: it has lerped motion to target, wobble and a tail.

I can use the tail, and it's easy to disable wobble by setting Wobble parameters to 0, but I can't completely get rid of the initial move. I'm working on an old school game and I want to start simple before I start adding fancy effects.

I set Behaviour Distance and Behaviour Direction to zero, but there is still some motion.

Looking at res://addons/dialogic/Modules/DefaultLayoutParts/Layer_Textbubble/text_bubble.gd > _process, the motion uses:

var direction := (base_direction + edge_influence).normalized()
var p: Vector2 = base_position + direction * (
		safe_zone + lerp(bubble_rect.size.y, bubble_rect.size.x, abs(direction.x)) * 0.4
		)

where base_direction seems normalized anyway, and edge_influence is not zero either, so there is no way to really set it to 0.

The only way I found was to change code to force set p = base_position

Not the bubble doesn't move anymore on display, but I also lost the tail completely.

Describe the solution you'd like
A parameter to set to 0 or uncheck, to completely disable bubble motion.

Describe alternatives you've considered
It could also be a separate layer template, but it would probably be reusing the same .gd script anyway so in both cases there'd need to be parameter-based motion in text_bubble.gd

Additional context
Add any other context or screenshots about the feature request here.

The best result I got by suppressing motion, lost the tail:

image

@hsandt
Copy link
Author

hsandt commented May 21, 2024

Ah, the solution was just below, in the lerp:

position = position.lerp(p, 5 * delta)

is a lerp toward target with hardcoded factor.

Replacing it with:

position = p

wraps bubble to target position.

So there could be an option to enable/disable smooth motion to target, as well as a tunable reverse exponential factor to replace 5 (both are useful, since to simulate insta-move we'd need a huge factor which is not elegant).

@Jowan-Spooner Jowan-Spooner added the Enhance ⚡ Improve a feature's workflow. label May 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhance ⚡ Improve a feature's workflow.
Projects
None yet
Development

No branches or pull requests

2 participants