Files

140 lines
8.5 KiB
Plaintext
Raw Permalink Normal View History

Episode: 1778
Title: HPR1778: Nethack and Vi cursor keys
Source: https://hub.hackerpublicradio.org/ccdn.php?filename=/eps/hpr1778/hpr1778.mp3
Transcribed: 2025-10-18 09:10:23
---
This is HPR episode 1,778 entitled, Nehack and Microsakean and in part of the series, Vincant.
It is hosted by Steve Vehicle and is about 9 minutes long, the summary is more about Roman
6Vim and my Nehack virtual machine.
This episode of HPR is brought to you by AnanasThost.com.
Get 15% discount on all shared hosting with the offer code, HPR15, that's HPR15.
Better web hosting that's honest and fair at AnanasThost.com.
Hi, I'm Steve Vehicle and this episode is Nehack and ViCursakean.
It's my contribution partially inspired by the recent series of Vi and Vim podcasts
and also by Frank Bell's recent episode Introduction to Rogue Class Linux.
In addition to my piece here, I also want to use this opportunity to point out an excellent
podcast about Vim that's complimentary to the series on HPR.
I was pleased to see recently that Thomas Gideon's The Command Line podcast is back from
a hiatus and I want to make sure others are aware.
This 12th of April podcast is an essay entitled Hope and Fear in the World of Vim, where
he discusses his use of Vim throughout his career as a programmer.
You can find this podcast at thecommandline.net.
So let's get on to Vi.
The text editor Vi was written a long ago by Bill Joy in the late 70s before the advent
of PC keyboard and cursor keys.
So the default key mappings for left, down, up and right being HJK and L and not immediately
familiar to a PC keyboard user.
The original machine for which Vi was written used the AD-M3A terminal where HJK and L
had the cursor arrow keys engraved upon them.
Vi is installed as a default choice on many distros and where it is not there is invariably
a package available so that it can be easily added.
Some, if not most distros, come with Vim installed by default.
Vim by the way stands for Vi improved.
This does have the cursor keys mapped nicely for a modern PC keyboard as well as for the
original keys.
Vim is always out alias as Vi.
So if it's been installed when you enter Vi, you get Vim.
Vi is pretty lightweight bit of code whereas Vim has more dependencies so sometimes Vi still
preferred as the default install package.
For instance Debian and many of its derivatives have Vi rather than Vim installed by default.
So if you're distro hopping or working on other people's systems, you can generally
rely on having Vi available.
But you can't be sure to get Vim so it's useful to be conversant with the Vi key mappings
along with the working knowledge of some of the basic commands.
Then you'll never be at a loss for a text editor when needing to hack around in a Linux
box.
For me, as an occasional user of Vi, the most challenging keys to remember to use are
the HJK and L cursor keys.
Since muscle memory has my fingers diving for the arrow keys.
This is where the NetHack game comes in and which is really what this article or episode
is about.
So to NetHack, NetHack is a terminal-based dungeon adventure game which uses the same cursor
keys as Vi and other old Unix programs.
Play this game for a few hours and you'll never struggle with Vi cursor keys again.
The goal of the game is to retrieve the amulet from the lowest level of the dungeon and return
to the surface with it for your god.
NetHack presents as a text-based adventure with each level gradually being revealed
to you in an on-screen character-based level map.
As you travel through the dungeon, more of the level is revealed.
As you play, your character gains more experience and it levels up its capabilities.
You play as one of a number of types of character and race.
These include many of the usual dungeons and dragons types, archaeologists, most likely
inspired by Indiana Jones and tourists which definitely owe very much to Terry Pratchett.
Each role and race has their own initial characteristics, default inventory items, levels of resilience
and the ability to learn various skills.
For instance, a wizard will advance his spell making capabilities faster than a footpad.
Although seemingly simplistic, a simplistic terminal-based game, there's a lot more
going on in NetHack than at first apparent.
Originally released in 1987, it was actively developed with improvements to gameplay features
until 2003.
Since then, there have been minor updates and ports to different platforms have been added.
However, there's room for to be a release with further gameplay improvements sometime
this year.
The game has a real depth and subtlety that is gradually revealed the more you play.
It's not an easy game to win.
From my experience to the date, that may not even be possible.
But the more you play it, the better strategies you devise and the more rewarding the game
becomes.
There's complexity to this game.
It's probably more complex than most modern 3D HD graphic adventures that you might find.
Although there's a NetHack wiki where information about how to play can be sought, the true
elite apparently learn through playing.
I'd suggest having a go, then when you become familiar with YA SDs, yet another stupid
death, there's a lot of them.
You'll have enough experience to want to answer a few burning questions with the wiki
in order to play a more satisfying game.
Although a challenging game, it's not a difficult game to play once you've remembered
a few keyboard commands.
And this game can be played just about anywhere, because the game has a gpl license and there
are many ports and flavours available.
It's possible to play on most platforms, I've tried it on Linux, Android and even as
a Google Chrome app.
Although the iOS port wasn't usable on our old iPad or on a colleague's new iPhone.
There are various ports for the Windows platform, some of which replace the character based
interface with Windows 3.1 style tile interface or a 3D isometric graphical interface.
Personally, I'd prefer to stick with a traditional character interface since the graphics don't
really add anything to the gameplay.
In fact, when I play the game on my Windows laptop, I use a minimal Debian install running
on VirtualBox.
I have it set up to auto run NetHack and shut down my next in the game.
Then I launch the VM directly with a shortcut containing the VirtualBox command that I keep
on the desktop.
So this is how I set up my NetTack VM.
Since I created a VirtualBox VM with one core, 256 mega RAM and an 8GB hard drive, I could
actually have got away with a 2GB hard drive.
Then I installed a minimum install of Debian, configured networking and installed NetHack
using AppsGetInstall.
Once NetHack was installed, I disabled the networking so I don't have to wait for a network
connection to time out on booting up the machine if my laptop's not online.
To make Debian Auto start with a particular user, you can edit the ETC init tab and alter
one of the TTY invocations.
I changed this line.
1, colon, 2, 3, 4, 5, colon, respawn, colon, forward slash, S bin, forward slash, mingetti,
space, TTY 1.
So to log into my account automatically, I actually added in after mingetti minus auto
log in, Steve.
So having inserted that in there, when you reboot the machine, it automatically logs
into that account.
To get NetHack to run on startup and the VM to shut down on exiting the game, you can
edit the user's .bash RC file and append these three commands to the end of the game.
First of all, clear, this ensures the screen's clear prior to running the game.
Then on the next line, NetHack to actually run the game and then to finally close down
the machine when you exit the game, add the line, pseudo, shut down, minus H now.
Because NetHack's a terminal-based game, it doesn't have other battery and portable
machines, making it an ideal travel game for a commuter.
Even if you're not a gamer, I suggest it's worth a look at NetHack.
It might be the one computer game that really grabs your attention.
You've been listening to HackerPublicRadio at HackerPublicRadio.org.
We are a community podcast network that releases shows every weekday, Monday through Friday.
Today's show, like all our shows, was contributed by an HPR listener like yourself.
If you ever thought of recording a podcast, then click on our contribute link to find
out how easy it really is.
HackerPublicRadio was founded by the Digital Dove Pound and the Infonomicon Computer Club,
and is part of the binary revolution at binrev.com.
If you have comments on today's show, please email the host directly, leave a comment on
the website or record a follow-up episode yourself.
Unless otherwise stated, today's show is released on the create of comments, attribution,
share a like, 3.0 license.