Construct-bugs icon indicating copy to clipboard operation
Construct-bugs copied to clipboard

Move-to following timeline bezier path with set angle, extreme CPU usage

Open F3der1co opened this issue 1 year ago • 3 comments

Problem description

Using the Move-to behavior to follow a timeline bezier path with set angle enabled leads to extreme CPU usage.

Attach a .c3p

moveToBezier.zip

Steps to reproduce

  1. run preview and observe cpu usage
  2. disable set angle on the move to behavior
  3. run preview and observe cpu usage

Observed result

with set angle enabled: extremely high CPU usage, for me it's dropping frames with set angle disabled: almost no CPU usage

Expected result

Low cpu usage in both cases. Maybe slightly higher with set angle, as more calculations need to be done, but this is just heavy to an extend where it seems unusable.

More details

Affected browsers/platforms:

First affected release:

System details

View details

PASTE HERE

F3der1co avatar Jul 02 '24 09:07 F3der1co

Just took a quick look and it seems like there are a few places that can be made more efficient, having said that it is going to be more demanding than not setting the angle just because calculating the angle at any given point of a bezier curve, is a bit of pain.

DiegoScirra avatar Jul 02 '24 14:07 DiegoScirra

True, but the difference seems extreme here. My naive solution would be getting the paths position slightly into the future and set the angle towards that.

F3der1co avatar Jul 02 '24 14:07 F3der1co

Not sure how applicable this is depending on your implementation: https://youtu.be/aVwxzDHniEw?si=UcdE5aBjRX_weoxP&t=451

F3der1co avatar Jul 02 '24 14:07 F3der1co

The next beta will include a significant performance improvement. It's still quite intensive, but will be able to handle more.

DiegoScirra avatar Aug 20 '24 18:08 DiegoScirra