Carmack always (ab)used the hardware to the highest level in its code to get that performance/quality ratio and this is why he always kept the latest engine closed.
Unreal engine also had tricks up on its sleeve since Unreal Tournament days, however I don’t know the exact details. IIRC, it was about lighting and shadows mostly.
I had two friends who wrote their own engines. One built a company around that. Other one did visual simulations. Former one told me about the war stories which he battled against NVIDIA drivers, how driver behave the way it wanted, and how he had to abuse it to get the performance it wants. Also both AMD and NVIDIA drivers sometimes implement alternate paths to fix some engines’ performance and artifacts.
He also told how some big studios’ developers abused the driver in a way which can be only defined as “hacking”. I don’t remember the details, but they modified some data in place to bypass the graphics APIs to gain performance. Of course that is pretty brittle.
Latter friend told me how he had to optimize calculations, do great yet cheap approximations and abuse the strong parts of a GPU to get the performance he wanted.
So, a lot. All of these are considered black art and trade secret. Crytek should have some patents about some of the rendering methods they have developed even. They stopped sharing tech demos to prevent being copied, too.
static uint8_t data[1048576]; /* IMPORTANT: ASK LEAD WHEN FAILING CERT DUE TO MEMORY */Nvidia moreso than AMD. An interesting artefact of this (or maybe the specific tricks that Nvidia chooses) is that Nvidia's cards need to be paired with a strong CPU, or you can suffer a performance penalty of up to 25%.
So, you need a fast CPU to keep data flowing to the GPU at the correct rate, without much hindering.
The driver detected the game (possibly via checksum of the executable), and ignored that function call (while returning success to the game engine), and only executed the function in full, if there's a necessity to do so.
Back in the day, ATI's drivers used shading and texturing optimizations in Need for Speed series to reduce the load on the card for faster frame rates for very minor visual changes.
Do these kinds of optimizations for tens of games, and things get complicated. I remember these optimizations are done for Need for Speed III, Quake 3, Far Cry series, GTA3 (nVidia's budget cards ran the game better than ATI's faster cards at that time), etc.
Since these drivers bent a lot of corners for specific games and made things very complicated, an embedded platform provider decided to re-fork AMD's Open Linux drivers to Windows (IIRC) since they were vanilla, honest to spec drivers with no convoluted pipelines.
A cutting edge graphics card driver is possibly one of the most complex software in today's software ecosystem, IMHO.
Games with modding in mind often do open source relevant bits to make modding easier.
While, if you have a successful game, there will undoubtedly be clones, you don't have to make it easy for them.
Another reason: you are now much more vulnerable to patent trolls.
- Hackers finding exploits easier when they have the source and can run a debugger on real variable names - Companies from countries with less respect of copyright can create clones of your game and might outearn you
As a developer I'm welcoming this move though
and there there is the problem of engine using many midllewares : https://news.ycombinator.com/item?id=3186440
This has also been my experience.
Similarly, even most popular game mod projects don't release source code, even though they are volunteer/community efforts who you would think would act like a FOSS project.
But I find that a lot of the people who work on games have more of that artist mindset where they feel a type of ownership over the creation that to them is at odds with just giving it away "for free". This branch of SW just hasn't been socialized the same way.
I don't know where on the spectrum from casual to enthusiast sim War Thunder is. I looked at YouTube and the game looks graphically primitive, so the engine would have to do something else that's impressive.
You can't even necessarily fight it legally if the clone is "distinct."
That being said, I think there's less risk once your game "takes off" like WarThunder. Barotrauma is another good example where a clone is unlikely now.
I remember a game called Armored Warfare, that was like a mashup of World of Tanks and War Thunder, with modern vehicles, upgrades, multiple factions, more PvE focus and actual story missions (with sci-fi elements and cheesy voice acting).
It played well and looked nicely, too, though for whatever reason it never took off. If a game that well put together didn't attract a notable following, I doubt any others will either.
Game engine creator studios, like unity or unreal, have vastly different objectives than a game company. Releasing and being required to maintain a public game engine costs resources. Where game devs are always crunching.
Even then, look at the state of Unity, hardly profitable. Unreal was cruising on Fortnite cash so they don't care too much. More interested in setting themselves up to be the top dog first. This isn't exactly a money making situation.