Giter Club home page Giter Club logo

spring-launcher's Introduction

spring-launcher

Launcher for SpringRTS games

Build Status

What's this for?

spring-launcher provides a simple yet powerful distribution system for games and tools built with the SpringRTS engine. Developers can specify download and launch configurations, and the system will create executable builds. These executables are generated automatically and updates are then be propagated to users.

The following download resources are supported: maps, games, engines and custom HTTP links. For maps, games and engines pr-downloader is used, while custom resources are downloaded from a specified HTTP link and optionally extracted to a directory.

There is cross-platform support with Linux and Windows builds available. Windows additionally contains a portable build which requires no install but also doesn't support auto-updating.

A common usecase is to use spring-launcher to distribute games that use the Chobby lobby, but it's also possible to use spring-launcher without a lobby (see https://github.com/Spring-SpringBoard/SpringBoard-Core/).

How can I setup spring-launcher for my game?

  1. (Optional) As a first step you may want to ensure your game is available on Rapid (not necessary if you intend to provide your game via a custom HTTP link). Rapid is a system which automatically generates games files in an auto-downloadable format any time a new version of your game is ready and distributes (small) delta updates to users. A new test version will be generated any time you make a commit, while a stable version will be created when your commit contains a predefined commit message in the format VERSION{x.xx} - eg. VERSION{1.02}. Check https://springrts.com/wiki/Rapid for details.
  2. Install the spring-launcher GitHub App in a GitHub repository where you want to manage your game updates. This can be done in your game repository, but it can also be created separately. This template https://github.com/Spring-Chobby/DistCfg/ may be helpful to start.
  3. Make sure the registered directory has the dist_cfg/config.json file, and create it if it doesn't. (see https://github.com/Spring-Chobby/DistCfg/blob/master/dist_cfg/config.json for example)
  4. If you have registered your game on rapid, then add the appropriate rapid tags in dist_cfg\config.json.
  5. Once you've modified dist_cfg\config.json, create a commit and push, and this will trigger the automatic generation of installers of your game. Download links and build status can be viewed here: https://spring-launcher.firebaseapp.com/repo, which will be in the https://spring-launcher.firebaseapp.com/repo/$USER/$REPO format for your game (e.g. https://github.com/Spring-Chobby/DistCfg/ -> https://spring-launcher.firebaseapp.com/repo/Spring-Chobby/DistCfg)

How do I generate a new installer?

The process is automatic. Simply make a commit in your repository that modifies something in the dist_cfg folder (even changing a single character in the config.json file will do) and push it. After a few minutes, new releases for Windows and Linux will be ready on the https://spring-launcher.firebaseapp.com/repo site (always the same URL for your game), and updates will be automatically sent to users.

Help and Questions

