Thyme icon indicating copy to clipboard operation
Thyme copied to clipboard

Working with CNC-Online

Open Invictaz opened this issue 6 years ago • 20 comments

Is Thyme working with CNC-online and it's launcher?

They have (for Generals 1.8, Zero Hour untested) also a tool called Gentool which enables 1080 resolution. Since Thyme is also trying to rescale to bigger resolutions would their tool be compatible with Thyme or is either one best?

Invictaz avatar Nov 12 '17 23:11 Invictaz

Currently, no, Thyme needs to reimplement the part of the code where the server string is stored before it can be told to connect to the cnc-online server.

Gentool works similarly to Thyme by injecting code into the original binary and replacing parts of it, as such they are incompatible with each other as they may try to patch the same code.

For people just wanting to play the game, at the time of writing Gentool is the best thing to use as its dedicated to allowing connections to cnc-online and fixing a few of the most annoying bugs as well as trying to prevent common cheats. Thyme will hopefully replace the need for Gentool and eventually even the original binary as it progresses, but that is a way off for the moment.

Thyme is currently of interest for people who want to poke around the inner workings of the original game engine, who want to help reimplement functions for Thyme or for people who want to test Thyme and report bugs that it introduces or that it doesn't yet fix.

OmniBlade avatar Nov 13 '17 12:11 OmniBlade

Well thanks for the answer. I wait for Thyme to implement the online server code. From what I have read it was just a hosts file reroute, but it is in fact more than that?

Genteel does not allow the connection to cmc-online, its the launcher (with / without hook) that does that? I went online without Gentool at first.

From what I have seen I would like the cross compatibility first. So a proper OSX and Linux implementation without any Wine tricks.

Is this SAGE engine further open sourced or reverse engineered? I saw in one of your repo's that you are contributing to it but unsure how it relates.

For now I'm just searching for higher quality graphics for Generals 1 (not Zero Hour). The Zero Hour HD graphics mod seems to be incompatible online as I have read. And setting the resolution with GenTool does not upscale the internal resolution. This might need higher quality textures. Do you happen to know if these exist?

Invictaz avatar Nov 14 '17 00:11 Invictaz

Gentool has largely replaced the cnc-online launcher and as far as I know doesn't use the host file, it patches ZH in memory to replace the server address like Thyme will do.

The other Open Sage projects are doing things differently. This one is bottom up, replacing the original code a function at a time. They are top down, looking at how the game behaves and then trying to write code that imitates that behaviour. I contribute information to them as I discover it myself from work on Thyme.

OmniBlade avatar Nov 14 '17 08:11 OmniBlade

Ah so you are reverse engineering the SAGE engine.

So I can uninstall the launcher? It might have some compatibility issues with the Origin version of the game. I might switch over to that kind since I then have an online backup of the game. I can't find if Gentool has the same issues.

Gentool is very picky though which .exe is booted. I had the Generals 1.8 patch but it only worked when I replaced the exe for another one. A separate kind of .dll file would be best. Like in OpenRCT so you can keep the client as vanilla as possible.

And registering a nickname on the Revora forums is missing from within the game. For the rest it is a great reverse engineering effort!

Invictaz avatar Nov 20 '17 08:11 Invictaz

For tech support regarding using cnc-online you should really go to their forums as I don't really have any affiliation with them. My understanding is that Gentool expects you to have Bibbers fixed launchers which replace the Origin game.dat with one from one of the CD releases I believe.

I'm not sure if registering on Revora entirely witin the game should be possible but its something I will look into when the time comes.

OmniBlade avatar Nov 20 '17 08:11 OmniBlade

Much appreciated.

Invictaz avatar Nov 24 '17 16:11 Invictaz

I've added a hack that allows Thyme to connect to cnc-online now, it should work the same as gentool, you just load the game and login, no need for the cnc-online launcher. However it appears there are currently bugs in the Thyme code that cause desyncs pretty much instantly, so until we find and fix those online still doesn't work just yet.

OmniBlade avatar Jan 24 '18 08:01 OmniBlade

@OmniBlade Thanks for this. I have to mention that GenTool is the only option to have 1080 resolution. So I hope Thyme has that also (in the future)

Invictaz avatar Jan 28 '18 23:01 Invictaz

It doesn't yet provide a gui option for it, but all versions of ZH support higher resolutions by editing options.ini in the configuration folder the game creates under your Documents folder. Does Gentool fix the issue of the view being zoomed in too much on wide screen resolutions when you do this?

