Scott Hanselman

Building 0verkill on Windows 10 Subsystem for Linux - 2D ASCII art deathmatch game

January 12, 2018 Comment on this post [4] Posted in Linux | Win10
Sponsored By

I'm a big fan of the Windows Subsystem for Linux. It's real Linux that runs real user-mode ELF binaries but it's all on Windows 10. It's not running in a Virtual Machine. I talk about it and some of the things you should be aware of when sharing files between files systems in this YouTube video.

WHAT IS ALL THIS LINUX ON WINDOWS STUFF? Here's a FAQ on the Bash/Windows Subsystem for Linux/Ubuntu on Windows/Snowball in Hell and some detailed Release Notes. Yes, it's real, and it's spectacular. Can't read that much text? Here's a video I did on Ubuntu on Windows 10.

You can now install not only Ubuntu from the Windows Store (make sure you run this first from a Windows PowerShell admin prompt) - "Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux"

I have set up a very shiny Linux environment on Windows 10 with lovely things like tmux and Midnight Commander. The bash/Ubuntu/WSL shell shares the same "console host" (conhost) as PowerShell and CMD.exe, so as the type adds new support for fonts, colors, ANSI, etc, every terminal gets that new feature.

I wanted to see how far this went. How Linuxy is Linux on Windows? How good is the ANSI/ASCII support in the console on Windows 10? Clearly the only real way to check this out would be to try to build 0verkill. 0verkill is a client-server 2D deathmatch-like game in ASCII art. It has both client and server and lots of cool features. Plus building it would exercise the system pretty well. It's also nearly 20 years old which is fun.

PRO TIP: Did you know that you can easily change your command prompt colors globally with the new free open source ColorTool? You can easily switch to solarized or even color-blind schemes for deuteranopia.

There's a fork of the 0verkill code at https://github.com/hackndev/0verkill so I started there. I saw that there was a ./rebuild script that uses aclocal, autoconf, configure, and make, so I needed to apt in some stuff.

sudo apt-get install build-essential autotools-dev automake
sudo apt-get install libx11-dev
sudo apt-get install libxpm-dev

Then I built it with ./rebuild and got a TON of warnings. Looks like this rather old code does some (now, in the modern world) questionable things with fprintf. While I can ignore the warnings, I decided to add -Wno-format-security to the CFLAGS in Makefile.in in order to focus on any larger errors I might run into.

Changing CFLAGS in Makefile.in

I then rebuild again, and get a few warnings, but nothing major. Nice.

Building 0verkill

I run the server locally with ./server. This allows you to connect multiple clients, although I'll just be connecting locally, it's nice that the networking works.

$ ./server
11. 1.2018 14:01:42  Running 0verkill server version 0.16
11. 1.2018 14:01:42  Initialization.
11. 1.2018 14:01:42  Loading sprites.
11. 1.2018 14:01:42  Loading level "level1"....
11. 1.2018 14:01:42  Loading level graphics.
11. 1.2018 14:01:42  Loading level map.
11. 1.2018 14:01:42  Loading level objects.
11. 1.2018 14:01:42  Initializing socket.
11. 1.2018 14:01:42  Installing signal handlers.
11. 1.2018 14:01:42  Game started.
11. 1.2018 14:01:42  Sleep

Next, run the client in another bash/Ubuntu console window (or a tmux pane) with ./0verkill.

Awesome. Works great, scales with the window size, ASCII and color looks great.

Alone in 0verkill

Now I just need to find someone to play with me...


Sponsor: Get the latest JetBrains Rider for debugging third-party .NET code, Smart Step Into, more debugger improvements, C# Interactive, new project wizard, and formatting code in columns.

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Hosting By
Hosted in an Azure App Service
January 12, 2018 10:05
Hahahahaha awesome.

Thanks for the write up. Got it running in a couple of minutes, will play with it tonight :)

Did not do the Wno-format-security thing, seems to run fine.
January 12, 2018 12:33
Thanks for sharing valuable information. I really enjoy the article.
January 13, 2018 1:55
Thanks Scott, this inspired me to build and run Rogue. I figured I would get something without requiring another player.
Guy
January 16, 2018 18:28
+1 favoring C over C++ for legacy code to work on.

Easier to read, debug, manipulate....

Comments are closed.

Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.