0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

AlmaLinuxでnethackを遊ぶ

Last updated at Posted at 2024-06-03

ローグライク(Rogue Like)

ローグライクというゲームジャンルを御存じでしょうか?
不思議なダンジョンシリーズで有名な風来のシレンなどがそれです。

このローグライクゲームはもともと、ローグ(rogue)という文字だけのゲームから派生していってできたもので、ローグ(Rogue)に似ている(Like)ためローグライクゲームといいます。

nethack

細かい事はwikiに任せますが、このローグ(rogue)から派生してできたゲームでnethackというものがあります。
AlmaLinuxではなんとこのnethackが遊べてしまいます。

しかも、手順的には

  • epelリポジトリを登録する
  • nethackをインストールする

というたった2つの手順で遊べてしまいます。

インストール手順

細かい事は置いといて、早速インストールしてみましょう。

epelのインストール

nethackはepelリポジトリで配布されています。まずはepelリポジトリをインストールします。

rootユーザでログインしている場合

# dnf install epel-release -y

sudo権限が付与されている場合

$ sudo dnf install epel-release -y

実行例

[root@AL ~]# dnf install epel-release
Last metadata expiration check: 2:46:53 ago on Mon 03 Jun 2024 08:36:41 AM UTC.
Dependencies resolved.
========================================================================================================================
 Package                                 Architecture          Version                      Repository             Size
========================================================================================================================
Installing:
 epel-release                            noarch                9-5.el9                      extras                 18 k
Installing dependencies:
 python3-dateutil                        noarch                1:2.8.1-7.el9                baseos                287 k
 python3-dnf-plugins-core                noarch                4.3.0-13.el9                 baseos                246 k
 python3-six                             noarch                1.15.0-9.el9                 baseos                 36 k
 python3-systemd                         x86_64                234-18.el9                   baseos                 83 k
Installing weak dependencies:
 dnf-plugins-core                        noarch                4.3.0-13.el9                 baseos                 36 k

Transaction Summary
========================================================================================================================
Install  6 Packages

Total download size: 706 k
Installed size: 2.1 M
Is this ok [y/N]: y
Downloading Packages:
(1/6): dnf-plugins-core-4.3.0-13.el9.noarch.rpm                                         234 kB/s |  36 kB     00:00
(2/6): python3-dnf-plugins-core-4.3.0-13.el9.noarch.rpm                                 932 kB/s | 246 kB     00:00
(3/6): python3-six-1.15.0-9.el9.noarch.rpm                                              229 kB/s |  36 kB     00:00
(4/6): python3-dateutil-2.8.1-7.el9.noarch.rpm                                          789 kB/s | 287 kB     00:00
(5/6): python3-systemd-234-18.el9.x86_64.rpm                                            621 kB/s |  83 kB     00:00
(6/6): epel-release-9-5.el9.noarch.rpm                                                  139 kB/s |  18 kB     00:00
------------------------------------------------------------------------------------------------------------------------
Total                                                                                   307 kB/s | 706 kB     00:02
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                1/1
  Installing       : python3-systemd-234-18.el9.x86_64                                                              1/6
  Installing       : python3-six-1.15.0-9.el9.noarch                                                                2/6
  Installing       : python3-dateutil-1:2.8.1-7.el9.noarch                                                          3/6
  Installing       : python3-dnf-plugins-core-4.3.0-13.el9.noarch                                                   4/6
  Installing       : dnf-plugins-core-4.3.0-13.el9.noarch                                                           5/6
  Installing       : epel-release-9-5.el9.noarch                                                                    6/6
  Running scriptlet: epel-release-9-5.el9.noarch                                                                    6/6
Many EPEL packages require the CodeReady Builder (CRB) repository.
It is recommended that you run /usr/bin/crb enable to enable the CRB repository.

  Verifying        : dnf-plugins-core-4.3.0-13.el9.noarch                                                           1/6
  Verifying        : python3-dateutil-1:2.8.1-7.el9.noarch                                                          2/6
  Verifying        : python3-dnf-plugins-core-4.3.0-13.el9.noarch                                                   3/6
  Verifying        : python3-six-1.15.0-9.el9.noarch                                                                4/6
  Verifying        : python3-systemd-234-18.el9.x86_64                                                              5/6
  Verifying        : epel-release-9-5.el9.noarch                                                                    6/6

Installed:
  dnf-plugins-core-4.3.0-13.el9.noarch          epel-release-9-5.el9.noarch      python3-dateutil-1:2.8.1-7.el9.noarch
  python3-dnf-plugins-core-4.3.0-13.el9.noarch  python3-six-1.15.0-9.el9.noarch  python3-systemd-234-18.el9.x86_64

