Code Monkey home page Code Monkey logo

umoria's Introduction

Umoria

The Dungeons of Moria is a single player dungeon simulation originally written by Robert Alan Koeneke, with its first public release in 1983. The game was originally developed using VMS Pascal before being ported to the C language by James E. Wilson in 1988, and released as Umoria.

Moria/Umoria has had many variants over the years, with Angband being the most well known. Umoria was also an inspiration for one the most commercially successful action roguelike games, Diablo!

Supported Platforms:

  • Windows
  • macOS
  • Linux (Ubuntu/Debian)

Compiling and limited testing has been done for other Linux based system including NetBSD 8.1 and Fedora 32.

Umoria 5.7.x releases

The main focus of the 5.7.0 release was to provide support for the three main operating systems: Windows, macOS, and Linux. Support for all other outdated computer systems such as MS DOS, "Classic" Mac OS (pre OSX), Amiga, and Atari ST was removed.

Note: there have been no intentional gameplay changes in the 5.7.x releases.

Since the initial 5.7 release, a great deal of code restoration has been undertaken in the hope of aiding future development of the game. Some examples of the work done include reformatting the source code with the help of clang-tidy and clang-format, modernizing the code to use standard C types, breaking apart most large functions (many of which had hundreds of lines of code) into smaller, easier to read functions, and fixing all compiler warnings when compiling against recent versions of GCC and Clang.

Full details of all changes can be found in the CHANGELOG, and by browsing the commit history.

Due to its lack of Windows and macOS support Moria was inaccessible to many people. Hopefully these changes will give many more people a chance to play this classic roguelike game.

Notes on Compiling Umoria

Umoria has been tested against GCC (10 and 11) and with ncurses 6.x, although recent earlier versions should also work fine.

You will need these as well as CMake and the C++ build tools for your system.

macOS and Linux

Change to the umoria game directory and enter the following commands at the terminal:

$ mkdir build && cd build
$ cmake ..
$ make

NOTE: use make -j $(nproc) to speed up compilation on Linux.

An umoria directory will be created in the current directory containing the game binary and data files, which can then be moved to any other location, such as the home directory.

Windows

MinGW is used to provide GCC and GNU Binutils for compiling on the Windows platform. The easiest solution to get set up is to use the MSYS2 Installer. Once installed, pacman can be used to install GCC, ncurses, and the make/cmake build tools.

At present an environment variable for the MinGW system being compiled on will need to be specified. This will be either mingw64 or mingw32.

At the command prompt type the following, being sure to add the correct label to MINGW=:

$ MINGW=mingw64 cmake .
$ make

To perform an out-of-source build, type the following:

$ mkdir build
$ cd build
$ MINGW=mingw64 cmake ..
$ make

As with the macOS/Linux builds, all files will be installed into an umoria directory.

Historical Documents

Most of the original document files included in the Umoria 5.6 sources have been placed in the historical directory. You will even find the old CHANGELOG, which tracks all code changes made between versions 4.81 and 5.5.2 (1987-2008). If you'd like to learn more on the development history of Umoria, these can make for interesting reading.

There is also the original Moria Manual and FAQ. Although these are a little outdated now they are certainly worth reading as they contain a lot of interesting and useful information.

Code of Conduct and Contributions

See here for details on our Code of Conduct.

For details on how to contribute to the Umoria project, please read our contributing guide.

License Information

Umoria is released under the GNU General Public License v3.0.

In 2007 Ben Asselstine and Ben Shadwick started the free-moria project to re-license UMoria 5.5.2 under GPL-2 by obtaining permission from all the contributing authors. A year later they succeeded in their goal and in late 2008 official maintainer David Grabiner released Umoria 5.6 under a GPL-3.0-or-later license.

umoria's People

Contributors

awjackson avatar dbtick avatar eli-the-bearded avatar grimler91 avatar h3xx avatar jbrahy avatar jhirschberg70 avatar mrcook avatar omalley avatar polluks avatar russell-taylor avatar sdicke avatar steils avatar whitehara avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

umoria's Issues

CLI option for enabling roguelike keys missing

In v5.7.12 the roguelike keys mode was enabled by default and the CLI option to start moria with this mode was removed. In v5.7.14 the default was reverted back to moria mode, but the CLI option was not added back.

Would it be welcome adding this back? I'll gladly do it.

Compile on OpenBSD 7.3

Hi! i wanted to compile in OpenBSD 7.3 (latest stable) and i get the following error:

lea@latitude5480 umoria $ cd build/
lea@latitude5480 build $ cmake ..
-- Build type set to 'Release'
-- The CXX compiler identification is unknown
CMake Error at CMakeLists.txt:27 (project):
  The CMAKE_CXX_COMPILER:

    g++

  is not a full path and was not found in the PATH.

  Tell CMake where to find the compiler by setting either the environment
  variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path
  to the compiler, or to the compiler name if it is in the PATH.


-- Configuring incomplete, errors occurred!
See also "/home/lea/src/umoria/build/CMakeFiles/CMakeOutput.log".
See also "/home/lea/src/umoria/build/CMakeFiles/CMakeError.log".

i added this packages already:
doas pkg_add autoconf-2.71 gcc-11.2.0p6 gmake

i also tried with this commands with same error:
cmake .. -DCMAKE_MAKE_PROGRAM=gmake -DCMAKE_CXX_COMPILER=/usr/local/bin/eg++

Thanks for mantaining this amazing game!

mac installation

I'm having issues when I try to install this on a Mac (OS 10.10.5). I have gcc-6.3 and ncurses-6.0, and I'm getting the following error when I type in the 'make package' command:

[ 2%] Building CXX object CMakeFiles/umoria.dir/src/data_creatures.cpp.o
error: unknown warning option '-Wunsafe-loop-optimizations'; did you mean
'-Wunavailable-declarations'? [-Werror,-Wunknown-warning-option]
make[2]: *** [CMakeFiles/umoria.dir/src/data_creatures.cpp.o] Error 1
make[1]: *** [CMakeFiles/umoria.dir/all] Error 2
make: *** [all] Error 2

Any ideas?

Build fails on systems with libtinfo separate from libncurses

[100%] Linking CXX executable umoria/umoria
/usr/lib/gcc/x86_64-pc-linux-gnu/8.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: CMakeFiles/umoria.dir/src/ui_io.cpp.o: undefined reference to symbol 'keypad'
/usr/lib/gcc/x86_64-pc-linux-gnu/8.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: /lib64/libtinfo.so.6: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/umoria.dir/build.make:836: umoria/umoria] Error 1
make[1]: *** [CMakeFiles/Makefile2:73: CMakeFiles/umoria.dir/all] Error 2
make: *** [Makefile:130: all] Error 2

See also: https://bugs.gentoo.org/677672

Fails to compile on macOS using Xcode 12.5.1

I get two errors attempting to compile on macOS 11.4 using Xcode 12.5.1 (clang 12.0.5). In both cases the error is

anonymous non-C-compatible type given name for linkage purposes by typedef declaration; add a tag name here [-Werror,-Wnon-c-typedef-for-linkage]

This error occurs on Game_t in game.h and Player_t in player.h. It seems to have to do with linkage of anonymous structs. (Possibly because they embed other anonymous structs?)

Mana lost when canceling mage spells

The mana cost of a spell is still deducted when canceling a mage spell with the escape key. This is not the case with priest spells, which do not appear to subtract their cost upon canceling.

Tested on Umoria 5.7.12 and 5.7.10, Windows 32 bit build. Can be duplicated by using wizard mode and casting a spell (I tested confusion, fire bolt, frost ball, and a few others.), then hitting escape when prompted for a direction.

Haven't checked the other classes that use mage spells, but this issue presumably affects them as well.

color umoria?

Might it be possible to add in color umoria as an option? It was updated in recent years but now has two compilation errors and I haven't heard back from the uploader/maintainer...

Build failed on GCC 8.1

/home/aaron/Documents/source-packages/umoria/src/umoria-5.7.10/src/dungeon_los.cpp: In function ‘bool lookSee(int, int, bool&)’:
/home/aaron/Documents/source-packages/umoria/src/umoria-5.7.10/src/dungeon_los.cpp:530:37: error: ‘%s’ directive writing up to 159 bytes into a region of size between 149 and 152 [-Werror=format-overflow=]
                 (void) sprintf(msg, "%s %s ---pause---", description, obj_string);
                                     ^~~~~~~~~~~~~~~~~~~               ~~~~~~~~~~
/home/aaron/Documents/source-packages/umoria/src/umoria-5.7.10/src/dungeon_los.cpp:530:31: note: ‘sprintf’ output between 21 and 183 bytes into a destination of size 160
                 (void) sprintf(msg, "%s %s ---pause---", description, obj_string);
                        ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1plus: all warnings being treated as errors

Looks like the issue is that obj_string is the same size as msg, so it seems to the compiler like there would be an overflow here. If I make msg larger, I get similar errors elsewhere, and so on. Seems like a common pattern.

