AMS2 Dedicated Server Tool / SteamCMD Support

Discussion in 'Automobilista 2 - General Discussion' started by Dave Stephenson, May 29, 2020.

  1. Dave Stephenson

    Dave Stephenson Administrator Staff Member AMS2 Club Member

    Joined:
    Feb 13, 2016
    Messages:
    873
    Likes Received:
    1,124
    NOTE: Both variants of the dedicated server are considered beta software at this time. The information here and in the user guide along with the features and operation of the server app/addons is subject to change. Only a Windows version is currently available.

    Automobilista 2 has an accompanying dedicated server distribution which can be installed without the need for the machine running the server to have an account with a license for the full game. The app is lightweight and allows setting up events and track rotations etc which can be enforce on the server as well as being able to server as a rebroadcaster to reduce the bandwidth requirements of game client controlled sessions.

    There is no benefit to running the dedicated server on the same machine as the game client if you will be present at the event's start.

    A full user guide is included in the installation as well as attached to this post.

    Install via Steam client

    To install via the standard Steam desktop client find the entry in the tools section of the library if using an account which owns AMS2/AMS2Beta or open the link below on the machine you wish to install on in your browser or 'Start > Run'

    steam://install/1338040 (release)
    or
    steam://install/1338240 (beta)
    The tool will be listed in the library if the tools filter is enabled

    Install via SteamCMD

    Valve provides the SteamCMD tool to users as a means to perform the installation, update, and validation, of games from the command line without the need for the standard Steam desktop client, making it ideal for use in server installations. It has many benefits including being scriptable, allowing automation of the process, and not being limited to a single installation of each appid as the main desktop client is.

    SteamCMD direct download: https://steamcdn-a.akamaihd.net/client/installer/steamcmd.zip

    The complete documentation for SteamCMD is location on Valve's wiki: SteamCMD - Valve Developer Community

    The dedicated server can be installed using anonymous login.

    SteamCMD Quickstart

    Attached to this post is a quick start zip file which contains the steamcmd binary and update scripts for a single installation of each of the beta and release variants of the dedicated server. Simply unzip the files where you wish to install the dedicated server and run the batch file for the variant you wish to install. The dedicated server app will be installed into 'ams2_release_dedicated' or 'ams2_beta_dedicated' as appropriate.

    At any time run the script again to update to the latest version.

    NOTE 1: When first running the script SteamCMD will be updated and download any files it requires from steam before installation of the app.

    NOTE 2: Any default file may be overwritten during an update, please make copies of example configs etc before editing if you wish them to persist between updates.


    upload_2020-5-29_14-1-35.png

    Running the Server

    First of all create a config and name it server.cfg. Place it next to DedicatedServerCmd.exe and run the exe. Full documentation of the configuration file is detailed in UserGuide.pdf and some example configs are available in the installation directory under 'config_sample'
     

    Attached Files:

    • Like Like x 5
  2. Wolfgang Herold

    Wolfgang Herold I Like Liveries :) AMS2 Club Member

    Joined:
    Apr 3, 2016
    Messages:
    2,417
    Likes Received:
    1,445
    is or will there be the "-selectds" option for dedicated servers.
    With this PC2 option you could create a hostsession and after clicking start there appeared a list of dedicated servers to be selected to host this session.
     
  3. Balrog

    Balrog Active Member AMS2 Club Member

    Joined:
    Aug 25, 2016
    Messages:
    220
    Likes Received:
    56
    I still don't see the dedi tool in my library and
    steam://install/447760
    installs the AMS1 dedi tool.:oops:
     
  4. kagurazakayukari

    kagurazakayukari Member

    Joined:
    Dec 1, 2019
    Messages:
    43
    Likes Received:
    16
    It should be 1338040
     
  5. Balrog

    Balrog Active Member AMS2 Club Member

    Joined:
    Aug 25, 2016
    Messages:
    220
    Likes Received:
    56
    Yeah, now it appeared in my library as well, it wasn't there early in the morning yet.
     
  6. viper4r

    viper4r Active Member AMS2 Club Member

    Joined:
    Mar 5, 2020
    Messages:
    148
    Likes Received:
    55
    Deleted
     
    Last edited: May 30, 2020
  7. Dave Stephenson

    Dave Stephenson Administrator Staff Member AMS2 Club Member

    Joined:
    Feb 13, 2016
    Messages:
    873
    Likes Received:
    1,124
    @viper4r yes it will be coming. I intended to cover that in the first pos. Thanks for the heads up.
     
    • Like Like x 1
  8. Kevin Cox

    Kevin Cox Active Member AMS2 Club Member

    Joined:
    Mar 11, 2016
    Messages:
    473
    Likes Received:
    99
    Is there any GUI for setting up the dedi instead of having to edit config files?
     
  9. Shadak

    Shadak Active Member

    Joined:
    May 2, 2020
    Messages:
    405
    Likes Received:
    196
    you can edit next sessions and some things via IP and port that you have set which shows a nice web UI. But the initial stuff has to be in the cfg I believe.
     
  10. kagurazakayukari

    kagurazakayukari Member

    Joined:
    Dec 1, 2019
    Messages:
    43
    Likes Received:
    16
    The web UI is nice, but might have loopholes, so local access might be the answer. But, if you want to hosting a race, it is not good to connecting remote server, then opening a server, then opening a browser, then change settings.
     
  11. Shadak

    Shadak Active Member

    Joined:
    May 2, 2020
    Messages:
    405
    Likes Received:
    196
    Im just happy we have something for now, its clear there will be more work done on this.
     
    • Agree Agree x 1
  12. Eduardo Beninca

    Eduardo Beninca New Member

    Joined:
    Nov 26, 2017
    Messages:
    22
    Likes Received:
    3
    @Dave Stephenson

    I was trying to start a server on Microsoft Azure, just copied the file server_game_controlled.cfg to the root folder and renamed to server.cfg.

    Edited the variable "name" to "AMS2 Dedi ClassicB" and started, unfortunately it's not showing on server list.

    I opened all ports to see if there's some ocult port that i need to open beyond 8766, 27015 and 27016. No good.

    Windows Firewall:

    [​IMG]

    Azure security rules:

    [​IMG]

    Server web console: (JOINABLE = FALSE ???)

    upload_2020-5-30_16-13-53.png

    upload_2020-5-30_16-14-31.png

    I'm running a rFactor2 server in the same machine now, and it's working fine. Can you help?
     
    Last edited: May 30, 2020
  13. Dave Stephenson

    Dave Stephenson Administrator Staff Member AMS2 Club Member

    Joined:
    Feb 13, 2016
    Messages:
    873
    Likes Received:
    1,124
    @Eduardo Beninca

    With that config the server is just a rebroadcaster for the game client and the server needs to be setup from there. There is an intermittent issue atm that I'm still tracking down on the client-side so if you want to use it in that config you will need to create the first session via the web interface.

    Set some event properties and save them on the 'Next Session' tab and you should find that it will appear in the server browser in game. From there the host will be able to have control of the car/track from in game.
     
  14. Eduardo Beninca

    Eduardo Beninca New Member

    Joined:
    Nov 26, 2017
    Messages:
    22
    Likes Received:
    3
    I changed the vehicle, saved, and received the message on the right corner...

    upload_2020-5-30_17-58-34.png

    But, when i go back to "Current Session screen", nothing changes.

    "Current state of the server does not allow editing attributes"

    I left this screen for 10 minutes, refreshed, same thing.

    upload_2020-5-30_18-0-16.png

    I tried with other cfgs, same result.
     
  15. Shadak

    Shadak Active Member

    Joined:
    May 2, 2020
    Messages:
    405
    Likes Received:
    196
    you would have to setup cfg to force servee to be admin to see current config when 0 playets joined. Try switching LUA to false, at the end of config setup your session, then join in browser and web should display session details, when there is 0 players, you can switch stuff in the next session tab and it will always be current. As soon as people join, you need an empty lobby for it to work.

    if you force server to be admin, you can change current stuff when people are in lobby i think but then no one in the lobby will be allowed to ( even if you tick the allow switch it doesnt seem to let anyone do it )
     
  16. Martin Edmunds

    Martin Edmunds New Member AMS2 Club Member

    Joined:
    Aug 5, 2019
    Messages:
    11
    Likes Received:
    1
    i cannot sign in.
    upload_2020-5-31_0-14-11.png

    I tried to set the user name and password in the server.cfg file but no luck.
    Can anyone point me out to where i can change that properly ?
     
  17. Wolfgang Herold

    Wolfgang Herold I Like Liveries :) AMS2 Club Member

    Joined:
    Apr 3, 2016
    Messages:
    2,417
    Likes Received:
    1,445
    remove "//" before name and pw in server.cfg
     
  18. Dave Stephenson

    Dave Stephenson Administrator Staff Member AMS2 Club Member

    Joined:
    Feb 13, 2016
    Messages:
    873
    Likes Received:
    1,124
    There is no current session until someone joins the server.
     
  19. Asturbo

    Asturbo Member AMS2 Club Member

    Joined:
    Apr 8, 2017
    Messages:
    40
    Likes Received:
    47
    I’ve been testing the DS that is basically the same as PCARS2. If someone is interested, you can use the spreadsheet I made for PC2 to calc the flags value for the SERVER.CFG file: Link

    But I hope it could be improved by adding some options as:

    - Send commands from the text chat for i.e. advance session or kick players by the host.
    - Invite friends from DS's sessions
    - Use web interface to blacklist rammers
    - Option to save the server's setup from the web interface.
    - Option to save the server player's status for if is needed to restart.
    - Option to sort grids or set penalties from web Interface
    - User friendly live status to follow the race standing, times, maps… (from browser)

    But there is another option that would be very useful for communities and I think it's no very complex:

    Random Pattern in LUA rotations

    As we know, if we program a rotation in the sms_rotate_config.json file, we have two options in the parameter “persist_index”. If “true” the rotation continues from the last combo used in the lobby from those defined in the file. If is set to false, it starts ever from the first combo of the list when someone joins. The problem is that you know ever what combo will be the next after a few interactions.

    I propose a third option for this parameter:

    Index: Persistent (same as true, sequential order from last one used)
    Index: Restart (same as false, sequential order from first)
    Index: Random (pick a combo of the list randomly)

    That makes that we can make a huge list of combos and we don’t know what we will get, because it doesn’t follow a sequential order.

    But the most important target for the proposed option, would be to manage the weather conditions for community events. I’ll try to explain with my poor enligsh:

    I.E., the next race of a community will be in Interlagos and they want to have a 10% options of light rain, and a 10% of rain. They can make a list of 10 identical combos changing only the weather option making one of them with light rain, and another with rain. If the index is random, the DS will pick one of the 10 possible scenarios in the rotate file. So we will get 80% of dry races and 20% of wet races randomly (10% light rain). We could control the probability of rain adding or removing combos from the list of the rotations. We can also exclude from the rotation weird weather scenarios, that we could get using in-game random weather.

    Another option would be generace only 3 rotation (with the different weather options) and assign different weights (80/10/10), but probably that would be more complex to code.
     
    Last edited: Jun 2, 2020
    • Like Like x 12
  20. Mikk Schleifer

    Mikk Schleifer Active Member AMS2 Club Member

    Joined:
    Nov 30, 2019
    Messages:
    187
    Likes Received:
    176
    Can you show that exactly in server. cfg, didnt get it, thx man
     

Share This Page