MU Soapbox

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Muxify
    • Mustard
    1. Home
    2. faraday
    3. Posts
    • Profile
    • Following 0
    • Followers 8
    • Topics 14
    • Posts 3117
    • Best 2145
    • Controversial 1
    • Groups 1

    Posts made by faraday

    • RE: Codebase Pot Pie - Or what I like or wish I could have

      @Thenomain said in Codebase Pot Pie - Or what I like or wish I could have:

      No matter how many times fans of attribute trees explain it to me, I don't see anything I can't and don't already do on my own.

      The only time I used attr trees was in +combat to store the individual combat attributes for each participant. You'd have things like:

         stat_faraday`ammo: 10
         stat_faraday`recoil: 2
      

      When you had several dozen combatants, it was handy to be able to examine the combat instance object and see the combatants and other sundry combat attributes without having to get spammed by everybody's combat state. That's the only time I've found them useful.

      posted in MU Code
      faraday
      faraday
    • RE: Sensitive cultural/political/religious aspects of game themes.

      @surreality said in Sensitive cultural/political/religious aspects of game themes.:

      That's different from saying 'they shouldn't allow that to happen because it corrupts the purity of the setting by skewing it too far into unrealistic territory', however.

      I think the difference is that people tend to gravitate towards historical games because they like that period of history. So anything that dramatically changes the 'feel' of the historical period for them is potentially a Big Deal. We all have our hot buttons.

      Contrast that with a supernatural game where, yeah, it's a bit goofy that your small town in Maine has all these supers, but it's not like a lot of people were drawn to your game because "Oh, hey, small town in Maine! Sign me up!"

      posted in Mildly Constructive
      faraday
      faraday
    • RE: Sensitive cultural/political/religious aspects of game themes.

      @surreality said in Sensitive cultural/political/religious aspects of game themes.:

      But I don't feel 'give people a little leeway to allow for creativity while preserving player comfort' is tantamount to 'now anything goes, it's all a worthless travesty, you may as well hand-wave everything because the sacred truth has already been despoiled', which is a worrying notion that seemed to emerge in the other thread.

      A lot of people really do feel that way though. On my western game, I approved people on individual merits. Want to be an abolitionist? Freed slave who made their way west? Female ranch owner? Female Pinkerton agent? African-American doctor? Sure. All these things existed in real life history.

      Did all of them exist in one single small town in Wyoming though? No, of course not. So it ended up being like Twin Peaks the Western. I got a lot of flak for how preposterous the characters were and how badly it broke the Western theme.

      Saying that the PCs are the exception to the rule only goes so far. Unless you've got people really exercising the "mainstream" NPC viewpoint, the exception becomes all you see and therefore becomes people's mental rule no matter what you say. So you get this weirdly-jarring discontinuity when the person claiming to be oppressed by totally valid IC prejudices ends up looking like a looney since it never happens on-camera. (or if it does, the poor NPC is quickly smacked down by all the modern-sensibility PCs.)

      But for me I wouldn't change a thing. It was far more palatable than trying to enforce a world where 90% of the playerbase had to be racist/sexist jerks or farmers/manual labor. Didn't seem like much fun for me, as a player or a staffer. So YMMV.

      posted in Mildly Constructive
      faraday
      faraday
    • RE: Brilliant Breakthroughs and Impossible Projects

      @Griatch said in Brilliant Breakthroughs and Impossible Projects:

      Splitting that into optional easy-to use components make's it easy to do any extra fluff on a case by case basis.

      Yeah definitely different layers of abstraction. The Ares engine does similar parsing to what you're talking about. crack is for figuring out args. So you just leave that up to individual commands to figure out, splitting the string as needed? Nothing wrong with that, btw, I just codified that as a separate step.

      posted in MU Code
      faraday
      faraday
    • RE: Brilliant Breakthroughs and Impossible Projects

      @skew said in Brilliant Breakthroughs and Impossible Projects:

      So: Has anyone hooked the basic pose/say commands? Is there some big scary reason why we shouldn't be doing it?

      I've used it for my pose autospacer and combat pose tracking on Penn and it worked just fine. I know others have used it for pose order/repose stuff too without incident.

      @Griatch Thanks for the feedback. I think we might be talking about two different levels of argument parsing with the parse/crack methods. Your parse sounds very generic if you can use one version for all MUX-like commands. Crack is highly command-specific, because what it does is take something like: <target>=<message> or <board #>/<post #> and break it into sensibly-named variables like "target", "message", "board_num", and "post_num". There's almost zero opportunity for inheritance there because almost every command has different arguments. There are utilities for common scenarios, but that's more composition than inheritance.

      But yeah, we have a similar command flow with the base command handler's on_command method calling log, crack, error-check (aborting if any check_xxx method returns an error), and handle. Most handlers implement crack, handle, and at least one check, but there are exceptions. "who" just has handle. Some override log for privacy so we don't log things like pages and poses.

      posted in MU Code
      faraday
      faraday
    • RE: Brilliant Breakthroughs and Impossible Projects

      @Thenomain said in Brilliant Breakthroughs and Impossible Projects:

      That's totally opposite the usual mood about code bases; you really are tired of this hobby, aren't you?

      Seriously, the number of code holy wars encountered in this hobby are but a pale shadow of the number encountered in my day to day job. But yes, so sick of all of them. 🙂

      posted in MU Code
      faraday
      faraday
    • RE: Brilliant Breakthroughs and Impossible Projects

      @Thenomain You can do more than one check per error-checker method if you need to sequence things. It's a tool not a religion 🙂

            def check_can_set_actor
              return nil if self.name == enactor_name
              return nil if Actors.can_set_actor?(enactor)
              return "You're not allowed to do that."
            end
      

      Technically they are also run in sorted alphabetical order, but I think it's getting a bit too wacky if you rely on that. The only time that gets used is for some of the built-in checks like 'is logged in', which you can include with a single line of code:

      include CommandRequiresLogin

      You want to make sure they're logged in before you start checking for things like character permissions and whatnot, so it's important that it runs first.

      Edit to add -- Oh, I think I missed what you were saying about state changes. If you need to do some funky state-based stuff, you should probably put the error check inside of the handle method. Otherwise the state change wouldn't be persisted. The check methods are just a shortcut for simple atomic things that can short-circuit the processing early on.

      posted in MU Code
      faraday
      faraday
    • RE: Brilliant Breakthroughs and Impossible Projects

      So I'm not sure if this is the right topic but it seems to kinda fit so I figured I'd try. Especially interested in @Thenomain and @Lithium's thoughts since we were talking about making the next-gen servers easier to learn.

      Ares plugins have Command Handlers - each responsible for a single command. You can think of them as the equivalent of &CMD-FOO attributes from Penn/Tiny/Rhost land.

      Now the easiest and most straightforward thing would be to have command handlers implement a single method to do everything.

      Side note: Ares uses Ruby, but what I have below is more psuedocode showing the general idea for simplicity. I want to focus on the overall flow, not the actual code.

      class PageCmd
         def on_command(client, cmd)
             # Figure out the parameters, like *=*
             recipients = cmd.args.arg1
             message = cmd.args.arg2
             # Do error checks
             if (a recipient is not valid)
               client.emit "Don't know who you're trying to page."
               return # do not continue
             end
             # Emit the page to everyone
             recipients.each { emit page to recipient }
             client.emit page message
      

      The pseudocode there is pretty short, but in reality it would be a bit longer.

      Now, in the current version of Ares I tried to make the coder's life easier by breaking this process up into three distinct steps with three distinct Ruby methods: crack parses the parameters, checks do the error checking and abort if there's a problem, handle executes the command if there are no problems.

      class PageCmd
        # Define member variables for your command parameters
        # so they're available throughout the class
        attr_accessor :recipients, :message
      
        def crack
           # Figure out the parameters, like *=*
           recipients = cmd.args.arg1
           message = cmd.args.arg2
        end
      
        # This is an error-check method, because it starts with check_
        # If it returns nil, all is well.  If it returns a message, that message gets
        # emitted to the client and the command is aborted.
        # You can have other check methods too checking different things
        def check_recipients
           if (a recipient is not valid)
               return "Don't know who you're trying to page."
           end
           return nil  # All is well
        end 
      
        # All the error checks have passed, do the thing.
        def handle
            # Emit the page to everyone
            recipients.each { emit page to recipient }
            client.emit page message
        end
      

      I personally like the second example better. I think each step is broken out clearly. There's less repetition with the error check because the if (error) emit return stuff is bundled up in the check method handling.

      BUT is it too much for new devs to absorb? Functions that get auto-executed based on their names? Member variables? The emit/return stuff happening behind the scenes? I worry that in making it cleaner, it's actually made it harder to learn.

      Thoughts?

      posted in MU Code
      faraday
      faraday
    • RE: What is out there? Hard and soft codebases of choice.

      @Griatch said in What is out there? Hard and soft codebases of choice.:

      ... But that said, I agree that the API doc section of our wiki is, while complete, not necessarily aimed at someone just diving in: it lists also systems that a normal user would most likely not be concerned about ever, or at least not until at an advanced level of understanding or when contributing to Evennia itself.

      API docs and tutorials have a completely different purpose and ideal design. One is not a good substitute for another. Merry Christmas / Happy Holidays!

      Edit to add: That was always MUSHCode's problem IMHO. There was plenty of "this function does X, that function does y" type documentation, but it took the community ages before they produced useful docs of how to string those functions together into something useful. Which is why I find the comparison to MUSHcode as a pillar of good documentationto be a bit baffling.

      posted in MU Questions & Requests
      faraday
      faraday
    • RE: What is out there? Hard and soft codebases of choice.

      @Thenomain said in What is out there? Hard and soft codebases of choice.:

      Step 1: Recognize a built-in function from a defined function.

      • In Mushlikes: Is it a u()? No: Is it in 'help'? No: @function/list.
      • In Mainstream Languages: ...?

      Agree with you in general principle. (Gasp!)

      To answer your specific question for Ares/Ruby, the object-oriented bit helps a great deal. When you see FS3Skills.ability_rating(char, "Athletics") or "abc".ljust(22) it is hopefully reasonably obvious that ability_rating is a FS3 function and ljust is a Ruby string function. I do "google ruby whatever" a lot 🙂

      And of course, using a mainstream language opens up a host of editors from Sublime Text to TextMate to VSCode to RubyMine that will provide you with anything from full-on intellisense support to an easy global search for "now where the heck is emit defined? Search for def emit"

      Docs are critical, but tools and conventions help too.

      posted in MU Questions & Requests
      faraday
      faraday
    • RE: What is out there? Hard and soft codebases of choice.

      @Thenomain said in What is out there? Hard and soft codebases of choice.:

      @faraday and @Thenomain on opposite sides of an issue. It should be a podcast!

      Maybe so since it seems to happen every other Tuesday 🙂

      how to find the help files so you can translate def switch_set(self, target, files, rhs, isadmin): into English. I mean, sure, you have to do the same with iter(), but 'help iter' and boom, done.

      Does Evennia have a 'help switch_set'? If not, it desperately needs one!

      Uhh... perhaps I'm missing something critical about your point, but with a mainstream (I won't say "real" because say what you will about MUSHCode but it is a "real" language) programming language there are literally gazillions of "how to do a switch in Ruby" type tutorials. You can learn the critical basics in the interactive tryruby.org 15 minute tutorial. Have a wacky question? There are millions of answers on stackoverflow. Given the popularity of Python I have to assume that similar resources exist.

      The critical piece I think is needed for transitioning from MUSHCode to a different framework is a bridge document. "Here's how to do iter(a b c,...) in Ares. Here's how to do set(#123: x) in Ares." That's what I'm working on right now.

      posted in MU Questions & Requests
      faraday
      faraday
    • RE: What is out there? Hard and soft codebases of choice.

      @Lithium I believe that anyone smart enough to figure out MUSHcode through experimentation and arcane help files is more than smart enough to learn Python or Ruby in short order with the right documentation and tutorials.

      Ares is still in development so those docs/tutorials don't yet exist. But they will. I haven't looked much at Evennia's docs to know what state they're in.

      Of course, whether or not it's worth the effort to you is a completely separate issue. For someone who can already do 99% of what they want to do in MUSHcode and doesn't see many advantages with a different framework... it probably isn't. That's totally cool. But to dismiss as impossible is doing yourself a disservice, IMHO.

      posted in MU Questions & Requests
      faraday
      faraday
    • RE: What is out there? Hard and soft codebases of choice.

      @Griatch said in What is out there? Hard and soft codebases of choice.:

      How do you handle single-letter shortcuts, like ":" for emoting?

      So yeah, in the vein of "everything is consistent until it isn't", there are a couple special cases for channels, room exits and poses. 🙂 There's an emote catcher at the bottom of the Pose Plugin's get_cmd_handler method to look if the command starts with : or ; or whatnot. But command roots can be single letters, and there's also a shortcut system for aliasing (for instance) 'con' to 'connect'.

      posted in MU Questions & Requests
      faraday
      faraday
    • RE: What is out there? Hard and soft codebases of choice.

      @Griatch said in What is out there? Hard and soft codebases of choice.:

      The default Evennia commands are inspired by MUX and that's where the @ comes from. Consistently, all commands related to building or administration use @ while in-game commands like look, get, inventory etc. do not. It would be simple to have the default commands accept both @ and -not though; just have an alias for the non-@ version. Does Ares list the commands with @ (but accept without too) or are they listed without @ (but accepts one anyway) ?

      Ares lists all commands with no prefix at all in help files and whatnot. Unless you explicitly make a command look for a prefix (@, &, /, +), Ares just ignores it completely.

      This is, incidentally, why the default Ares config renamed the public chat channel to "Chat" instead of "Public", to avoid the obvious mav-prone confusion of p for page and +p for public 🙂

      Edit to add: Codewise Ares breaks the command up into (prefix)root(page#)(/switch) (args). So all the built-in commands only look at cmd.root but you could make one look at cmd.prefix if you really wanted.

      posted in MU Questions & Requests
      faraday
      faraday
    • RE: What is out there? Hard and soft codebases of choice.

      @Griatch Yeah, I did experiments with the command looping and performance was not an issue. The dispatcher goes with the first plugin that wants it, so it's on the coder to avoid command name duplication.

      As for merge conflicts - absolutely those can happen. But I think by making it pluggable you're just trading one kind of headache for another. For starters, it's more complexity for the designer to worry about. Also, if someone makes a custom version of the Bob command and you make an upstream change to the core Bob command, then they've got a philosophical merge conflict whether they've modified BobCmd or overridden it with MyBobCmd. Editing in place allows you to use the built-in git merge tools to resolve trivial conflicts automatically, and gives you help in resolving more complex ones.

      Also we've got different user bases. A lot of my target audience won't be modifying the commands at all (since they're using Ares because they lack a coder) or just won't bother upgrading. So it's quite possible that your strategy works best for Evennia. It's a question of tradeoffs.

      posted in MU Questions & Requests
      faraday
      faraday
    • RE: What is out there? Hard and soft codebases of choice.

      @Ashen-Shugar Thanks. To your point, I think I left out something important: The game/plugins directory contains all of the plugin code. When you first install Ares, it has the default plugins. If you want to change one, you just... change it. Again, it's simplicity over elegance. Rather than "overriding" functionality, you just replace or change it directly.

      Also, the commands are handled within the plugins themselves so you can easily remove an entire swath of command handling just by disabling that plugin. More elaborate example: Mail Plugin vs Who Plugin.

      Edit to add due to reading comprehension fail: I get what you're saying about people being leery of hacking core code, but Ares is really designed with the intention that you will. If it really concerns you, though, you can absolutely just insert your own custom stuff at the beginning of a plugin's command dispatcher, effectively bypassing what was there to begin with.

      posted in MU Questions & Requests
      faraday
      faraday
    • RE: What is out there? Hard and soft codebases of choice.

      @Ashen-Shugar said in What is out there? Hard and soft codebases of choice.:

      However, on the condition of a full moon, between the times of midnight and 3am, I want players with a race of 'WOLF' to do an entirely different feature set by typing 'bob' at the same time that everyone else can still use the normal 'bob', which, of course, returns to the normal 'bob' after the conditions have elapsed.

      Figured this would be a good chance to contrast Evennia and Ares' philosophy for command handling.

      Ares has the Engine (which provides core services) and Plugins (which handle commands, events, and data storage).

      One of the core services provided by the Engine is command dispatching. When a player types a command, the Engine goes through each of the Plugins asking "do you want to handle this?" until it finds one that does. It then executes a Command Handler provided by the Plugin. If nobody wants the command, you get the usual "Huh?" message.

      Most Plugins implement a very straightforward if/else or case statement based on the command root and switch. For example:

      Who Plugin:

            case cmd.root
            when "where"
              return WhereCmd
            when "who"
              return WhoCmd  
            else
              return nil   # I don't want it, move on to the next plugin
            end
      

      Mail Plugin:

            case cmd.root
            when "mail"
              case cmd.switch
              when "send"
                return MailSendCompositionCmd
              when "start"
                return MailStartCmd
              ... etc ...
            else
              return nil   # I don't want it, move on to the next plugin
      

      But Plugins could also do more sophisticated dispatching. You could have a command that only got handled if the enactor is a Wolf character in the Special Room on a Tuesday.

      You can also do that sort of check inside the Command Handler itself. For example, you could have the BobCmd do something like:

      BobCmd handler:

      def handle
          if (you're a Wolf in the Special room on a Tuesday)
             do something
         else
            do something else
          end
      end
      

      It's not as elegant as Evennia's command sets, and it doesn't follow the old MU* strategy of letting you tie those command sets directly to rooms or characters, but I like to think it's pretty straightforward and easy to understand/extend. I hope?

      Two other things worth noting:

      • Ares by default ignores the prefix (+, @, &, /) in front of commands. So who is the same as +who is the same as @who.
      • ALL commands are handled by the plugins, even ones that were old-school 'hardcoded' commands like movement, pages, poses, help, etc. This allows you to override/replace/extend any game command without having to do who vs +who or help vs +help.
      posted in MU Questions & Requests
      faraday
      faraday
    • RE: What is out there? Hard and soft codebases of choice.

      @WTFE Since you so clearly think so little of my chosen profession, industry, and the apparently-nonsensical design choices for my MU* server, I'd say there's not really much more to be gained from further discussion. Hope you find a game server that meets your needs.

      posted in MU Questions & Requests
      faraday
      faraday
    • RE: What is out there? Hard and soft codebases of choice.

      @Griatch said in What is out there? Hard and soft codebases of choice.:

      Could you elaborate more on what you refer to by the "web template interface" here?

      We were just talking about web UIs for MUSHes. I mentioned my painful experiments with Ares' web UI, we both sort of said "I wonder how Evennia does it" and went on a scavenger hunt through the code and docs before finally finding this.

      Now I know that nothing in Evennia is stamped "for professionals only" but there's HTML and Javascript stuff, python stuff, Django templates, plus a separate web client and web server, plus SQL... you gotta kinda admit it's a lot to learn, yeah?

      And hey, I'm not saying that's a horrible thing or a deal breaker, but compared to Amberyl's tutorial telling you Everything You Need to Know About MUSHCode, I can see where it's kind of daunting.

      I've struggled with the same things with Ares, so I completely sympathize. Using modern tools means using a patchwork of stuff. That's just the way modern software tools are. There are pros and cons. I can understand how someone who's never experienced the 'pros' would find the 'cons' pretty off-putting. I can also understand how one person's "pro" is another person's "con", so ... it's all relative. Pick the tool that best fits YOUR job.

      posted in MU Questions & Requests
      faraday
      faraday
    • RE: What is out there? Hard and soft codebases of choice.

      @krmbm said in What is out there? Hard and soft codebases of choice.:

      Will it be that way with AresMUSH when it's done? Legit interested. Can you uninstall default plugins and not break your game?

      It's still a work in progress. Ultimately yeah I'd love for it to be completely plug-and-play, but it's not there yet. Some plugins are more central than others. But I like to think it's a marked improvement over my Penn codebase because each plugin clearly defines the interfaces (APIs) that other plugins are allowed to use. For example, the BBS plugin defines has_unread_bbs?, post and system_post. If you were to remove that plugin, you'd just need to either stub out those methods so they do nothing, or edit the places that are trying to use them.

      posted in MU Questions & Requests
      faraday
      faraday
    • 1
    • 2
    • 135
    • 136
    • 137
    • 138
    • 139
    • 155
    • 156
    • 137 / 156