Skip to content

ByteOverlord/Watch_Quake2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Logo 03.09.2023

Watch_Quake2 is a Quake 2 port specifically designed for Apple Watch, incorporating software rendering and working video and audio playback capabilities.

Contents

About
Changes by ByteOverlord
Features
Changelog
Game Size
Battery Usage
Benchmark
Known Issues
Building Requirements
Building the Watch_Quake2
Adding music to Watch_Quake2 (Optional)
Credits
License

About

Following the successful release of the Quake 1 port for Apple Watch, our team set an ambitious objective: to bring Quake 2 to this portable device. However, porting the 1997 release of Quake posed significant challenges. We encountered initial setbacks that considerably delayed the release schedule for several months. ByteOverlord made commendable progress early in the porting process, but crashing issues persisted. After a brief hiatus, we resumed our efforts and focused on improving the stability of the game port, ultimately achieving a more reliable and robust build.

The primary objective of this project was to demonstrate the remarkable capabilities of the Apple Watch, even when operating in software rendering mode. This project serves as a glimpse into the untapped potential that could be unlocked if we were granted access to the device's GPU. Just envision the possibilities that could be achieved with such resources at our disposal.

Previous port:
Quake 1 for Apple Watch https://github.com/ByteOverlord/Watch_Quake 18.11.2022

Photo

Changes by ByteOverlord

  • Swift for UI drawing, audio callback and input processing
  • Music playback support added. Audio file format “Mono, 22050 Hz, WAV, IMA ADPCM” preferred for lower processing and minimal space required
  • Cheats an maps menus added. Custom graphics for these menus included with pak3.pak
  • Resolution setting is automatic with hud, menu and console notification placements affected by resolution
  • Transparent surface drawing fixed for 64bit
  • Game pausing through Swift UI when application enters background state and saves settings. Mutes audio when inactive state
  • Saving and loading rewritten for 64bit (referenced Yamagi Quake 2). Might still have some bugs
  • Video playback’s audio sample rate changed to match Apple Watch’s sample rate
  • Video cinematic’s audio volume control added to options
  • Initial game loading fixed so that game and audio loops start after the Swift UI tells the app is active (≥ WatchOS 9.2). When content view updates the game starts (< WatchOS 9.2)
  • Touch input handling through Swift UI. Customized touch control layout for movement, camera, interaction and menu controls
  • Touch and crown inputs can be handled at the same time. Workaround uses separate views for touch and crown inputs to enable them to register at the same time (works with watchOS 9 and 10)
  • Benchmark mode that logs average, low and high frame times. Uses the Quake’s DEMO1 and DEMO2 playbacks

Photo

Features

  • pak0, pak1 and pak2 loading
  • Menu screen
  • Save and load game
  • Autosaving of options
  • Map quick select screen
  • Cheat activation screen
  • Tweaked controls for watch interface
  • Video and Music playback
  • Benchmark mode
  • Automatic native resolution (Series 4 40mm -> Ultra2)

Controls

Controls

Changelog

10.10.2023

  • Touch and crown inputs now enabled at the same time (workaround found that works with watchOS 9 and 10)
  • Framework files removed from the project (remnants from WatchKit)
  • Maps screen updated with preview images
  • Cheats screen updated with visible toggles

08.10.2023

  • Game view position fixed for watchOS 10

06.09.2023

  • Cheats added to the menu (noclip and notarget)
  • Menu graphics updated (pak3.pak)

Game size

Complete game with optional video and music takes ~ 403,4 MB on the watch.

pak0.pak is 184 MB
pak1.pak is 13 MB
pak2.pak is 45 KB
Video Files 163,7 MB
Music Tracks are 38,7 MB (converted with Audacity (Mono, 22050 Hz, WAV, IMA ADPCM))

Battery Usage

Usage listed as % the charge dropped during the test.

Model Battery Health 30 min 60 min
S4 40mm - - -
S4 44mm - - -
S5 40mm - - -
S5 44mm 95% 17% 33%
SE (1st Gen) 40mm - - -
SE (1st Gen) 44mm - - -
S6 40mm - - -
S6 44mm - - -
S7 41mm - - -
S7 45mm - - -
SE (2nd Gen) 40mm - - -
SE (2nd Gen) 44mm - - -
S8 41mm - - -
S8 45mm - - -
Ultra - - -
S9 41mm - - -
S9 45mm - - -
Ultra 2 - - -

Results are only indicative.

Benchmark

Reference table:

Good Moderate Bad
≤ 5 ms 6-12 ms > 16 ms

Results:

DEMO1 Avg Low High
S4 40mm 6.80 2.85 12.96
S4 44mm 7.12 2.90 14.08
S5 40mm 6.95 2.55 16.72
S5 44mm 7.28 3.19 14.89
SE (1st Gen) 40mm - - -
SE (1st Gen) 44mm - - -
S6 40mm - - -
S6 44mm - - -
S7 41mm - - -
S7 45mm - - -
SE (2nd Gen) 40mm - - -
SE (2nd Gen) 44mm 7.71 2.57 14.29
S8 41mm - - -
S8 45mm - - -
Ultra - - -
S9 41mm - - -
S9 45mm - - -
Ultra 2 - - -
DEMO2 Avg Low High
S4 40mm 7.10 2.93 15.36
S4 44mm 7.58 4.31 16.79
S5 40mm 7.23 3.35 14.50
S5 44mm 7.20 4.17 14.43
SE (1st Gen) 40mm - - -
SE (1st Gen) 44mm - - -
S6 40mm - - -
S6 44mm - - -
S7 41mm - - -
S7 45mm - - -
SE (2nd Gen) 40mm - - -
SE (2nd Gen) 44mm 7.96 3.45 18.13
S8 41mm - - -
S8 45mm - - -
Ultra - - -
S9 41mm - - -
S9 45mm - - -
Ultra 2 - - -

