Jump to content


Photo

Performance and script checks


  • Please log in to reply
2 replies to this topic

#1 temnix

temnix
  • Member
  • 983 posts

Posted 29 August 2017 - 03:41 PM

For my current mod I'm going to have to put quite a lot of stuff in baldur.bcs. There is just no other script that runs at all times and everywhere. I'm not seeing any lag, but then, I don't have mods installed that cram much else up there, like some people. In the interest of preserving performance, though, I'd like to understand - if anybody knows to tell me! - how the engine processes triggers. Does it quit looking through a block the moment something checks false or does it run to the bottom of the trigger list but simply doesn't execute the actions? I try to put the most generic and broad triggers, like ActuallyInCombat(), on top of my trigger stacks so that the engine can see these early warning signs and skip all the rest, but I don't know if that makes any difference. As in, between:

 

- true

- true

- true

- false

 

and

 

- false

- true

- true

- true

 

?



#2 Roxanne

Roxanne

    Modder

  • Member
  • 3564 posts

Posted 30 August 2017 - 01:33 AM

For my current mod I'm going to have to put quite a lot of stuff in baldur.bcs. There is just no other script that runs at all times and everywhere. I'm not seeing any lag, but then, I don't have mods installed that cram much else up there, like some people. In the interest of preserving performance, though, I'd like to understand - if anybody knows to tell me! - how the engine processes triggers. Does it quit looking through a block the moment something checks false or does it run to the bottom of the trigger list but simply doesn't execute the actions? I try to put the most generic and broad triggers, like ActuallyInCombat(), on top of my trigger stacks so that the engine can see these early warning signs and skip all the rest, but I don't know if that makes any difference. As in, between:

 

- true

- true

- true

- false  >> Go to next block

 

and

 

- false >> Go to next block

- true

- true

- true

 

?

But consider OR(XX) are treated as one trigger


Edited by Roxanne, 30 August 2017 - 01:35 AM.

The Sandrah Saga

another piece of *buggy, cheesy, unbalanced junk*

 


#3 temnix

temnix
  • Member
  • 983 posts

Posted 30 August 2017 - 09:01 AM

Okay, so the ordering matters. Good to know it. Maybe I should go with my "script mule" idea after all. Instead of putting blocks in baldur.bcs I could just write there this:

 

IF

 

!Exists("scriptmule")

 

THEN

RESPONSE #1

 

CreateCreature("SCRIPT_#",[1000.1000],0)

Wait(1)

Continue()

 

END

 

And extend the mule's script with my actions instead of baldur.bcs. If there is a mule everywhere the party goes, it would work just the same, running its script in parallel. I don't know if it would make a difference performance-wise. What gets loaded or run after what or second to what? Also what happens if I create another mule in the next area? Will the first one still respond to !Exists? Normally when two creatures with the same script name are made to appear, the name changes owners, and then the first one remains nameless even if the second one is killed. But that's in the same area. How about same script name in different areas?


Edited by temnix, 30 August 2017 - 09:02 AM.