SteamDatabase / FileDetectionRuleSets

🔎 Rules to detect game engines and other technologies based on Steam depot file lists
https://steamdb.info/tech/
MIT License
182 stars 74 forks source link

Fix detection of Construct games #32

Open AshleyScirra opened 3 years ago

AshleyScirra commented 3 years ago

SteamDB link to the game

n/a

What is it being detected as and what should it be detected as? Any other information?

Thanks for your work reviewing engines used on Steam!

Construct comes up as the 5th most popular engine on the engines list, but it looks like the detection merely comes down to this code:

        //If I have a package.nw file and it matches nodeJS, it's probably Construct
        if( $has( 'Evidence.PACKAGE_NW' ) && $has( 'SDK.NodeJS' ) )
        {
            return 'Engine.Construct';
        }

This won't be accurate: it will produce both false negatives and false positives. In particular not all Construct games even have a file named package.nw - this is optional in Construct.

An accurate way to detect Construct games is to look for a file named either c2runtime.js or c3runtime.js, in the main files (including searching in subfolders) OR inside package.nw (as Construct supports exporting with either packaged or unpackaged assets). The package.nw file is just a zip file, so it can be searched or extracted like any old zip file in order to look for the tell-tale files c2runtime.js/c3runtime.js (which again should include searching in subfolders).

So to be clear there are four cases that indicate a Construct game:

You can ignore any other signals, this alone should be reliable enough to identify Construct games. I think implementing this will produce a significantly different number for Construct... but I'm not sure whether it will be higher or lower! It would be interesting to see.

larsiusprime commented 3 years ago

We did this and the matches for Construct decreased significantly, though we believe the count is accurate now at least in terms of not having false positives.

Do you have any other things that giveaway construct games?

larsiusprime commented 3 years ago

Some limitations:

Based on this it looks like many construct games will not be detected as they cannot be distinguished from a vanilla node.js game. We can however detect Node.JS, so this is better than nothing. This is similar to the situation with HaxeFlixel -- it gives off no signature of its own, but every HaxeFlixel game is also necessarily a Lime/OpenFL game, so you can at least have an idea of where they might be based on that detection.

AshleyScirra commented 3 years ago

The default export settings in Construct will bundle everything in to package.nw, so presumably the majority of Construct games do that. Unless you look in there, it is probably indistinguishable from anything else using NW.js. So unfortunately I think if you are not going to look in a zip file, you won't be able to calculate a meaningful number for games made with Construct.

It should be possible to open a zip and identify the contained filenames without having to extract anything, though. A standard zip parsing library ought to be able to open and list files without doing any serious heavy lifting.

TobiX commented 1 year ago

https://steamdb.info/app/827670/ is still detected as "Construct", even if it has a Сredits RPG Maker MW.html file in its main depot (https://steamdb.info/depot/827671/).

MichaelHinrichs commented 11 months ago

https://steamdb.info/app/827670/ is still detected as "Construct", even if it has a Сredits RPG Maker MW.html file in its main depot (https://steamdb.info/depot/827671/).

That's because https://steamdb.info/depot/827672/ has c2runtime.js. Also this issue should be closed, now that it's resolved. I've never seen a package.nw that didn't contain a c2runtime.js or c3runtime.js, but the system now works as suggested.