Benchmarks are only indicative.

Known Issues

  • Player camera jumps after saving or loading a game
  • Mods are not supported
  • Multiplayer is not supported
  • Audio will not transmit through Bluetooth
  • Sound does not playback on app start (Put the game to the dock and open it from there again.)
  • App does not start anymore (Build the app to the watch from Xcode). There is a 7 day testing period on a 'Free Provisioning' profile.

Building Requirements

  • Apple Watch Series 4 or later with watchOS 9.1 or later
  • iPhone 8 or later with iOS 16 or later
  • Mac with macOS 12.5 or later
  • Xcode 14.1 or later with command-line tools
  • Homebrew
  • Innoextract
  • bchunk (only for music)
  • Audacity (only for music)

Building the Watch_Quake2

  1. Install Xcode through Apple AppStore and install command-line tools when Xcode asks for it.

Screenshot

  1. Download the Watch_Quake2 from GitHub. (https://github.com/ByteOverlord/Watch_Quake2)

Screenshot

  1. Get Quake II (Original) through gog.com

  2. Download the Quake II (Original) installer from your gog.com profile:
    "gog.com Profile" -> Games -> Quake II (Original) -> View Downloads -> Download Offline Backup Game Installers -> Quake II (Original)

Screenshot

Screenshot

Screenshot

  1. Install Homebrew from terminal:
    ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/homebrew/go/install)"

  2. Install innoextract from Homebrew:

brew update
brew install innoextract
  1. In terminal extract the Quake 2 game files with innoextract:
    innoextract “downloaded setup_quake2_quad_damage_2.0.0.3.exe file location”

(innoextract will extract an “app” and "tmp" folders in current working directory.) "app" folder has the needed PAK files (app/baseq2/), optional video (app/baseq2/video/) and optional audio (app/music/).

  1. Copy pak0.pak, pak1.pak and pak2.pak to WatchQuake2 project (pak names have to be lowercase (case sensitive))

/WatchQuake2 Watch App/Resources/baseq2/

Optional video files can be placed in: /WatchQuake2 Watch App/Resources/baseq2/video/

  1. Open the GitHub WatchQuake Xcode project.

  2. In WatchQuake2 project file go to:
    WatchQuake2 -> Targets -> WatchQuake2 -> Signing & Capabilities

  3. Select your "Team" and write a unique “Bundle Identifier”.

Screenshot

  1. Then in WatchQuake2 project file go to:
    WatchQuake2 -> Targets -> WatchQuake2 Watch App -> Signing & Capabilities

  2. Select your "Team" and use the same “Bundle Identifier” as previously but with “.watchkitapp” added at the end.

Screenshot

  1. Check that the project is on release setting.

Screenshot

  1. Test the build first with a simulator (Series 4 Simulator or newer (watchOS Simulator))

Screenshot

After building, the game will start and playback demo1.

Simulator

Click the game view to go to main menu.

Simulator

  1. After testing connect iPhone to the Mac with a cable and make sure Apple Watch has a connection to iPhone.

  2. Set the iPhone and Apple Watch in to "Developer" mode.

On iPhone:
Settings -> Privacy & Security -> Developer Mode (SECURITY) -> Developer Mode

Screenshot

Screenshot

Screenshot

On Apple Watch:
Settings -> Privacy & Security -> Developer Mode (SECURITY) -> Developer Mode

Screenshot

Screenshot

Screenshot

After the devices have restarted.

  1. Select the Apple Watch as target.

Screenshot

  1. From Xcode build the Watch_Quake2 to the watch.

Screenshot

Transfer times:
2 min (iPhone X & S4 40mm)
2 min (iPhone X & S4 44mm)
7 min (game, music), 10 min (game, videos, music), (iPhone X & S5 44mm))
15 min (iPhone 12 mini & S5 40mm)

Watch

Adding music to Watch_Quake2 (Optional)

  1. Locate the music tracks (track02 - track21.ogg) that where extracted from the Quake 2 installer (app/music/).

  2. Open Audacity and drag the tracks to it. Edit the tracks to Mono.
    Select -> All
    Tracks -> Mix -> Mix Stereo Down to Mono

Screenshot

Screenshot

  1. Set the “Project Rate (Hz)” to 22050.

Screenshot

  1. Export tracks with “Export Multiple” in “WAV” format with “IMA ADPCM” encoding.

Screenshot

Screenshot

  1. Place the exported audio files (track02 - track21.wav) inside the WatchQuake2 project:
    “WatchQuake2 Watch App/Resources/baseq2/music/”

  2. From Xcode build the Watch_Quake2 to the watch.

Screenshot

Transfer times:
2 min (iPhone X & S4 40mm)
2 min (iPhone X & S4 44mm)
7 min (game, music), 10 min (game, videos, music), (iPhone X & S5 44mm))
15 min (iPhone 12 mini & S5 40mm)

Photo

Credits

quake_watch https://github.com/MyOwnClone/quake_watch
Quake 2 source code by Id Software. https://github.com/id-Software/Quake-2
Yamagi Quake II (game saving) https://github.com/yquake2/yquake2
App icon, images and documentation by IdeaVoid

License

This software is released under the terms of the GNU General Public License v2.