GithubHelp home page GithubHelp logo

xu4-engine / u4 Goto Github PK

View Code? Open in Web Editor NEW
47.0 7.0 8.0 44.29 MB

xu4 "Ultima IV Recreated"

Home Page: http://xu4.sourceforge.net

License: GNU General Public License v2.0

Makefile 0.41% C++ 71.41% C 23.55% Objective-C 0.34% Objective-C++ 0.09% Inno Setup 2.00% GLSL 1.90% Shell 0.21% Java 0.09%
game rpg ultima

u4's Introduction

XU4

Prepare yourself for a grand adventure: Ultima IV, sixteen times larger than Ultima III, is a milestone in computer gaming. Lord British has produced a game to challenge, not only your physical and mental skills, but the true fabric of your character. The evil triad of Mondain, Minax, and the hellspawn Exodus, have been vanquished and peace reigns throughout the land of Britannia. Evil yet abounds, but in isolated pockets and in the hearts of men. A new age awaits the coming of one who can conquer evil on all frontiers through the mastery of both magic and the use of force. Daemons, dragons and long-dead wizards still plague the countryside and must be destroyed. The seeker on the path of the avatar will faces hostile groups composed of mixed enemy types and will survive such encounters only by strategic use of weapons and terrain. Earthly victories over seemingly impossible odds lead to the final conflict, where the ultimate challenge -- the self -- awaits...

-- Back cover of Ultima IV box

XU4 is a remake of the computer game Ultima IV. The goal is to make it easy and convenient to play this classic on modern operating systems. XU4 is primarily inspired by the much more ambitious project Exult. Linux is the primary development platform but it gets built for Windows regularly. It should be easy to port to any system with Allegro 5.2 support.

XU4 isn't a new game based on the Ultima IV story -- it is a faithful recreation of the old game, right up to the crappy graphics. If you are looking for a game with modern gameplay and graphics, this is not it -- yet. New features that improve the gameplay and keep with the spirit of the original game will be added.

XU4 also tries to maintain strict compatibility with the original for its savegame files. You can use a game saved in XU4 with the original and vice versa, at least in theory.

Status

The game is fully playable and can use the original DOS EGA and upgraded VGA graphics.

Some optional features have been added such as reagent mixing similar to Ultima 5, speech for non-player characters, and unique spell sounds.

Some thoughts for possible improvements:

  • Ultima 5 style aiming in combat (i.e. allow angle shots)
  • More sound effects
  • Support for higher-resolution tile sets
  • Allow the map view to display more of the world
  • Menu-based interface, like Sega version
  • Use GPU for all rendering.
  • Formal modding system to extend the world or create entirely new adventures.

Compiling

To build the binary on Linux use these commands:

./configure
make

If the required libraries & headers are present, make will create the executable src/xu4.

For more detailed build instructions see doc/build.md.

Running

The actual data files from Ultima 4 are loaded at runtime, which means that a copy of Ultima 4 for DOS must be present. Fortunately, Ultima IV is available as closed-source freeware from www.gog.com.

Some graphics and sounds are stored in module files which have a .mod extension. Soundtrack modules that only contain music streams are also available. One game module and one soundtrack module can be selected using the Game Module Browser, which is opened with the Escape key. Modules can be found on the XU4 Download page.

If you have the optional u4upgrad.zip XU4 can read the data files straight out of the zipfile. To use it select the U4-Upgrade module.

XU4 searches for data, modules and zipfiles in the following places:

  • The current directory when xu4 is run
  • On Linux: $HOME/.local/share/xu4, /usr/share/xu4 & /usr/local/share/xu4
  • On Windows: %LOCALAPPDATA%\xu4

The DOS game zipfiles (ultima4.zip & u4upgrad.zip) don't need to be unpacked, but if they are the contents may be in a subdirectory named ultima4 or u4.

Settings & Options

At the title screen, a configuration menu can be accessed by pressing 'c'. Here, the screen scale, filter, volume and other settings can be modified. These settings are stored in $HOME/.config/xu4/xu4rc on Linux and %APPDATA%\xu4\xu4.cfg on Windows.

The saved game files are stored in the settings directory.

XU4 also accepts the following command line options:

    --filter <string>   Specify display filtering mode.
                        (point, HQX, xBR-lv2, xBRZ)