Incorrect FAQ info regarding poinson gas spell

This issue was submitted via email.

In the documentation, the FAQ states that There is no resistance against poison gas.
However, I see listed in the Manual the spell Resist Poison Gas. This was probably inherited from GMoria version 5.7. I'm not sure whether the spell actually exists in the current version of Umoria. If it does, then the FAQ could be updated.

How to publish a release that allows scores?

First of all, thanks so much for modernizing Umoria... I really missed this game.

I forked it and ported Colour-Umoria back in.

But when I build from source and try to publish a release, loading saved games doesn't work. It gives these messages and marks it as a Duplicate:

This character is already on the scoreboard; it will not be scored again. -more-
This save file cannot be used to get on the score board.

I can see where it checks for game.noscore but I'm not sure why that is being set to non-zero. Is there some flag I need to set when building for a release that allows people to load saved games?

Compiling via mingw64

Running MSYS2 MinGW 64-bit on my Windows 10 PC. I think I have all the compile tools installed, but I may have installed something unnecessary which is causing the following conflict.

My cmake command seems to go properly but then I get the following error on make. It looks like
a mingw64 include file "C:/msys64/mingw64/x86_64-w64-mingw32/include/winnt.h:289:15" has a typedef for INT which is conflicting with the INT in the enum in player.h.

I have not done any c++ compiling in 20 years or so.

Do I just need to somehow disinclude the winnt.h file?
Or perhaps I should remove MSYS2 and restart with a fresh install of necessary packages. If so, what are the specific packages I need.
Any help would be appreciated.

**make
Scanning dependencies of target umoria
[ 1%] Building CXX object CMakeFiles/umoria.dir/src/config.cpp.obj
In file included from C:/msys64/home/abram/umoria-master/src/headers.h:67,
from C:/msys64/home/abram/umoria-master/src/config.cpp:10:
C:/msys64/home/abram/umoria-master/src/player.h:22:5: error: 'INT' redeclared as different kind of entity
22 | INT,
| ^~~
In file included from C:/msys64/mingw64/x86_64-w64-mingw32/include/minwindef.h:163,
from C:/msys64/mingw64/x86_64-w64-mingw32/include/windef.h:8,
from C:/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:69,
from C:/msys64/home/abram/umoria-master/src/headers.h:19,
from C:/msys64/home/abram/umoria-master/src/config.cpp:10:

C:/msys64/mingw64/x86_64-w64-mingw32/include/winnt.h:289:15: note: previous declaration 'typedef int INT'
289 | typedef int INT;
| ^~~
make[2]: *** [CMakeFiles/umoria.dir/build.make:83: CMakeFiles/umoria.dir/src/config.cpp.obj] Error 1
make[1]: *** [CMakeFiles/Makefile2:96: CMakeFiles/umoria.dir/all] Error 2
make: *** [Makefile:104: all] Error 2**

Heroism potion failed

Level 3 dwarven priest, taking around 6 damage per turn from the two centipede attacks, down to 2 HP. I drink a potion of heroism. From what I understand it gives +10 HP. However, the centipede kills me with the next attack.

Casting spell turns monsters into walls

When casting Stinking Cloud spells against Giant Glowing Rats they sometimes get turned in to walls. There is also other strange behaviour such as the @ disappearing, or being exchanged onto the other creature. I've also seen an item in the room suddenly being shows with a r tile.

This seems to be related to the recent Pass by Reference refactoring efforts, and is triggered by this commit: d2b34d4

Punctuation error on character generation screen

(This was an issue submitted via email)

I'm running this via the terminal on Windows (latest version of Umoria) and there's no punctuation mark between the parentage and family standing lines:

Character Background
You are one of several children You are a well liked child. You have dark brown eyes, wavy brown hair, and an average complexion.

On this re-roll, the human character's social class is only 9, so maybe the lack of stated parentage (serf, landed knight, etc.) indicates that I'm unacknowledged. If this were the case, though, wouldn't it just say: "You are one of several children. You are a well liked child."? It makes me think that something isn't printing out that should be.

Keypad does not seem to be working on Windows 10

The keypad doesn't appear to be working correctly in Windows 10 (version 2004).

With Num Lock on every key opens the Repeat dialog with the corresponding number. With Num Lock off the keypad buttons do various things like browse books, run in a direction, open the mini-map, etc.

Edge case causes destruction of primary weapon

When I have a full inventory (a-v), I have two sets of bolts (or arrows), and I shoot and miss a monster and then pick up one of the bolts sometimes my inventory shows it as a single bolt and my inventory has an extra entry (a-w). When I finally get this sorted out, my primary weapon has disappeared.

