Adding CnCNet support #338
mvdhout1992
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I suggest adding CnCNet support. Both the server and client (written in C#) are open-source and make use of a modified IRC protocol. The client and server has been used by 10 000s of people (see cncnet.org). There are a lot of devs working on cncnet and the client is also used by popular ra2/ts mods. The client can be customized through INI control files, barely anything needs to be changed in code (probably just map previews).
The client is also cross-platform with Linux and OS X support and it uses .net 8.0.
https://github.com/orgs/CnCNet/repositories
Thyme developers like Omniblade and tomsons26 have experience working on patching older C&C games to support CnCNet. For supporting Zero Hour the following things are needed:
-Spawner support: This is adding a new -SPAWN cmd line arg which loads the EXE direclty into a match, using a spawn.ini control file with the match settings.
-Tunneling support: This is a small amount of code that has already been written. It involves creating a proxy for recv/send() WinSock funcs to add optional tunneling support. it's barely any work.
CnCNet itself supports the following:
-Auto-updating, including custom content like maps and mods, models, textures, games mods
-Transferring maps and minimods when hosting games through the client (instead of the slow and buggy ingame ZH code)
-Ladder (I think using ELO?)
-QM
-External C# client (so dont need to be ingame to host a match, player can do things while chatting in the main lobby or hosting a game)
-Anticheat can be supplied via auto-updater, plus additional anti-cheat can be added via client like checking memory integrity
-Single player support (including custom missions)
-LAN mode support (don't need to connect to CnCNet server)
-Skirmish mode
-Savegames support
-Tunneling support so no fucking around with NAT (the tunnel server can detect whether p2p is possible and tell the player)
-Emergency save feature can be added like in Tiberian Sun, when the game mismatches a multiplayer savegame is created and the host can re-host the game using this emergency save and the match will load into the moment of mismatch. This requires adding support to Zero Hour too.
-Replay support
-Built-in game and cncnet config tool.
What I also suggest doing is not bothering with 1.04 compat. It takes too much time and I had a lot of issues with keeping compat with the last official patch when working on Red Alert 1 via ASM patching, and that's a much simpler game.
I also suggest making the community balance patch a match option in the game lobby (e.g. like Starting Spot/Credits/teams). This is also done by the RA2 community with cncnet client. The benefit is that you don't have separate vanilla ZH and community balance patch game lobbies when trying to join a game in the main lobby, but instead you join the game lobby and then you decide whether the community balance patch is turned on or off.
And my last suggestion is creating a Generals mod for Zero Hour so only need to update the Zero Hour codebase and not also the Generals codebase. If needed the missing logic can be added to Zero Hour. This is also done with ra2/yr on CnCnet where the ra2 support is just a mod for the Yuri's Revenge EXE to prevent us from maintaining two different EXE patches (because ra2 and yr are two different EXEs). Instead of actually using the ra2 EXE we just made a mod for YR.
See my proposal here; #339
Now one thing I need to emphasize is that it doesn't take that much work to add CnCNet support and most of it is non-code related so non-devs can help.
here's the code for the tunneling needed by cncnet: https://github.com/CnCNet/ts-patches/blob/master/src/spawner/nethack.c
and heres all the code that is needed for spawner (which uses -SPAWN command line arg to load EXE direclty into a match using spawn.ini control file for match settings):
https://github.com/CnCNet/yr-patches/blob/main/src/spawner/load_spawn.c
the code looks dirty because this is ASM patching the Yuri's revenge exe. of course doing it via CPP in the codebase itself is clean
Here are some screenshots for the RA2 version of the client, its all the same client code, just cutomized thru INI config.
Beta Was this translation helpful? Give feedback.
All reactions