Linux Gaming on ODROID: Box86 - Part 2

About a year ago, I wrote about box86, an i386 emulator for ARM developed by @ptitSeb, who is also responsible for the awesome gl4es wrapper for OpenGL → OpenGL ES. While the original look at it a year ago was already impressive, I want to look at it again, and point out what has changed since then and what you can do with it now.

Requirements

I’m currently still testing this on my old Debian Jessie based ODROID GameStation Turbo image, with box86-odroid, libgl-odroid and monolibs-odroid installed. Each of these are used in a different way to improve the overall experience and provide drivers needed to run the games in this game. All of the above will be installed together if you install box86-odroid.

Background

Some people may be familiar with a software called ExaGear. It was a commercial x86 (i386) emulator for ARMand ARM64 devices, that allowed you to run i386 software. While the overall performance was quite good, it lacked 3D support, if your platform did not provide x86 GPU drivers, which is normally not the case, except for the RPi which can use MESA drivers, and for this is able to run OpenGL on i386 in a limited way. Also, most x86 games require OpenGL, which most ARM SoCs do not support. Therefore, the overall support for x86 games was limited to 2D games and applications which did not require any hardware acceleration, or command line tools.

With box86, @ptitSeb took a different approach. He did not only write a CPU emulation for x86, but also implemented the possibility of redirecting calls from the x86 environment to the ARM host environment, using native ARM libraries rather than emulated x86 libraries. He first implemented this for OpenGL support, which in combination with gl4es allowed us to run applications and games that require hardware acceleration. It also allows to forward many system calls from applications directly to the host system rather than trying to emulate these calls under an emulated x86 environment, which is much faster than pure emulation.

Overall Changes

@ptitSeb is constantly working on box86 to improve compatibility and performance, but he also is working hard on gl4es (libgl-odroid) to support this project. The combination of these two has greatly improved over the last months allowing us to run more applications and games that are only available on x86 to be run on ARMplatforms. One of the biggest changes is the work @ptitSeb is doing on an x86 → ARM dynamic recompiler. This means that some of the x86 calls are converted directly into ARMcode “on the fly” without emulation, at the time they are requested. The same technique is done in many other emulators to speed up overall performance.

For example, in the past when you run PSX emulator on an ARM64 board, that was compiled for ARM64 it was unable to use dynamic recompiler (for example the C2 or N2), and even if the board was more powerful than other boards, the games were very slow and far from being full speed, while much slower ARMboards (for example the ODROID C1 or U3) were perfectly capable of running these games at full speed with an ARMdynamic recompiler. Some applications run 2-10 times faster with dynamic recompiler, than with pure emulation. The same applies for box86, games that were previously way too slow to play are now running much faster, opening up so many more games that are able to run on ODROIDs. The dynamic recompiler increased loading times a lot, games load so much faster than they did before, where on some games you had to wait 5-15mins to load the game data, they are now loaded in mere seconds.

Recap of some old games

Neverwinter Nights

While the game already ran impressively well the last time I checked it, the latest improvement makes the game a very smooth experience. Overall performance increased quite a bit, and you can now set the graphics quality to maximum. The game runs nearly like a native game with only tiny stutter here and there, which you would expect on an older PC as well. I can highly recommend this game on the ODROID-XU4.

God Will Be Watching

There is not much to say: the game was running well, although not at full speed, so what changed? Now it does run at full speed perfectly well.

Freedom Planet

When I first looked at the game, the game took a very long time to load (somewhere between 5-10 minutes). Now it takes about 30 seconds to start, that is over 10 times faster than it was before. In game, the game was also suffering from some minor speed problems. They were nothing that rendered the game unplayable but it wasn’t full speed, which was a bit of a shame for a game that relies on speed similar to Sonic. This is now fixed as well and the game runs perfectly at full speed.

Faster Than Light

This is another well known commercial game that was already running under box86, but with a very long loading time of over 5 minutes. This is also reduced to less than a minute, and the sound problem is also gone. The game is now fast enough to play music and sound effects and doesn’t cause stutter.