OmniBlade avatar Jan 29 '18 11:01 OmniBlade

@OmniBlade There is no zoom unfortunately. I don't understand what you mean with "zoomed in too much".

Invictaz avatar Jan 29 '18 12:01 Invictaz

The issue is that on widescreen resolutions, the view appears to be too zoomed in because the camera is set up for a 4:3 aspect ratio. A work around is to alter the max camera higher in GameData.ini, but that prevents online play. Once the code that controls it is reimplemented in Thyme this will be fixable, but its possible GenTool already has a hack to fix it.

OmniBlade avatar Jan 29 '18 13:01 OmniBlade

Gentool works with all original executable versions from all final patches (1.8 & 1.4) and a few cracks. It does connect to cnc online. The fov is dynamically adjusted with the wide screen resolution.

xezon avatar Aug 21 '18 08:08 xezon

Which function does Gentool modify or what data structure does it manipulate to adjust the fov in the ZH 1.4 english binary?It will potentially make it easier to implement in Thyme if I know where GenTool does it.

OmniBlade avatar Aug 21 '18 09:08 OmniBlade

work around is to alter the max camera higher in GameData.ini, but that prevents online play.

Setting MaxCameraHeight in GameData.ini does work for multiplayer actually, as long as you don't use gentool which hardcodes it in memory.

The mismatches will happen if the user uses a GameData.ini that does not match the base game used to play with other players. (so taken from the internet rather than say... extracting it from a mod/zh .big) or if other options than MaxCameraHeight itself are altered, like the camera angle and so on.

all versions of ZH support higher resolutions by editing options.ini in the configuration folder the game creates under your Documents folder.

Worth adding gentool also fixes the custom resolution not being reset if you change anything in the in-game Options menu, since there isn't a way to set a custom resolution in the drop-down selector natively.

@Invictaz C&C Online Launchers can be set to use hooking "tricks" via registry to bind their launcher to the game executable. For ZH in particular this breaks Mod Launchers and probably origin installs.

Unhooking the launcher is poorly documented, but explained here. Gentool largely replaced C&C online launchers indeed, so I'd recommend that instead.

Gentool is very picky though which .exe is booted.

Gentool works with all original executable versions from all final patches (1.8 & 1.4) and a few cracks.

With the amount of "repacks" and no-cd fixes floating around, getting a working executable for gentool that does not cause modified version message when joining a lobby is a challenge and makes arranging games with strangers difficult.

As far as I know Generals Online does not do any NAT traversal/punching either so we ended up falling back to a VPN solution leveraging the Network Lobby for our community.

Teteros avatar Aug 21 '18 11:08 Teteros

I should note that as of commit c1c159aa Thyme itself is already pointed at the CNC Online servers for internet multi-player but I'm not at all sure it is stable for multiplayer as of yet so I haven't closed this as technically fixed without being able to test further. Network games without any modication seem fairly unstable on my testing systems such that I can't even get 2 vanilla instances of Zero Hour to connect over LAN which is a real issue.

OmniBlade avatar Aug 21 '18 12:08 OmniBlade

Which function does Gentool modify or what data structure does it manipulate to adjust the fov in the ZH 1.4 english binary?It will potentially make it easier to implement in Thyme if I know where GenTool does it.

GenTool sets these statics 0x95D9A8 -> 1.78f 0x95D9AC -> 1.24f

Edit: I misread the question. Above addresses are for unlocking more resolutions in the options menu.

xezon avatar Nov 01 '18 12:11 xezon

FOV must by dynamically scaled with resolution.

See

  • xezon/GeneralsGamePatch#492

xezon avatar Nov 01 '18 12:11 xezon

@xezon We might split this up in a seperate issue as there are two:

-Connecting to the Revora network aka CnC-online what seems to be fixed in commit c1c159a -Setting the bigger resolution that GenTool does hardcoded in memory (what you refer to)

Invictaz avatar Nov 01 '18 19:11 Invictaz

Is it planned to implement code to have a dedicated server? (no P2p)

ElTioRata avatar Mar 31 '24 01:03 ElTioRata

Is it planned to implement code to have a dedicated server? (no P2p)

User EEE also inquired about that on Discord. My reply was

xezon — 19/09/2023 14:21 My expectation is that Dedicated Server for Zero Hour will never happen. It will be huge overhaul of game logic. And there is no guarantee that it will provide tangible benefit for this game.

xezon avatar Mar 31 '24 08:03 xezon