If a tree falls in a MUD forest and no one is around to hear it, does it make a sound?

142 views
Skip to first unread message

Tristano Ajmone

unread,
Mar 7, 2015, 6:13:04 AM3/7/15
to eve...@googlegroups.com
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

Griatch Art

unread,
Mar 7, 2015, 6:53:31 AM3/7/15
to eve...@googlegroups.com
It's a good point indeed, and not nearly as philosophical in a game as it is in the real world I think.

Evennia itself doesn't care what you do with your tickers or scripts. You generally don't messages fruitlessly to an empty room since you'll be using room.msg_contents() to do this, which means that if the room has no contents you will not send any messages. You *will* however send to non-player objects this way (which may potentially respond to messages after all), so that would potentially be something to keep in mind.

Messaging to everyone in the game would probably not be handled such that you go to every room and message its contents. Rather you'd probably make a custom solution for something like that - get all active, puppeted characters in the game and send to them directly. In most games I imagine such messages would be rare though, or completely handled using channels.

Also, what is the actual difference between a "fallen" tree and a "standing" one? In a text-game, not much normally. It's literally just a few extra words. So felling a tree is cheap - you just update its description. The complexity comes if you want the fallen tree to have an actual in-game effect, like blocking the road or revealing some secret. If you created the tree as a typeclass beforehand all the work is done at that point though - the tree just has two states: fallen and unfallen, and whatever commands and extra features the typeclass implements are just checking this state on-demand. All you need to do to fell a tree is just to flip the switch and possibly echo a fall message if there is someone nearby.

To elaborate on this a little further and go into whether that tree needs to fall at all, again this depends on your implementation. Notably, what the reason is for modellng the falling of the tree in the first place.
  • Is it a quest reason? That is, some sort of condition elsewhere (magical wind summoned or something) so that the tree will fall and reveal some secret at its roots - then you would do this by setting a simple flag - when people enter the room the flag will be checked (by the Tree object or the room) and they will see the fallen tree. Just using msg_contents(exclude=Tree) will probably be enough to transparently avoid messaging people unnecessarily.
  • Does a fallen tree constitute some particular game effect? Maybe a certain type of enemy only appears near a fallen tree. In that case you can randomly decide if the tree has fallen in the room when a person first enters it. The tree is then created fallen there, on the fly. It literally didn't fall until people were there to see the results.
  • Does the very falling of trees have a purpose? That is, is there a monster walking around in the forest that are tumbling trees in its wake? In that case you might want to actually broadcast the sound of crashing trees to spook players. Maybe they won't even need to find an actual fallen tree in the room after wards - if the tree has no real purpose then just hearing them fall may be enough. In a text game you can assume the fallen tree is just somewhere in a large forest room. Tracking the monster is a matter of following the sound. Again, just how you broadcast messages to a lot of rooms depends on implementation. Fastest would be to tag all rooms in your forest with a "forest" tag and just message the contents of all the rooms with that tag.
  • Is it just a mood-setter or a way to vary the description of room? In that case no one need to ever see it actually fall. It need not even be an actual Object. You can just have a tiny random chance that when you enter the forest room "a fallen tree" will be added to the room's description. It's just scenery. 
Just some random ideas.
.
Griatch

Tristano Ajmone

unread,
Mar 7, 2015, 8:09:18 AM3/7/15
to eve...@googlegroups.com
Thanks a lot, this was a very important reply in regard to my learning needs, and provides a lot of insight!


The tree is then created fallen there, on the fly. It literally didn't fall until people were there to see the results.

Well, this being the case, we're dealing with a "Schrodinger Tree"—the tree is neither fallen nor standing until an observer actually looks at it in the room. Therefore, the act of observation is what solves the  quantum superposition of the tree-state. The tree is both fallen and standing while an observer is absent.

We might conclude by inference that the Observer, the Observed and the act of Observation are One in the MUD universe. Let's call it the 4 Os of Quantistic MUD/MUSH. Being the hallucination of shared-nature within the MUSH world, one (ie: «I» — whatever this pronoun might still mean in such a highly non-linear ad undeterministic philosophical context) one might wonder what happens if another player is observing the first player (whic is caught in the act of observing the tree): this second player will be in a quantistic meta-state in respect to the tree-observing player. Will his act of observation be determinant to the quantum-conondrum solution? Will this meta-state of observation introduce some meta-scripting in Evennia?

Quantum theory is enough to make us doubt if we live in a universe governed by laws (and the more we learn about it, the more we wonder at simple facts like not falling off the Earth!). But Mud-Quantum theory is even more shocking, because against all logics and odds we are faced with Mud universes that actually exist online, even though they seem to do so against all reason and common sense. And often we have to accept that we took part in coding such "impossible objects".

My connational, Galileo Galilei, exclaimed "And yet it moves!"

I might add in the same spirit, "And yet it falls!" and just take that as a sufficient explanation of why the falling-tree script works.

;-)

Griatch Art

unread,
Mar 7, 2015, 9:14:22 AM3/7/15
to eve...@googlegroups.com
Alas, semantics aside, the computer processor knows exactly at every moment whether the tree has fallen or not so it's not a real superpositional quantum state. ;)

I guess one could make a case for it if your randomization mechanism is a true quantum spin source though ...
.
Griatch

Tristano Ajmone

unread,
Apr 16, 2015, 10:03:01 AM4/16/15
to eve...@googlegroups.com
Over a month has passed since this post of mine and, following Griatch advice, I've stated reading Richard Bartle's Designing Virtual Worlds (2003) and —guess what!—I've come across the (almost) identical question in the book:

If a tree falls in a desert, does it make a noise?

and of course, the book also provides answers to this question:

Using proximity activation, it would never fall in the first place.

This being the "quick answer" in the book—the whole book being itself an global answer to any such design conundrums. It's really a great book, and most definitely a must-read for anyone who considers embraking on the creation of a MUD/MUSH—as Griatch pointed out!
Reply all
Reply to author
Forward
0 new messages