TomTesoro Posted November 20, 2020 Share Posted November 20, 2020 I'm trying to determine for script optimization purposes, which is the faster method for the game to run. I can't find any solid information on this particular case. My gut feeling is that using the quest name and assigning a property to it would be faster to run than GetOwningQuest(), but I have my doubts. Any help would be appreciated. Link to comment Share on other sites More sharing options...
maxarturo Posted November 20, 2020 Share Posted November 20, 2020 "GetOwningQuest" is used for script fragments to acquire the Alias, Package, TopicInfo, etc... that the "Quest" owns / is targeting. While "Quest Property" is used to define which quest to handle in your trigger box, activator, object, etc... that has a script doing something and it setting "Stage" to that quest or for checking the quest in question. So, there is no question about optimization or performance, but what function is used in what occasion. Have a nice weekend. Link to comment Share on other sites More sharing options...
foamyesque Posted November 21, 2020 Share Posted November 21, 2020 There is actually a performance difference. However, in most cases, it's unlikely to be dramatic. Properties get baked into saves, but many of the Papyrus functions (and GOQ is one, I believe) are tied to the frame rate of the game. So, for a given thread of the script engine, frame-linked function calls will always take at least one frame to return their result (multiple threads can process at the same time). This means that for stuff where you need to do a *lot* of things, in sequence, in a very short time -- inventory manipulation, for example -- you want to cut them to the minimum possible. However, a single call to GOQ will only take 1 frame. You can then store that in a variable on initialization of your alias, or whatever. if you need to access it repeatedly, and the performance impact is minimal. Link to comment Share on other sites More sharing options...
maxarturo Posted November 22, 2020 Share Posted November 22, 2020 @ foamyesque I didn't know that GOQ was tied to the frame rate, well... live one more day to learn one more thing... Link to comment Share on other sites More sharing options...
foamyesque Posted November 22, 2020 Share Posted November 22, 2020 @ foamyesque I didn't know that GOQ was tied to the frame rate, well... live one more day to learn one more thing... I actually looked it up! GOQ is a non-delayed native function and therefore the fastest possible kind in the game short of direct operations like addition and whatnot. List of them here: https://www.creationkit.com/index.php?title=Category:Non-delayed_Native_Function So there's no real reason to avoid using it. It's still good practice IMO to stuff it into a variable if you're going to be using it multiple times, to save your fingers if nothing else :) Link to comment Share on other sites More sharing options...
maxarturo Posted November 22, 2020 Share Posted November 22, 2020 @ foamyesque I didn't know that GOQ was tied to the frame rate, well... live one more day to learn one more thing... I actually looked it up! GOQ is a non-delayed native function and therefore the fastest possible kind in the game short of direct operations like addition and whatnot. List of them here: https://www.creationkit.com/index.php?title=Category:Non-delayed_Native_Function So there's no real reason to avoid using it. It's still good practice IMO to stuff it into a variable if you're going to be using it multiple times, to save your fingers if nothing else :smile: Although i have read this page, i didn't remember that. :thumbsup: Link to comment Share on other sites More sharing options...
TomTesoro Posted November 22, 2020 Author Share Posted November 22, 2020 I'm mostly using it to set the stage in fragments. Thanks for the useful info. I'll keep using it for that purpose. Link to comment Share on other sites More sharing options...
Recommended Posts