World of Goo

The game now runs at full speed, but might need LIBGL_FB=3 as a flag to run, due to some issues with GLX initialization.

What’s new

So overall the games from last time work better, that’s good, but what is new since then? What can we run that we couldn’t run before?

Day of the Tentacle Remastered

Let’s start with something big and shiny.

Figure 1 - Day of the Tentacle Remastered in 1080p on the ODROID-XU4
Figure 1 - Day of the Tentacle Remastered in 1080p on the ODROID-XU4

Figure 2 - Green never looked friendlier!
Figure 2 - Green never looked friendlier!

I love the original game Day of the Tentacle, and still play it today on ScummVM on my ODROIDs. Now, with box86, I can also play the remastered version with improved graphics and interface. It looks amazing and plays very well. There is one minor downside at the moment. The loading time between screens can be 10 seconds, which is quite long if you consider this game is about walking and exploring and trying out things from one place to another place. Still, the game works fine, and if you don’t mind the loading, there’s no difference between this and a regular PC.

Jelly Killer

This rather simple looking game is actually quite heavy on the GPU, probably due to their use of CRT and other shaders.

Figure 3 - A murderous Jelly is on the loose and jumps it’s way through numerous levels
Figure 3 - A murderous Jelly is on the loose and jumps it’s way through numerous levels

The game is a puzzle platformer where you need to time your jumps right, infest humans to reach your target, or kill other enemies. It’s a fun little game, which a little while ago only ran slow, but now is quite playable if not yet full speed.

Pier Solar and the Great Architects

This RPG game is a tribute to the old Mega Drive / Genesis styled RPG games and has a 16bit mode that pretty much looks like it could be from a Mega Drive / Genesis. It also has a HD and HD+ mode which look a lot better and polished.

Figure 4 - Pier Solar title screen
Figure 4 - Pier Solar title screen

Figure 5 - Looting strangers homes like in every good RPG
Figure 5 - Looting strangers homes like in every good RPG

Figure 6 - You can select auto for AI based fights a faster way to finish a fight
Figure 6 - You can select auto for AI based fights a faster way to finish a fight

For my taste, the game takes too long to get started, but it’s ok, and I wonder what it’s like in later sections of the game. It’s fully playable on the ODROID- XU4 though, so give it a try if you want.

Postal 2

Many have probably heard of the game, not so many might have played it. In some countries it’s still forbidden due to its controversial nature. This action shooter allows you to follow a peaceful path to accomplish your goals, but it’s also the more boring path. The game runs overall ok, but not perfect. I had issues with sound and it’s hard to change resolution. The game is slightly too slow, not unplayable, but definitely not full speed.

Figure 7 - Another full 3D game with a very strange theme
Figure 7 - Another full 3D game with a very strange theme

Figure 8 - This guy doesn’t know what’s coming at him
Figure 8 - This guy doesn’t know what’s coming at him

The Bard’s Tales

The Bard’s Tales is an impressive series of RPG games that look very good and run fine on the ODROID-XU4 and other ODROIDs. The graphics are really something, and although the game was already working when I last tried it a couple of months back, it now has much better performance, making this game feel like a native game.

Figure 9 - Even the Menu is fully 3D animated
Figure 9 - Even the Menu is fully 3D animated

Figure 10 - The graphics are impressive for this game, especially on ODROIDs
Figure 10 - The graphics are impressive for this game, especially on ODROIDs

