Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix detection of Construct games #32

Open
AshleyScirra opened this issue Aug 9, 2021 · 5 comments
Open

Fix detection of Construct games #32

AshleyScirra opened this issue Aug 9, 2021 · 5 comments

Comments

@AshleyScirra
Copy link

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:

  • c2runtime.js anywhere in main files
  • c3runtime.js anywhere in main files
  • c2runtime.js anywhere inside a zip file named package.nw
  • c3runtime.js anywhere inside a zip file named package.nw

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
Copy link
Collaborator

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
Copy link
Collaborator

Some limitations:

  • We cannot scan file content at all
  • neither can we unpack zip files.
  • All we can detect based off of is the filenames that are immediately present.

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
Copy link
Author

AshleyScirra commented Aug 12, 2021

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
Copy link

TobiX commented Jan 8, 2023

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
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants