Anonymous edits have been disabled on the wiki. If you want to contribute please login or create an account.

Difference between revisions of "Half-Life 2"

From AppleGamingWiki, the wiki about gaming on M1 Apple silicon Macs
Line 54: Line 54:
 
</pre>
 
</pre>
  
4. Clone the Source Engine GitHub repository
+
4. Set pkg config path:
 +
<pre>
 +
export PKG_CONFIG_PATH="/opt/homebrew/opt/jpeg/lib/pkgconfig
 +
</pre>
 +
 
 +
5. Clone the Source Engine GitHub repository
 
<pre>
 
<pre>
 
git clone --recursive https://github.com/nillerusr/source-engine
 
git clone --recursive https://github.com/nillerusr/source-engine
Line 60: Line 65:
 
</pre>
 
</pre>
  
5. Configure game builds:
+
6. Configure game builds:
 
*'''Half-Life 2''':  
 
*'''Half-Life 2''':  
 
**<code>python3 waf configure -T release --64bits --prefix='' --build-games=hl2</code>
 
**<code>python3 waf configure -T release --64bits --prefix='' --build-games=hl2</code>
Line 70: Line 75:
 
**<code>python3 waf configure -T release --64bits --prefix='' --build-games=cstrike</code>
 
**<code>python3 waf configure -T release --64bits --prefix='' --build-games=cstrike</code>
  
6. Build the game:
+
7. Build the game:
 
<pre>
 
<pre>
 
python3 waf build
 
python3 waf build
 
</pre>
 
</pre>
  
7. Create '''Build folder''' Install build into directory, this can be located anywhere ideally append with <code>hl2</code>, <code>episodic</code>, <code>portal</code>, <code>cstrike</code> etc.
+
8. Create '''Build folder''' Install build into directory, this can be located anywhere ideally append with <code>hl2</code>, <code>episodic</code>, <code>portal</code>, <code>cstrike</code> etc.
 
<pre>
 
<pre>
 
python3 waf install --destdir='~/Documents/Build folder/hl2'
 
python3 waf install --destdir='~/Documents/Build folder/hl2'
 
</pre>
 
</pre>
  
8. Open '''Build folder''' in new Finder window.
+
9. Open '''Build folder''' in new Finder window.
  
9. Open Mac version of Steam and install games e.g Half-Life 2, Episode 1, Episode 2, Portal, Counter-Strike: Source etc. these game files I will refer to as the '''Steam folder'''.
+
10. Open Mac version of Steam and install games e.g Half-Life 2, Episode 1, Episode 2, Portal, Counter-Strike: Source etc. these game files I will refer to as the '''Steam folder'''.
  
10. Open '''Steam folder''' in Finder: right-click on game in Steam library, go to Manage and Browse local files. Alternatively navigate to <code>~/Library/Application Support/Steam/steamapps/common/</code>
+
11. Open '''Steam folder''' in Finder: right-click on game in Steam library, go to Manage and Browse local files. Alternatively navigate to <code>~/Library/Application Support/Steam/steamapps/common/</code>
 
 
11. In the '''Steam folder''':
 
  
 +
12. In the '''Steam folder''':
 
*Delete <code>Steam folder/bin/</code> folder.
 
*Delete <code>Steam folder/bin/</code> folder.
 
*Copy/move <code>Build folder/bin/</code> folder into <code>Steam folder/</code> replacing the previous <code>Steam folder/bin/</code> folder.
 
*Copy/move <code>Build folder/bin/</code> folder into <code>Steam folder/</code> replacing the previous <code>Steam folder/bin/</code> folder.
  
12. In the '''Steam folder''':  
+
13. In the '''Steam folder''':  
 
*Delete <code>hl2_osx</code>
 
*Delete <code>hl2_osx</code>
 
*Copy/move from '''Build folder''' <code>Build folder/hl2_launcher</code>
 
*Copy/move from '''Build folder''' <code>Build folder/hl2_launcher</code>
 
*Rename the <code>hl2_launcher</code> into <code>hl2_osx</code>
 
*Rename the <code>hl2_launcher</code> into <code>hl2_osx</code>
  
13. In the '''Steam folder''':
+
14. In the '''Steam folder''':
 
 
 
*Navigate inside 'game' folder (e.g. <code>/hl2/</code> or <code>/episodic/</code> or <code>/portal/</code> or <code>/cstrike/</code>)
 
*Navigate inside 'game' folder (e.g. <code>/hl2/</code> or <code>/episodic/</code> or <code>/portal/</code> or <code>/cstrike/</code>)
 
*Delete the bin subfolder (e.g. <code>Steam folder/hl2/bin/</code>)
 
*Delete the bin subfolder (e.g. <code>Steam folder/hl2/bin/</code>)
 
*From the '''Build folder''' go to game folder (e.g. <code>Build folder/hl2/</code>) and move/copy from the '''Build folder''' to the '''Steam folder''' into the game (e.g. <code>Steam folder/hl2/</code>)
 
*From the '''Build folder''' go to game folder (e.g. <code>Build folder/hl2/</code>) and move/copy from the '''Build folder''' to the '''Steam folder''' into the game (e.g. <code>Steam folder/hl2/</code>)
  
