Mac

From PZwiki
Revision as of 21:23, 23 April 2012 by Pianoman (talk | contribs)

Project Zomboid works great on a Mac, but only when not running in a browser.

Playing without browsers version 0.1.5d - The Launcher

  1. Download the launcher here
  2. Unzip it
  3. Double-click it!

The launcher will only give you an option to play offline if you have it cached locally, so you must start it at least once in the browser first.

Playing without browsers version 0.1.5d - The involved way

First, make sure you have logged in at least once with your account details using Safari, so that you have downloaded the client.

Next, open TextEdit (In /Applicatons) and create a new file with the following text:

#!/bin/bash
DATA=$HOME/Library/Caches/Java/cache/lwjglcache/cloud.projectzomboid.com/ProjectZomboid;
java -Xmx1024m -Djava.library.path=$DATA/natives -cp $DATA/zombie.jar:$DATA/lwjgl.jar:$DATA/lwjgl_util.jar zombie.GameWindow

After you paste in the text, click on Format in the menu bar and click Make Plain Text (unless the file is already in plain text). Then save the file as ProjectZomboid.command in the location of your choice. Next open Terminal.app (In /Applications/Utilities). Type in the following text and make sure you leave a space at the end:

chmod u+x

Then drag the ProjectZomboid.command file from the Finder in the Terminal window, which will paste the path to it, then press enter.

Please remember that when you use this method your version of Project Zomboid will NOT auto-update, and you will have to login again using Safari to update your client.

Now ProjectZomboid.command can be started by double-clicking on it in the Finder.

This has been verified to work in this environment:

zombiepie$ /usr/bin/sw_vers
ProductName:    Mac OS X
ProductVersion: 10.6.7
BuildVersion:   10J869

zombiepie$ java -version
java version "1.6.0_24"
Java(TM) SE Runtime Environment (build 1.6.0_24-b07-334-10M3326)
Java HotSpot(TM) 64-Bit Server VM (build 19.1-b02-334, mixed mode)

Running Test Release 0.2.0 on Your Mac

This has been tested with 0.2.0q. See the Indie Stone forum topic here.

Method 1

Clark W. Griswold wrote:

version 0.1.5d is totally different. It works fine with no workarounds, but 0.2.0x needs more work.

Download the standalone version of the game (don't bother with the launcher, it won't work).

Download the lwjgl binaries from http://lwjgl.org/download.php

Copy the files from lwjgl-2.8.3/jar to your PZ directory.

Copy the files from lwjgl-2.8.3/native/macosx to your PZ directory.

Make a script file called "runzomboid.sh" or something similar and edit it to contain the following:

#!/bin/bash
PWD=`dirname "${0}"`
java -Dsun.java2d.noddraw=true -Dsun.awt.noerasebackground=true -Dsun.java2d.d3d=false -Xms1024m -Xmx1024m -Dsun.java2d.opengl=false -
Dsun.java2d.pmoffscreen=false -Djava.net.preferIPv4Stack=true -Djava.security.policy=applet.policy -XX:+AggressiveOpts -
XX:+ScavengeBeforeFullGC -XX:+TieredCompilation -XX:Tier2CompileThreshold=30000 -XX:CompileThreshold=1500 -XX:+UnlockExperimentalVMOptions -
XX:+UseG1GC -XX:MaxGCPauseMillis=3 -XX:+UseAdaptiveSizePolicy -Dorg.lwjgl.util.NoChecks=true -Djava.library.path="${PWD}" -cp 
"lwjgl.jar:lwjgl_util.jar:minlog-1.2.jar:reflectasm-1.01.jar:asm-3.3.1.jar:./" zombie.FrameLoader

Open Terminal, navigate to your PZ directory, and run "sh runzomboid.sh", if you did it right and are very lucky, everything will work.


Method 2

Kawo wrote:

Hi there,

I have managed to run PZ 0.2.x on my mac, here are the steps:

