annabunches.net/_posts/technology/2011-06-02-gaming-in-linux-my-adventures-with-wine.html

17 lines
9.3 KiB
HTML
Raw Normal View History

2016-04-11 22:01:00 +00:00
---
category: technology
2016-04-11 22:01:00 +00:00
layout: post
title: Gaming in Linux - my adventures with wine
date: '2011-06-02T10:00:00.000-04:00'
author: Anna Wiggins
tags:
- programming
- video games
- wine
- Technology
modified_time: '2013-10-22T11:19:50.951-04:00'
blogger_id: tag:blogger.com,1999:blog-4209116010564764361.post-3787689467459426007
blogger_orig_url: http://www.stringofbits.net/2011/06/gaming-in-linux-my-adventures-with-wine.html
---
I like playing games. My 1600-word review of Portal 2 should have been at least some indication of that. I enjoy console and PC video games, tabletop roleplaying games, and board games. But today, I'm talking about playing PC video games in Linux.<br/><h3>wine is not an emulator</h3><br/>Let's start with the basics (then probably skip the middle ground and jump straight to the advanced stuff). Programs written for Windows or Mac OS can't be run natively in Linux. By 'natively', I mean you can't just click on a Windows application, or type its name on your terminal, and expect it to work. You'll get an error like this:<br/><pre>bash: ./windowsprogram.exe: cannot execute binary file</pre><br/>There are a number of reasons this doesn't work. The first and most fundamental is that Windows and Linux use different <em>binary file formats</em>; that is, the actual program code is structured in an entirely different way.<br/><br/>So why not just create a tool that can take one binary format and convert it to another? Well, to begin with, that would be pretty complicated, and probably fraught with problems; these binary formats are actually pretty complex, and include things like how to dynamically access libraries. Libraries are big chunks of code that are written separately from the program, then used by the program so that software developers don't have to repeatedly write the same code to accomplish common tasks.<br/><br/>And that leads us to the real problem - Linux and Windows have fundamentally different sets of libraries available. Each OS has a large collection of system libraries that developers can use to interact with the Operating System in different ways. And there is very, very little overlap between these libraries. A prominent example of a library that exists only in Windows is Direct3D, which is used by a lot of game developers; it contains code that makes it easier to do a lot of complicated things with the graphics card, thus making it easier to make pretty, visually involved games.<br/><br/>So, if you want to run a Windows program in Linux, you would have to create a tool that could take a Windows program, make it "think" it is running in a Windows environment, and then take its library calls and somehow convert them into a set of library calls that Linux can understand. Direct3D calls, for instance, might be converted into equivalent OpenGL calls in Linux. This is exactly what the wine project does.<br/><br/>Wine has been around for a long time, and it has aged well (these are the jokes, folks). The latest wine codebase does a great job handling a ton of Windows applications, including a great many games. This article is an overview of my experience using wine to play games on Fedora.<br/><h3>blizzards and steam valves</h3><br/>My journey begins with wine-1.3.18, the version packaged with fedora 13. Wanting to play <a href="http://us.battle.net/sc2/en/">Starcraft 2</a>, I ran the installer, which executed without a problem. The game itself also ran great, without having to make any tweaks at all to wine's configuration. So, Starcraft 2 was an easy win. Blizzard's games, in general, work great under wine. I'm not sure if Blizzard just avoids strange API calls, or if wine has a lot of developers interested in making certain Blizzard's games work. Either way, this one was phenomenally easy.<br/><br/>The next thing I tried was Valve's <a href="http://store.steampowered.com/">Steam</a> client. If you're somehow reading this from the past, or Steam no longer exists in the future (or you have recently emerged from a coma), Steam is a game distribution platform. You can buy electronic copies of games, install them in steam, and play them. Many games also support achievements and server-side syncing of your game data. This makes gaming on multiple computers really nice (as long as you're the only one using Steam, that is). It also has community features; you can see what your friends are playing, join them in multiplayer games, etc.<br/><br/>So, I have quite a few games on Steam, and before I can try to run the <str