"BatClient does not start" workaround

So, you just installed BatClient aka the fancy custom MUD client for BatMUD probably through Steam, on your Linux system, and for some reason it does not start. What gives?

There may be several reasons, but the one I've ran into myself is that the Excelsior JET runtime used by BatClient has a silly bug - it attempts to use the system's limit for maximum number of concurrently open file descriptors to determine how much memory to allocate for .. something.

On many modern Linux systems, such as later versions of Ubuntu such as 25.04, that setting is "unlimited" by default. And you may now start to see wherein the problem lies... attempting to allocate unlimited amount of memory will inevitably fail.

To circumvent this issue, we need to change the limit to some value that is less than infinite but still reasonably high. In a Linux system this can be done via "ulimit -H -n [value]" command on commandline, before starting BatClient (or Steam) from that commandline. This only affects that shell's (and its child processes') limits and is not persistent.

A more persistent fix would be do to ONE of the following options:

  1. This first option is the most targeted solution, impacting only BatClient itself. However, it may get broken by updates and I have not personally tested if it actually works with Steam. It consists of renaming the BatClient executable and using a wrapper script to set the limit.

    1. In a terminal cd to BatClient main directory (I have no idea where Steam on Linux places the files) and rename the executable file
      mv BatMUD BatMUD.bin
    2. Create a new file there with the wrapper script
      printf '#!/bin/sh\nif test "$(ulimit -n)" = "unlimited"; then\n  ulimit -H -n 12345\nfi\n./BatMUD.bin "$@"\n' > BatMUD
      
      The contents of the file will be:
      #!/bin/sh
      if test "$(ulimit -n)" = "unlimited"; then
        ulimit -H -n 12345
      fi
      ./BatMUD.bin "$@"
          
    3. Make the file executable:
      chmod u+x BatMUD
  2. Another option is to change your system's global configuration. To do that, you add a new configuration file under /etc/security/limits.d/ directory, if your system has that. If not, see the next point.
    echo "* hard nofile 1234567" > /etc/security/limits.d/99-nfiledescs-batclient-fix.conf
      
  3. If your system only has /etc/security/limits.conf, append a line to it:
    echo "* hard nofile 1234567" >> /etc/security/limits.conf
      
    NOTE: It might be wiser to just edit the file and see if such line (with "hard nofile") already exists and modify that.

Obviously you must do either of things as superuser (root). The value "1234567" is obviously arbitrary here and does not necessarily need to be that high. After that you will need to restart your session or reboot for the limits to take effect.

After rebooting, open a terminal and check that the configuration was correctly applied by invoking "ulimit -H -n", which should print out 1234567.

I take no responsibility on the accuracy or applicability of the information presented here. Modifying system configuration or running commands from the Interwebs without understanding what you are doing is not advisable.