Skip to content

Instantly share code, notes, and snippets.

@wey-gu
Last active June 27, 2024 06:22
Show Gist options
  • Save wey-gu/9ef27e5a34ea1c5058ade42fd0d9b798 to your computer and use it in GitHub Desktop.
Save wey-gu/9ef27e5a34ea1c5058ade42fd0d9b798 to your computer and use it in GitHub Desktop.
Red Alert 2 on Chromebook

TOC

Table of contents generated with markdown-toc

Options

In ChromeOS(probably similar with other Linux Distributions), we could play RA2 in browser or with Wine.

The browser version is really SOTA solution while it doesn't support single user mode(but we could play with friends!).

The Wine version had taken me quite some hours, thus I put things together in this gist, so you don't have to.

Wine

We will need:

  • Linux Env to run normal Linux
  • Flathub to run X App w/o taking care of dependencies
  • POL(PlayOnLinux) as a handy Wine Frontend/Shell
  • CNC-ddraw to mitigate slow gaming

Installation

Flathub

sudo apt install flatpak
flatpak --user remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo

Restart the machine

PlayOnLinux(Wine Shell)

flatpak install com.playonlinux.PlayOnLinux4

# Run it with
flatpak run com.playonlinux.PlayOnLinux4

Wine(3.21)

This is the verified latest working version, all newer versions will not display properly of RA2.

To download it, in POL, Click Tools --> Manage Wine versions

Wine

Configuration and Place Game

Create Virtual drive

Let's create a virtual drive with Wine 3.21 prefix. To do so just:

  • Click Configure
  • Click New, Next
  • Select 32 bits windows installation
  • Select 3.21 Wine version
  • Provide name of the virtual drive, i.e. ra2_wine3.21
  • Next, Next, Next...

We'll see this:

Virtual_Drive_Wine_3.21

Place Game Dir

As for now, .var/app/com.playonlinux.PlayOnLinux4/data/PlayOnLinux/wineprefix is the path our virtual drive(wineprefix) is placed, we could create a soft symbolic link for it like:

cd ~
ln -s .var/app/com.playonlinux.PlayOnLinux4/data/PlayOnLinux/wineprefix pol_wine_prefixes

Then we could copy game dir from ~/pol_wine_prefixes/ra2_wine3.21/drive_c/Program Files:

Assume I had placed my ra2 game folder(with ra2.exe under it) under: '~/misc/Red Alert 2', then we copy them to the Program Files of our wineprefix with:

cp -r ~/misc/Red\ Alert\ 2 .

Create Game Shortcut

Then, we just Click "Make a new shortcut from this virtual drive" and "Browse" our game entry .exe file as a shortcut that we could run with POL/Wine:

Create Shutcut

And afterwards, we'll see it's there on first window of POL:

Shortcut

Configuations

Leveraging cnc-ddraw

W/o cnc-ddraw, ra2 will be quite slow running in Wine.

Thanks to https://github.com/FunkyFr3sh/cnc-ddraw, we could mitigate compatibility issues in older games, such as black screen, bad performance, crashes or defective Alt+Tab.

First we follow its readme to download the cnc-ddraw.zip and extract all files and place it in our ra.exe dir.

The next step of winecfg will be done then.

Configure Wine

With POL, we could go to Wine, Configure Wine to change settings like:

  • For Graphics, we need to ensure it's not emulating virtual desktop(for cnc-ddraw to work properly).

  • For Applicaiton, we could set Windows Version as Windows XP.

  • For Libraries, type ddraw and click add.

Then, we could configur Display of Wine like this:

Configuration display refresh rate(external monitor)

I found, when connecting to my 4K display, the sound of the game will be lagging, and after some inspection, the root cause was the refresh rate that causing this.

So I changed refresh rate to 30Hz to fix it.

Run it!

In main screen, run the shortcut we created, enjoy and have fun!

Play Online

All we need is to browse our purchased game package or folder, and visit https://game.chronodivide.com/ to play with others.

chronodivide.com

@SuperCael
Copy link

I tried putting the command script you sampled but it doesn't do anything. Can you show me where to put the Place Game Dir part? I am stuck on that part.. I tried doing the next step but it doesn't allow me to continue as I am missing to follow that part.

@wey-gu
Copy link
Author

wey-gu commented Jun 21, 2024

You have nothing on .var/app/com.playonlinux.PlayOnLinux4/data/PlayOnLinux/wineprefix or? I need to know which exact command, and how it "doesnt do anything".

@SuperCael
Copy link

As you can see, I am now on this part. The part where I needed to follow the Place Game Dir is where I am stucked. I don't know where to go from there. About you asking whether I have the ..var/app/com.playonlinux.PlayOnLinux4/data/PlayOnLinux/wineprefix. I see that when I follow the steps that asks me to create a new shortcut but nothing continue after that as I have skipped the Place Game Dir part.
Uploading Screenshot 2024-06-22 01.48.02.png…

@SuperCael
Copy link

SuperCael commented Jun 25, 2024

Here's where I am lost. Can you tell me what to do next? Where should I work on the PLACE GAME DIR part? Should I go to Miscellaneous? Should I run a script? Should I go to POL?

Screenshot 2024-06-26 02 20 49

@wey-gu
Copy link
Author

wey-gu commented Jun 27, 2024

Here's where I am lost. Can you tell me what to do next? Where should I work on the PLACE GAME DIR part? Should I go to Miscellaneous? Should I run a script? Should I go to POL?

Please spawn another terminal session and:

cd ~
ln -s .var/app/com.playonlinux.PlayOnLinux4/data/PlayOnLinux/wineprefix pol_wine_prefixes

Then, copy your RA2 things into ~/pol_wine_prefixes/ra2_wine3.21/drive_c/Program Files, you could do so with ChromeOS's File Manager(like Explorer of Windows), or with the terminal.

Note: ~/pol_wine_prefixes/ra2_wine3.21/drive_c/Program Files refers to path:pol_wine_prefixes/ra2_wine3.21/drive_c/Program Files of your Linux File System Home dir.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment