Hacker News new | past | comments | ask | show | jobs | submit login
Dagor Engine and Tools source code from Gaijin Games KFT (github.com/gaijinentertainment)
226 points by SXX 6 months ago | hide | past | favorite | 98 comments



I disagree with the title change on this post. It is much less clear what is happening here.

For those new: the engine of popular game War Thunder has been open sourced under the BSD license.


Yeah, I specifically editorialized the title because few people on HN possibly know Gajin Entertainment and no one know what "Dagor Engine" is. I pretty certain that even people who play the game have no clue how their internal tech was called.

A lot of people know War Thunder itself though.


But the title doesn't say that...

Also, posting a descriptive title isn't "editorializing." It's exactly what should be expected (if not required) of any post here.


>please use the original title, unless it is misleading or linkbait; don't editorialize.


A title which fails to lead to any understanding is almost as misleading as one which leads to the wrong understanding.

Possibly more, depending on how wrong the wrong one is.


The infantile lashing-out against informative titles here is baffling.


The "original title" is what you type in.


Keep downvoting facts.


We get to compete on editorializing it for votes here in the comments!


The daScript repo [1] in the same org is quite interesting in its own right and makes some ambitious claims to performance [2].

[1] https://github.com/GaijinEntertainment/daScript

[2] https://dascript.org/#performance


> LLVM-8.0.1

The benchmark must be 2019-2020, but thats still very interesting.


Is this an old build or the modern engine? According to steam charts they have 70.1k players in-game right now.

I'm intrigued that the 11th highest current player count on steam has native linux support and open sourced their engine?

They provide sample files too, I'm not saying they have bad motivations in any way, I'm just curious as to why they decided to do this now. Either way I applaud it!


Their possible motivation for releasing code as open source is to allow some other Russian companies like VK Group to build their IP on it without having any deals with them directly. Just now VK Group announced their in-home game engine will be based on this code.

I can guess that Gaijin Entertainment had some contracts with companies in Russia, but after moving their business out of Russia it's now easiest way to fulfill the terms of some IP licensing deal.

Yandex is doing the same thing, but other way around by releasing more and more of their code as open source. It let them to cleanly trasfer IP from Russia-poisoned company to their Israel company.


Open source as sanctions busting. Interesting.


You know, PGP is “exported” as a book to go around export regulations. So this is not new.


None of the companies are actually under any sanctions, but obviously having any licensing deals or IP transfers with companies located in Russia is legal hazard.


VK Group is definitely sanctioned in the USA & EU.



The CEO is sanctioned, which makes dealing with the company complicated.

https://sanctionssearch.ofac.treas.gov/Details.aspx?id=34596


Would be difficult to pay with SWIFT cut off?


Russia is not cut off from SWIFT. There are multiple banks that doing USD / EUR payments in and out, but with minimal amount of 20,000 EUR and some 200-500 EUR fee.

And you can also transfer bunch of other currencies much much cheaper. It's mostly question on whatever you have paperwork for bank outside of Russia to accept that payment.

PS: Only normal people are affected by those restrictions. Companies and super-rich cronies can still move their money freely and pay for whatever military components they want from EU / US:

https://theins.press/en/politics/266147


and Gaijin's motivation for having VK build their IP on it is that VK will contribute to the development of the engine? or does some Russia-only Gaijin subsidiary benefit monetarily?


I honestly have no insight in their motivation here, but I shared my guesses.

From legal standpoint 99.9% of game development companies originated from Russia never held any IP within the country legal framework to begin with. It was a rule of a thumb of doing any IT business: register everything on Cyprus or in other functioning country. Usually regional office is only received money from holding company to pay for ads, pay salaries and minimal taxes.

So unlike giants like Yandex they were never under Kremlin direct control and could withdraw out of country rapidly without any losses.


As far as I remember, formally, Yandex Russia is also a subsidiary of a company based in the Netherlands.


That's true, but majority of Yandex business was always inside Russia. Also Kremlin's Sberbank held golden share in Yandex since 2019 to veto any changes in company they dont like.

For game development companies like Gajin it was always just one of the markets even if important one.