-f, --fullscreen        Run in fullscreen mode.
-h, --help              Print this message and quit.
-i, --skip-intro        Skip the intro. and load the last saved game.
-m, --module <file>     Specify game module (default is Ultima-IV).
-p, --profile <string>  Use another set of settings and save files.
-q, --quiet             Disable audio.
-s, --scale <int>       Specify display scaling factor (1-5).
-v, --verbose           Enable verbose console output.

Profiles

Profiles are stored in the profiles sub-directory. Use quotation marks around profile names that include spaces. The active profile name is shown on the introduction map view off the main menu.

Ultima 4 Documentation

Included with Ultima 4 for DOS, as downloaded from one of the above sites, are electronic copies of the printed documentation from the original Ultima IV box. HISTORY.TXT contains the "The History of Britannia", a general introduction to the world of Ultima IV. WISDOM.TXT contains "The Book of Mystic Wisdom", which explains the system of magic and provides descriptions of the spells and reagents.

PDF versions of these books are included in the official download in the EXTRA folder of the zip file. As an added bonus this folder also includes a pdf of the offical Ultima IV cluebook.

An image of the cloth map from the original Ultima IV box is also included in the EXTRA folder.

Debug Mode (cheats)

XU4 has a very useful debug mode (you can also think of it as a cheat mode). To enable it:

  • press 'c' in the main menu
  • make sure that
    1. Game Enhancements = On
    2. Enhanced Gameplay Options -> Debug Mode (Cheats) = On

Cheat list:

  • ctrl-c (cheat menu; press one of the following keys to use a cheat)

      1-8   gate (teleports you to a moongate location)
      F1-F8 virtue +10
      a     advance moons (advances the left moon [Trammel] to its next phase)
      c     collision (lets you walk across water, through mountains, etc.)
      e     equipment (gives the party Armour and Weapons)
      f     full stats (gives all party members 50 str, dex & intel and level 8)
      g     goto (enter a location and you will be teleported there)
      h     help (displays list of available cheats)
      i     items (gives the party Items and Equipment)
      j     joined by companions (if eligible)
      k     show karma (shows your virtues)
      l     location (displays current map and coordinates)
      m     mixtures (gives the party 99 mixtures of all spells)
      o     opacity (lets you see through opaque tiles)
      p     peer (switches between normal and gem view)
      r     reagents (gives the party 99 of all reagents)
      s     summon (enter a monster name, and it will appear somewhere nearby)
      t     transports (press b/h/s + arrow key to create a balloon/horse/ship)
      v     full virtues (makes you a full avatar)
      w     change wind (changes or locks the wind direction)
      x     exit map (teleports the party to where it entered the current map)
      y     y-up (like the Y-up spell, but free)
      z     z-down (like the Z-down spell, but free)
    
  • ctrl-d (destroy monster/object; doesn't work on energy fields)

  • ctrl-e (end combat)

  • ctrl-h (teleport to Lord British's throne room)

  • ctrl-v (switch between 3-d and 2-d view; dungeons only)

  • F1-F8 (teleport to a dungeon entrance; surface only)

  • F9-F11 (teleport to the altar room of truth/love/courage; surface only)

  • F12 (display torch duration)

Note: Except for the ctrl-e command, none of the cheats work during combat.

Misc.

See http://xu4.sourceforge.net/links.html for some other interesting Ultima IV related links.

Please send an email to [email protected] if you are interested in helping.

u4's People

Contributors

chocorho avatar darrenjaneczek avatar dominusexult avatar kirben avatar wickedsmoke avatar winterheart 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

u4's Issues

companions' names not visible in party window

Screenshot from 2023-03-06 23-54-59
the avatar at the top, dupre on the left, and jaana on the right. dupre's name is highlighted in the party window, but the text is invisible.

switching from U4-Upgrade to Ultima-IV then back to U4-Upgrade fixes the party window like 20% of the time. i'd try it with the vanilla graphics, but i can't play without the upgrade anymore -- when switching to Ultima-IV and attempting to load my save, xu4 crashes:

xu4: warning: Can't load image "u4/start.ega" with type 3
Segmentation fault (core dumped)

i started playing without the modded graphics and it seemed to work fine, but i only had a companion join after i'd installed the upgrade. now, even trying to start a new (non-upgraded) game (with a clean ~/.config/xu4/, so default settings) crashes after the personality test -- everything works fine up to that point.

i'm using the gog release in a directory named ultima4, next to the xu4 binary and u4upgrad.zip. and i'm using pop!_os 22.04 lts (ubuntu) and the prebuilt xu4 1.2.1 release from sourceforge

Move glv to github?

I just tried updating NixOS/nixpkgs#181866 but it fails fetching the submodule for glv:

source> exporting https://github.com/xu4-engine/u4.git (rev v1.4) into /nix/store/0ibb0821xvymqzpw7dw1265fxmi7skfi-source
source> Initialized empty Git repository in /nix/store/0ibb0821xvymqzpw7dw1265fxmi7skfi-source/.git/
source> remote: Enumerating objects: 437, done.
source> remote: Counting objects: 100% (437/437), done.
source> remote: Compressing objects: 100% (418/418), done.
source> remote: Total 437 (delta 11), reused 235 (delta 7), pack-reused 0
source> Receiving objects: 100% (437/437), 7.76 MiB | 15.05 MiB/s, done.
source> Resolving deltas: 100% (11/11), done.
source> From https://github.com/xu4-engine/u4
source>  * tag               v1.4       -> FETCH_HEAD
source> Switched to a new branch 'fetchgit'
source> Submodule 'src/faun' (https://github.com/WickedSmoke/faun.git) registered for path 'src/faun'
source> Submodule 'src/glv' (https://git.code.sf.net/p/outguard/glv) registered for path 'src/glv'
source> Cloning into '/nix/store/0ibb0821xvymqzpw7dw1265fxmi7skfi-source/src/faun'...
source> remote: Enumerating objects: 70, done.
source> remote: Counting objects: 100% (70/70), done.
source> remote: Compressing objects: 100% (68/68), done.
source> remote: Total 70 (delta 0), reused 45 (delta 0), pack-reused 0
source> Receiving objects: 100% (70/70), 115.50 KiB | 3.30 MiB/s, done.
source> Cloning into '/nix/store/0ibb0821xvymqzpw7dw1265fxmi7skfi-source/src/glv'...
source> remote: Enumerating objects: 47, done.
source> remote: Counting objects: 100% (47/47), done.
source> remote: Compressing objects: 100% (46/46), done.
source> remote: Total 47 (delta 7), reused 6 (delta 1)
source> remote: Total 0 (delta 0), reused 0 (delta 0), pack-reused 0
source> remote: Enumerating objects: 9, done.
source> remote: Counting objects: 100% (9/9), done.
source> remote: Compressing objects: 100% (5/5), done.
source> remote: Total 5 (delta 4), reused 1 (delta 0), pack-reused 0
source> Unpacking objects: 100% (5/5), 416 bytes | 416.00 KiB/s, done.
source> From https://github.com/WickedSmoke/faun
source>  * branch            f090eba840d8373d5aa2acbd9f402337c7bba098 -> FETCH_HEAD
source> Submodule path 'src/faun': checked out 'f090eba840d8373d5aa2acbd9f402337c7bba098'
source> remote: Total 0 (delta 0), reused 0 (delta 0)
source> error: Server does not allow request for unadvertised object 8b3f057502061925ce01e7db627532046dc04e09
source> fatal: Fetched in submodule path 'src/glv', but it did not contain 8b3f057502061925ce01e7db627532046dc04e09. Direct fetching of that commit failed.

I don't know why it's complaining about this commit, it does exist https://sourceforge.net/p/outguard/glv/ci/8b3f057502061925ce01e7db627532046dc04e09/
Who knows what sourceforge is doing here... it's showing its age I guess. Since u4 and faun are already on github maybe glv could be moved to github?

Alternatively updating the submodules "fixes" the issue somehow too ( mausch@f9db0a2 )... for now at least 🤷‍♂️

Cannot get Xu4 1.1 to run "Cannot find module"

I unpacked the files to a folder named XU4. In this folder I have another folder named Ultima4. In this folder are all the game files I installed from gog. When I try to run xu4.exe, I get a message "Cannot find module Ultima IV".

can't build on macos

I ran ./configure
then make, which fails

└─> make
make -C src -f Makefile.macosx
make[1]: *** No rule to make target `macosx/SDLMain.m', needed by `macosx/SDLMain.o'.  Stop.
make: *** [src/u4] Error 2

I have SDL installed via brew.

I cd into src dir and ran make, which got further, but still failed

./xu4.h:11:1: note: did you mean struct here?
class SaveGame;
^~~~~
struct
person.cpp:33:10: fatal error: 'boron/boron.h' file not found
#include <boron/boron.h>
         ^~~~~~~~~~~~~~~
4 warnings and 1 error generated.
make: *** [person.o] Error 1

"Master is unstable"

Hey there, nice to see that this fantastic project has moved to Github and some additional work is being done on it!

The project description says that "Master is unstable", so where should we build from if we want to build xu4 from source or package it? The Sourceforge home page offers beta builds which are ancient (and probably shouldn't use) and snapshot builds, but it's not clear what commits/tags these were build from.

Also, as a side-note, are there any fundamental differences between the Allegro and SDL builds? Which one is the recommended version? Are there any up or downsides to either of them?

Thanks!

Tag for 1.1 ?

Hi, great news about the 1.1 release, congrats!
Could you tag it here on github so I can package it?
Many thanks.

Sanity Check: OpenGL requirement.

Decades long player of xu4 here.

Ultima 4 ran on a 1mhz, 8-bit Apple ][.

XU4 ran with almost no cpu use on many, many devices, which did not have openGL support.

Can you please explain why you've added opengl as a requirement? XU4 is a game that does nort inherently require opengl. Many devices do not have opengl or GPU, and will no longer be able to run XU4.

Thank you for your consideration. Very interesting to follow your many commits. Thanks for the work!

Todo list?

Hey guys,

This is more a question, perhaps a small request.

Is there a document that:

a) shows the completion of the project compared to u4, e. g. what is playable what is not
b) shows a todo list of things that are missing or so?

In particular b) may perhaps be helpful in the long run when devs come in but may only
have a limited amount of time, so perhaps they could work on a todo list for some days
before moving on.

Building xu4 on aarch64 devuan

Glad you're reviving. What uses -gstabs?
./configure --sdl make make -C src -f Makefile make[1]: Entering directory '/media/sd/pcbak2/Projects/games/u4/src' cc -DHAVE_BACKTRACE=1 -DHAVE_VARIADIC_MACROS=1 -Wall -I. -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -I/usr/include/libxml2 -DICON_FILE=\"/usr/local/share/pixmaps/u4.bmp\" -DVERSION=\"1.1svn\" -ggdb1 -rdynamic -g -O0 -fno-inline -fno-eliminate-unused-debug-types -gstabs -g3 -c -o lzw/hash.o lzw/hash.c cc1: error: target system does not support the ‘stabs’ debug format

DEBUGCXXFLAGS=-ggdb1 -rdynamic -g -O0 -fno-inline -fno-eliminate-unused-debug-types -gstabs -g3

Removing -gstabs from Makefile gets me through most of the compile but then, ... ambush!

g++ -DHAVE_BACKTRACE=1 -DHAVE_VARIADIC_MACROS=1 -Wall -I. -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -I/usr/include/libxml2 -DICON_FILE=\"/usr/local/share/pixmaps/u4.bmp\" -DVERSION=\"1.1svn\" -ggdb1 -rdynamic -g -O0 -fno-inline -fno-eliminate-unused-debug-types -g -g3 -O2 -march=native -mcpu=native -mtune=native -ffast-math -ftree-vectorize -fno-strict-overflow -funsafe-math-optimizations  -c -o util/dumpsavegame.o util/dumpsavegame.cpp
g++ -DHAVE_BACKTRACE=1 -DHAVE_VARIADIC_MACROS=1 -Wall -I. -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -I/usr/include/libxml2 -DICON_FILE=\"/usr/local/share/pixmaps/u4.bmp\" -DVERSION=\"1.1svn\" -ggdb1 -rdynamic -g -O0 -fno-inline -fno-eliminate-unused-debug-types -g -g3  -o dumpsavegame util/dumpsavegame.o savegame.o
/usr/bin/ld: savegame.o: in function `UltimaSaveIds::alloc(int, int, Config*, Tileset const*)':
/media/sd/pcbak2/Projects/games/u4/src/savegame.cpp:421: undefined reference to `Config::internSymbols(unsigned short*, unsigned short, char const*)'
/usr/bin/ld: /media/sd/pcbak2/Projects/games/u4/src/savegame.cpp:428: undefined reference to `Tileset::getByName(unsigned short) const'
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile.common:99: dumpsavegame] Error 1
make[1]: Leaving directory '/media/sd/pcbak2/Projects/games/u4/src'
make: *** [Makefile:13: src/u4] Error 2

savegame.cpp looks quite different to my other versions. Still I got an executeable somehow.

27160992 Jul  6 08:49 u4

symlinked my ultima4 dir to ./ultima4 and ran u4
it complained with

xu4: warning: Failed to open file u4u/charset.vga for reading.

Let's make this work with original tileset and not require vga ultima4upgrade
(available here) https://ultima4.ultimacodex.com/ultima-4-upgrade/


moving on...

xu4: warning: Failed to open file u4u/start.old for reading

Strace doesn't show u4 trying to load any start.old, just shows:

/pr/games/u4/src$ strace ./u4 2>&1 |grep -i start.old
write(2, "Failed to open file u4u/start.ol"..., 46Failed to open file u4u/start.old for reading.) = 46

/pr/games/u4/src$ ls -l  u4u/start.old ultima4/u4u/start.old
-rw-rw-rw- 1 6847 Apr 30  1999 u4u/start.old
-rw-r--r-- 1 6847 Jul  6 09:39 ultima4/u4u/start.old

Then there's this mysterious thing:

xu4: error: Unable to load image "borders"
09:39:56-Clort@Desktop:/pr/games/u4/src$ strace ./u4 2>&1 |grep -i borders
write(2, "Unable to load image \"borders\"", 30Unable to load image "borders") = 30

I know this is detail work but just thought I'd give the feedback. For now U4 works fine in SCUMMVM

[Feature request] Let us select multiple music modules

Let us select multiple music modules at once and hand-pick which track from each to play.

For example, the player could enable the Aradindae and Hurin music modules at once and have the game use the Hurin tracks for Wanderer and Towns, along with the Aradindae tracks for the rest of the music.

Hope that was clear enough.

Building binaries directly in github

Hi!

Earlier today I was having a quiet day at work and thought "I wonder if xu4 works on macos".. one thing led to another and I started investigating what it would take to make binaries directly in github themselves. Before I finish this work I wanted to check in and ask... would you take a PR that spits out binaries as releases automatically?

I was thinking:

  • Linux builds (most straightforward)
  • Try and cross-build from linux for windows (with msys2)
  • Macos will take the most work (but they do have mac runners in github)

If this is a PR you'd take I may have some questions (I've been trying to make this work locally and I'm not 100% sure on the optimal setup for boron, etc).

And just to show roughly what linux looks like right now:

jobs:
  release-linux-amd64:
    name: release-linux-amd64
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2

    - name: Dependencies
      run: |
        sudo apt update
        sudo apt install -y liballegro5-dev libxml2 libxml2-dev

    - name: Install boron
      run: |
        rm -rf boron
        git clone --depth 1 git://git.code.sf.net/p/urlan/boron/code boron
        cd boron
        ./configure
        make
        sudo make install install-dev

    - name: Configure
      run: ./configure

    - name: Build
      run: make

That at least gets to a point it can compile xu4.

(Oh and separately I'll mention I had to modify image.h to change #include "image32.h" to "support/image32.h" and xu4.h to "support/notify.h" to get working compiles). Anyway, I just wanted to pick your brain about the entire effort before I go on any further :)

stack smashing detected; terminated

After some challenges building from the github repo (which may admittedly be the source of my problem here) on pop_os 21.10 I've managed to get to a complete build, but now the xu4 binary aborts with

$ ./src/xu4 
*** stack smashing detected ***: terminated
Aborted (core dumped)

The build is mostly clean with a few warnings of the type:

warning: format not a string literal and no format arguments

but no other errors.

Dependencies were satisfied as follows:

From system packages:
libsdl2-2.0-0
libsdl2-dev
libxml2
libxml2-dev
liballegro5.2
liballegro5-dev

From sourceforge:
libboron https://sourceforge.net/p/urlan/boron/code/ci/master/tree/

any suggestions would be much appreciated

Sounds

I am not sure if you are interested, but I did some work a while back to get all the sounds correct for Dos, C64 and Apple.

The DOS sounds are found here:

https://github.com/cambragol/xu4/tree/master/sound/dos

The apple II and c64 sounds are not named/sorted the same as dos, so might need some work to fit. In any case, the files are all recorded and cleaned up nicely. Incorporate them if you want.

SDL support

Is SDL support planned? I see there is some code for that, though the build fails with:
event_sdl.cpp:117:14: error: ‘SDL_MOUSEWHEEL’ was not declared in this scope; did you mean ‘IE_MOUSE_WHEEL’?

If it is planned, it would be nice to have support for legacy SDL (i.e. SDL1). I would love to see this game on some cheap handhelds and SDL1 is a prerequisite for that.

xu4: error: Unable to initialize Allegro

I'm getting a mystery-meat "Unable to initialize Allegro" launching the sourceforge binaries of xu4 1.0 on a Debian bullseye system with Allegro 5.2.6 installed.

Running xu4 --verbose is no more enlightening.

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.