Complete!

nethackのインストール

以下コマンドでnethackをインストールします。

rootユーザでログインしている場合

# dnf install nethack -y

sudo権限が付与されている場合

$ sudo dnf install nethack -y

実行例

[root@AL ~]# dnf install nethack
Last metadata expiration check: 2:48:55 ago on Mon 03 Jun 2024 08:36:41 AM UTC.
Dependencies resolved.
=================================================================================================================================================================================================================
 Package                                                      Architecture                              Version                                               Repository                                    Size
=================================================================================================================================================================================================================
Installing:
 nethack                                                      x86_64                                    3.6.7-1.el9                                           epel                                         2.0 M
Installing dependencies:
 fonts-filesystem                                             noarch                                    1:2.0.5-7.el9.1                                       baseos                                       9.0 k
 freetype                                                     x86_64                                    2.10.4-9.el9                                          baseos                                       387 k
 graphite2                                                    x86_64                                    1.3.14-9.el9                                          baseos                                        94 k
 harfbuzz                                                     x86_64                                    2.7.4-10.el9                                          baseos                                       623 k
 libICE                                                       x86_64                                    1.0.10-8.el9                                          appstream                                     70 k
 libSM                                                        x86_64                                    1.2.3-10.el9                                          appstream                                     41 k
 libX11                                                       x86_64                                    1.7.0-9.el9                                           appstream                                    645 k
 libX11-common                                                noarch                                    1.7.0-9.el9                                           appstream                                    151 k
 libXau                                                       x86_64                                    1.0.9-8.el9                                           appstream                                     30 k
 libXaw                                                       x86_64                                    1.0.13-19.el9                                         appstream                                    197 k
 libXext                                                      x86_64                                    1.3.4-8.el9                                           appstream                                     39 k
 libXmu                                                       x86_64                                    1.1.3-8.el9                                           appstream                                     74 k
 libXpm                                                       x86_64                                    3.5.13-10.el9                                         appstream                                     57 k
 libXt                                                        x86_64                                    1.2.0-6.el9                                           appstream                                    179 k
 libfontenc                                                   x86_64                                    1.1.3-17.el9                                          appstream                                     30 k
 libpng                                                       x86_64                                    2:1.6.37-12.el9                                       baseos                                       116 k
 libxcb                                                       x86_64                                    1.13.1-9.el9                                          appstream                                    225 k
 mkfontscale                                                  x86_64                                    1.2.1-3.el9                                           appstream                                     31 k
 nethack-bitmap-fonts                                         noarch                                    3.6.7-1.el9                                           epel                                          17 k
 nethack-bitmap-fonts-core                                    noarch                                    3.6.7-1.el9                                           epel                                         7.6 k

Transaction Summary
=================================================================================================================================================================================================================
Install  21 Packages

Total download size: 4.9 M
Installed size: 13 M
Is this ok [y/N]: y
Downloading Packages:
(1/21): libSM-1.2.3-10.el9.x86_64.rpm                                                                                                                                             69 kB/s |  41 kB     00:00
(2/21): libICE-1.0.10-8.el9.x86_64.rpm                                                                                                                                           111 kB/s |  70 kB     00:00
(3/21): libXau-1.0.9-8.el9.x86_64.rpm                                                                                                                                            407 kB/s |  30 kB     00:00
(4/21): libX11-common-1.7.0-9.el9.noarch.rpm                                                                                                                                     714 kB/s | 151 kB     00:00
(5/21): libXext-1.3.4-8.el9.x86_64.rpm                                                                                                                                           712 kB/s |  39 kB     00:00
(6/21): libX11-1.7.0-9.el9.x86_64.rpm                                                                                                                                            694 kB/s | 645 kB     00:00
(7/21): libXmu-1.1.3-8.el9.x86_64.rpm                                                                                                                                            669 kB/s |  74 kB     00:00
(8/21): libXpm-3.5.13-10.el9.x86_64.rpm                                                                                                                                          521 kB/s |  57 kB     00:00
(9/21): libfontenc-1.1.3-17.el9.x86_64.rpm                                                                                                                                       458 kB/s |  30 kB     00:00
(10/21): libXaw-1.0.13-19.el9.x86_64.rpm                                                                                                                                         442 kB/s | 197 kB     00:00
(11/21): libXt-1.2.0-6.el9.x86_64.rpm                                                                                                                                            772 kB/s | 179 kB     00:00
(12/21): mkfontscale-1.2.1-3.el9.x86_64.rpm                                                                                                                                      316 kB/s |  31 kB     00:00
(13/21): fonts-filesystem-2.0.5-7.el9.1.noarch.rpm                                                                                                                               101 kB/s | 9.0 kB     00:00
(14/21): libxcb-1.13.1-9.el9.x86_64.rpm                                                                                                                                          964 kB/s | 225 kB     00:00
(15/21): graphite2-1.3.14-9.el9.x86_64.rpm                                                                                                                                       947 kB/s |  94 kB     00:00
(16/21): libpng-1.6.37-12.el9.x86_64.rpm                                                                                                                                         1.5 MB/s | 116 kB     00:00
(17/21): harfbuzz-2.7.4-10.el9.x86_64.rpm                                                                                                                                        2.6 MB/s | 623 kB     00:00
(18/21): freetype-2.10.4-9.el9.x86_64.rpm                                                                                                                                        970 kB/s | 387 kB     00:00
(19/21): nethack-bitmap-fonts-3.6.7-1.el9.noarch.rpm                                                                                                                             138 kB/s |  17 kB     00:00
(20/21): nethack-bitmap-fonts-core-3.6.7-1.el9.noarch.rpm                                                                                                                         58 kB/s | 7.6 kB     00:00
(21/21): nethack-3.6.7-1.el9.x86_64.rpm                                                                                                                                          2.3 MB/s | 2.0 MB     00:00
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                                                            1.0 MB/s | 4.9 MB     00:04
Extra Packages for Enterprise Linux 9 - x86_64                                                                                                                                   1.6 MB/s | 1.6 kB     00:00
Importing GPG key 0x3228467C:
 Userid     : "Fedora (epel9) <epel@fedoraproject.org>"
 Fingerprint: FF8A D134 4597 106E CE81 3B91 8A38 72BF 3228 467C
 From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-9
