Commit 29f69fc7 authored by Chris R's avatar Chris R 👍
Browse files

Release 2.2.0; MS Windows port, native windowing support and more.

This version adds:

- Support for native (non-Cygwin) Microsoft Windows
- Can now use OS windows instead of a terminal (via SDL and PDCurses)
- Colouring is now much more configurable
- Many more tweaks, bug fixes and code quality improvements.

See Changes.md for a complete list.

Note that save files from 2.1.x or earlier are not compatible with
this version.
parent e30d5021
......@@ -11,15 +11,16 @@ the Larn source code. It is currently maintained by Josh Brandt who
took it over in 2001.
iLarn by Bridgit Spitznagel (aka i0lanthe) was derived from Ularn in
the early 2000s as a version of Ularn for PalmOS devices.
ReLarn was written by Chris Reuter between 2010 and 2019. It was
derived from Ularn version "1.15ish" dated "16 November 2001" with
some elements taken from iLarn.
the early 2000s as a version of Ularn for PalmOS devices. Some ideas
and code snippets were stolen from it.
Line-of-sight code was written by Greg McIntyre via "libfov", most of
which is included here.
ReLarn was written by Chris Reuter between 2010 and 2020. It was
derived from Ularn version "1.15ish" dated "16 November 2001" with
some elements taken from iLarn.
These are all of the contributors that I know of; there are likely
many others.
......
......@@ -3,6 +3,113 @@
Note that spoilery changes are listed in a following section if you
wish to avoid them.
## Changes in 2.2.0
Now supports native Microsoft Windows as a platform. All Hail the
MinGW and MSYS teams.
Now builds as a native windowed application in addition to running on
a TTY (i.e. console). All Hail the PDCurses and SDL teams. TTY mode is
still supported on non-Windows platforms.
Now lets you select colours for various elements in the relarnrc file.
In addition, there is now a nice set of default colours. There is
also now a "dark-screen" option to improve colouring on light-on-dark
displays.
The town is now completely visible (it's daylight, after all) and
looks a bit more pleasant.
You can now scroll back on the message pane to see older messages.
Backspace now works as expected when entering numbers or other text.
When a displayed statistic changes (e.g. STR, Max HP), the stat is
temporarily displayed in bold or reverse-video to make it more
noticable.
The challenge level system is now deprecated. The `-c` option is now
gone and challenge level is no longer displayed in the final message.
(It's still available in relarnrc and still affects your score.)
Added config option 'gui-email-client:'; like 'email-client:' but only
used by the SDL-based build. This lets you specify a different email
client (or the same one but in an xterm) when there isn't a TTY
present.
Option 'no-introduction' is ignored if the user interactively created
a character. In addition, the `-n` option has been removed.
Cleaned up the way the basic stats are managed. This is a code
quality fix but may <strikeout>reduce cheating</strikeout>introduce
subtle changes in stat modification in some corner cases.
Successfully casting a spell will now always result in a descriptive
message.
The savefile ID is now less fragile. Rebuilding on a system with an
updated kernel should no longer break savefile compatibility.
Renamed spell "Invulnerabilty" to "Invulnerable Globe". This seems
implied by some variable names and makes for better lore.
Rewrote the Sphere of Annihilation code to make it simpler and to
simplify saving.
Fixed a bug where the Explorer's Guild Membership Certificate would
declare that the player had defeated **REDACTED** even when they
hadn't.
Generating the Diagnostic file (a debugging aid) no longer creates new
levels.
The ziller has now been renamed to its more common name, 'zill'. (A
zill is a large carnivorous mustelid; its smaller cousin is known as
the 'wee zill'.)
The Genocide spell is now Banishment. Mechanically, it's exactly the
same but magical banishment fits the lore better and is less
abhorrent.
Corrected the spelling of "jaculus". (Was using the Latin plural
"jaculi".)
Fixed the formatting on some messages.
End-of-game email messags now put the current date in the `mbox`
separator; this was leading to incorrect dates on some email clients.
### Spoilery Changes
Permanence no longer applies to "Hold Monster".
Bug fix: the damage modifier from your current weapon is no longer
added to magical ranged attacks (e.g. magic missile).
Lemmings are now much less annoying after a few experience levels,
just enough to get the full Lemming Experience but not enough for it
to get old.
Destroying certain objects with Spheres of Annihilation will now have
more consequences: destroying Home loses the game immediately, the LRS
office adds $2000 to your outstanding tax bill and the University
revokes your degree (i.e. mark a course as not taken) and (attempts
to) delete your diploma if you've graduated.
The Diploma now makes you a little more money. It will now not work
if you don't have all of your courses. (This can happen if you drop
the diploma, destroy the University with a Sphere of Annihilation and
then pick it up again.)
Now smarter about keeping track of which level numbers the player
knows after a random level teleport, trap door or other events that
can send them to an unidentified level of unknown depth. If the
player can deduce the depth of previously unknown levels, the game
will now reveal them.
Changed the way Create Monster finds a free spot to place the monster
so that it's a bit more random.
## Changes in 2.1
Broke savefile compatibility with 2.0.
......@@ -62,8 +169,8 @@ through them.
Praying at an altar can now (very, very rarely) teleport you back to
the town with the Potion of Cure Dianthroritis, effectively winning
the game. (True fact: this could actually happen in 2.00 as the
result of a bug.)
the game. (True fact: this (instantly winning while praying) could
also happen in 2.00 as the result of a bug.)
Haste-self now decreases the passage of time by half. (It used to
stop the counter completely; this meant that permanent haste-self
......@@ -77,11 +184,11 @@ on it. This is because the action menu gets suppressed if you haven't
moved and bringing it up requires an explicit look (via ','), which
consumes a turn.
Made lemmings much easier to kill (and therefore less annoying) by
increasing their AC. (Recall that lower AC is better.)
Made lemmings somewhat easier to kill. (I mean, it's a good feature
but it gets old fast.)
The spell "Time Stop" was not stopping the turn counter from
advancing.
advancing. It does now.
It is no longer possible to walk through a closed door when "Time
Stop" is in effect.
......
ReLarn is Copyright (C) 1986-2019 by The Authors.
ReLarn is Copyright (C) 1986-2020 by The Authors.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......
# ReLarn
ReLarn is a fork of the the classic Roguelike game Ularn that improves
the user interface and refactors the source code to be more
maintainable and better suited to the modern world. The code has been
modularized with OS- and UI-dependencies abstracted away, all warnings
have been fixed, arrays replaced with structures and more.
ReLarn is an old-school Roguelike game based on ULarn. The source
code was forked from Ularm 1.5-ish and extensively refactored to be
more maintainable and better suited to the modern world.
The goal is to preserve the spirit of the original game on modern
computers.
The code has been modularized with OS- and UI-dependencies abstracted
away, all warnings have been fixed, arrays replaced with structures
and more. In addition, there have been a number of quality-of-life
improvements to the game and its interface as well as a few lore and
gameplay tweaks.
The goal of this project is to preserve the spirit of the original
game on modern computers.
See [Changes.md](Changes.md) for a more complete summary of changes.
* [Website](http://relarn.org)
* [Github](http://github.com/relarn/relarn)
* [Gitlab](https://gitlab.com/relarn/relarn)
## Getting Started
ReLarn should be easy to build on any sufficiently Unix-like system.
If it doesn't work out of the box, the build scripts are just small,
hand-written Makefiles and shell scripts so they're easy to fix.
It has been successfully built on Ubuntu Linux, Raspbian on a
Raspberry Pi 3, macOS with MacPorts, and Cygwin on Windows 7.
### Prerequisites
To build ReLarn, you will need:
* gcc, clang or some other C compiler that supports C99 and the common
Unix compiler arguments.
* ncurses version 6 or better. (Earlier versions may also work.)
* GNU Make
* `bash`
* Perl 5 (optional; `pod2html` is used to generate the man page)
* The common Unix utilities.
These should all be installed by default or easily available to your
package manager. For example, on Ubuntu, the following command is
all you need:
sudo apt-get install libncurses-dev gcc make perl
Note that the Makefile uses a bunch of Unixy compiler options so
(e.g.) Visual C won't work out of the box. It may be possible to
hack up the make scripts until it works, but that's not going to be
easy.
### Configuration
For a program the size of ReLarn, automatic configuration systems
(e.g. CMake or autoconf) tend to be more trouble than they're worth;
instead, you configure ReLarn by editing the file `src/config.mk`.
Simply set `INST_ROOT` to the place you wish the game installed.
INST_ROOT = /usr/local/games/
The default location is `~/apps/relarn`; if that's sufficient for you,
you don't need to do anything else.
### Building and Installing
Once configuration is done, simply do the standard `make` and `make
install` in `src/`:
cd src
make RELEASE=yes
make RELEASE=yes install
And there you go.
### Building a Binary Release
You can also build a tar archive containing the playable game. This
doesn't need `INST_ROOT` to be set at all. Simply run make:
cd src
make RELEASE=yes
make RELEASE=yes distbin
This will place the archive in the project root directory.
Pre-built binaries for the major platforms (and Windows) should now be
available from [the website](http://relarn.org) so the easiest route
is probably to just snag one of those and unzip it somewhere.
You should probably also at least skim [the manual](doc/relarn.pod).
### When It Doesn't Work
If you want to build it yourself, directions are [here](doc/BUILD.md).
If `make` fails with an error message like
config.mk:43: *** No settings for FooOS-bar_arch. Stop.
## Installing
you will need to add your platform to the list of supported OS-CPU
pairs in `config.mk`. It's probably sufficient to copy one of the
Linux sections.
ReLarn typically follows the standard Unix file layout (`bin/`,
`lib/`, `share/`, etc.) so you could just `make install` or untar into
(e.g.) `/usr/local/` on your *nix system. I generally don't recommend
this because saved games are not compatible across significant version
changes so keeping the old version around gives you a shot at
finishing it.
If it's no that, you'll need to debug it yourself. Sorry. Feel free
to contact me if you can't get it working or to submit a patch or pull
request if you do.
My preferred scheme is to put in /usr/local/apps/relarn-<version>/ and
then symlink the `relarn` file to somewhere in my path.
## Contributing
......@@ -123,7 +64,7 @@ decades so it's impossible to track down everyone.
## License
This project is licensed under the GNU General Public License. See
[Copyright.txt](Copyright.txt) and [LICENSE.txt](LICENSE.txt) for
details.
This project is licensed under the GNU General Public License
version 2. See [Copyright.txt](Copyright.txt) and
[LICENSE.txt](LICENSE.txt) for details.
#!/bin/bash
# Windows+MSYS: Copy all non-system shared libraries that relarn.bin
# depends on. Used for creating redistributable binary packages.
set -e
function get_deps_for() {
local bin="$1"
echo "Scanning $bin..."
ldd $bin | \
perl -ne '/=>\s*(\S+)\s+\(/ && print "$1\n"' | \
while read lib; do
[ "${lib:0:6}" = "/mingw" ] || continue
if [ -f "$(basename $lib)" ]; then
echo "Already have $lib"
else
echo "Copying $lib"
cp $lib .
fi
done
}
get_deps_for ./relarn.exe
nlibs=""
while true; do
compgen -G '*.dll' || break
for lib in *.dll; do
get_deps_for $lib
done
nnlibs=$(ls -1 *.dll | wc -l)
if [ "$nnlibs" = "$nlibs" ]; then
break
fi
nlibs=$nnlibs
done
#!/bin/bash
# macOS: Copy all non-system shared libraries that relarn.bin depends on.
#
# Warning: this works by excluding certain paths so it's possible that
# I haven't been thorough enough and you're getting system libs. So
# check on that.
set -e
function get_deps_for() {
local bin="$1"
echo "Scanning $bin..."
otool -L "$bin" | tail -n +2 | sed -e 's/^[ ]*//' -e 's/ .*//' | \
while read lib; do
(echo $lib |grep -q '^\(/System\|/usr/lib\)' ) && continue
if [ -f "$(basename $lib)" ]; then
echo "Already have $lib"
else
echo "Copying $lib"
cp $lib .
fi
done
}
get_deps_for ./relarn.bin
nlibs=""
while true; do
compgen -G '*.dylib' || break
for lib in *.dylib; do
get_deps_for $lib
done
nnlibs=$(ls -1 *.dylib | wc -l)
if [ "$nnlibs" = "$nlibs" ]; then
break
fi
nlibs=$nnlibs
done
......@@ -8,7 +8,10 @@ set -e
INST_ROOT="$1"
bin="$2" # Filename extension for the binary
sh_ext="$3" # Filename extension for the launcher script
is_dist="$3" # Non-empty if creating a binary distribution
sh_ext="$4" # Filename extension for the launcher script
is_windows="$5" # Non-empty if targetting plain (non-Cygwin) Windows
LIBDIR="$INST_ROOT/share/relarn/lib"
DOCDIR="$INST_ROOT/share/relarn/doc"
......@@ -25,9 +28,11 @@ fi
# Create the data directory and copy over the game data
mkdir -p "$LIBDIR"
for d in Umaps Ufortune Uhelp Uintro Ujunkmail; do
for d in Umaps Ufortune Uhelp Uintro Ujunkmail relarnrc.sample \
icon/relarn-icon.bmp
do
cp ../data/$d "$LIBDIR"
chmod 664 "$LIBDIR/$d"
chmod 664 "$LIBDIR/`basename $d`"
done
# Create the score directory and empty scorefile.
......@@ -41,27 +46,46 @@ mkdir -p "$EXEDIR" "$BINDIR"
[ -f "$EXEDIR/relarn$bin" ] && rm -f "$EXEDIR/relarn$bin" # might be read-only
cp relarn$bin "$EXEDIR/relarn$bin"
strip "$EXEDIR/relarn$bin"
#strip "$EXEDIR/relarn$bin" # We want the debug symbols
chmod a-w "$EXEDIR/relarn$bin" # Disables the debug menu
cp ../data/relarn.sh "$BINDIR/relarn$sh_ext"
chmod a+x "$BINDIR/relarn$sh_ext"
# Fetch the shared libs on Windows and macOS
if [ -n "$is_dist" ] && [ -n "$is_windows" -o "$(uname)" = Darwin ]; then
script=fetch_osx_dylibs.sh
[ -n "$is_windows" ] && script=fetch_msys_dlls.sh
( set -e
scriptdir=$(cd `dirname $BASH_SOURCE[0]`; pwd)
cd "$EXEDIR"
bash $scriptdir/$script
)
fi
# Install the launcher
if [ -n "$is_windows" ]; then
for b in relarn relarn-scores relarn-winning-scores; do
cp ../platform_src/windows_launcher/windows_launcher.exe "$BINDIR/$b.exe"
done
else
cp ../data/relarn.sh "$BINDIR/relarn$sh_ext"
chmod a+x "$BINDIR/relarn$sh_ext"
fi
# Create the manpage. We skip this step if pod2man isn't installed so
# that you don't need to install Perl just to generate a manpage.
mkdir -p "$DOCDIR" "$MANDIR"
if command -v pod2man > /dev/null; then
pod2man -s 6 -r ReLarn ../doc/relarn.pod > relarn.6
cp relarn.6 "$MANDIR"
cp relarn.6 "$MANDIR"
fi
# Create the doc directory and copy over the docs.
for f in ../doc/relarnrc.sample \
../doc/historical/Ularn-spoilers.txt \
for f in ../doc/historical/Ularn-spoilers.txt \
../LICENSE.txt \
../AUTHORS.txt \
../Copyright.txt
../Copyright.txt \
fov/COPYING-libfov
do
cp $f "$DOCDIR"
done
done
#!/bin/bash
# Attempt to guess the current platform and print out a normalized
# name for use by Makefile et. al. Only handles platforms test for in
# config.mk. (This is sort of a low-rent clone of config.guess).
set -e
os=$(uname -s | tr [A-Z] [a-z])
# Clean up the various cygwin flavours
case $os in
msys_nt*) os=msys_nt ;;
mingw*) os=msys_nt ;;
cygwin_nt*) os=cygwin_nt ;;
esac
arch=$(uname -m)
case $arch in
# It turns out we can lump all the x86 systems together
i[0-9]86) arch=x86 ;;
x86_64) arch=x86 ;;
# All arm variants get called "arm"
arm*) arch=arm ;;
esac
echo "$os-$arch"
......@@ -4,16 +4,16 @@ Movement: . wait one turn W wear armor
, take or use nearby item T take off armor
Z teleport yourself
y k u ^ identify a trap w wield a weapon
\\ \| \/ C close an open door d drop an item
\\ \| \/ C close an open door d drop an item
h -- @ -- l g show pack weight
\/ \| \\ D display what you know i show your inventory
b j n P give tax status
\/ \| \\ D display what you know i show your inventory
b j n P give tax status o show scores
c cast a spell
(SHIFT to run) v print program version q quaff a potion
? this help screen e eat something
Q quit the game
S save and quit
Q quit the game ^p message scroll back
S save and quit ^n msg scroll forward
......@@ -25,7 +25,7 @@ Movement: . wait one turn W wear armor
ReLarn is Copyright (C) 1986 - 2019 by The Authors. See |Copyright.txt|
ReLarn is Copyright (C) 1986 - 2020 by The Authors. See |Copyright.txt|
and |AUTHORS.txt| for details.
ReLarn is free software; you can redistribute it and\/or modify it
......@@ -41,3 +41,15 @@ for more details.
You should have received a copy of the GNU General Public License
along with this program as the file |LICENSE.txt|; if not, please see
http:\/\/www.gnu.org\/licenses\/old-licenses\/gpl-2.0.txt.
If you received ReLarn in binary form, you may have also received some
of the following libraries:
PDCurses (https:\/\/pdcurses.org) by William McBrine et. al
SDL 2.0 (https:\/\/libsdl.org) by the SDL team
SDL\_ttf 2.0 (https:\/\/libsdl.org\/projects\/SDL\_ttf) by Sam Lantinga
FreeType (https:\/\/freetype.org) by the FreeType team
......@@ -34,7 +34,7 @@ Explorers' Guild of Larn
[retrieving ${wealth_gp}]
[slaying the God of Hellfire]
[${slaying} the God of Hellfire]
on this date, [${date}], and has so earned membership in the
Explorers' Guild of Larn with [${score}] Club Points.
......
#!/bin/bash
# Convert the master icon (relarn-icon.png) to the various formats we
# need. Run this if you've changed the icon.
#
# This is not part of the build process so that most people won't need
# to install ImageMagick just to compile ReLarn.
set -e
# Windows-style icon for the Windows launchers
convert relarn-icon.png relarn-icon.ico
# BMP for PDCurses+SDL to load as a runtime application icon
convert relarn-icon.png relarn-icon.bmp
# OSX Icon (Requires makeicns from MacPorts.)
makeicns -in relarn-icon.png -out relarn-icon.icns
......@@ -20,6 +20,11 @@ fi
export RELARN_INSTALL_ROOT=$(cd -P "$(dirname "${BASH_SOURCE[0]}")/.." ; pwd)
# For macOS, we need to set the dylib load path to find the shared libs.
if [[ "`uname -s`" = "Darwin" ]]; then
export DYLD_LIBRARY_PATH="$RELARN_INSTALL_ROOT/lib/relarn/"
fi
if [ ! -x "$RELARN_INSTALL_ROOT/lib/relarn/relarn$bin" ]; then
echo "Incomplete relarn installation."
exit 1
......
## Sample ~/.relarn/relarnrc file
## The default character is a Pratchett reference, as required by law
# name: Eskarina
# character: Wizard
# female
# spouse_male
## Gender options:
# female
# male
# nonbinary
## Spouse gender options
# spouse_female
# spouse_male
# spouse_nonbinary
## Difficulty setting for new games. This should be a number between
## 0 and 100. The default is 0.
##
## WARNING: This is unsupported. This has not been tested in a long
## time and tends to just make the game unpleasant. USE AT YOUR OWN
## RISK!
# difficulty: 0
## Disable the "beep"; this is currently usually a visual flash anyway,
## but you can turn it off here.
# no-beep