> from Russia-poisoned company to their Israel company.

That sounds really offensive, and not to the companies.


I guess as "proud" owner of Russian passport I have all rights to say that.


As a person who can't distinguish between people and a government, you don't.


> has native linux support

It does, a game or two of Warthunder are my guilty pleasure while waiting for some CI pipelines to finish.


I would take from the commit messages that this is up to date as of Sunday.


This looks like Dagor 4 from that message whereas I think the latest version is 6?


True (at least google confirms that), but the files have headers that look like

    //
    // Dagor Engine 6.5
    // Copyright (C) 2023  Gaijin Games KFT.  All rights reserved
    // (for conditions of use see prog/license.txt)
    //
Which suggests the repo is just misnamed... which really isn't uncommon.

Also seems unlikely there would be active work if this was an old version of the engine, and a lot changed between the 2023-09-15 import and the 2023-10-22 update.


my engine branch of a 2 year old game in development is “UE4” despite the fact that we are running 5.2.

At previous companies where we developed a game engine at the same time as the game we were building it for; after releasing the 4th game on that engine it still had the binaries named the codename of the original first game.

So, renaming things can be hard or overlooked.


Russia is self-isolating right now. They are trying to standardize on one engine that does not have ties with West. E.g. they do not want to be at mercy of Unity or Epic.

This is a bid for that piece of government sponsorship.


Open-sourcing software and uploading it to a site owned by a US-based company is the opposite of self-isolation.


Isn't linux support mandatory / a given if they want to run on the Deck or is that a clever emulation layer?


Deck runs a compatibility layer called Proton [1]. A game does not need native Linux support to run on the Deck.

1. https://en.wikipedia.org/wiki/Proton_(software)


Most games supported/available on the Deck use a Windows API emulation layer.


Wine, thus Proton, is not an emulator.


I was expecting this reaction, of course, but that's why I specifically wrote "Windows API emulation layer", which it definitely is.

The recursive acronym name was chosen first and foremost because it's funny, but also to make the point that it's not emulating all of Windows, and definitely isn't something like dosbox or Dolphin in terms of implementation strategy. This is true, but we shouldn't allow it to break our language, no matter how much we love the clever meme!


At that point I would just call it a reimplementation instead of emulation.


Proton includes DXVK, and that is a high-level emulator for DirectX by most definitions. Wine isn't an emulator because it doesn't have to be.


To add to the other replies, interesting to note War Thunder itself has had native Linux support since before the Steam Deck. I think it was mostly half-assed/broken until they implemented Vulkan. Now it's flawless in my experience.


I’m curious what game developers have to lose by open sourcing their code. When I imagine a world where games all have their source available (but without textures and models so you still need to pay for it to play), I can’t see financial losses for the people selling the game. And especially for games where modding is encouraged the lack of OS releases is surprising.


A lot of black magic is done in game engines to get that level of performance with that level of quality.

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.


I've worked on games where a static reference is found in the host libraries, and that's used as an offset to stomp on the unnecessary parts of the library provided by the vendor; and therefore recover slivers of precious console memory space for the game.


IIRC, Andy Gavin said during the development of Crash Bandicoot, he stomped pages in the Sony system/OS libraries. As long as the game kept running, all good!


< distant screaming >


Still a (well-known) old favourite of mine:

    static uint8_t data[1048576]; /* IMPORTANT: ASK LEAD WHEN FAILING CERT DUE TO MEMORY */


> Also both AMD and NVIDIA drivers sometimes implement alternate paths to fix some engines’ performance and artifacts

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%.


How are those two things related?


Driver interrupts the engine instructions, applies fixes or other does other processing on the CPU, and renders the modified code. Think as a SQL query optimizer running real time.

So, you need a fast CPU to keep data flowing to the GPU at the correct rate, without much hindering.


Do they really apply these optimizations on every draw call/frame/flush without any significant caching?


I don't know about caching, but I remember in a particular instance, a game engine (CryEngine IIRC) was calling a very expensive function which should be called seldomly (or every 10 frame or something) every frame, and hurting performance of the card severely. It was very bad PR for the card company.

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.


