dialogic-godot / dialogic-1

Dialogic 1.x - For Godot 3.x!
MIT License
5 stars 5 forks source link

Lag when using .start() #10

Open piemanguy opened 1 year ago

piemanguy commented 1 year ago

Starting a new dialogue freezes the game for 300ms

Im using dialogic 1.4.5 (Godot 3.4) When i trigger the dialogue event, everything freezes for 300ms, i looked into the profiler when running the game and it points to the Dialogic.start() function.

this is how i start my dialogue

func start_dialog(): var dialog = Dialogic.start("timeline0") get_parent().add_child(dialog)

If anyone would be able to help with this it would be great :)

TaofeekS commented 1 year ago

hi,

i also have the same problem where on my android exports, i don't notice such lag while running the game on my pc.

i think i has to do with multiple loads happening at the same time. my pc can handle it but my android phone cant without some micro lag

ii4y-studios commented 1 year ago

it is due to multiple loads, yes. I am still working on it, but dialogic-godot/dialogic#1271 should resolve this issue once I finish hooking the pieces all together

sealionnn commented 1 year ago

Hi @thebardsrc, will this still be fixed in a future update?

ii4y-studios commented 1 year ago

Hi @thebardsrc, will this still be fixed in a future update?

it took a lot longer then I hoped becuse of life issues, but dialogic-godot/dialogic#1271 is nearly complete to be merged hopefully this week. go ahead and try using that branch and let me know how the performance is for you with that! 🙂

zaknafean commented 1 year ago

Feel free to join the testing and discussion in discord.

sealionnn commented 1 year ago

@thebardsrc Thanks for the link and your contributions to this project. That version seems slightly faster, but the freeze up is still very noticeable. The comments for prepare() make it seem like the prepared dialog is supposed to stay in memory, but prepare() runs anytime I call start(). Is this intended? Also, it looks like the documentation broke after I copied your changes over.

As a quick fix for the freezing, I am looking at not letting the dialog delete on fade-out, and modifying change_timeline() to start the fade-in. If I am off-base, let me know if you don't mind.

@zaknafean Is it within the Godot discord? I can't find any discord connected to Dialogic.

PS: First time using Dialogic, and I have practically zero Github/Discord experience.

zaknafean commented 1 year ago

@sealionnn Its its own thing. You can get to it here https://discord.gg/6hShRw6J

ii4y-studios commented 1 year ago

@sealionnn I'll take a look later this evening to see if I screwed something up with it, prepare() should run the first time start() is run, and then not any subsequent ones after that because it should be resident in memory from prepare(), unless you deliberately clear it for some reason

ii4y-studios commented 1 year ago

@sealionnn I did in fact have that screwed up, lol. Single line, line 50 in DialogicClass.gd, change it to:

if !Engine.get_main_loop().has_meta('dialogic_tree'):

sealionnn commented 1 year ago

@thebardsrc Thanks, that did speed it up, but I still get a noticeable lag. Maybe Dialogic has too much going on for my computer. I’m going to focus on a custom dialogue system instead.

Jowan-Spooner commented 1 year ago

@exelia-antonov or @zaknafean is this resolved? Or should we keep this open?

zaknafean commented 1 year ago

I do not think this is fully resolved yet.

On Sat, Aug 26, 2023 at 4:47 AM Jowan-Spooner @.***> wrote:

@exelia-antonov https://github.com/exelia-antonov or @zaknafean https://github.com/zaknafean is this resolved? Or should we keep this open?

— Reply to this email directly, view it on GitHub https://github.com/coppolaemilio/dialogic/issues/1336#issuecomment-1694231485, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB3CCZLXPLO4I2KIZVOQLK3XXGZZBANCNFSM6AAAAAASG364KM . You are receiving this because you were mentioned.Message ID: @.***>