Please join the spring-launcher Discord channel (on the SpringRTS server - https://discord.gg/ZcBJ2c7) for direct access to the developer (@gajop) and other SpringRTS game developers who might be able to assist you with any issues or questions you might have.

Development Setup

  1. Download this repository
  2. Install npm if you haven't
  3. Create a config.json file in the src directory. See config.json example: https://github.com/Spring-Chobby/DistCfg/blob/master/dist_cfg/config.json
  4. Install dependencies with npm install
  5. Start the program with npm start

spring-launcher's People

Contributors

antlerforce avatar beherith avatar born2crawl avatar darkeyedragon avatar dependabot[bot] avatar fir3bal avatar gajop avatar jazcash avatar l-e-x-o-n avatar lhog avatar maddoxbr avatar p2004a avatar raph-amiard avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

spring-launcher's Issues

resource-download: finished: return name

  1. Please return the name of the resource-download on DownloadFinished
  2. Stop sending endless DownloadFinished commands with name="Skipping..." (see. beneath)

After starting a resource-download with arguments:

  1. launcher returns DownloadFinished without an identifying parameter once
  • isSuccess = true
  • isAborted = false
  1. then sends endless returns of DownloadFinished with
  • isSuccess = true
  • isAborted = false
  • name = Skipping C:\Beyond-All-Reason\data\engine\105.1.1-1354-g72b2d55 bar: already exists.

Add integrated Feral Interactive GameMode

Feature request for integrated Gamemode support on linux flatpak. Currently, the only way to have gamemode running is by executing the appimage with gamemoderun. Having an option or toggle in the application would be nice to have and may allow some additional performance improvements on the linux flatpak.

Failed to open link to discord

From one of users logs after error:

[2024-02-18 10:21:40.275] [error] Prevented navigation to: https://discord.gg/beyond-all-reason

Better scripts for patching and building release

We now have patching instructions in https://github.com/beyond-all-reason/BYAR-Chobby/blob/master/.github/workflows/launcher.yml#L45-L62 and in https://github.com/flathub/info.beyondallreason.bar/blob/master/info.beyondallreason.bar.yml#L34-L49 which is the supported method after the original one https://github.com/gajop/spring-launcher#how-do-i-generate-a-new-installer was turned down.

We should refactor is into something more reusable so we don't do copy pasting.

Select target directory for game files on first run

AppImage installs, updates and downloads studd to user's "Documents" directory.
Sometimes user has another disk volume with appropiate space, or even faster for games.
And sometimes "Documents" directory is a network drive, inconvenient for software or rapid i/o.

AppImage should ask where to install files on first run.

Better handle spawn failures

From user log:

[2024-02-18 10:17:47.744] [error] Unexpected error occurred.
[2024-02-18 10:17:47.745] [error] {
  createIssue: '[function] function () { [native code] }',
  error: 'Error: spawn UNKNOWN\n' +
    '    at ChildProcess.spawn (node:internal/child_process:414:11)\n' +
    '    at spawn (node:child_process:784:9)\n' +
    '    at Launcher.launchSpring (C:\\Users\\user\\AppData\\Local\\Programs\\Beyond-All-Reason\\resources\\app.asar\\src\\engine_launcher.js:170:18)\n' +
    '    at Launcher.launch (C:\\Users\\user\\AppData\\Local\\Programs\\Beyond-All-Reason\\resources\\app.asar\\src\\engine_launcher.js:137:9)\n' +

Linux autoinstaller

Hey,

I got bored and created a basic bash script to autoinstall this depending on their linux distro, is this something you worth having?

Loader gets stuck if the game is started without internet connection

When the game is loaded various artifacts are downloaded from online resources, e.g updates.
In case there is no active internet connection when the game is started the loader seems to get stuck.

IMHO this should be addressed by either checking the internet connection of the machine or by adding a "reconnect" button that the user can use when the internet is active again.

Allow savegames to be started with old engines

Due to us lingering very long on one engine, with a large player influx since then, it might be wise to implement the loadsavegame wrapper function to run for alternate engines.
Here are some notes regarding this:

Each save game has an associated lua file with metadata, which contains the engine version used :

return {
	description = "20220907_102607",
	engineVersion = "105.1.1-1158-g27934d7 BAR105",
	gameName = "Beyond All Reason",
	gameVersion = "test-20718-cbf3397",
	gameframe = 31594,
	map = "Comet Catcher Remake 1.8",
	playerName = "[teh]Beherith",
	totalGameframe = 31594,
	date = {
		day = 7,
		hour = 10,
		isdst = true,
		min = 26,
		month = 9,
		sec = 7,
		wday = 4,
		yday = 250,
		year = 2022,
	},
}

However, the way save games are loaded, they can only load on the most recent engine, due to being loaded via:
WG.Chobby.localLobby:StartGameFromString(script)

Replays on the other hand, support being launched from older engines, as they are launched via the wrapper:
https://github.com/beyond-all-reason/spring-launcher/blob/master/src/exts/start_new_spring_handler.js

local engine = string.gsub(string.gsub(startEngineVersion, " maintenance", ""), " develop", "")
local engine = string.gsub(startEngineVersion, "BAR105", "bar") -- because this is the path we use
local params = {
	StartDemoName = string.sub(startReplayFile, 7), -- TRUNCATE 'DEMOS/' FROM THE PATH!
	Engine = engine,
	SpringSettings = WG.SettingsWindow.GetSettingsString(),
}
WG.WrapperLoopback.StartNewSpring(params)

This wrapper is implemented by the launcher, and works fine usually, except it does not work for savegames, as the launcher hard codes the demos/ folder.

https://github.com/beyond-all-reason/spring-launcher/blob/master/src/exts/start_new_spring_handler.js

Proposed solution:
I'm going to remove the hard-coded 'demos' from this, to allow loading of save games on old engines too.

Last component of installation path set to Beyond-All-Reason on reinstall/update.

When users selects during installation custom directory that doesn't exist e.g. C:\BAR, it is allowed, and the game is installed directly there. Unfortunately on update/reinstall installer correctly detects the install path but appends Beyond-All-Reason into the path, and users ends up with 2 installations, old one in C:\BAR and a new one inside that in C:\BAR\Beyond-All-Reason.

Steps to reproduce:

  1. Download old launcher
  2. Install in custom location, doesn't matter if user or machine e.g. C:\BAR that doesn't exist
  3. It puts files in C:\BAR without a subdirectory
  4. Download newer launcher
  5. It picks up C:\BAR
  6. It actually installs in C:\BAR\Beyond-All-Reason

This is a bug in upstream electron-updater used to create installer: electron-userland/electron-builder#6885. No known workarounds at this time.

resource-download: progress: return name

Please return name of resource-download on DownloadProgress instead of destination

after starting a resource-download with arguments:

launcher returns DownloadProgress with name = destination

  • progress = 0.2568467
  • total = 16441672
  • name = engine//105.1.1-1354-g72b2d55 bar

Add workaround for Windows Antivirus

Players on Windows have sometimes failing rename due to "operation not permited". It's fault of not great antivirus implementation and disabling antivirus helps.

I don't have clean setup where we can reproduce this, but it's possible that cause is the same as in: rust-lang/rustup#1870 antivirus is scanning files after closure which on windows blocks moves.

Idea here is to try to workaround it by retrying all renames with backoff until some deadline and see if it mitigates the issue...

Incorrect window dimenions under native Wayland

When running the application under wayland (--enable-features=WaylandWindowDecorations --ozone-platform-hint=auto), the window dimensions are off and bottom of the application is cut off: image

Fails to Download Game on ARM64

When trying to download the game on Ubuntu 23.04 ARM (within a VM on a mac, if its important) using the flatpak launcher, I get the following error:

[warn] /app/main/bin/pr-downloader: /app/main/bin/pr-downloader: cannot execute binary file
[error] byar:test: Download failed: byar:test: 126

Flathub lists compatibiilty with aarch64, but is that just for the launcher?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.