Git Product home page Git Product logo

u4dosrandomizer's Introduction

U4DosRandomizer

Randomizer for Ultima IV Currently this randomizer randomizes the over world map and deals with all the repercussions of the overworld map being randomized.

Requires Ultima IV which is available for free at https://www.gog.com/game/ultima_4.

  1. Download the randomizer from https://github.com/Fenyx4/U4DosRandomizer/releases.
  2. Unzip and drop the executable in the Ultima IV directory (same folder as the WORLD.MAP file).
  3. Backup your original game. This has an option to restore but don't trust it we're still in alpha.
  4. Run the executable.
Options:
  -s |--s <seed>             The seed for the randomizer.  Same seed will produce the same map. Defaults to random value.
  -p |--p <path>             Path to Ultima 4 installation.  Leaving blank will assume it is the working directory.
  -r |--r                    Restore original Ultima 4 files.
  -e |--encoded              Encoded flags. Overrides all other flags.
  --miniMap                  Output a minimap of the overworld.
  -o |--overworld            Sets randomization level for Overworld map. 1 for no change. 2 for shuffle overworld locations. 5 for randomize the entire map. Defaults to 5.
  --spellRemove              Put in the letters of the spells you want removed. e.g. "--spellRemove zed" would remove zdown, energy field and dispel.
  --startingWeaponsArmor     Randomize the weapons and armor player and companions start with.
  --mixQuantity              Lets you input how much of a spell you want to mix.
  -d |--dungeon              Sets randomization level for Dungeon maps. 1 for no change. 2 for make dungeons super simple. 3 for randomize location of dungeon stones. 5 for randomize the entire map. Defaults to 1.
  --dngStone                 Randomize the location of stones in the dungeons (deprecated use --dungeon)
  --fixes                    Collection of non-gameplay fixes.
  --hythlothFix              Fixes an issue with Hythloth dungeon room.
  --sleepLockAssist          Helps prevent sleeplock in battles.
  --activePlayer             Allow selecting which characters are active in combat.
  --appleHitChance           Change hit chance to behave like the original Apple II version.
  --diagonalAttack           Allow diagonal attacks in combat.
  --sacrificeFix             Adds a way to gain sacrifice which the shrine says should work.
  --runes                    Randomize the location of the runes.
  --mystics                  Randomize the location of the mystics.
  --mantras                  Randomize the mantras.
  --wordOfPassage            Randomize the Word of Passage.
  --questItems <0-100>       Percentage chance to start with a quest item.
  --karmaValue <value>       Value to override starting karma value for a virtue. Leave blank for random.
  --karmaPercentage <0-100>  Percentage chance to override a starting karma value for a virtue. Default 0 (no override).
  --monsterDamage <0-3>      Value to change how much damage monsters do. Allowed values 0-3. 0 is quad damage. 1 is more damge. 2 is default. 3 is less damage.
  --weaponDamage <1-3>       Value to change how much damage weapons do. Allowed values 1-3. 1 is more damge. 2 is default. 3 is less damage.
  --earlierMonsters          Make more difficult monsters appear earlier.
  --monsterQty               More monsters from the start.
  --noRequireFullParty       Don't require the full party.
  --randomizeSpells          Randomizes the gate and resurrection spells that you learn in game.
  --sextant                  Start with a sextant.
  --clothMap                 Cloth map of the world.
  --principleItems           Randomize the order of the Principle Items.
  --townSaves                Enable saving in towns.
  --daemonTrigger            Fix daemon spawn in Abyss
  --awakenUpgrade            Awaken spell awakens all characters.
  --shopOverflow             Don't allow overflow exploit in shops.
  --other                    Allow other gender like in Ultima III.
  --vgaPatch                 VGA patch compatibility. Run randomizer after applying VGA patch.
  --spoilerLog               Output a spoiler log.
  -? | -h | --help           Show help information

All the files the randomizer changes get backed up with the extension ".orig" added. Run with '-r' to restore to the original game.

Example: https://imgur.com/qNRxpSy

Helping

