db0 / godot-card-game-framework

A framework which comes with prepared scenes and classes to kickstart your card game, as well as a powerful scripting engine to use to provide full rules enforcement.
http://dbzer0.com/projects/godot-card-game-framework/
GNU Affero General Public License v3.0
907 stars 96 forks source link

Choppy animations when more than 30 cards in deck #82

Closed db0 closed 3 years ago

db0 commented 3 years ago

Probably related to the still active pulse.

db0 commented 3 years ago

Looks like this is related somehow with the tweens. When there's a lot of cards and you try to do too many tweens at once, they start losing frames. Rest of the game performance seems fine, but it mostly affects animations into or out of piles.

it affects deck more severely than discard, so I suspect this is related to the flip_tweening

db0 commented 3 years ago

Yep, it's due to the animations. The flip animation as cards are enterring the deck just makes it worse. Don't understand why the amount of card scenes loaded makes the impact rather than how many animations are currently running. Even two simultaneous anims are choppy when there's 50+ cards in the deck, whereas the same is fine with 15 cards.

db0 commented 3 years ago

Actually scratch that, it was caused by me instancing a scripting engine twice every script executions. instancing a new class is quite a heavy task it seems.