The disappearing primary weapon has happened to me on at least 2 characters (and at least twice on one) but this was the first time I caught it in the act.

GFX glitch with inventory menu in Town level

This bug was submitted via email:

When dropping items in town, right after dropping the first item, the action menu was still functioning. The first line of the message "You are carrying 80.7 pounds. In your pack there is -" was there, but the list of "more" items that could be acted upon got overwritten by the town structures. This happened only once and I could not replicate again the bug.

better/classic wall characters?

Moria looked better in 1990s when I played it on DOS (than on UNIX/GNU/Linux) because used an extended ASCII block character for walls. Some roguelikes revived this style with unicode. Would it be possible to make this standard or option? I know Moria also has a command to identify map character, and someone might type '#' but unless they want for some reason (and it says 'wall') I don't think that's necessary. Hash/pound character just looks horrible for walls and feels harder to look at and play than when it had solid/connected walls.

wizard mode partly broken

If one plays an elf ranger in wizard mode (I also used <CTRL>e to maximize everything including speed) hunger occurs almost every other action/movement so you die fast, making the game almost unplayable in that mode. It didn't happen as other characters such as human warrior (after maximizing everything including speed). I don't know if it happens with other races & classes.

options are not saved.

Sorry if it is an error on my part in compiling.

out of source compile of version 5.7.11

use = to change rogue like commands from yes to no
restart and rogue like commands is set to yes again.

in attempt to find the problem I tried the following with the corresponding results.

umoria -n creates a new game with rogue like set to yes
umoria -r opens game with rogue like set to yes

If it is an error on my part please advise.

I thank you for your work on this great project.

truly,
--gary

error: array subscript 66 is above array bounds of ‘Tile_t [66][198]’ [-Werror=array-bounds]

This happens on Slackware64 15.1-current.

d@cosmos:~/math/src/games/roguelike/moria_angband_tome/umoria$ make
Consolidate compiler generated dependencies of target umoria
[  1%] Building CXX object CMakeFiles/umoria.dir/src/game_save.cpp.o
/home/d/math/src/games/roguelike/moria_angband_tome/umoria/src/game_save.cpp: In function ‘bool loadGame(bool&)’:
/home/d/math/src/games/roguelike/moria_angband_tome/umoria/src/game_save.cpp:810:29: error: array subscript 66 is above array bounds of ‘Tile_t [66][198]’ [-Werror=array-bounds]
  810 |                 if (tile >= &dg.floor[MAX_HEIGHT][0]) {
      |                             ^~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/d/math/src/games/roguelike/moria_angband_tome/umoria/src/headers.h:59,
                 from /home/d/math/src/games/roguelike/moria_angband_tome/umoria/src/game_save.cpp:8:
/home/d/math/src/games/roguelike/moria_angband_tome/umoria/src/dungeon.h:55:12: note: while referencing ‘Dungeon_t::floor’
   55 |     Tile_t floor[MAX_HEIGHT][MAX_WIDTH];
      |            ^~~~~
cc1plus: all warnings being treated as errors
make[2]: *** [CMakeFiles/umoria.dir/build.make:370: CMakeFiles/umoria.dir/src/game_save.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/umoria.dir/all] Error 2
make: *** [Makefile:91: all] Error 2

scores.dat File in Repository Not Empty

The scores.dat file in the repository appears to contain the score from a test character named test, a human mage killed by interrupting. I'm thinking this was inadvertently added to the repository.

List of Inventory Items Blank After Dropping Item

I am playing version 5.7.15 on Ubuntu 20.04.2 LTS using the Umoria keyboard layout.

To recreate the issue, display the character's inventory with the "i" command. Then use the "d" command to drop an item (it doesn't matter which item). Since this consumes a turn, the monsters will update after dropping the item. If the update causes screen_has_changed to be set to true, then the game attempts to display the character's remaining inventory, but the list of items is blank. I have attached a screenshot to show the incorrect behavior. I've also attached a save file that should make it easy to expose the bug. Simply load the file and follow the steps above.

While having a blank list of inventory items is incorrect, I believe the real bug may be that the game shouldn't attempt to display the remaining items at all. Instead, I believe the game should be querying the player to continue with the inventory command. This is what happens if the player wields an item from the inventory screen ("i" followed by "w" followed by selecting an item) and screen_has_changed is set to true.

I believe that this issue can be fixed by removing all references the variable recoverScreen in ui_inventory.cpp. I've attached a corresponding update to ui_inventory.cpp.

