docs: def get_delta(self, branch, turn_from, tick_from, turn_to, tick_to):
          """Get a dictionary describing changes to the world.
  
          Most keys will be character names, and their values will be dictionaries of
          the character's stats' new values, with ``None`` for deleted keys. Characters'
          dictionaries have special keys 'nodes' and 'edges' which contain booleans indicating
          whether the node or edge exists at the moment, and 'node_val' and 'edge_val' for
          the stats of those entities. For edges (also called portals) these dictionaries
          are two layers deep, keyed first by the origin, then by the destination.
  
          Characters also have special keys for the various rulebooks they have:
  
          * 'character_rulebook'
          * 'avatar_rulebook'
          * 'character_thing_rulebook'
          * 'character_place_rulebook'
          * 'character_portal_rulebook'
  
          And each node and edge may have a 'rulebook' stat of its own. If a node is a thing,
          it gets a 'location'; when the 'location' is deleted,
          that means it's back to being a place.
  
          Keys at the top level that are not character names:
  
          * 'rulebooks', a dictionary keyed by the name of each changed rulebook, the value
          being a list of rule names
          * 'rules', a dictionary keyed by the name of each changed rule, containing any
          of the lists 'triggers', 'prereqs', and 'actions'
  
          """
          from allegedb.window import update_window, update_backward_window
          if turn_from == turn_to:
              return self.get_turn_delta(branch, turn_to, tick_to, start_tick=tick_from)
          delta = super().get_delta(branch, turn_from, tick_from, turn_to, tick_to)
          if turn_from < turn_to:
              updater = partial(update_window, turn_from, tick_from, turn_to, tick_to)
              univbranches = self._universal_cache.settings
              avbranches = self._avatarness_cache.settings
              thbranches = self._things_cache.settings
              rbbranches = self._rulebooks_cache.settings
              trigbranches = self._triggers_cache.settings
              preqbranches = self._prereqs_cache.settings
              actbranches = self._actions_cache.settings
              charrbbranches = self._characters_rulebooks_cache.settings
              avrbbranches = self._avatars_rulebooks_cache.settings
              charthrbbranches = self._characters_things_rulebooks_cache.settings
              charplrbbranches = self._characters_places_rulebooks_cache.settings
              charporbbranches = self._characters_portals_rulebooks_cache.settings
              noderbbranches = self._nodes_rulebooks_cache.settings
              edgerbbranches = self._portals_rulebooks_cache.settings
          else:
              updater = partial(update_backward_window, turn_from, tick_from, turn_to, tick_to)
              univbranches = self._universal_cache.presettings
              avbranches = self._avatarness_cache.presettings
              thbranches = self._things_cache.presettings
              rbbranches = self._rulebooks_cache.presettings
              trigbranches = self._triggers_cache.presettings
              preqbranches = self._prereqs_cache.presettings
              actbranches = self._actions_cache.presettings
              charrbbranches = self._characters_rulebooks_cache.presettings
              avrbbranches = self._avatars_rulebooks_cache.presettings
              charthrbbranches = self._characters_things_rulebooks_cache.presettings
              charplrbbranches = self._characters_places_rulebooks_cache.presettings
              charporbbranches = self._characters_portals_rulebooks_cache.presettings
              noderbbranches = self._nodes_rulebooks_cache.presettings
              edgerbbranches = self._portals_rulebooks_cache.presettings
  
          def upduniv(_, key, val):
              delta.setdefault('universal', {})[key] = val
          if branch in univbranches:
              updater(upduniv, univbranches[branch])
  
          def updav(char, graph, node, av):
              delta.setdefault(char, {}).setdefault('avatars', {}).setdefault(graph, {})[node] = bool(av)
          if branch in avbranches:
              updater(updav, avbranches[branch])
  
          def updthing(char, thing, loc):
              if (
                  char in delta and 'nodes' in delta[char]
                  and thing in delta[char]['nodes'] and not
                  delta[char]['nodes'][thing]
              ):
                  return
              thingd = delta.setdefault(char, {}).setdefault('node_val', {}).setdefault(thing, {})
              thingd['location'] = loc
          if branch in thbranches:
              updater(updthing, thbranches[branch])
          # TODO handle arrival_time and next_arrival_time stats of things
  
          def updrb(whatev, rulebook, rules):
              delta.setdefault('rulebooks', {})[rulebook] = rules
  
          if branch in rbbranches:
              updater(updrb, rbbranches[branch])
  
          def updru(key, _, rule, funs):
              delta.setdefault('rules', {}).setdefault(rule, {})[key] = funs
  
          if branch in trigbranches:
              updater(partial(updru, 'triggers'), trigbranches[branch])
  
          if branch in preqbranches:
              updater(partial(updru, 'prereqs'), preqbranches[branch])
  
          if branch in actbranches:
              updater(partial(updru, 'actions'), actbranches[branch])
  
          def updcrb(key, _, character, rulebook):
              delta.setdefault(character, {})[key] = rulebook
  
          if branch in charrbbranches:
              updater(partial(updcrb, 'character_rulebook'), charrbbranches[branch])
  
          if branch in avrbbranches:
              updater(partial(updcrb, 'avatar_rulebook'), avrbbranches[branch])
  
          if branch in charthrbbranches:
              updater(partial(updcrb, 'character_thing_rulebook'), charthrbbranches[branch])
  
          if branch in charplrbbranches:
              updater(partial(updcrb, 'character_place_rulebook'), charplrbbranches[branch])
  
          if branch in charporbbranches:
              updater(partial(updcrb, 'character_portal_rulebook'), charporbbranches[branch])
  
          def updnoderb(character, node, rulebook):
              if (
                  character in delta and 'nodes' in delta[character]
                  and node in delta[character]['nodes'] and not delta[character]['nodes'][node]
              ):
                  return
              delta.setdefault(character, {}).setdefault('node_val', {}).setdefault(node, {})['rulebook'] = rulebook
  
          if branch in noderbbranches:
              updater(updnoderb, noderbbranches[branch])
  
          def updedgerb(character, orig, dest, rulebook):
              if (
                  character in delta and 'edges' in delta[character]
                  and orig in delta[character]['edges'] and dest in delta[character]['edges'][orig]
                  and not delta[character]['edges'][orig][dest]
              ):
                  return
              delta.setdefault(character, {}).setdefault('edge_val', {}).setdefault(
                  orig, {}).setdefault(dest, {})['rulebook'] = rulebook
  
          if branch in edgerbbranches:
              updater(updedgerb, edgerbbranches[branch])
  
          return delta