hereami Posted July 13, 2019 Share Posted July 13, 2019 (edited) Some folks here happen to disassemble game exe, so maybe do know. 1) Wiki says, that every condition in a Conditions block is calculated sequentially regardless of intermediate result. Sounds awfull (just because a first encountered False renders whole AND block False, no matter how huge the block is), but probably, nothing's changed since Skyrim wiki, though could be good to know, if has. 2) Is every single condition in game unevitably evaluated each update period (1 sec.?) or is there an internal signaling mechanism for "expensive" functions at least, which informs, when a condition needs actual reevaluation. E.g. a block (or single condition?) could receive generic "inventory change" event, if has a function like GetItemsCount/GetKeywordItemsCount, and mark itself "needs recalc" or maybe request immediate evaluation of the block. Just for example, don't know how it's made usually, possibly, too "expensive" on its turn.PS. Meaning "constant effect" conditions. Edited July 13, 2019 by hereami Link to comment Share on other sites More sharing options...
DeathMotif Posted July 13, 2019 Share Posted July 13, 2019 1. In logic, it only takes one false input to render AND statements false. This is simply the way it is. OR is precisely the opposite. One true input renders the whole statement true. Look up truth tables and you will soon understand this concept. There is nothing “awful” about this. 2. No, Every condition is not evaluated every update cycle. Only those whose evaluations are “true” are evaluated. Keep in mind that conditions are nested in branches. If a node in the branch evaluates to false, the rest of the successive nodes are ignored as they are no longer relevant. Barring programming errors, eventually all conditions may be evaluated during the course of the program running. This is how programs, indeed computer hardware, work. There is the concept of “interrupts”. They are precisely what they sound like. They interrupt the execution of the program when certain conditions are met. Depending on how it is handled, keyboard input is often an interrupt. It signals to the program that the user is making changes to the environment, such as movement or other actions. Most of these are deferred, but some, like toggling the console, are instant. The point is, that it depends on implementation, but rest assured that not all conditions are evaluated every cycle. That would be impossible under current technology. Hopefully this explanation helps. Let me know if you have further questions. Link to comment Share on other sites More sharing options...
hereami Posted July 13, 2019 Author Share Posted July 13, 2019 (edited) Thanks. This statement made me confused https://www.creationkit.com/index.php?title=Conditions "Keep in mind that when attaching conditions to "high-demand" items, like spells and magic effects, using too many conditions can result in a major hit to performance" - said in regards to AND-OR blocks. Nothing said there about predictive optimization. Thus my conclusion was, every Condition item is recalculated no matter what, and only then operators get applied - that's what i consider "awful", as the matter may concern excessive idle processing. (PS. Still, i don't mean OR-only blocks). Not sure, how there can be branching in CK conditions list, except modelled from OR blocks. Edited July 13, 2019 by hereami Link to comment Share on other sites More sharing options...
DeathMotif Posted July 14, 2019 Share Posted July 14, 2019 You’re welcome. Most of the time you won’t have to worry too much about conditionals. Most of the built-in conditionals (embedded inside the “type” blocks [ARMO, COBJ, INNR, etc.]) are fairly straight forward. The only time you really have to pay attention to them is when scripting. Just remember that every condition requires a check for validity. The more conditions, the more checks. Some checks are ok. More checks are generally bad. Enough of them can negatively impact performance. That’s why you want to be judicious with their use. Link to comment Share on other sites More sharing options...
Recommended Posts