Moria Inventory Bug

game.sav.zip

ui_inventory.cpp.zip

Error in Definition of character_backgrounds Array

I am playing version 5.7.15 on Ubuntu 22.04.1 LTS using the Umoria keyboard layout.

Somewhere along the line, a bug was introduced into the definition of the character_backgrounds array. character_backgrounds[127] is currently defined as

{"of a Royal Blood Line. ", 100, 2, 3, 140},

Based on my understanding of the code, this entry is meant for generating histories for Humans and Half-Elves (chart value of 2, next value of 3), In its current location in the array, this data will never be used. This entry should be moved to character_backgrounds[10]. If you look at the equivalent background array in versions up through 5.2, you'll see that's where it's located.

In 5.7.15, if you happen to roll 100 when generating the portion of the history for a Human or Half-Elf that comes from chart 2, the code falls through to chart 3 and it's entry for a roll of 100, character_backgrounds[12] in 5.7.15. Thus, the character will never have the associated parentage and social class modifier and will always be "a well liked child."

I can submit a pull request with the fix, if you'd like.

STR variable not behaving properly for Elf mage

Running an Elf Mage in uMoria 5.7 and STR has always been 4 despite having been bitten by a variety red beasties which say they have "weakened" my Elf numerous times. I was thinking that 4 must be the minimum STR value. Today I found a Ring of Strength (+1) but once I put this ring on, my STR value was reduced to 2. Thinking this ring was cursed, I took it off but STR was reduced to 1. This made carrying my wands etc very difficult as the load exceeded my strength. Putting the ring back on made STR 2 again.
Looks like a bug to me.

[Info] Does not build with gcc-11.1

Greetings. I maintain https://aur.archlinux.org/packages/umoria/ currently.
The build instructions are in the PKGBUILD on there, if you're particularly curious.

I was troubleshooting a failure to build in Arch, but fortunately before posting this I tested my previous builds and found they no longer worked. Some troubleshooting finally led me to see that when I last built I actually had gcc 10 still, which was the issue.
I therefore specified the variables CC and CXX to fix this issue- and it STILL didn't work because CMakeLists.txt has g++ hardcoded, so switching it to use g++-10 to get around this issue required a minor patch.

When running make with gcc-11.1 I consistently get the following error:

[ 42%] Building CXX object CMakeFiles/umoria.dir/src/game_save.cpp.o
/home/rojikku/GITS/AUR/umoria/gittest/umoria-5.7.15/src/game_save.cpp: In function ‘bool loadGame(bool&)’:
/home/rojikku/GITS/AUR/umoria/gittest/umoria-5.7.15/src/game_save.cpp:810:29: error: array subscript 66 is above array bounds of ‘Tile_t [66][198]’ [-Werror=array-bounds]
  810 |                 if (tile >= &dg.floor[MAX_HEIGHT][0]) {
      |                             ^~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/rojikku/GITS/AUR/umoria/gittest/umoria-5.7.15/src/headers.h:59,
                 from /home/rojikku/GITS/AUR/umoria/gittest/umoria-5.7.15/src/game_save.cpp:8:
/home/rojikku/GITS/AUR/umoria/gittest/umoria-5.7.15/src/dungeon.h:55:12: note: while referencing ‘Dungeon_t::floor’
   55 |     Tile_t floor[MAX_HEIGHT][MAX_WIDTH];
      |            ^~~~~
cc1plus: all warnings being treated as errors
make[2]: *** [CMakeFiles/umoria.dir/build.make:370: CMakeFiles/umoria.dir/src/game_save.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/umoria.dir/all] Error 2
make: *** [Makefile:91: all] Error 2

Hopefully, anyone else who experiences this issue will be able to search the reported error and realize it can be solved by using gcc10 instead of gcc11.

I do not know enough about CMake to say if you should make any improvements there, or nearly enough about C++ to suggest if you should make this compatible with gcc11, so consider this issue purely informative.

Turning on discussions?

Any thoughts on turning on discussions for this repo? Might be better then opening issues? 🤷🏽‍♂️

I was looking at the project tasks, and had some ideas on setting them up as milestones , and then breaking them down into issues and such.

Just a thought.
Thanks, and have a great day.
Russ

100% CPU load with game locked up for (at least) hours

Every once in awhile, the CPU load goes to 100% and the game stays locked up for at least hours. Had previously encountered a brief version of this followed by a report of monsters being optimized. I presume that was caused by some sort of replicating flea or louse causing too many of itself and needing to be cleaned up. I don't know that this is the same cause as the essentially infinite lock, up but it seems likely.

This has happened fairly deep in the dungeon for me, so maybe it is some creature that shows up at larger depths.

This is on the mac, if it matters. I'll try to recompile in debug mode and attach a debugger the next time it happens.

sprintf deprecated

Building on MacOS Ventura 13.2
Apple clang version 14.0.0 (clang-1400.0.29.202)
Target: x86_64-apple-darwin22.3.0

error: 'sprintf' is deprecated: This function is provided for compatibility reasons only. Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Werror,-Wdeprecated-declarations]