If you’ve made your own engine or significant unique pieces of technology that’s part of your companies IP which is inherently part of the value of the company. Further to that open sourcing software takes effort and the more complex the software the more effort it takes. Game engines are very complex. Then for most companies they are trying to make and ship games which is also pretty hard. So open sourcing seems like a lot of work for little return. That’s often why engines that become open source are general at their end of life from a commercial perspective.

Games with modding in mind often do open source relevant bits to make modding easier.


Clones with more marketing budget / scummy promotion behind it. Not supplying the assets isn't a deterrent, because one they can be lifted from your game anyway, and two, there's factories producing assets production line style.

While, if you have a successful game, there will undoubtedly be clones, you don't have to make it easy for them.


One reason: third-party libraries and tools that aren't compatible with the FOSS license you want to use.

Another reason: you are now much more vulnerable to patent trolls.


The obvious problems that might occur are:

- 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


The first issue wouldn’t apply to single player games. But the second might be the big one that scares publishers/developers. I really wonder how consequential that would be.


Its an interesting question, there are many game dev that just don't even think about it and are too busy to dedicate even a minute to it,

and there there is the problem of engine using many midllewares : https://news.ycombinator.com/item?id=3186440


> Its an interesting question, there are many game dev that just don't even think about it and are too busy to dedicate even a minute to it,

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.


Well a simplistic answer would be that if you have a better codebase than your direct competition then the opportunity to crib large parts of your code might end up making their game attractive enough that some customers end up buying it instead of yours.


Not really. Barely anyone buys game for the engine. The story and game mechanics are much more important.


In the sim game genre, the two are somewhat intertwined and customers are also more aware of what the engine does. Car and flight enthusiast sim people absolutely do shop for physics, flight model, and so on to some extent.

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.


Cheap, dirty clones.

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.


> That being said, I think there's less risk once your game "takes off" like WarThunder.

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.


What's the economic benefit for the company?


It cost a metric shit ton of time and manpower to create the game engine. What benefit would they have giving it away for free?

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.


LoL! I really gotta make an update to the marching cubes example code...

https://github.com/GaijinEntertainment/DagorEngine/blob/main...

https://github.com/GaijinEntertainment/DagorEngine/blob/main...

When I said "There are many ways that this code could be made faster", I meant it :P A good start would be to use Surface Nets instead https://0fps.net/2012/07/12/smooth-voxel-terrain-part-2/


Any idea why Gaijin has developed two fully-featured scripting languages? I see Quirrel and daScript in their Github page.


They fill two different niches, daScript is statically typed, AoT compiled and attempting to outperform LuaJIT, Quirrel is dynamically typed and better for writing game logic.

Note that Quirrel is a fork of Squirrel (in early 2019), which is a language very heavily inspired by Lua (you could say Lua-done-over) with a very similar embedding API, but much more like a typical OO language rather than quirky (which makes it very similar to Javascript). Squirrel was most famous used by many Valve games like Portal 2 and L4D2, and I recommend it. Quirrel attempts to make Squirrel more Python-like, easier, add tooling like static analysis and tests, and to continue development, as Squirrel has only received the odd bugfix for years and been neglected. I've been watching Quirrel for years, and development has been picking up. They seem to have about 1.5-2 people working on it fulltime. The language is diverging more and more from Squirrel (and further towards Python) and getting bigger.


Quirrel is, as far as I've been able to tell, a fork of Squirrel. daScript is all their work though.


I would guess a combination of tech evolution, legacy code and disagreements between design departments. I once worked at a gamedev company that had an in-house scripting system and a purchased system from an engine fire-sale (not a fire-engine sale). The in-house one was better for complicated situations, but was relatively a lot of work for large volumes of simple situations.


Not wanting to sound too disrespectful (although I AM getting cranky about this issue), but I find a lot of open source projects on github that are at least moderately complex (which a game engine certainly is), are useless as-is. There is no documentation and it would likely be easier to just write your own code from scratch. I can see how if you get stuck with say quaternions then you may dive into another persons project to get some tips but even then, without documentation you're better off just learning the math from a book and rewriting from scratch.