If you end up making changes to the game's source code you will need to update the diff files. Run U4DosRandomizer.Patcher with the below parameters then copy the diffs into U4DosRandomizer/patches and rebuild. -b "E:\Projects\U4DosRandomizer\u4_decompile\SRC\ORIGINAL\AVATAR.EXE" -s "E:\Projects\U4DosRandomizer\u4_decompile\SRC\ORIGINAL\AVATAR.EXE.sig" -n "E:\Projects\U4DosRandomizer\u4_decompile\SRC\ORIGINAL\U4_MAIN.EXE" -d "E:\Projects\U4DosRandomizer\u4_decompile\SRC\ORIGINAL\AVATAR.EXE.octodiff" -b "E:\Projects\U4DosRandomizer\u4_decompile\SRC-TITLE\ORIGINAL\TITLE.EXE.orig" -s "E:\Projects\U4DosRandomizer\u4_decompile\SRC-TITLE\ORIGINAL\TITLE.EXE.sig" -n "E:\Projects\U4DosRandomizer\u4_decompile\SRC-TITLE\ORIGINAL\TITLE_0.EXE" -d "E:\Projects\U4DosRandomizer\u4_decompile\SRC-TITLE\ORIGINAL\TITLE.EXE.octodiff"

"The generation of random numbers is too important to be left to chance." - Robert R. Coveyou

u4dosrandomizer's People

Contributors

fenyx4 avatar

Stargazers

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

u4dosrandomizer's Issues

Blinking into the Abyss Valley

In the original it is quite difficult to 'blink' into the Abyss valley. I'm not sure if it is possible, but I couldn't manage it. (Though in the Apple II version I seem to remember pulling it off)

Probably because it looks like the whole bottom right corner of the map is off limits to blink from tile 192 on in the x and y coordinates