Is this ok [y/N]: y
Key imported successfully
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                                                                                                         1/1
  Installing       : libICE-1.0.10-8.el9.x86_64                                                                                                                                                             1/21
  Installing       : libSM-1.2.3-10.el9.x86_64                                                                                                                                                              2/21
  Installing       : libpng-2:1.6.37-12.el9.x86_64                                                                                                                                                          3/21
  Installing       : graphite2-1.3.14-9.el9.x86_64                                                                                                                                                          4/21
  Installing       : harfbuzz-2.7.4-10.el9.x86_64                                                                                                                                                           5/21
  Installing       : freetype-2.10.4-9.el9.x86_64                                                                                                                                                           6/21
  Installing       : fonts-filesystem-1:2.0.5-7.el9.1.noarch                                                                                                                                                7/21
  Installing       : nethack-bitmap-fonts-3.6.7-1.el9.noarch                                                                                                                                                8/21
  Installing       : libfontenc-1.1.3-17.el9.x86_64                                                                                                                                                         9/21
  Installing       : mkfontscale-1.2.1-3.el9.x86_64                                                                                                                                                        10/21
  Installing       : nethack-bitmap-fonts-core-3.6.7-1.el9.noarch                                                                                                                                          11/21
  Running scriptlet: nethack-bitmap-fonts-core-3.6.7-1.el9.noarch                                                                                                                                          11/21
  Installing       : libXau-1.0.9-8.el9.x86_64                                                                                                                                                             12/21
  Installing       : libxcb-1.13.1-9.el9.x86_64                                                                                                                                                            13/21
  Installing       : libX11-common-1.7.0-9.el9.noarch                                                                                                                                                      14/21
  Installing       : libX11-1.7.0-9.el9.x86_64                                                                                                                                                             15/21
  Installing       : libXext-1.3.4-8.el9.x86_64                                                                                                                                                            16/21
  Installing       : libXt-1.2.0-6.el9.x86_64                                                                                                                                                              17/21
  Installing       : libXmu-1.1.3-8.el9.x86_64                                                                                                                                                             18/21
  Installing       : libXpm-3.5.13-10.el9.x86_64                                                                                                                                                           19/21
  Installing       : libXaw-1.0.13-19.el9.x86_64                                                                                                                                                           20/21
  Installing       : nethack-3.6.7-1.el9.x86_64                                                                                                                                                            21/21
  Running scriptlet: nethack-3.6.7-1.el9.x86_64                                                                                                                                                            21/21
  Verifying        : libICE-1.0.10-8.el9.x86_64                                                                                                                                                             1/21
  Verifying        : libSM-1.2.3-10.el9.x86_64                                                                                                                                                              2/21
  Verifying        : libX11-1.7.0-9.el9.x86_64                                                                                                                                                              3/21
  Verifying        : libX11-common-1.7.0-9.el9.noarch                                                                                                                                                       4/21
  Verifying        : libXau-1.0.9-8.el9.x86_64                                                                                                                                                              5/21
  Verifying        : libXaw-1.0.13-19.el9.x86_64                                                                                                                                                            6/21
  Verifying        : libXext-1.3.4-8.el9.x86_64                                                                                                                                                             7/21
  Verifying        : libXmu-1.1.3-8.el9.x86_64                                                                                                                                                              8/21
  Verifying        : libXpm-3.5.13-10.el9.x86_64                                                                                                                                                            9/21
  Verifying        : libXt-1.2.0-6.el9.x86_64                                                                                                                                                              10/21
  Verifying        : libfontenc-1.1.3-17.el9.x86_64                                                                                                                                                        11/21
  Verifying        : libxcb-1.13.1-9.el9.x86_64                                                                                                                                                            12/21
  Verifying        : mkfontscale-1.2.1-3.el9.x86_64                                                                                                                                                        13/21
  Verifying        : fonts-filesystem-1:2.0.5-7.el9.1.noarch                                                                                                                                               14/21
  Verifying        : freetype-2.10.4-9.el9.x86_64                                                                                                                                                          15/21
  Verifying        : graphite2-1.3.14-9.el9.x86_64                                                                                                                                                         16/21
  Verifying        : harfbuzz-2.7.4-10.el9.x86_64                                                                                                                                                          17/21
  Verifying        : libpng-2:1.6.37-12.el9.x86_64                                                                                                                                                         18/21
  Verifying        : nethack-3.6.7-1.el9.x86_64                                                                                                                                                            19/21
  Verifying        : nethack-bitmap-fonts-3.6.7-1.el9.noarch                                                                                                                                               20/21
  Verifying        : nethack-bitmap-fonts-core-3.6.7-1.el9.noarch                                                                                                                                          21/21

Installed:
  fonts-filesystem-1:2.0.5-7.el9.1.noarch            freetype-2.10.4-9.el9.x86_64       graphite2-1.3.14-9.el9.x86_64          harfbuzz-2.7.4-10.el9.x86_64       libICE-1.0.10-8.el9.x86_64
  libSM-1.2.3-10.el9.x86_64                          libX11-1.7.0-9.el9.x86_64          libX11-common-1.7.0-9.el9.noarch       libXau-1.0.9-8.el9.x86_64          libXaw-1.0.13-19.el9.x86_64
  libXext-1.3.4-8.el9.x86_64                         libXmu-1.1.3-8.el9.x86_64          libXpm-3.5.13-10.el9.x86_64            libXt-1.2.0-6.el9.x86_64           libfontenc-1.1.3-17.el9.x86_64
  libpng-2:1.6.37-12.el9.x86_64                      libxcb-1.13.1-9.el9.x86_64         mkfontscale-1.2.1-3.el9.x86_64         nethack-3.6.7-1.el9.x86_64         nethack-bitmap-fonts-3.6.7-1.el9.noarch
  nethack-bitmap-fonts-core-3.6.7-1.el9.noarch

Complete!

遊ぶ!

起動方法

nethackコマンドを実行するだけで遊ぶことができます!

[yoyo@AL ~]$ nethack

この画面が出たらOKです!

NetHack, Copyright 1985-2023
         By Stichting Mathematisch Centrum and M. Stephenson.
         Version 3.6.7 Unix, built Mar 12 04:09:55 2023.
         See license for details.


Shall I pick character's race, role, gender and alignment for you? [ynaq]

yはyes,nはno,aはany,qはquitです。

aを入力してみました。

とても恰好いい導入です!

アヌールの書にはこう書かれている:

創造の後、残酷な神モロクは創造神マルドゥクの権威に反抗した。
モロクはマルドゥクから神々の最も強力な神器であるイェンダーの護符を盗み、暗いゲヘノム(地獄)の奥深くにそれを隠した。モロクは現在そこに潜み、時を待っている。

あなたの神アヌールはこの護符を手に入れ、他の神々に対して正当な優位性を得ようとしている。

あなた、新しく訓練されたエヴォーカー(呼び寄せ術師)は、アヌールの使いとして生まれつき預言されてきた存在だ。あなたはアヌールのためにこの護符を取り戻す運命にあり、またはその試みで死ぬ運命にある。あなたの運命の時が来た。私たち全員のために:勇敢にアヌールと共に行け!

