You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For the game I work on, I decided on using Dialogue Manager to help me do the variable substitutions in parts of my UI.
For this, I passed the parser a line, and then passed the result to create a DialogueLine:
This is done for a UI with a 4x3 grid, so 12 calls are done per page.
However when changing the page, there is a big hiccup which seems to be of about 300ms, due to the DialogueConstants.translate calls:
It seems that when using a debug run, the DialogueConstants.translate calls within the 6 assert(limit < 1000, translate(xxx)) are done, and due to the way the function works, it slows down the game.
I suspect this also may slow down the editor when using the plugin normally.
Make a new project, ask the parser to parse a string on the fly, then create the DialogueLine associated with it and run it with in debug mode:
varparse_result: DialogueManagerParseResult=DialogueManagerParser.parse_string(": Some string [ID:some_line_id]", "")
varline: DialogueLine=awaitDialogueManager.create_dialogue_line(parse_result.lines["1"], [])
The more calls are done like this, the worst the issue becomes, due to the 6 assert calls that are done to see if something went wrong, and the hard loop limits are reached.
Expected behavior
One of the following:
Improve the way the translate function is to make use of some sort of cache, and speed it up ;
The translate call is evaluated only when needed, which would make writing ifs around the assert()s the easiest solution.
If you would like me to make a PR, just tell me which route you'd like to take :) for the time being I'll add ifs around the assert()s so I no longer have the 300ms hiccups :)
The text was updated successfully, but these errors were encountered:
I wasn't able to replicate the slowdown that you're experiencing but I have moved all runtime asserts to be behind conditional checks to stop early evaluation of the message expressions.
I'd also suggest you use Expressions for evaluating stuff instead of trying to parse individual lines with Dialogue Manager.
Describe the bug
For the game I work on, I decided on using Dialogue Manager to help me do the variable substitutions in parts of my UI.
For this, I passed the parser a line, and then passed the result to create a
DialogueLine
:This is done for a UI with a 4x3 grid, so 12 calls are done per page.
However when changing the page, there is a big hiccup which seems to be of about 300ms, due to the
DialogueConstants.translate
calls:It seems that when using a debug run, the
DialogueConstants.translate
calls within the 6assert(limit < 1000, translate(xxx))
are done, and due to the way the function works, it slows down the game.I suspect this also may slow down the editor when using the plugin normally.
Affected version
Hardware: i5-12600K, 16GB RAM, RX 6900 XT, 2TB PCIe 4 NVMe SSD
To Reproduce
Make a new project, ask the parser to parse a string on the fly, then create the
DialogueLine
associated with it and run it with in debug mode:The more calls are done like this, the worst the issue becomes, due to the 6 assert calls that are done to see if something went wrong, and the hard loop limits are reached.
Expected behavior
One of the following:
translate
function is to make use of some sort of cache, and speed it up ;translate
call is evaluated only when needed, which would make writingif
s around theassert()
s the easiest solution.If you would like me to make a PR, just tell me which route you'd like to take :) for the time being I'll add
if
s around theassert()
s so I no longer have the 300ms hiccups :)The text was updated successfully, but these errors were encountered: