FunkyFr3sh / cnc-ddraw

GDI, OpenGL and Direct3D 9 re-implementation of the DirectDraw API for classic 2D games for better compatibility with Windows 2000, XP, Vista, 7, 8, 10, 11, Wine (Linux/macOS/Android) and Virtual Machines
https://discord.gg/afWXJNDDF5
MIT License
2.13k stars 143 forks source link

Scroll speed and camera smooth move #250

Closed Mitradis closed 9 months ago

Mitradis commented 9 months ago

This is not issue. This common question about influence game scroll speed setting on how camera move smooth. Some games like AOE2\Tzar depend from scroll speed setting. For example AOE2 have "zero" setting, for 60hz, for smooth camera move is 22 in "Scroll Speed" (HKEY_CURRENT_USER\SOFTWARE\Microsoft\Microsoft Games\Age of Empires II: The Conquerors Expansion\1.0 and saving .nfx\z files). If we set <18 or 24> we can see twitching(stuttering). For 75hz need other value. I try capture video, from Tzar, from screen (in OBS) to see how game output frames. And discovered what frames output through one (2 same frames and only next different). Same issue have AOE2 if set <18 or 24> setting scroll speed. BUT this issue not have Tiberian Sun and some other games, where smoothing camera move not depend from scroll speed settings - we get always smooth camera move. And after this i have question: possible set frame creation and output independently from game scroll setting? Or something for smoothing as in TS.

Funky-Fr3sh commented 9 months ago

Yeah, a lot of games have that issue. But there is nothing I can do from within cnc-ddraw, this will need a game patch.

I also had to make such a patch recently for Warcraft II: https://github.com/FunkyFr3sh/Warcraft-II-Plugins/tree/main/SmoothScroll

C&C games work differently, they don't have that problem. But funny thing is, they do have another problem instead (Scroll speed too fast if the CPU is too good).

BTW. posting from my alt-account currently cause i need to setup 2FA on main account, github doesn't let me log in atm.

Mitradis commented 9 months ago

I understand, I guessed that the problem lay in the game engine. Ty for answer.

Mitradis commented 9 months ago

hm i found what Tzar GOG version is broken. Original game with same wrapper settings runs more smoother (no frames twitching) than GOG version and original game have "Use DirectDraw" option (GOG no have). GOG broken this game. Original game can be found here https://www.old-games.ru/game/download/1630.html (english version exist)

Funky-Fr3sh commented 9 months ago

Maybe they just don't want to use DirectDraw and "optimized" it for the other renderer (Direct3D?), could be that they broke the game when doing that yeah.

I remember it had the DIRECTXDEVICE=0 setting to enable DirectDraw, not sure if there is any advantage when you disable DirectDraw though

Mitradis commented 9 months ago

in gog version by default DIRECTXDEVICE=-1 (disable) and this setting can be changed only by manual ini edit. They completely broken DirectDraw mode and disable it. But in original game this mode with wrapper work perfect!