少しやってみましたが・・・

                                                                                   It is written in the Book of Anhur:

                            --------------                                             After the Creation, the cruel god Moloch rebelled
                            .............|                                             against the authority of Marduk the Creator.
                            |......f....$|                                             Moloch stole from Marduk the most powerful of all
                            +.......@....|                                             the artifacts of the gods, the Amulet of Yendor,
                            --- ----------                                             and he hid it in the dark cavities of Gehennom, the
                                                                                       Under World, where he now lurks, and bides his time.

                                                                                   Your god Anhur seeks to possess the Amulet, and with it
                                                                                   to gain deserved ascendance over the other gods.

                                                                                   You, a newly trained Evoker, have been heralded
                                                                                   from birth as the instrument of Anhur.  You are destined
                                                                                   to recover the Amulet for your deity, or die in the
                                                                                   attempt.  Your hour of destiny has come.  For the sake
                                                                                   of us all:  Go bravely with Anhur!
                                                                                   --More-
Yoyo the Evoker                St:14 Dx:10 Co:14 In:18 Wi:10 Ch:9 Chaotic
Dlvl:1 $:0 HP:12(12) Pw:6(6) AC:9 Xp:1

1Fでやられてしまいました・・・

                       ----------
                      /          \
                     /    REST    \
                    /      IN      \
                   /     PEACE      \
                  /                  \
                  |       yoyo       |
                  |      125 Au      |
                  |   killed by a    |
                  |    sewer rat     |
                  |                  |
                  |                  |
                  |       2024       |
                 *|     *  *  *      | *
        _________)/\\_//(\/(/\)/\//\/|_)_______


Goodbye yoyo the Rogue...

You died in The Dungeons of Doom on dungeon level 1 with 157 points,
and 125 pieces of gold, after 603 moves.
You were level 1 with a maximum of 11 hit points when you died.

操作方法のヘルプ

初めて遊ぶ人は何をどうすればいいのか面食らうかもしれません。このゲームはキーボードだけで遊ぶので、いろんなキーにいろんなコマンドが割り当てられています。
ゲームが始まったら?を入力することで各種詳細を見ることができます。
?を入力すると・・・

      Select one item:

a - About NetHack (version information).
b - Long description of the game and commands.
c - List of game commands.
d - Concise history of NetHack.
e - Info on a character in the game display.
f - Info on what a given key does.
g - List of game options.
h - Longer explanation of game options.
i - Full list of keyboard commands
j - List of extended commands.
k - List menu control keys
l - The NetHack license.
m - Support information.
(end)

右側にこんな表示がでてきます。
ここでcを入力すると、今度は下部にこんな感じで表示されます。

y k u   7 8 9   Move commands:
 \|/     \|/            yuhjklbn: go one step in specified direction
h-.-l   4-.-6           YUHJKLBN: go in specified direction until you
 /|\     /|\                        hit a wall or run into something
b j n   1 2 3           g<dir>:   run in direction <dir> until something
      numberpad                     interesting is seen
                        G<dir>,   same, except a branching corridor isn't
 <  up                  ^<dir>:     considered interesting (the ^ in this
                                    case means the Control key, not a caret)
 >  down                m<dir>:   move without picking up objects/fighting
                        F<dir>:   fight even if you don't sense a monster
                If the number_pad option is set, the digit keys move instead.
                Depending on the platform, Shift digit (on the numberpad),
                Meta digit, or Alt digit will invoke the YUHJKLBN commands.
                Control <dir> may or may not work when number_pad is enabled,
                depending on the platform's capabilities.
                Digit '5' acts as 'G' prefix, unless number_pad is set to 2
                in which case it acts as 'g' instead.
                If number_pad is set to 3, the roles of 1,2,3 and 7,8,9 are
                reversed; when set to 4, behaves same as 3 combined with 2.
                If number_pad is set to -1, alphabetic movement commands are
                used but 'y' and 'z' are swapped.

General commands:
?     help      display one of several informative texts
--More--

ランキング

rogueもそうでしたが、nethackはランキング機能が存在します。


 No  Points     Name                                                   Hp [max]
  1        157  yoyo-Rog-Orc-Fem-Cha died in The Dungeons of Doom on
                level 1.  Killed by a sewer rat.                        -  [11]
             0  yoyo-Bar-Hum-Mal-Neu quit in The Dungeons of Doom on
                level 1.                                               16  [16]

おわりに

私はぼっちなのでできませんが、 友達や知り合いなどのユーザを作成して、みんなで遊ぶことで競うことができます。
私の大先輩なんかは学生の頃に大学に泊まり込んで、みんなでnethackをプレイしていたらしいです。

今はもっと操作性がよく、グラフィカルでリッチなUIなどを持つゲームが沢山ありますが、面白さは全く変わりません。

皆さんも連休にでもパソコン仲間と一緒にプレイしてはいかがでしょうか?

ちなみに難易度はハチャメチャに難しいです!

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?