1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Greetings Guest!!

    In order to combat SPAM on the forums, all users are required to have a minimum of 2 posts before they can submit links in any post or thread.

    Dismiss Notice

When a Tree Falls in the Forest

Discussion in 'UO Stygian Abyss' started by Maplestone, Apr 29, 2009.

  1. Maplestone

    Maplestone Crazed Zealot
    Stratics Veteran

    Joined:
    Jul 26, 2008
    Messages:
    3,657
    Likes Received:
    9
  2. Tazar

    Tazar Guest

    "You must log in to view this page"...

    Not a chance! Any tidbits you can copy/paste over for those of us who do not want to register?
     
  3. Harlequin

    Harlequin Babbling Loonie
    Stratics Veteran

    Joined:
    Jun 11, 2008
    Messages:
    2,716
    Likes Received:
    32
  4. Maplestone

    Maplestone Crazed Zealot
    Stratics Veteran

    Joined:
    Jul 26, 2008
    Messages:
    3,657
    Likes Received:
    9
    I'm hesitant to copy the whole thing here, but the essay talks about some quirky behavior in a SA dungeon he because of the fact the monster AI/activity turns off when there are no players around (which yes, does sound like it's a followup to that philosophy thread Harlequin - I thought the same thing when I read it).
     
  5. Basara

    Basara UO Forum Moderator
    Moderator Professional Governor Wiki Moderator Stratics Veteran Stratics Legend Campaign Supporter

    Joined:
    Jul 16, 2003
    Messages:
    8,491
    Likes Received:
    601
    He's stated already in one of his replies that people can copy stuff like that as much as they want to other places.
     
  6. Storm

    Storm UO Forum Moderator
    Moderator Professional Premium Wiki Moderator Stratics Veteran Stratics Legend

    Joined:
    Mar 18, 2004
    Messages:
    7,469
    Likes Received:
    361
    Falling Trees


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

    Ultima Online is a big world, containing a myriad of virtual objects of every type and description. Animals, monsters, people, plants, and yes, trees too, all abound over nearly seventy million square meters of territory that exists merely as a figment of data in some server's RAM, dutifully backed up on a daily basis.

    If UO is a persistent world, does everything keep going, even when players aren't there?

    The short answer is: no, unfortunately not. A somewhat commonly known thing amongst our playerbase, for instance, is that mobiles (any dynamic object that can move: animals, monsters, NPCs) don't move when players aren't nearby. This "sleep" behavior was implemented some time ago in order to combat wasted CPU time that bogged down performance for the rest of the game.

    The behavior itself is very simple to understand. Every mobile has its own basic AI loop that executes, sets a short delay, and starts over again. This allows every mobile to evaluate its current situation and respond to it, and then turn control of the CPU back over to the rest of the game.

    In fact, these loops are very short, and we call them ticks or heartbeats. Rather than give every single object in the game its own individual share of the CPU, we have a main thread that runs as a loop as well, which gives short amounts of time to each object on an as needed basis.

    Now, imagine a normal server, like Atlantic. There are over sixty thousand mobiles up and running, all potentially handling their AI loops at any given time. If every mobile tried to execute all the conditions and possibilities available to it, the game would take a gigantic hit in performance. Even worse, imagine if every mobile wanted to actually move.

    And so, instead, if players aren’t within a certain distance, those mobiles just go to sleep, waiting for their time to shine.

    This became a problem, though, while we were working on the Stygian Abyss expansion.

    We wanted to do something we thought would be relatively simple. One of the newer dungeon levels has a series of tombs, each blocked by a gate, hooked to a lever in another room. When the lever is pulled, it should open the gate, releasing the monsters inside.

    Now, normally, that means we just send a message to each monster saying "move down the corridor and get ready to meet the player in the main hallway."

    So we pulled all the levers, eager to see the suddenly full hallway, and to our surprise, found the hallway quite empty. At least, for a moment! Suddenly the monsters came streaming from left and right, coming out of the tombs, now that someone was there to see them.

    Even though we knew about the "sleep" mode for mobiles, we thought we could override it just by directly sending commands to them. This had worked in many other game systems added for live events, such as Sherry the Mouse, an NPC who had a full daily schedule of running around the castle, eating lunch in the kitchen, popping through mouseholes, and generally being cute.

    It turns out, we were wrong! The only reason Sherry worked at all when players weren't around was because she could teleport when her movement checks failed, a failsafe originally designed to deal with griefers trying to trap her in the corner.

    Ultimately, our resolution is a simple one: we've designed a flag that allows some mobiles to avoid the sleep system, which will be implemented in the new expansion. From here on out, parts of the world will come to life more than ever before, existing and evolving apart from the comings and goings of the average observer.

    And while we may not be able to hear a tree chopped down in the woods, and least we know a horde of undead Gargoyles won't be standing idly by when you raid their tombs!

    This was from Draconi's facebook essay
     
  7. Hmm.. I wonder how certain spawns like dungeon stealables works then. Interesting article.
     
  8. Storm

    Storm UO Forum Moderator
    Moderator Professional Premium Wiki Moderator Stratics Veteran Stratics Legend

    Joined:
    Mar 18, 2004
    Messages:
    7,469
    Likes Received:
    361
    Makes me wonder what Draconi is gonna do to us in SA I am sure it wont make it easier to stay alive lol
     
  9. Draconi

    Draconi Most explosive UO Legend
    VIP Stratics Veteran Stratics Legend

    Joined:
    Aug 20, 2004
    Messages:
    1,223
    Likes Received:
    53
    Right - anything I put on Facebook can be considered public and approved for distribution.

    Anything I say on an internal beta forum, though, is subject to NDA.

    Luckily, the whole point of dev accounts for Facebook is for stuff just like this :)
     
  10. Draconi

    Draconi Most explosive UO Legend
    VIP Stratics Veteran Stratics Legend

    Joined:
    Aug 20, 2004
    Messages:
    1,223
    Likes Received:
    53
    Huh, I suppose I should write a short essay on that next then :p
     
  11. Maplestone

    Maplestone Crazed Zealot
    Stratics Veteran

    Joined:
    Jul 26, 2008
    Messages:
    3,657
    Likes Received:
    9
    Good to know - I wasn't sure about that approved for (re)distribution part of Facebook :)

    I keep wondering about CPU cycles and the amount of time that has passed since UO first went live.

    How many times has the underlying hardware changed? Has the coding become significantly more complex or the number of mobiles increased to eat the proceeds of Moore's Law? (or do different subservers have their own threads that can be spaced out across CPUs?)

    Do the same presures exist to keep inactive mobs inactive that were there when it was it first implemented. I suppose any time a server is chugging away with nobody to benefit from it must seem like a waste, but I keep thinking back to playing with cellular automata and wishing my gardener could find a nice big open field and set off a massive "game of life" simulation planting seeds :)
     
  12. *sigh*
    Im not social in RL.....

    Could you just email me everything you ever post on any forum/book/twits/twips/tweets or whatever they call it?

    :)