Hi everyone.
I want to pose a question which has been buggering my mind for a while. It's partly rethorical, in the sense that in the documentation I haven't so far come across this issue in plain terms (even though the subject is mentioned in a pass-by manner in different places), and it's partly extremely practical because Evennia's powerful openeness seems to offer customizable approaches to such issues.
A Zen saying goes "If a tree falls in a forest and no one is around to hear it, does it make a sound?" In practical terms, the question is quite relevant to MUDs, I'd say.
I'd like to approach the issue in a real-Dumbo fashion (more than For Dummies!)
Suppose I create some custom timed events that will make the said tree fall. I am not quite at peace of heart in regard to how it gets handled.
Let's say the tree falls in a given room and is meant to be heard only within that room. How does it go? Should a message be sent to the room and not bother wether players are in it? Is it handled by the "system" behind the scene?
Suppose the tree falls and is meant to be heard in every room (a big tree indeed)... Should the script/code try to send a message ("zen-tree has fallen very loudly!") to all rooms and let some hydden-system-hocus-pocus handle it wisely, or is there going to be some actual messaging to every room (empty or not).
In short, I'm trying to understand how this goes in terms of resources (memory, code-checks, etc).
Suppose I create an NPC which now and then starts mumbling about things. Is it up to me to check that before the NPC speaks there must be someone in the room? Or is that the NPC shouldn't be even running scripts if no player is actually in his room? Or is all this handled invisibly by Evennia magical forces?
Or is it something that is up to the developer to decide how it should be handled?
So far I haven't found a single place in the Wiki where this is explained in-and-out (and it could just as well be because it's an issue which is as plain as the Sun, it's just me that I'm missing the whole point).
I do guess though that any wrong approach to timed-events might easily lead to huge resource-drainage. But is there a proper way to handle this? I'm not speaking of tickers, I'm speaking of scripted actions which should have a visible effect on rooms (which might be empty or not). I guess that any script could easily check if a room is empty or not before doing anything, but the checking itself might end up eating more resources that just messaging the room anyway.
My confusion derives from the fact that scripts can be attached to rooms, players, etc., or even be running on their own. So it seems that a tre-falling script affecting a single room could be attached to that room, while a worldwide script might just run on its own. But the question remains: should the room-bound script be aware of players within it? Is there some system in place to handle all this? Or does it boil down to "best practices" of some sort.
The fact is that trees do fall, and will fall, even in MUDs, and they do so regardlessly of wether the room is empty or full. But the real and ancient mind-bamboozling philosophical question is wether this tree will make a sound when noone is there!
Tristano