13. Now the respective game can be launched from within Steam.
+
15. Now the respective game can be launched from within Steam.
  
14. Other parameters:
+
16. Other parameters:
 
*cstrike (Counter-Strike: Source) - in addition tot he above instructions, also copy the <code>Steam folder/hl2/</code> and put it in the root of the <code>Steam folder</code> so that the game will launch.
 
*cstrike (Counter-Strike: Source) - in addition tot he above instructions, also copy the <code>Steam folder/hl2/</code> and put it in the root of the <code>Steam folder</code> so that the game will launch.
 
*tf (Team Fortress Classic)
 
*tf (Team Fortress Classic)

Revision as of 19:52, 23 May 2023

macOS Compatibility

Method Rating Notes
Native Perfect Compiled the Source Engine Leak. https://jameshug.notion.site/Guide-to-Installing-Portal-Using-Source-Engine-on-macOS-660803f9ced149cfa1647d38fd5a7092[1]
Rosetta 2 Unknown
Compatibility layer
CrossOver Runs Installed via Steam on CrossOver 21, extreme fps drops during shootouts and explosions.
Wine Unknown
Virtualization
Parallels Perfect Playable.[2]

Native ARM build from leaked source

These instructions are heavily based on guides written by James Hughes. This method can ne used to build native ARM macOS ports of Half-Life, Half-Life 2, Half-Life 2: Episode 1 & 2, Portal, Counter-Strike: Source etc. as long as the necessary game files from Steam have been copied into the correct folder.

Enter these commands into a Terminal window:

1. Install Homebrew

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Remember to set the path - modify with your username:

(echo; echo 'eval "$(/opt/homebrew/bin/brew shellenv)"') >> /Users/yourusername/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"

2. If Xcode Command Line Tools does not install, then install it manually:

xcode-select --install

3. Install required packages from Homebrew (added the jpeg-turbo dependency from instructions)

brew doctor
brew cleanup
brew install sdl2 freetype2 fontconfig pkg-config opus libpng libedit python3 jpeg-turbo

4. Set pkg config path:

export PKG_CONFIG_PATH="/opt/homebrew/opt/jpeg/lib/pkgconfig

5. Clone the Source Engine GitHub repository

git clone --recursive https://github.com/nillerusr/source-engine
cd source-engine

6. Configure game builds:

  • Half-Life 2:
    • python3 waf configure -T release --64bits --prefix= --build-games=hl2
  • Half-Life 2 Episodes:
    • python3 waf configure -T release --64bits --prefix= --build-games=episodic
  • Portal:
    • python3 waf configure -T release --64bits --prefix= --build-games=portal
  • Counter-Strike: Source:
    • python3 waf configure -T release --64bits --prefix= --build-games=cstrike

7. Build the game:

python3 waf build

8. Create Build folder Install build into directory, this can be located anywhere ideally append with hl2, episodic, portal, cstrike etc.

python3 waf install --destdir='~/Documents/Build folder/hl2'

9. Open Build folder in new Finder window.

10. Open Mac version of Steam and install games e.g Half-Life 2, Episode 1, Episode 2, Portal, Counter-Strike: Source etc. these game files I will refer to as the Steam folder.

11. Open Steam folder in Finder: right-click on game in Steam library, go to Manage and Browse local files. Alternatively navigate to ~/Library/Application Support/Steam/steamapps/common/

12. In the Steam folder:

  • Delete Steam folder/bin/ folder.
  • Copy/move Build folder/bin/ folder into Steam folder/ replacing the previous Steam folder/bin/ folder.

13. In the Steam folder:

  • Delete hl2_osx
  • Copy/move from Build folder Build folder/hl2_launcher
  • Rename the hl2_launcher into hl2_osx

14. In the Steam folder:

  • Navigate inside 'game' folder (e.g. /hl2/ or /episodic/ or /portal/ or /cstrike/)
  • Delete the bin subfolder (e.g. Steam folder/hl2/bin/)
  • From the Build folder go to game folder (e.g. Build folder/hl2/) and move/copy from the Build folder to the Steam folder into the game (e.g. Steam folder/hl2/)

15. Now the respective game can be launched from within Steam.

16. Other parameters:

  • cstrike (Counter-Strike: Source) - in addition tot he above instructions, also copy the Steam folder/hl2/ and put it in the root of the Steam folder so that the game will launch.
  • tf (Team Fortress Classic)
  • dod (Day of Defeat)
  • hl2mp (Half-Life 2: Deathmatch)

References

  1. Verified by User:PBeGood4 on 29 April 2023
    Device: M1 MacBook Pro
    Method: Compiled Source Engine Leak
    Resolution: 1920x1080
    Settings: high
    Framerate: 120+ FPS
  2. Verified by User:gp on 7 Sep 2021
    Device: Mac M1 16 GB RAM
    OS: Windows 11 (latest Insider ISO)
    Method: Parallels 17
    Resolution: 1080p
    Settings: Medium
    Framerate: 50~60 FPS