Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Launch HTML5 game through command-line?

A topic by NatSpectrum created May 17, 2023 Views: 1,121 Replies: 8
Viewing posts 1 to 3
(+2)

Is it possible to launch a game through the Itch app via a command-line argument?

First of all, I am aware that a topic with this question already exists, but it is at least one year old and as such I didn't wish to necrobump it.

Also, while the response to the older thread was that there was no need to use command-line arguments to launch games, as you could just directly load the game's executable outside of the itch app, I have discovered a use-case where a command-line argument would be necessary; HTML5 games.

When downloading a HTML5 game through the itch app, there is no executable file, only a html file. Loading the html file directly will load it in whatever web browser is your default; this works for some HTML5 games, but others will completely break and be non-functional...it seems to depend on how the game was made and with what engine.

However, loading said game through the itch app instead loads it in some sort of special HTML5 launcher that's built into the itch app, one that appears to be compatible with all HTML5 games.

As such, a command-line argument to launch specific games through the itch app is absolutely necessary if the games in question are HTML5 games, as trying to load the file directly without the itch app can be problematic. And as for why you'd want to launch a specific game through the itch app automatically, this would be helpful for Steam Deck users as well as those who use alternative launchers (like Playnite or Launchbox) to organise their games.

Admin

We don’t provide anything to do this. You need some kind of browser runtime to launch those games. We don’t create stand-alone executables for HTML games, but run them directly inside of the itch.io’s app own browser runtime.

So to clarify, there is no way to tell the itch app to load a specific game through a command-line argument? Is that something that could be considered later down the line?

Admin (4 edits)

No public API but you can explore what butlerd supports here:

Note that this is an internal API. Although we likely aren’t changing it in the near future, we reserve the right to make changes without notice.

(1 edit) (+1)

Is there no way to directly launch games within the itch.io app's browser runtime? I'd simply like to launch an HTML5 game through a separate launcher. If not, is there at least a way to have the itch.io app launch and then start the game automatically?

(1 edit)

Running automatically that desktop issue.

If butler daemon and communication with it is required for launching games, that should do some itch application(or maybe even itch if that does not complicate so much and maybe patches are welcome) and try not have another user launcher with their own program communicating with butler(in docs there is saying only on windows?) and trying to guess where data are located and maybe be blocked by some itch development issue or progress or even operating system policy.

And butler also requires some info about launching with previous info get from it to post info how to launch it, so some desktop shortcuts seems cumbersome as program in the middle to have launcher for itch so bye bye common sense present in operating system... But if itch decide how to have this functionality then may be more desktop experience be in and also itch application have be the only point of itch development and user in.

wait, what? I understand the want for arguments to be passed to the game if you use a launcher. steam has this and I think i even used it once or twice, but can't remember why. Just saves you hte hassle of creating a custom link to the app  with the options. Games should not need this by design. Though it might be needed for some troubleshooting  options.

But html games?  a  command line option?

I think what you really want is this:

an option to launch web games from the app with external browser, instead of the built in browser. 

you would not have access to the save game that was made in the built in browser  or want  features of your regular  browser.

(1 edit)

No, that's not what I want.

You know how you can run a game through Steam without using the interface with steam://rungameid/######?

I want that for the itch app.

(+3)

Ahhh. That is what is written in the desktop shortcut, if you let steam create one.

The itch app on windows launches with

 
  itch-setup.exe --prefer-launch --appname itch

So yeah, I would assume you might be able to supply an appname different than itch. I could not do it while testing for a minute. So maybe not. It tries to run name-setup, if write name instead of itch.    But it sure looks, like it should be possible.

So what we want is a way to launch games without opening the itch app interface.