New ServerConfig.json file and defining the location of these server files

MurphyIdiotMurphyIdiot NS2 programmer Join Date: 2008-04-17 Member: 64095Members, Super Administrators, NS2 Developer, Subnautica Developer, Pistachionauts, Future Perfect Developer
Hey server admins!

With 1.0 coming up so soon, we want to try to fix as many of the server admin issues as we can.

So here are a couple of new things you should all be aware of (and maybe one of you can document this on the wiki for me).

First of all, there is a new ServerConfig.json file in patch 220. We are going be removing the existing server.xml file eventually (not sure when, maybe not until right after 1.0) so this new file will take over some of the roles of server.xml.

For now, the only thing in this new file is going to be "newbie_friendly". This will set the server to be in newbie mode which is something that will be explained in more detail when we are done implementing it (should be in 220). But soon the optional auto-team balance system will be configured through this new file as well. Perhaps other options like player counts, password, etc too.

Here is what it looks like:

<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->{
    "settings":
    {
        "newbie_friendly": true,
        "auto_team_balance": true,
        "unbalance_count": 2
    },
    "tags": [ "newbie" ]
}<!--c2--></div><!--ec2-->

Just an example. The team balance stuff isn't used yet. Another thing to notice here are the tags. So if you want your server to be in newbie mode, you need to also have a "newbie" tag. These tags are a Steam feature that other games use too but basically, the server browser will be able to use these tags to filter servers later. You can add whatever tags you want but please be aware there is a 128 character limit on ALL tags combined (this is just a normal Steam limitation).

The second thing to be aware of is that we are implementing an often requested feature: configurable server admin files location.
So here is an example of how that works:
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->server.exe -config_path "C:\server1\config"<!--c2--></div><!--ec2-->
All of the server files such as bans, admin, map cycle, and this new config file will all read and write to this directory. It defaults to %appdata%\Natural Selection 2\

All these changes will be in 220.

Thanks!
«1

Comments

  • oldassgamersoldassgamers Join Date: 2011-02-02 Member: 80033Members, Squad Five Blue, Reinforced - Shadow
    <!--quoteo(post=1977213:date=Sep 13 2012, 09:07 PM:name=MurphyIdiot)--><div class='quotetop'>QUOTE (MurphyIdiot @ Sep 13 2012, 09:07 PM) <a href="index.php?act=findpost&pid=1977213"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->The second thing to be aware of is that we are implementing an often requested feature: configurable server admin files location.
    So here is an example of how that works:
    <!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->server.exe -config_path "C:\server1\config"<!--c2--></div><!--ec2-->
    All of the server files such as bans, admin, map cycle, and this new config file will all read and write to this directory. It defaults to %appdata%\Natural Selection 2\

    All these changes will be in 220.

    Thanks!<!--QuoteEnd--></div><!--QuoteEEnd-->


    YAY FINALLY, I'm so happy for this feature. I'm been waiting for this for sooooooooo looooooong <3 <3 <3 <3

    Great job guys :D
  • Katana-Katana- Join Date: 2008-11-25 Member: 65575Members
    Any chance we can get a Lua event to hook into when a client attempts to connect to a server?

    As in before the client fully connects and gets a slot on the server, it would be nice if the server could refuse their connection. This would allow for some nice customization on servers for things like reserved slots.

    It would also be nice if a hook existed to modify the way the engine handles responding to the Steam gamelist server.
  • MurphyIdiotMurphyIdiot NS2 programmer Join Date: 2008-04-17 Member: 64095Members, Super Administrators, NS2 Developer, Subnautica Developer, Pistachionauts, Future Perfect Developer
    Yes, there is a chance.

    I'll try to get it sorted out soon.

    I don't understand why you would want to hook into the steam master server stuff. A lot of that is configurable already through the new keyvalue things in 219 (ent_count and tickrate) and now tags in 220.
  • Katana-Katana- Join Date: 2008-11-25 Member: 65575Members
    Hooking into the query handler was how reserved slots were implemented in NS1.

    Basically if you wanted a 16 player server, you would make an 18 slot server, and report only 16 of those slots to the master game list. The game list would only let 16 player in, but if you connected to the server via console, the server would let you in. Once the player was in the server would check to see if it needed to kick some one to make room for the new player, or if the new player needed to be kicked because he didn't have a reserved slot.

    The hook to refuse incoming connections, or kick players to make room for incoming connections is preferable. If we have hope of getting that feature, don't worry about the query responder. :)
  • MOOtantMOOtant Join Date: 2010-06-25 Member: 72158Members
    JSON is a progress but if had too much time to do this I'd use YAML. This is sample postgresql.yaml config file in Yesod framework:

    <!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->Default: &defaults
      user: u
      password: p
      host: 192.168.1.5
      port: 5432
      database: h
      poolsize: 10

    Development:
      <<: *defaults

    Testing:
      database: h_test
      <<: *defaults

    Staging:
      database: b_staging
      poolsize: 100
      <<: *defaults

    Production:
      database: b_production
      poolsize: 100
      <<: *default<!--c2--></div><!--ec2-->

    You can have one setting and use it as reference. You could have 1 server.yaml file and start server.exe with -instance "a" "b" or whatever and it'd use different one but inherit same defaults. Inheritance was my biggest problem with JSON-like scripts that Source engine has. There is already a YAML library for C++.

    <a href="http://en.wikipedia.org/wiki/YAML" target="_blank">http://en.wikipedia.org/wiki/YAML</a>
  • MurphyIdiotMurphyIdiot NS2 programmer Join Date: 2008-04-17 Member: 64095Members, Super Administrators, NS2 Developer, Subnautica Developer, Pistachionauts, Future Perfect Developer
    Also, new map cycle format in 220, this is in the Dedicated_Server_Usage.txt file:

    <!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->The server can be configured to cycle through a list of maps by creating a file
    called MapCycle.json in your server config directory.

    This file defines the amount of time (in minutes) to wait before switching maps.
    It will only switch maps after a round completes.
    It also defines a mode which can be either "order" or "random".
    It then defines a list of maps to cycle.

    Avoid listing the same map twice in "order" mode.

    Here is an example map cycle file:

    {
        "time": 30,
        "mode": "order",
        "maps":
        [
            "ns2_summit",
            "ns2_mineshaft",
            "ns2_tram"
        ]
    }<!--c2--></div><!--ec2-->
  • Katana-Katana- Join Date: 2008-11-25 Member: 65575Members
    For map rotation, would it be possible to implement a change after a certain number of rounds instead of a certain number of minutes? Like the map changes after 2 rounds are played on one map?

    sorry for the feature request spam :)
  • MurphyIdiotMurphyIdiot NS2 programmer Join Date: 2008-04-17 Member: 64095Members, Super Administrators, NS2 Developer, Subnautica Developer, Pistachionauts, Future Perfect Developer
    Yes, that is possible. I'll add it to my list of junk to do.
  • Katana-Katana- Join Date: 2008-11-25 Member: 65575Members
    I feel like I should send you a beer or something :)
  • SecuritySecurity Join Date: 2005-01-07 Member: 33133Members, Constellation, Squad Five Blue
    <!--quoteo(post=1977213:date=Sep 13 2012, 11:07 PM:name=MurphyIdiot)--><div class='quotetop'>QUOTE (MurphyIdiot @ Sep 13 2012, 11:07 PM) <a href="index.php?act=findpost&pid=1977213"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->The second thing to be aware of is that we are implementing an often requested feature: configurable server admin files location.
    So here is an example of how that works:
    <!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->server.exe -config_path "C:\server1\config"<!--c2--></div><!--ec2-->
    All of the server files such as bans, admin, map cycle, and this new config file will all read and write to this directory. It defaults to %appdata%\Natural Selection 2\<!--QuoteEnd--></div><!--QuoteEEnd-->

    Nice feature!

    Eventhough as of 220, the server wouldn't find/use the default location (%appdata%\Natural Selection 2\) for me anymore, so I was forced to set -config_path (to the default location) manually.

    Was this intended?
  • falcfalc Join Date: 2011-03-18 Member: 87128Members
    Its still working for me.

    <b>However:</b>
    In the versions before, the json-files were in a subfolder "config". This has changed now, the json files have to be on the 1st level, respectively "%appdata%\Natural Selection 2\".
  • SecuritySecurity Join Date: 2005-01-07 Member: 33133Members, Constellation, Squad Five Blue
    edited September 2012
    <!--quoteo(post=1980123:date=Sep 19 2012, 11:30 AM:name=falc)--><div class='quotetop'>QUOTE (falc @ Sep 19 2012, 11:30 AM) <a href="index.php?act=findpost&pid=1980123"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec--><b>However:</b>
    In the versions before, the json-files were in a subfolder "config". This has changed now, the json files have to be on the 1st level, respectively "%appdata%\Natural Selection 2\".<!--QuoteEnd--></div><!--QuoteEEnd-->

    Alright, that might be it then.

    Edit: Indeed, that was the problem.
  • MurphyIdiotMurphyIdiot NS2 programmer Join Date: 2008-04-17 Member: 64095Members, Super Administrators, NS2 Developer, Subnautica Developer, Pistachionauts, Future Perfect Developer
    221 will have the new auto team balance system.

    Here is how it works:

    <!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->{
        "settings":
        {
            "auto_team_balance":
            {
                "enabled_on_unbalance_amount": 2,
                "enabled_after_seconds": 10
            }
        },
        "tags": [ ]
    }<!--c2--></div><!--ec2-->

    Simply having "auto_team_balance" in the settings table there will enable auto team balance mode.

    enabled_on_unbalance_amount is how many player over perfect team balance there needs to be on one team for the system to kick in.

    For example, with 2, there would have to be 10 players on one team and 8 on the other for the system to turn on.

    enabled_after_seconds is how long to wait after the enabled_on_unbalance_amount condition is met before the system is turned on. This allows there to be a little buffer in case another player joins the server soon or people are switching teams before the system is turned on. You can set this to 0 if you don't want any delay.

    Players will NOT automatically be switched teams with this system. Instead, the game will try to maintain the same number of players on the field when teams are unbalance.

    So if the Marines have 10 players and the Aliens have 8, when a Marine player dies, they will be in a special spectator mode until there are only 7 players alive. At which point, the player who has waited the longest in this mode will be spawned like normal.

    A player in this mode can also choose to switch teams without penalty.

    There is also a server admin command that can be used to control this system: sv_autobalance <true/false> <num players> <seconds>

    Thanks
  • VenatosVenatos Join Date: 2012-03-31 Member: 149762Members, Reinforced - Shadow, WC 2013 - Gold
    edited September 2012
    that system sounds realy awsome, cant wait to see it in action!
    there was a discusion about something like that a few(actualy pretty many) month back on how to implement autobalance into an already startet round.
    your system sounds better than everything we could come up with. ;)
  • KhyronKhyron Join Date: 2012-02-02 Member: 143308Members
    <!--quoteo(post=1980432:date=Sep 20 2012, 07:22 AM:name=MurphyIdiot)--><div class='quotetop'>QUOTE (MurphyIdiot @ Sep 20 2012, 07:22 AM) <a href="index.php?act=findpost&pid=1980432"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->221 will have the new auto team balance system.

    Here is how it works:<!--QuoteEnd--></div><!--QuoteEEnd-->
    Great to see progress on this issue, but a couple of thoughts come to mind:
    <ul><li>It will probably be necessary to set a time threshold of several minutes to get around the issue of end-game ragequits. Often in the last few minutes of a game, half the loosing team will f4 or just leave the server. Without some flexibility there, a round could be unnecessarily dragged out.</li><li>How will players in that mode be informed when they are under the effect of auto-balance? A specific help widget should do the trick. Without that, we'll be getting lots of questions and accusations that spawn queues are bugged etc.</li></ul>
  • Katana-Katana- Join Date: 2008-11-25 Member: 65575Members
    A related feature would be the option to disqualify a team if they have half the number of players the opposing team does (provided the game has started, and one team has more then 4 players). NS1 did this, and it makes it so f4ing to end the game works as long as the majority of the players on a team f4.
  • MurphyIdiotMurphyIdiot NS2 programmer Join Date: 2008-04-17 Member: 64095Members, Super Administrators, NS2 Developer, Subnautica Developer, Pistachionauts, Future Perfect Developer
    <!--quoteo(post=1980531:date=Sep 19 2012, 06:41 PM:name=Khyron)--><div class='quotetop'>QUOTE (Khyron @ Sep 19 2012, 06:41 PM) <a href="index.php?act=findpost&pid=1980531"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->How will players in that mode be informed when they are under the effect of auto-balance?<!--QuoteEnd--></div><!--QuoteEEnd-->

    There is a big text on the screen now that explains what is going on.

    <!--quoteo(post=1980550:date=Sep 19 2012, 07:39 PM:name=Katana-)--><div class='quotetop'>QUOTE (Katana- @ Sep 19 2012, 07:39 PM) <a href="index.php?act=findpost&pid=1980550"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->A related feature would be the option to disqualify a team if they have half the number of players the opposing team does (provided the game has started, and one team has more then 4 players). NS1 did this, and it makes it so f4ing to end the game works as long as the majority of the players on a team f4.<!--QuoteEnd--></div><!--QuoteEEnd-->

    Somebody mentioned this to me a couple days ago. I think it is a good idea as an option and should be easy to add. Of course, ideally this wouldn't be necessary.
  • Katana-Katana- Join Date: 2008-11-25 Member: 65575Members
    I'd prefer a vote to concede be implemented, but I have a feeling that is a lot more work :)
  • KhyronKhyron Join Date: 2012-02-02 Member: 143308Members
    <!--quoteo(post=1980591:date=Sep 20 2012, 03:31 PM:name=Katana-)--><div class='quotetop'>QUOTE (Katana- @ Sep 20 2012, 03:31 PM) <a href="index.php?act=findpost&pid=1980591"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->I'd prefer a vote to concede be implemented, but I have a feeling that is a lot more work :)<!--QuoteEnd--></div><!--QuoteEEnd-->
    That's a solution to a different problem
  • MurphyIdiotMurphyIdiot NS2 programmer Join Date: 2008-04-17 Member: 64095Members, Super Administrators, NS2 Developer, Subnautica Developer, Pistachionauts, Future Perfect Developer
    edited September 2012
    221 will also have consistency checking (a form of anti-cheat).

    A file called ConsistencyConfig.json will automatically be generated in the server config directory when you first start the server. It can be edited to change what type of files are checked on the client.

    A client that has modified files will automatically be disconnected from the server.

    You can disable consistency checking on your server by editing ConsistencyConfig.json from this:
    <!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->[ "*.lua", "*.fx", "*.screenfx", "*.surface_shader", "*.fxh", "*.render_setup", "*.shader_template" ]<!--c2--></div><!--ec2-->

    To this:
    <!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->[  ]<!--c2--></div><!--ec2-->
  • KoruyoKoruyo AUT Join Date: 2009-06-06 Member: 67724Members, Reinforced - Shadow
    edited September 2012
    Will there also be an option to make exceptions?

    E.g.:
    Imagine i would add "*.dds" files to check, but i want to allow ppl to have custom crosshairs and exclude those files? (crosshairs, crosshairs-hit, exo1234...)

    Or is this further down the pipe?

    edit:
    Will it also check if files are missing, i'm pretty sure that some ppl remove ambient sound files, which is REALLY annoying.
    (e.g. if i would add "*.fsb")
  • SopsSops Join Date: 2003-07-03 Member: 17894Members, Constellation
    <!--quoteo(post=1980591:date=Sep 20 2012, 12:31 AM:name=Katana-)--><div class='quotetop'>QUOTE (Katana- @ Sep 20 2012, 12:31 AM) <a href="index.php?act=findpost&pid=1980591"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->I'd prefer a vote to concede be implemented, but I have a feeling that is a lot more work :)<!--QuoteEnd--></div><!--QuoteEEnd-->
    F4 pretty much is a vote.


    Also 10 seconds is way too short, maybe 60 would be better.
  • Squirreli_Squirreli_ Join Date: 2012-04-25 Member: 151046Members, Reinforced - Shadow
    <!--quoteo(post=1980432:date=Sep 20 2012, 12:22 AM:name=MurphyIdiot)--><div class='quotetop'>QUOTE (MurphyIdiot @ Sep 20 2012, 12:22 AM) <a href="index.php?act=findpost&pid=1980432"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->221 will have the new auto team balance system.

    ....

    A player in this mode can also choose to switch teams without penalty.<!--QuoteEnd--></div><!--QuoteEEnd-->

    Sounds great! However, a minor gripe: Since marines currently gain pres faster, a marine switching to aliens is likely to have the top pres of the new team. Should this maybe be adjusted somehow? Maybe give the team switcher the average pres of the new team or maybe just cap max pres at the previous team top pres number?

    This goes the other way around too: Aliens switching to marines are likely to hold less pres than the marine team on average.
  • ZeikkoZeikko Join Date: 2007-12-16 Member: 63179Members, Squad Five Blue, NS2 Map Tester
    <!--quoteo(post=1980913:date=Sep 20 2012, 08:31 PM:name=MurphyIdiot)--><div class='quotetop'>QUOTE (MurphyIdiot @ Sep 20 2012, 08:31 PM) <a href="index.php?act=findpost&pid=1980913"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->221 will also have consistency checking (a form of anti-cheat).<!--QuoteEnd--></div><!--QuoteEEnd-->

    So if a server has consistency checking enabled for all lua files and for example ns2stats mod installed. Does this mean that the clients also need to have this mod installed? If they don't have it installed will they get an error and be disconnected from the server or will they automatically download the correct files from the server?
  • devicenulldevicenull Join Date: 2003-04-30 Member: 15967Members, NS2 Playtester, Squad Five Blue
    <!--quoteo(post=1981268:date=Sep 21 2012, 05:45 AM:name=Zeikko)--><div class='quotetop'>QUOTE (Zeikko @ Sep 21 2012, 05:45 AM) <a href="index.php?act=findpost&pid=1981268"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->So if a server has consistency checking enabled for all lua files and for example ns2stats mod installed. Does this mean that the clients also need to have this mod installed? If they don't have it installed will they get an error and be disconnected from the server or will they automatically download the correct files from the server?<!--QuoteEnd--></div><!--QuoteEEnd-->

    Auto downloading isn't in yet. If you're running a server side mod, you either need to disable consistency checking or make sure all the clients have it.
  • MurphyIdiotMurphyIdiot NS2 programmer Join Date: 2008-04-17 Member: 64095Members, Super Administrators, NS2 Developer, Subnautica Developer, Pistachionauts, Future Perfect Developer
    <!--quoteo(post=1981209:date=Sep 20 2012, 11:45 PM:name=Koruyo)--><div class='quotetop'>QUOTE (Koruyo @ Sep 20 2012, 11:45 PM) <a href="index.php?act=findpost&pid=1981209"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->Will there also be an option to make exceptions?<!--QuoteEnd--></div><!--QuoteEEnd-->

    Not currently. Maybe eventually.

    In the short term, you can't do consistency checks on textures or sounds as those don't exist on the server. We will figure out something for this soon.

    <!--quoteo(post=1981268:date=Sep 21 2012, 02:45 AM:name=Zeikko)--><div class='quotetop'>QUOTE (Zeikko @ Sep 21 2012, 02:45 AM) <a href="index.php?act=findpost&pid=1981268"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->So if a server has consistency checking enabled for all lua files and for example ns2stats mod installed. Does this mean that the clients also need to have this mod installed?

    If they don't have it installed will they get an error and be disconnected from the server or will they automatically download the correct files from the server?<!--QuoteEnd--></div><!--QuoteEEnd-->

    Yes, clients need to have it installed.

    We are going to fix up the Steam Workshop support for 221 this weekend so it will all be automatic (like how maps hosted on Steam Workshop work now but even better).

    So it will all be automatic from the Client's point of view.

    <!--quoteo(post=1981551:date=Sep 21 2012, 01:57 PM:name=devicenull)--><div class='quotetop'>QUOTE (devicenull @ Sep 21 2012, 01:57 PM) <a href="index.php?act=findpost&pid=1981551"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->Auto downloading isn't in yet. If you're running a server side mod, you either need to disable consistency checking or make sure all the clients have it.<!--QuoteEnd--></div><!--QuoteEEnd-->

    Yeah, another option for 221 if you don't want to setup your server to use the Steam Workshop is to simply disable consistency checking (at least for *.lua). Auto download should be ready for 221 though :)

    BRING ON THE MODS!
  • countbasiecountbasie Join Date: 2008-12-27 Member: 65884Members
    The Auto-Balance sounds very nice. It's like 'even the teams or just watch the game' instead of auto-switching. Sounds perfect. I hope that the rage quitting right before the game end will not make problems (the winning team may have to fight with 5 people instead of 9, it would take much longer to kill a stalemate).

    As always, nice to see that you are aware of the problems we players have.
  • dePARAdePARA Join Date: 2011-04-29 Member: 96321Members, Squad Five Blue
    How about server-admin mods like DAK?
    I use DAK+some stuff of Dghelneshi and customize it a bit for my needs.

    Did the clients have to download a server-admin mod?
  • peregrinusperegrinus Join Date: 2010-07-16 Member: 72445Members
    That's such a clever idea the spawning queue.
  • DeadzoneDeadzone Join Date: 2003-07-03 Member: 17911Members, Reinforced - Shadow
    Interesting spawing queue idea. I love that it helps the balance without punishing anyone. Of course only testing will tell, but it's absolutely worth trying.
Sign In or Register to comment.