1. Download latest PZ pre-version (http://theindiestone.com/community/viewforum.php?f=21), unrar wherever you want.

2. Download lwjgl library (http://sourceforge.net/projects/java-game-lib/files/Official%20Releases/LWJGL%202.8.3/) and unzip it.

3. In lwjgl-xxx/jar, copy "lwjgl.jar" and "lwjgl_util.jar" and paste them in PZ directory (eg. zomboid020 folder).

4. In lwjgl-xxx/native/macosx, copy all 3 files and paste them in PZ directory again

5. Open your favorite text editor (TextEdit will be fine) and copy/paste ONE of the following code:

For High preset:

#!/bin/bash
PWD=`dirname "${0}"`
java -Dsun.java2d.noddraw=true -Dsun.awt.noerasebackground=true -Dsun.java2d.d3d=false -Xms1024m -Xmx1024m -Dsun.java2d.opengl=false -
Dsun.java2d.pmoffscreen=false -Djava.net.preferIPv4Stack=true -Djava.security.policy=applet.policy -XX:+AggressiveOpts -
XX:+ScavengeBeforeFullGC -XX:+TieredCompilation -XX:Tier2CompileThreshold=30000 -XX:CompileThreshold=1500 -XX:+UnlockExperimentalVMOptions -
XX:+UseG1GC -XX:MaxGCPauseMillis=3 -XX:+UseAdaptiveSizePolicy -Dorg.lwjgl.util.NoChecks=true -Djava.library.path="${PWD}" -cp 
"lwjgl.jar:lwjgl_util.jar:minlog-1.2.jar:reflectasm-1.01.jar:asm-3.3.1.jar:./" zombie.FrameLoader


For Medium preset:

#!/bin/bash
PWD=`dirname "${0}"`
java -Dsun.java2d.noddraw=true -Dsun.awt.noerasebackground=true -Dsun.java2d.d3d=false -Xms1024m -Xmx1024m -Dsun.java2d.opengl=false -
Dsun.java2d.pmoffscreen=false -Djava.net.preferIPv4Stack=true -Dgraphiclevel=3 -Djava.security.policy=applet.policy -XX:+AggressiveOpts -
XX:+ScavengeBeforeFullGC -XX:+TieredCompilation -XX:Tier2CompileThreshold=30000 -XX:CompileThreshold=1500 -XX:+UnlockExperimentalVMOptions -
XX:+UseG1GC -XX:MaxGCPauseMillis=3 -XX:+UseAdaptiveSizePolicy -Dorg.lwjgl.util.NoChecks=true -Djava.library.path="${PWD}" -cp 
"lwjgl.jar:lwjgl_util.jar:minlog-1.2.jar:reflectasm-1.01.jar:asm-3.3.1.jar:./" zombie.FrameLoader


For Low preset:

#!/bin/bash
PWD=`dirname "${0}"`
java -Dgraphiclevel=0 -Dsun.java2d.noddraw=true -Dsun.awt.noerasebackground=true -Dsun.java2d.d3d=false -Dsun.java2d.opengl=false -
Dsun.java2d.pmoffscreen=false -Djava.net.preferIPv4Stack=true -Djava.security.policy=applet.policy -XX:+AggressiveOpts -
XX:+ScavengeBeforeFullGC -XX:+TieredCompilation -XX:Tier2CompileThreshold=30000 -XX:CompileThreshold=1500 -XX:+UnlockExperimentalVMOptions -
XX:+UseG1GC -XX:MaxGCPauseMillis=3 -XX:+UseAdaptiveSizePolicy -Dorg.lwjgl.util.NoChecks=true -Djava.library.path="${PWD}" -
Dsun.java2d.noddraw=true -Dsun.awt.noerasebackground=true -Dsun.java2d.d3d=false -Xms1024m -Xmx1024m -Dsun.java2d.opengl=false -
Dsun.java2d.pmoffscreen=false -Djava.net.preferIPv4Stack=true -Djava.security.policy=applet.policy -cp "lwjgl.jar:lwjgl_util.jar:minlog-
1.2.jar:reflectasm-1.01.jar:kryonet-1.04.jar:kryo-1.04.jar:asm-3.3.1.jar:./" zombie.FrameLoader


6. Save this file, in plain text, inside your PZ directory with ".sh" extension (eg. "launch_high.sh").

7. Open Terminal.app and navigate to PZ folder:

cd path/to/pz/folder

8. Then launch the script:

bash launch_high.sh

You will have a black screen for some seconds (30sec average) but it's ok.

Notes: This tutorial makes you download the latest lwjgl library (2.8.3), but you can download the version of your choice. Just make sure to follow steps 3 and 4. It's critical. If you want to match the lwjgl version shipped with PZ 0.2.x, you can download 2.8.2 version.