ReactiveDrop / reactivedrop_public_src

Alien Swarm: Reactive Drop game source code and issue tracker.
https://reactivedrop.com
119 stars 34 forks source link

Support SourceTV #167

Open mithrand0 opened 2 years ago

mithrand0 commented 2 years ago

In source engine games, it's possible to spectate using https://developer.valvesoftware.com/wiki/SourceTV.

For Reactive Drop, this functionality does not work correctly. It has two issues:

1) A bot 'SourceTv' joins the game, this bot becomes the leader of the lobby and cannot be voted out; 2) Enabling causes stutter.

Games like TF2 use it for watching competative games. Would be nice to have SourceTV working for AS:RD too

BenLubar commented 2 years ago
BenLubar commented 2 years ago

Need to test this in multiplayer

mithrand0 commented 2 years ago

Tested it, the relay won't connect.

On the game server:

srcds.exe -console -game reactivedrop +port 29001 ... +tv_enable 1 +exec serverconfig.cfg +map lobby

On the relay server:

srcds.exe -console -game reactivedrop +port 29020 +tv_relay 192.168.1.99:29001

log:

Connecting to public(192.168.1.99:29001) ...
0.563:  Sending UDP connect to public IP 192.168.1.99:29001
Server using '<none>' lobbies, requiring pw no, lobby id 0
RememberIPAddressForLobby: lobby 0 from address 192.168.1.99:29001
The server requires that you be running Steam.
mithrand0 commented 2 years ago

Tested without the relay server, the following issues are there:

  1. When joining over 'steam > game servers > spectate', the spectator becomes a player;
  2. The Source TV Bot gets the player icon when selecting a character;
  3. There is immense lag for the 'spectator' and the other players.
wawawawawawawa commented 2 years ago

srcds.exe -console -game reactivedrop +port 29001 +tv_enable 1 +map lobby +sv_allow_lobby_connect_only 0 +tv_autorecord 1

Joining works, if in beta there is no sourceTV is connecting... (forever), albeit you still get ready timer. At this step, if I start Landing Bay, I start to lag like crazy with this error

If I try to press F9, the game insta crash (I assume because sourceTV is connecting?) I'm also wondering why it says "Can't record on dedicated server." in the log.

In rd folder, there is auto-[stuff].dem, so sourceTV seems to record something. Sadly if I then try to watch the record with beta client, it says string tables differs, and if I try to watch it with non beta client, it says

ERROR: demo network protocol 7134 outdated, engine version is 7133
Failed to read demo header.

Maybe I'm doing something wrong when trying to set up the server, dunno

mithrand0 commented 2 years ago

@wawawawawawawa looks like you are not on the (latest) beta branch

BenLubar commented 2 years ago

Hmm, if server lobby interactions are affecting sourcetv that's a problem.

wawawawawawawa commented 2 years ago

How do you make srcds force going beta then? I thought I just had to be on beta with client when launching srcds, but guess not. Also, if I try to select "beta" in [Alien Swarm RD Dedicated Server] steam option thingy, it reset to None whenever I leave :/

edit : ok I tried again with this command srcds.exe -console -game reactivedrop +port 29001 +tv_enable 1 +map lobby +sv_allow_lobby_connect_only 0 +tv_autorecord 1 -beta beta (hopefully that actually puts it as beta?) Tried with steamcmd, but got lost way too much, hard to even find rd appid (not listed in valve wiki :/)

Anyway, doing it like that, now I see sourcetv as a bot, changing map works as well, no F9 insta crash. There still is mega lag issue whenever I start a map though, with some spawner being inside floors and whatnot. I tried cargo as well and same thing, albeit different spawners name.

SourceTV records something, but I get strings differs whenever I try to watch them. I guess it's probably because I didn't use steamcmd? Or somehow there's an old map in srcds, but like, both maps? dunno. In any case, the instant crash when pressing F9 is gone, and changing map works.

BenLubar commented 2 years ago

RD's appids are

563560 (main) 593000 (SDK) 582400 (dedicated server, currently broken for beta; use main appid with 1007 as a replacement)

mithrand0 commented 2 years ago

@wawawawawawawa -beta is a steamcmd.exe switch, not srcds.exe.

steamcmd.exe +force_install_dir reactivedrop +login anonymous +app_update 563560 -beta beta +app_update1007+quit"

It's important to not switch appid's of installs. If in doubt, do this in a clean folder.

After that:

srcds.exe -console -game reactivedrop +port 29001 +sv_allow_lobby_connect_only 0 +tv_enable 1 +tv_autorecord 1 +map lobby 

More information about downloading (beta) releases with steamcmd can be found here: https://developer.valvesoftware.com/wiki/SteamCMD#Downloading_an_App