I can only highly recommend the game, it’s very funny and has the famous “Beer Song” (https://www.youtube.com/watch?v=eTUJNeuFIFA), and a game that has beer in it can’t be bad.

Toki Tori

This game strangely only runs with OpenGL 1.x support, but it doesn’t show. The game looks gorgeous and plays really nicely. You need to rescue all the eggs in the game by collecting them. This puzzle game is quite challenging and makes you think before you make your move. It also looks very cute and has a nice little tune that fits the game perfectly. Overall, this game runs great even if it may not be the same speed as on a regular PC the game is quite playable and doesn’t feel laggy. The game controller support for the game is superb and even supports rumble if you have a controller that supports it. This is a highly addicting game and I recommend it.

Figure 11 - Toki Tori, highly addicting puzzle platformer
Figure 11 - Toki Tori, highly addicting puzzle platformer

Figure 12 - You have to deal with limited amounts of special moves like teleporters
Figure 12 - You have to deal with limited amounts of special moves like teleporters

Worms Reloaded

I played my first “Worms” game back on the Amiga 500. It was actually just called “Worms”, and it was a huge success and so much fun to play. The series continues even today, and has a couple of remakes of older versions of the game and 3D versions.

Figure 13 - Worms Reloaded on the ODROID-XU4
Figure 13 - Worms Reloaded on the ODROID-XU4

Figure 14 - The game looks beautiful and runs perfectly fine
Figure 14 - The game looks beautiful and runs perfectly fine

The game runs surprisingly fast. The only time it stutters is when the PC is calculating its move, but the actual move and attacks are perfectly fine.

UnEpic

Figure 15 - The things that happen to you when you need a bathroom
Figure 15 - The things that happen to you when you need a bathroom

Figure 16 - This dungeon crawler has beautiful graphics and lighting effects
Figure 16 - This dungeon crawler has beautiful graphics and lighting effects

This impressive dungeon crawler also runs full speed on the ODROID-XU4. The only problem with this one is that it requires a relatively huge amount of RAM (for ARM boards, that is). You need at least 1500MB free memory to run it, so depending on the operating system, you may not be able to run it on an XU4, and the game is better suited for an N1 with ARMHF drivers and 4GB of memory. Overall this game is impressive and I highly recommend it.

Honorable mentions

There are tons of more games I can’t go into, as there are so many of them that work now, but I want to share some of them with you to give you an idea what is working.

Figure 17 - Broken Sword Director’s Cut - Adventure
Figure 17 - Broken Sword Director’s Cut - Adventure

Figure 18 - Demon Hunter – Chronicles from Beyond - Hidden Object Game
Figure 18 - Demon Hunter – Chronicles from Beyond - Hidden Object Game

Figure 19 - Don’t Starve + Together - Survival / Crafting
Figure 19 - Don’t Starve + Together - Survival / Crafting

Figure 20 - eets Munchies - Puzzle
Figure 20 - eets Munchies - Puzzle

Figure 21 - Enigmatis Series - Hidden Object Game
Figure 21 - Enigmatis Series - Hidden Object Game

Figure 22 - Human Resource Machine - Programming “as a game”
Figure 22 - Human Resource Machine - Programming “as a game”

Figure 23 - Hyper Light Drifter - Action Platformer
Figure 23 - Hyper Light Drifter - Action Platformer

Figure 24 - Icewind Dale Enhanced Edition - RPG
Figure 24 - Icewind Dale Enhanced Edition - RPG

Figure 25 - Little Inferno - Casual / Puzzle
Figure 25 - Little Inferno - Casual / Puzzle

Figure 26 - Memoranda - Adventure
Figure 26 - Memoranda - Adventure

Figure 27 - Not a Hero - Action
Figure 27 - Not a Hero - Action

Figure 28 - Papers, Please - Puzzle
Figure 28 - Papers, Please - Puzzle

Figure 29 - Space Pirates and Zombies - Action / Simulation
Figure 29 - Space Pirates and Zombies - Action / Simulation

Figure 30 - Super Meatboy - Platform / Puzzle
Figure 30 - Super Meatboy - Platform / Puzzle

Figure 31 - VA-11 Hall-A - Simulation / Visual Novel
Figure 31 - VA-11 Hall-A - Simulation / Visual Novel

Figure 32 - Heretic 2 - 3rd Person “Shooter” / Action
Figure 32 - Heretic 2 - 3rd Person “Shooter” / Action

There are so many different types of games working now. A couple of months back, some of them were so slow that it was more like playing a slideshow, but these games now run full speed (for example, Hyper Light Drifter). It’s really impressive how far the emulator has evolved in just one year.

Special Games

There are, however, a few games I want to single out as they are my personal favorites, and some of which you may know as well. Two are very close and even share a similar name. I already played them a while back on ExaGear where they run in software 3D rendering. It was impressive that this game actually worked, but now I can run these games with box86 and 3D hardware acceleration. These games bring back so many memories for me, as I played them as a child and at it’s time they were in everyone’s gaming collection if they were a gamer, especially on the PC. I’m talking, of course, about Unreal and Unreal Tournament (the original 1999 edition).

Both Unreal and Unreal Tournament were ported to Linux many years back. It’s somewhat difficult to get these running nowadays, as they use very old drivers, especially when it comes to sound. But otherwise, these games are still amazing, and run as well as I remember playing them in 1999 on my AMD K6-2 450 MHz processor with Riva TNT graphics card. The game ran fine back then, but now on the ODROID, I can even play them in 720p or 1080p which I could not back in the old days. This is really amazing, and to be honest, I’m looking forward to taking some time off and replaying Unreal to see if it’s still how I remember it.

Figure 33 - Seeing the flyby back in 1998 was so iconic
Figure 33 - Seeing the flyby back in 1998 was so iconic

Figure 34 - Graphics were outstanding for its time, and still look good today
Figure 34 - Graphics were outstanding for its time, and still look good today

Unreal is working the best at the moment. I start the game with the following options:

$ LIBGL_SRGB=1 LD_PRELOAD=/usr/lib/arm-linux-gnueabihf/libaoss.so.0 box86 UnrealLinux.bin
LIBGL_SRGB=1 uses a special mode in gl4es that increases overall brightness, as the game can be extremely dark otherwise. LD_PRELOAD=/usr/lib/arm-linux-gnueabihf/libaoss.so.0 is required since the game uses /dev/dsp for sound output which is no longer used and with this we can redirect the sound to an alsa emulation.

The game takes a little while to start, as it loads quite a lot of data right at the start and then directly goes into the flyby. Performance wise, this is awesome, I mean it really feels like this game is running natively on the ODROID. I haven’t experienced any lag while playing the game. In fact, the menu seems to be slower than the game itself, and I run it on high details in 32bit color depth at 720p. It just feels amazing playing this game.

Figure 35 - What Unreal started, Unreal Tournament improved on
Figure 35 - What Unreal started, Unreal Tournament improved on

Figure 36 - Still got it... even if it was just the first level
Figure 36 - Still got it... even if it was just the first level

Unreal Tournament was the perfection of multiplayer first person combat. I played this countless times with friends at LAN parties while on vacation. The Assault game mode was always my favorite, and until today, there are very few games that have even come close to implementing such an exciting game mode. I totally miss playing this with my friends. I always hated “capture the flag”, which every other game was based around. Unreal Tournament did everything right and I dare to say I liked it better than Quake 3. However, I couldn’t get sound to work in this version. It relies on a very old driver called OSS, and while I’m able to load kernel modules for this, I’m unable to use it for sound. Other methods like aoss and padsp don’t work either, so I’m stuck without sound for this one.

Conclusion

In just one year Box86 really took off in terms of compatibility. Last time I wrote about it, it was a nice project with lots of promises, but rather little support. Now it’s gone through the roof, and the support for the games is amazing!

I’m looking forward to what will work in the months to come. I’m hoping for Unity and WINE support, as this opens up even more games. I especially look forward to WINE, which would be really impressive because WINE, in combination with OpenGL, could mean we may be able to play Windows games with hardware acceleration on ODROIDs as well. The project promises to be very exciting.

There are others that also follow the development and test games on Raspberry Pi and other platforms. You can check out the Youtube Channel “Pi Lab” (https://www.youtube.com/channel/UCgfQjdc5RceRlTGfuthBs7g/videos), where you can find even more games running under box86. Thanks @ptitSeb for all of his hard work on this project!

Be the first to comment

Leave a Reply