I'd say this is far from useless. Especially when building your own engine, you can look at other implementations and reuse elements that you need. The company I work for specializes in video game ports. Getting only the source code, without documentation, or a back-channel to ask questions on a regular basis is standard for us. Still, we manage to get by just fine.

I am thankful for every piece of code that is opened up, especially when it's published under a permissive license.

The devs likely don't have any intentions to build / support a community around this release, which is perfectly fine. No one is stopping you from building your project / community around it either.

Think about it like Doom / Quake engines, they are pretty popular as well, but didn't come with a lot of documentation or support from id software.


Note this repo contains full source for numerous third-party libraries that aren't BSD-licensed.


I don't see anything in /prog/3rdPartyLibs that isn't open source of some variety though?


Not every open source license is the same. Being open source doesn't mean do whatever you want. Not all pairs of open source license are compatible with each other. BSD license is one of the least restrictive open source licenses, engine depending on libraries that have different licenses means that the developer using the engine will potentially need to comply with more complicated license requirements compared to the case where everything was BSD licensed.

There are also a couple of folders non open source software:

* ATL -> Copyright (C) Microsoft Corporation All rights reserved. Nothing said about granting permission to copy,modify or redistribute

* PIX -> Copyright (C) Microsoft Corporation. All Rights Reserved. Nothing said about granting permission to copy,modify or redistribute

* reflexStats -> Copyright (c) 2021, NVIDIA CORPORATION Any use, reproduction, disclosure or distribution without an express license agreement from NVIDIA CORPORATION is strictly prohibited.

* PoissonGenerator -> Author Sergey Kosarevsky, no license text mentioning of granting any rights to do anything with it

* A couple more folders with no license information at all.


I found a nice video that shows the progression of their games: "History of Games Gaijin Made Before Warthunder" [1].

1: https://www.youtube.com/watch?v=Ls00Dsm6Cig


"Dagor Engine and Tools source code from Gaijin Games KFT".

For anyone wondering about this word soup: KFT == kft. == "korlátolt felelősségű társaság" == Hungarian limited liability company.

"Gaijin Games" is a Hungarian kft.


Sure. Yandex is Cyprus. JetBrains is Czechia. Eastern European gamedev circles had been joking about surprising resurgence of studios in Armenia, Cyprus and others over the last year.


My question is, did they have to apply for an ITAR license?


ITAR is an American law restricting the export of military technology... this is a Hungarian, formerly Russian, company. Why in the world would they need an American export licence?


I assume it’s a tongue-in-cheek reference to how the War Thunder forums have recently been used for multiple leaks of US military classified information.


US, French, British, and Chinese so far by my count. I might have missed some of the other leaks though.


Yes, sorry, I meant to edit this in but forgot :)


Is an open source game engine likely to cause those War Thunder forum participants with military clearances to become more angry in debates (because they can now see how the inaccuracies in specifications would impact the performance in game) or less angry?

Either way, I doubt the impact is zero. So as something that has military effect, it might be covered under ITAR after all!

/s


unrelated but it would be cool if someone opensources, say, rocket flight control software and get that part of ITAR deemed unconstitutional


Psu open sourced guidance software in the mid 2000s and it found its way into other drone corebases and into a variety of missiles, including the quassam 4.

Since it was open source and developed in public ,the itar folks determined it was okay to release.


It might have been OSU , not sure, it's been a long time.


There are a lot of Kerbal Space Program mods that do this.


Oh boy another avenue for people to leak classified operational data


I'm the only one missing docs?


There do appear to be some docs embedded in the source.

https://github.com/GaijinEntertainment/DagorEngine/tree/main...

I haven't built them/don't know how complete they are. At a glance I would guess not very.


There is a bunch of *.rst files which are readable. On Ubuntu ReText opens them. Build/install probably just moves them around and/or may be converts to html . There is not much in there.


> updated from dagor4 repo on 2023/10/22, rev 0c5bf9c1d82d7491c925febbb…

old code base


That’s 4 days ago…


Literally deprecated, some might say entirely useless and that it belongs in a museum




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: