hunke.ws

Home | Posts | F-Droid | GitHub | RSS

ScorchDroid

· Android, games

ScorchDroid is an Android port of Scorched3D, the 3D artillery game, based on the classic Scorched Earth.

It uses bberberov/scorched3d as an upstream source (you’ll see upstream referred to constantly) and even boasts cross-compatability with it, at least currently.

The entire game engine was ported over from Scorched3D so it plays the same as the original game. The UI has been totally redone but the graphics are mostly the same. The controls have been adapted to work on a touch screen, with sliders and touch buttons to provide the controls the keyboard used to.

Effort has been made to bring every feature from the desktop game to the mobile port, from graphics to audio to network play. Additional network options have been added, allowing you to play over Bluetooth or Ad-Hoc WIFI networks on top of regular WLAN play.

Requires Android 8.0 or higher.

Questions, bug reports, suggestions, looking for people to play with? Check out the #scorchdroid channel on my discord.

Features

Installing

The easiest way to install ScorchDroid and keep it up to date is through my F-Droid repo:

https://hunke.ws/fdroid/repo

Then search for ScorchDroid in F-Droid. When a new version comes out, F-Droid will offer it as an update.

You can also download the APK from GitHub and sideload it.

Playing in a browser

You can play it in a browser too, at hunke.ws/fdroid/play/scorchdroid. It’s the same game with the same menus. Play solo against bots, or join a server where browser players and phone players end up in the same game.

It has Scorched3D’s keyboard controls too, and so does the app if your phone has a keyboard. These are the keys it starts with, and you can change any of them in Settings, under Controls:

Key Function
Left / Right Turn
Up / Down Raise / lower barrel
+ / -, Page Up / Page Down Power
Hold Shift / Ctrl / both Aim slower / faster / much slower
Space or f Fire
Tab / Shift+Tab Next / previous weapon
u Back to your last shot’s aim
a Aim where the mouse is
d / p / b Shield / parachutes / battery
1 2 3 4 9, c Camera views, camera menu
Number pad 4 6 8 2, 9 3 Move the camera, zoom
t or Enter / y Chat / team chat
s Scores
o More actions
F1 to F4 Game speed (host only)
Esc Leave the game

A dedicated server (see below) has the game on its own web page too, at /play/, so on the same network that’s http://<server>:8080/play/. That’s the one to use for a server on your own network, since the page above is https and can only join servers that are too.

It needs a recent browser with WebGL 2 and WebAssembly GC (Chrome or Edge 119, Firefox 120, or Safari 18.2, or anything newer). The first load is about 37MB, most of it the game data, and the Apocalypse mod is another 8MB the first time you play it. Settings are kept in the browser, and so are saved games. A browser can join a game but can’t host one.

Dedicated server

If you want a game that’s always up you can run a dedicated server on a spare machine. It’s the same engine without the graphics and sound, so both ScorchDroid and desktop Scorched3D 44.3 players can connect to it. It comes with a web admin page where you can change any setting, manage players (kick, ban, mute etc.), watch the log and chat, and restart the server. Phones on the same network will find it on their own, and browsers can play on it from the same web page.

It runs as two containers and you don’t need to clone anything, the compose file builds straight from this repo:

curl -O https://raw.githubusercontent.com/roge-rm/ScorchDroid/master/dedicated-server/docker-compose.yml
echo 'ADMIN_PASSWORD=pick-something' > .env
docker compose up -d --build

Setup, config, mods and backups are covered in dedicated-server/README.md. If you’re curious how it’s built, see docs/dedicated-server.md.

Requirements

git clone --recurse-submodules https://github.com/roge-rm/ScorchDroid.git

Building & testing

./gradlew installDebug                          # build and install the debug APK
./gradlew assembleRelease                       # build the release APK
./gradlew :webApp:wasmJsBrowserDistribution     # the browser game, in web/app/build/dist/wasmJs/productionExecutable/

Upstream’s data/ folder (weapons, maps, models, language files) gets bundled from the submodule at build time and extracted to the phone’s storage on first run, since upstream reads its files with plain fopen().

Game logic is tested on the computer instead of the emulator:

cd host-tests/build && cmake .. && make && ./host_tests

That builds the same engine code natively and runs over 400 checks against it, including a full client joining a host, once over TCP and once over the same socket bridge Bluetooth uses. It only takes a few seconds.

The dedicated server can be built on its own too:

cmake -S dedicated-server -B build/server -DCMAKE_BUILD_TYPE=Release
cmake --build build/server -j
./build/server/dedicated_server --help

Or as the two containers, which is how it’s meant to be run: cp .env.example .env, set ADMIN_PASSWORD, then docker compose up --build.

Architecture

Two things worth knowing before digging into the renderer, because both have caused bugs: the engine’s fire angle goes counter-clockwise while wind and sun directions are clockwise compass angles, and engine coordinates (x, y, height) map to world (x, height, mapHeight - y).

Discussion and support

Questions, ideas, bug reports, looking for someone to play with?
Check out the #scorchdroid channel on my discord.

Attribution

License

GNU General Public License v2 (or later), same as Scorched3D. See LICENSE.

Source code: ScorchDroid-1.2.2.tar.gz
GitHub Repository

Dan