Create immersive gameplay for Chrome OS

Games

Get started with a few common game engines and built, test, and run games right from your Chromebook.

Unity

Complete the steps to enable GPU acceleration found in the setup guide.

Install libarchive (libarchive13) and gconf-editor:

sudo apt install -y libarchive13 gconf-editor

Download the installer from the last post of this forum thread.

Run the installer from the terminal. Select the Android and/or WebGL components if desired.

chmod a+x UnitySetup*
./UnitySetup*

Download Unity Hub for Linux to install the usage license and launch the editor.

Unity Hub is distributed as an AppImage file which isn't fully supported yet. Just extract it create a handy launcher shortcut.

chmod a+x UnityHub*
./UnityHub* --appimage-extract
mv squashfs* UnityHub
ln -s UnityHub/unityhub
./unityhub
  1. Create or sign-in to your Unity account.
  2. When prompted click "Install Unity" (don't worry, you won't have to install it again)
  3. Locate the version you downloaded with the installer (~/Unity-2019.1.0f2/Editor/Unity)
  4. If you are new to Unity development, go to the Learn tab and download, but do not start, two demo projects under "Tutorial Projects":
    • Roll-a-ball
    • Tanks
  5. Go back to the New tab and create a new project
  6. Choose the 3D template
  7. Add either the Roll-a-ball or Tanks asset package you downloaded, name the project appropriately, and launch!

Unreal Engine 4

Note: consider this recipe as an early exploration and starting point. Commands may need to be tweaked and performance may be poor.

Complete the steps to enable GPU acceleration found in the setup guide.

Unreal Engine 4 is an IDE and game engine that’s been used to create notable games such as Unreal Tournament and Fortnite. There are no pre-built binaries for Linux so you’ll need to build them from source. The following is based on the official Unreal Linux setup instructions:

  1. Follow steps 1 and 2 from the official instructions to connect your GitHub account to Epic.
  2. Download the zip file for 4.17 version of the editor.
    • *Newer versions require newer graphics cards (feature level 5) which may not be available in your Chrome OS device.
  3. Unzip the file and delete the archive to save space:
unzip Unreal*.zip
rm Unreal*.zip

Next, set up the build system (this could download ~4GB of dependencies):

cd Unreal*
./Setup.sh
./GenerateProjectFiles.sh

Let’s make a few changes to the source so things will run correctly.

  1. First, hard-code a non-zero vendor id:
gedit ~/UnrealEngine*/Engine/Source/Runtime/RHI/Private/RHI.cpp

(Line 257)

uint32 GRHIVendorId = 1;

Unreal will parallelize the build process by default, which can lead to race conditions. To avoid complications, edit the build configuration to only use two processors:

gedit ~/UnrealEngine*/Engine/Saved/UnrealBuildTool/BuildConfiguration.xml

Between the Configuration tags, add:
(Unreal Engine 4.17)

<BuildConfiguration>
  <MaxProcessorCount>2</MaxProcessorCount>
</BuildConfiguration>

(Unreal Engine 4.19+)

<LocalExecutor>
  <MaxProcessorCount>2</MaxProcessorCount>
</LocalExecutor>

Save, and then begin the build (this process may take one or two hours):

make

Create a handy script for opening the editor. Let’s use opengl3 for now:

gedit ~/unreal.sh
~/UnrealEngine*/Engine/Binaries/Linux/UE4Editor -opengl3
chmod a+x unreal.sh

Now, let’s give it a try!

  1. *The first run will need to compile some shaders so it will take some time
~/unreal.sh
  1. Once the project browser is up, you’ll notice a window counting down the number of shaders left to compile. Allow this process to complete.
  2. Select the new project tab and choose a project with a starter kit (try “Vehicle”).
  3. Select the directory you want your Unreal projects to live in and name the project.
  4. Create the project and take it for a spin!

Cocos2d-x

Note: consider this recipe as an early exploration and starting point. Commands may need to be tweaked and performance may be poor.

Cocos2d-x is an open-source game framework. Click here to read the full Linux installation instructions on the Cocos2d-x site.

  1. Optional: To build for Android, be sure to install Android Studio or the Android SDK. Install the NDK if you will have native code.

Complete the steps to enable GPU acceleration found in the setup guide.

First, install dependencies:

sudo apt install -y g++ libgdk-pixbuf2.0-dev python-pip cmake libx11-dev libxmu-dev libglu1-mesa-dev libgl2ps-dev libxi-dev libzip-dev libpng-dev libcurl4-gnutls-dev libfontconfig1-dev libsqlite3-dev libglew-dev libssl-dev libgtk-3-dev libglfw3 libglfw3-dev xorg-dev

Clone the repo and get the python dependencies:

git clone https://github.com/cocos2d/cocos2d-x.git
cd cocos*
python download-deps.py
git submodule update --init

Set up the cocos script and choose “~/Android/Sdk” if you want to build for Android when prompted:

./setup.py
source ~/.bashrc

You can now build using the cocos script:

cocos --help

Optional: Cocos Creator is an IDE/electron application for cocos2d-x that can be built for Linux following these instructions.

More resources

Extending games beyond mobile