This little piece in u4_spell.c:

	if((Party._x & Party._y) < 0xc0) {

However, it is possible in the randomized version:

Ultima IV Randomized 2020-09-06 at 9 57 37 PM

Color Options

Needs color options. Preferably old school palette options

Feature - Shuffle vendors

"Shuffle the vendors and/or inventory around to different towns. Example: now you buy keys in Minoc." - dagit

Idea from dagit. Also Gilmok's randomizer does this.

Feature - Randomize Monsters

Mix up all the monsters health, xp value, ai, and damage.

Options

  • Full randomization
  • Swap so for example Orcs now have stats and AI of Balrons
  • Just AI
  • Just stats

Feature - Way to escape a softlock

"Are there any "softlock" situations that can happen? It's probably worth giving the player a way to kill themselves to respawn at Lord British with the normal death penalty as a way to avoid a softlock." - dagit

A button to kill yourself would require a code change.
Could add a parameter to the randomizer itself that would set the parties location to Castle Britannia.

Idea from dagit

Dungeons and Villages trapped in mountains

This is for the lastest: Release v0.1-alpha.4

I found that some dungeons, and perhaps a village? were 'trapped', nearly or fully, within mountains.

Is this the correct place for this type of feedback? I assume so as you are releasing alpha builds, for testing..correct?

Ultima IV Randomized 2020-09-01 at 5 13 49 PM
Ultima IV Randomized 2020-09-01 at 5 13 43 PM

64 bit Windows only?

Tried to get the alpha working, but I am assuming it is a 64bit app only, as I could not start it in XP or Dos.

Just curious.

Include U4 v 1.01 fixes from Ultima Patcher

This updated version of Ultima IV fixes some minor bugs in the data
files. This is a list of the fixes:

1.01

  • Charm in Cove asks her question
  • Water in Lord British's castle asks its question
  • Alkerion in Minoc asks his question
  • Shamino in Skara Brae asks his question
  • fixed mispelling of keyword of prisoner in Yew
  • fixed incorrect guard indices in Serpents Hold

Feature - Location of items shuffled

"Locations of key items: The easiest thing is just to shuffle them. The super metroid item randomization logic makes a distinction between major and minor items and lets you keep them in their respective pools, or shuffle across item pools. Food for thought. For instance, maybe you only find stones in locations that stones can be found in in vanilla. Or maybe you can find a stone at bell?" - dagit

This is doable without a code change. Many items already moved around for overworld change. Add another flag to move them around without the overworld changed.

Runes have an additional mapping telling which town they are in. Can't have more than one in a location.
https://github.com/ergonomy-joe/u4-decompiled/blob/c2c2108fa3bb346bcd1d8c207c526f33a4c8f5ef/SRC/U4_SRCH.C#L210
https://github.com/Fenyx4/U4DosRandomizer/blob/master/U4DosRandomizer/Avatar.cs#L341

Feature - Randomize enemies

"Randomize enemy attributes: could randomize their HP, the XP they give, or the damage they deal, or as a hard option, the spells they use, or their AI" - dagit

This one might get split into multiple features

Idea from dagit also Gilmok's randomizer does this

Release v0.2-alpha.2

Gotta get another release out!

  • #34 - Hythloth Fix
  • #46 - Spoiler Log
  • #48 - Start with quest items
  • #47 - Starting virtues
  • #45 - U4 Remastered (C64)
  • #43 - U4 v1.01 fixes
  • #38 - Fix healer in Serpent's Hold
  • #32 - Map randomization optional

Avatar.exe changes

  • #50 - Output randomizer flag values
  • #44 - Decrease chance of sleep lock
  • #42 - Hit Chance -> Apple II
  • #41 - Fix Sacrifice - Last coin
  • #29 - Set active player
  • #57 - Diagonal attack

Integrated Avatar.exe changes

Feature - Increase Monster toughness

Feature - Boat shop

"A boat shop, or just letting the player start with a boat. The Final Fantasy 4 rando and link to the past randos, have options to start with an "open world". I could imagine starting with a boat being similar." - dagit

Also see #15

Idea from dagit

Feature - Button to Speed up moon cycles

This would require code changes. It is currently CPU limited... Would we even be able to speed it up? Or would we want to make it a fixed update speed and people would need to speed up their DOSBox clock for us to have some headroom to work with.

Idea from dagit

Feature - Spoiler Log

Output a text log of where things are supposed to be.

Also output the seed and the parameters.

Ejection from the Abyss

Ejection from the Abyss results in being sent to one of several places, depending when you are ejected. I think you are sent either to the entrance to the abyss itself, or else several locations near the staring towns.

Here is the code:

unsigned char D_0BF0[] = {0xE7,0x53,0x23,0x3B,0x9E,0x69,0x17,0xBA,0xD8,0x1D,0x91,0x59,0xE9};
unsigned char D_0BFE[] = {0x88,0x69,0xDD,0x2C,0x15,0xB7,0x81,0xAC,0x6A,0x30,0xF3,0x6A,0xE9};

static unsigned D_8CCA;

/return to surface/
C_2F9D(bp04)
unsigned bp04;
{
u_delay(5, 0);
Gra_CR();
Party._x = D_0BF0[bp04];
Party._y = D_0BFE[bp04];
Party.f_1d8 = D_8CCA;
Party._loc = 0;
CurMode = MOD_OUTDOORS;
spell_cnt = 0;
hit_tile = 0;
spell_sta = 7;
D_9440 = 1;
D_95C6 = 0;
Party.f_1dc = 0;
C_26B6();
dspl_Stats();
u_kbflush();
longjmp(D_9458, -1);
}

The values in D_0BF0[] and D_0BFE[] will need to be tweaked to match any changes to the map, town locations.

Speedup Features - Start with quest items

Option to start with random amount, % chance to have them on slider (so 100% would be guaranteed to start with all of them)
Each one with separate slider?

Runes
Stones
Three Part Keys
Bell, Book, Candle

Karma dependent resurrection

Just a thought, but you could have resurrection, via LB or spells, restore stats/xp based on the players karma/virtue levels. Like Ultima V.

Include Conversation fixes from U4 Remastered (C64)

https://github.com/MagerValp/u4remastered/blob/master/Changelog.txt

  • Fixed broken question trigger and added missing dialogue for Thevel in Britain.
    • Already fixed in DOS
  • Added missing dialogue for Serpent's Hold gate guards.
  • Changed keyword for Michelle to avoid conflict with health in Serpent's Hold.
    • Already fixed in #40 but should check how they fixed it
  • Fixed broken message trigger for Water in Castle British.
  • Fixed misspelled keyword for Estro in the Lycaeum.
    • REAS -> RESE
  • Fixed misspelled keyword for a poor beggar in Yew.
    • Already fixed in DOS
  • Fixed broken message trigger for Alkerion in Minoc.
  • Fixed broken message trigger for Shamino in Skara Brae.
  • Fixed broken message trigger for Charm in Cove.
  • Dozens of minor fixes to spelling, grammar, and formatting.

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.