required building with:

CMAKE_CXX_FLAGS+="-Wno-deprecated-declarations"

Display of "To AC" and "Total AC" are switched

When displaying the character's stats, the To AC and Total AC are using each others values (https://github.com/dungeons-of-moria/umoria/blob/master/src/misc3.cpp#L944-L945):

printHeaderNumber("+ To AC     ", py.misc.dis_tac, 11, 1);
printHeaderNumber("  Total AC  ", py.misc.dis_ac, 12, 1);

The comments on the struct fields are:

int16_t dis_ac;              // Display +ToAC
int16_t dis_tac;             // Display +ToTAC

The assumption here is that ToTAC means Total AC.

The same happens when writing the character sheet to a file: https://github.com/dungeons-of-moria/umoria/blob/master/src/files.cpp#L202-L205. At this point I'm not sure if other calculations made with these are actually correct.

This mixup exists in the original Umoria 5.6 source code (https://github.com/HunterZ/umoria/blob/master/source/misc3.c#L1021-L1022) so it looks to be a long standing error.

Disable roguelike commands by default

Just a suggestion, I really think it was a mistake to enable them by default. It's a big deterrent to new players.

Even I, as somebody who played Moria for years, had difficulty remembering how to toggle them off.

I've shared the game on another roguelike's forum (Attnam.com - forum for Iter Vehemens ad Necem), and the 2 people who have tried it both expressed their confusion about why their numpad didn't work, and I had to guide them on how to disable roguelike commands.

I also saw a thread on Reddit recently where somebody had the same confusion.

I think if past experienced players (myself) and experienced roguelike players (folks on my forum / folks who use roguelike subreddits) are having confusion with this, it was a mistake.

Program fails to compile on Fedora 32 Linux

/home/alansmith/Documents/umoria/umoria-master/src/ui_io.cpp:613:17: error: writing 1 byte into a region of size 0 [-Werror=stringop-overflow=]
613 | user[i] = '\0';
| ~~~~~~~~^~~~~~
/home/alansmith/Documents/umoria/umoria-master/src/ui_io.cpp:604:14: note: at offset 128 to object ‘user’ with size 128 declared here
604 | char user[128];
| ^~~~
cc1plus: all warnings being treated as errors
make[2]: *** [CMakeFiles/umoria.dir/build.make:720: CMakeFiles/umoria.dir/src/ui_io.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:96: CMakeFiles/umoria.dir/all] Error 2
make: *** [Makefile:104: all] Error 2

I get this error when trying to compile the program on fedora 32. Is there a workaround available to fix this and let the program finish compiling?

Incorrect GPL Version Reference in Help Message

I am playing version 5.7.15 on Ubuntu 20.04.2 LTS using the Umoria keyboard layout.

When executing umoria with the -h command-line option, the following prints to the screen:

Robert A. Koeneke's classic dungeon crawler.
Umoria 5.7.15 is released under a GPL v2 license.

Usage:
    umoria [OPTIONS] SAVEGAME

SAVEGAME is an optional save game filename (default: game.sav)

Options:
    -n           Force start of new game
    -d           Display high scores and exit
    -s NUMBER    Game Seed, as a decimal number (max: 2147483647)

    -v           Print version info and exit
    -h           Display this message

Note that line 2 says "Umoria 5.7.15 is released under a GPL v2 license." It should read "Umoria 5.7.15 is released under a GPL v3 license." Changing v2 in line 87 of main.cpp to v3 should fix the issue.

typo

Didn't see where to email umoria.org, but a page title has typo: A Hisotry of Moria - A Classic Roguelike.

Also, I thought I commented on your project before (asking if it was official) but can't find that post now, but it's good to see some bugs fixed. I wonder if the official maintainer will let you take over, or if there will be separate C (outdated) and C++ (bugfixed) versions. Since maybe 1993, (U)Moria has been my favourite videogame that you play a person, maybe my top favourite of all, or it shares the place with Tetris. So, I might make a SlackBuild (so people can build an unofficial package for Slackware) for your version, but already do one for the official version, and it'd only work to have one one or the other installed to run, but that'd be okay.

Cygwin: headers.h "Unknown compiler" error

Trying to compile the latest Umoria code in the latest Cygwin under Windows 11, I get an error:

$ make
Consolidate compiler generated dependencies of target umoria
[  1%] Building CXX object CMakeFiles/umoria.dir/src/config.cpp.o
In file included from /home/smbhax/umoria/src/config.cpp:7:
/home/smbhax/umoria/src/headers.h:28:5: error: #error "Unknown compiler"
   28 | #   error "Unknown compiler"
      |     ^~~~~
make[2]: *** [CMakeFiles/umoria.dir/build.make:76: CMakeFiles/umoria.dir/src/config.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/umoria.dir/all] Error 2
make: *** [Makefile:91: all] Error 2

(I found I am able to avoid the error with the following crude workaround in my src/headers.h:

  • comment lines 21, 27, 28
  • add "#else" as line 22

which changes

#ifdef _WIN32
    #define _CRT_SECURE_NO_WARNINGS
    #define _CRT_NONSTDC_NO_DEPRECATE
    #define WIN32_LEAN_AND_MEAN

    #include <windows.h>

    #include <io.h>
    #include <sys/types.h>

#elif __APPLE__ ||  __linux__ || __NetBSD__ || __MORPHOS__

    #include <pwd.h>
    #include <unistd.h>
    #include <sys/param.h>

#else
#   error "Unknown compiler"
#endif

to

#ifdef _WIN32
    #define _CRT_SECURE_NO_WARNINGS
    #define _CRT_NONSTDC_NO_DEPRECATE
    #define WIN32_LEAN_AND_MEAN

    #include <windows.h>

    #include <io.h>
    #include <sys/types.h>

//#elif __APPLE__ ||  __linux__ || __NetBSD__ || __MORPHOS__
#else
    #include <pwd.h>
    #include <unistd.h>
    #include <sys/param.h>

//#else
//#   error "Unknown compiler"
#endif

)

Add .clang-format

Thank you so much for the 5.7 release! Great work. Can you please add a .clang-format file containing the formatting options used to format the source code? This will allow other developers to maintain the existing style while hacking on the code base. If you did not use such a file during the conversion you can create one by using the same clang-format cli options ending with "-dump > .clang-format" I think.

Scores ranking/points not displaying correctly

The ranking order is not displayed correctly when viewing the scores file. The points are not being assigned to the correct player entry.

note: I may not fix this, but just wait until the new saved game and scores file handler library I'm writing is finished.

Kill EXP not calculated correctly

Bug submitted via email:

"I’m playing with version 5.7.4 on Mac OS Sierra 10.12.6.
I experience an issue with gaining experience: For most lower level monsters, I get the experience as shown in the monster info when I (r)ecall („worth x points for a level 35 character“). But when it comes to higher level creatures I get way less points than shown in that info, e.g. an ancient red dragon should be something with 3xxx, but I get 1xxx, I get maybe 100Exp. for an Emperor Lich instead of 11000. Even the AMHD just brought a few hundred
Can you determine what causes this?"

Incorrect Description When Dropping Multiple Items

I am playing version 5.7.15 on Ubuntu 20.04.2 LTS using the Umoria keyboard layout.

If you have multiple of the same item and attempt to drop them, a . is being inserted into the description that shouldn't be there. For example, say you have 5 rations of food in inventory slot a. If you type d to initiate a drop command followed by a to select inventory slot a you see this message:

"Drop all 5 Ration. of Food? [y/n]"

There is a . in place of the s in Rations. I would expect the message to be

"Drop all 5 Rations of Food? [y/n]"

The culprit seems to be line 822 of ui_inventory.cpp in the executeDropItemCommand function. There is no comment about what this line is supposed to be doing, and from my brief examination of the code, it seems like it should just be deleted. It doesn't seem like there would be a scenario where you'd want to overwrite a character in the middle of the description with a period, but again, I don't know the code that well.

Bug with trap being picked up

I apologize for not having full details and steps to reproduce and everything, but I am lasy. Hopefully someone else will give more details and this will serve as a starting point. I was playing Moria and I saw a trap and figured maybe it was a teleport trap and decided to walk into it (not the best strategy but don't judge me). I was scared it might be one of those traps that damages your equipment so I first took off all my equipment.

Anyway, I stepped on the trap and it was the one that summons a bunch of monsters. I put my equipment on one by one and then moved and the trap wasn't there any more. Whatever, I killed all the monsters and went on with my life. But then later I wanted to pray and I noticed that a was no longer my prayer book. I looked at my inventory and instead it was an item called "Error in objdes()". I went and dropped it and it showed up as a ^ and when looking at it it says "You see Error in objdes()"

I don't know if this is related to the bug or if something in the game actually does this, but my Charisma went down to 3 at some point as well. And not 3 with the regular number next to it and I need to drink a potion to get back my Charisma, but straight up 3.

I hope all this is enough information to find and fix the bug.

Disable Haggling option

In the manual, under options, there is an option to disable haggling:

Disable haggling. This is off by default. When on, all haggling will be disabled at the cost of a 10 percent tax on the final price on items you would otherwise have had to haggle for, and all prices displayed in the stores will be the actual prices you have to pay.

This does not seem to be in the code currently, but you can see it was at some point. I had added this feature when I added color to 5.6, and again recently. Before submitting, is this a PR you are interested in?

more mac installation issues

Okay, now I have some new (different) issues. When I try to run the 'make packages' command, I now get this error:

/Users/.../umoria-master/src/death.cpp:399:4: error: function declared
'[[noreturn]]' after its first declaration
[[ noreturn ]] void exitGame() {
^
/Users/.../umoria-master/src/externs.h:166:6: note: declaration missing
'[[noreturn]]' attribute is here
void exitGame();
^

I tried modifying line 166 in externs.h to add the noreturn attribute in the function declaration (I've added in spaces before/after attribute to preserve underscores here, but they aren't in the code):

void exitGame() __ attribute __((noreturn));

But I still got the same error; I'm not sure if I have the syntax wrong or there's something else I'm missing?

Mana not lost when failing spell as priest or paladin

When casting priest spells mana is not lost on a failed casting. Issue tested on v 5.7.10 and 5.7.11, Windows build, moria (non-rogue) keyset. Problem can easily be reproduced using wizard mode and attempting to cast high-fail rate spells such as holy word. This also affects paladins. Mage spells are not affected by this bug, and subtract the mana cost on a failed casting per expected behavior.

Adding Support for Playing in a Browser

For the past couple months I've been spending my spare time trying to make Umoria run in a browser using emscripten to compile to WASM. I'm not the first to do this (see Donnie Russell's port here) but my approach and intent (I believe) are different.

  1. Minimize changes to the code base. I think I've been reasonably successful with that, as I've only had to modify three headers and two cpp files from the current code base. The modifications consist of #ifdefs around small sections of code. I also added one new header, two new cpp files, a javascript file and an HTML file.

  2. Use javascript and HTML for the IO. Donnie Russell's version uses SDL, which is supported in emscripten and may be the better choice. Rather than duplicate his efforts, I figured I'd go the route of using what a browser provides natively to see if it would work. It seems to. I do see some slow down when there are a large number of monsters on the screen. I need to do more profiling, but I don't think that's due to rendering or handling input. WASM doesn't run as fast as native code, so slower performance is to be expected.

  3. Duplicate native look and feel. Aside from the aforementioned slow downs with a large number of monsters onscreen, I believe the game plays very much like a native build. I implemented a bell sound in browser for the terminalBellSound() function, as well as a cursor. Command line arguments work through URL query parameters.

  4. Create a universal "executable". While what I've put together could be hosted on a server, I was looking at it as more of a cross-platform "executable" that will run on any platform with a modern browser. The build process creates a single HTML file that you load in the browser. Scores and save files are stored in IndexedDB. I've played in Firefox, Chrome and Opera on Linux and Chrome and Edge on Windows, and so far things seem to be functioning properly. I don't have access to a Mac to try Safari. In theory, building for a browser allows you to pick your platform of choice for development, build once and have cross-platform compatibility from that single build. I've confined myself to Linux on a PC for development, so I can't speak to what it would take to build on other platforms.

Aside from the fun I've had working on this, and what I've learned, my hope is that my changes might become part of the repository. Obviously, that's ultimately up to @mrcook, but rather than just submit a pull request, I thought I'd post here to see if anybody has any interest/opinions. If it turns out that this would work better as a fork, then that's fine with me.

Monsters healing above maximum health

Looking at the drain mana functionality around line 812 of monster.cpp, it appears there is no check to prevent a monster from going above maximum health with this spell, at least as far as I can see? I am unsure of whether this is intended behavior, but felt it was worth opening an issue in case it was not since this seems potentially unintuitive.

(Though amusing I must admit.)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.