Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Project] Ambermoon bugfix patches #52

Open
Pyrdacor opened this issue Oct 31, 2020 · 322 comments
Open

[Project] Ambermoon bugfix patches #52

Pyrdacor opened this issue Oct 31, 2020 · 322 comments
Assignees
Labels
help wanted Extra attention is needed

Comments

@Pyrdacor
Copy link
Owner

The goal is to create a stable patched Ambermoon version in german and english. We focus on the english patch for now.

@Pyrdacor Pyrdacor added the WIP Work in progress label Oct 31, 2020
@Pyrdacor Pyrdacor self-assigned this Oct 31, 2020
@Pyrdacor
Copy link
Owner Author

Pyrdacor commented Oct 31, 2020

I decided to first add writers for all game objects like monsters, NPCs, texts, etc. I partially need this anyway to save Ambermoon.net games back to original savegames.

With those writers and the existing readers you can then do the following in code very easily:

  • Load a monster
  • Change a monster value
  • Save the monster

Combined with a decompressor/compressor and archive loader/writer this should allow for easy editing whole game files like "Monster_char_data.amb".

The archive loader and writer functionality is already there with decompression and compression support.

So when I finish the game object writers (which isn't too hard), the game data patching should be very easy.

@Pyrdacor Pyrdacor added the help wanted Extra attention is needed label Oct 31, 2020
@Pyrdacor
Copy link
Owner Author

The implementation of the writers will be tracked here: #53

@Pyrdacor
Copy link
Owner Author

@a1exh I will keep you up to date regarding data writer implementation status. Afterwards I'll need your support to fix those bugs and create a patch.

@a1exh
Copy link

a1exh commented Oct 31, 2020

Sounds good. I'll try to make some diff files for the more obscure bug fixes to help satisfy my curiosity

@Pyrdacor
Copy link
Owner Author

Pyrdacor commented Nov 2, 2020

@a1exh The character writers are ready (monsters, NPCs, party members) and the text writers too. So we could start fixing. Items will be much harder though, but maybe the first patch version could just fix characters and texts. Map writers are missing too but map texts can be fixed already.

@a1exh
Copy link

a1exh commented Nov 3, 2020

Object_texts.amb sub-file 001.amb this file has a bug in it where it uses the word "GRANDSON" regardless of the gender of the main character. In my bugfix I change the text to "GRANDCHILD". I think I didn't know if there was a scripting special markup gender specific code e.g. ~ SEX1 ~ (HE/SHE) AND ~ SEX2 ~ (HIS/HER) for things like this. But I don't think there anything as specific as SON/DAUGHTER

@a1exh
Copy link

a1exh commented Nov 3, 2020

v1.07 has an issue where if you're flying/sailing near the coordinates [0,0] (might be [1,1]) that there is a reference to a missing text block in 1Map_texts.amb that causes the Amiga version to crash. This was patched in two different ways, Metallic fixed it by adding a dummy text block 001.amb into 1Map_texts.amb so that it didn't crash. Meynaf said he removed the reference to the missing text block but he didn't say where or how he did this. The Meynaf patch doesn't modify 1Map_data.amb. I'd be curious to know what the underlaying cause of this is and how Meynaf patch works.

@a1exh
Copy link

a1exh commented Nov 3, 2020

I've been working for years on the list of bugfix patches for v1.07

https://docs.google.com/spreadsheets/d/1as5W8gibm-MTb9VEqpkfgtwWviqjQx96A3NmcvzX98A/edit?usp=sharing

The "sub-filename" number is the one produced using the Amiga tool by Metallic "ExtractAmb" to split files into their components.

Most bugs have two sub-files to DIFF to see the changes (however the files sometimes contain fixes for more than one bug)

You can sort the spreadsheet using the filename column to put them into file order.

I'm going through on a file-by-file basis starting with v1.07, Party_char.amb.

If I am going too slow for you then for v1.07 take a look at the modified version by Meynaf

http://meynaf.free.fr/pr/amberpatch.lzx

The patch is not comprehensive (there are known fixable bugs he didn't fix and at least one with a mistake) and it contains fixes not detailed in the list of fixes in the text file included in the archive.

And for v1.05 take a look at the modified versions by Daniel Schulz

http://slothsoft.net/getResource.php/amber/patch/Ambermoon.v1.06.zip

I don't know much about v1.05 as I don't read German but I believe he's fixed most (all?) of the common bugs between v1.07 and v1.05. He has a list v1.05 bugs albeit not down to the specific bytes :

http://slothsoft.net/Ambermoon/EditorHelp/ (look at the section : MIR BEKANNTE BUGS IN AMBERMOON)

@a1exh
Copy link

a1exh commented Nov 3, 2020

If you don't know in which file a bug may be located, feel free to ask. I am very familiar to the internal data structures and their relations already.

Where are the real opening times of all the shops stored? Lots of them have the wrong opening times in the v1.07 text blocks. Most have patches where people have worked out "in-game" the real opening times, but one or two remain. For example 2Map_texts.amb sub-file 119.amb ALCHEMISTS TOWER - "ALCHEMISTIC ACCESSORIES^ OPEN FROM 8 AM TO 8 PM" but I have bug reports it wasn't open when they visited at 18:45

@Pyrdacor
Copy link
Owner Author

Pyrdacor commented Nov 3, 2020

Object_texts.amb sub-file 001.amb this file has a bug in it where it uses the word "GRANDSON" regardless of the gender of the main character. In my bugfix I change the text to "GRANDCHILD". I think I didn't know if there was a scripting special markup gender specific code e.g. ~ SEX1 ~ (HE/SHE) AND ~ SEX2 ~ (HIS/HER) for things like this. But I don't think there anything as specific as SON/DAUGHTER

No there is only he/she and his/her. So I guess grandchild is a good solution.

@Pyrdacor
Copy link
Owner Author

Pyrdacor commented Nov 3, 2020

v1.07 has an issue where if you're flying/sailing near the coordinates [0,0] (might be [1,1]) that there is a reference to a missing text block in 1Map_texts.amb that causes the Amiga version to crash. This was patched in two different ways, Metallic fixed it by adding a dummy text block 001.amb into 1Map_texts.amb so that it didn't crash. Meynaf said he removed the reference to the missing text block but he didn't say where or how he did this. The Meynaf patch doesn't modify 1Map_data.amb. I'd be curious to know what the underlaying cause of this is and how Meynaf patch works.

In general text popups are triggered by specific map events. They are stored inside the map data. It is possible to fix the text index or remove the event. But if Meynaf didn't change the map data file this is strange. Another possibility are NPCs. They also can use map texts in some cases. But I don't think there is an NPC on that map.

@Pyrdacor
Copy link
Owner Author

Pyrdacor commented Nov 3, 2020

If you don't know in which file a bug may be located, feel free to ask. I am very familiar to the internal data structures and their relations already.

Where are the real opening times of all the shops stored? Lots of them have the wrong opening times in the v1.07 text blocks. Most have patches where people have worked out "in-game" the real opening times, but one or two remain. For example 2Map_texts.amb sub-file 119.amb ALCHEMISTS TOWER - "ALCHEMISTIC ACCESSORIES^ OPEN FROM 8 AM TO 8 PM" but I have bug reports it wasn't open when they visited at 18:45

The opening times are stored in the map events of each map. Only hours are stored. There are two places in Alchemists Tower: a merchant (sells goods) and a library (sells spell scrolls). In my current data the following open times are set for them:

  • Merchant: 8-18 (8am to 6pm)
  • Library: 8-20 (8am to 8pm)

@a1exh
Copy link

a1exh commented Nov 3, 2020

Thanks. I can change the text and move this bug to the FIXED page.

@Pyrdacor
Copy link
Owner Author

Pyrdacor commented Dec 1, 2020

@a1exh I don't know if this bug was reported before but I found something during battle testing in original:

If you choose to attack a nearby monster with a close-ranged weapon (e.g. Scimitar) and then open the inventory and exchange this weapon with a long-ranged weapon (e.g. Crossbow) you will be able to attack with the long-ranged weapon without consuming ammunition. Moreover the symbol for close-ranged attack is displayed near the portrait.

@a1exh
Copy link

a1exh commented Dec 1, 2020

Thanks this has never been reported. Is it 100% reproducible?

@a1exh
Copy link

a1exh commented Dec 1, 2020

Daniel Schulz has noted two semi-related things

  1. Magic Bolts require 0 hands and so can be combined with a 2-handed weapon to give enchantment bonus of attack +15

  2. Sling Knife and Sling Dagger have an attack value even though they are ammunition and therefore you should equip rather than a shield

It is not obvious if these are bugs or as intended.

@Pyrdacor
Copy link
Owner Author

Pyrdacor commented Dec 1, 2020

Thanks this has never been reported. Is it 100% reproducible?

I only tested with german v1.01 (22-11-1993). But with this version it is reproducible.

@Pyrdacor
Copy link
Owner Author

Pyrdacor commented Jan 8, 2021

@a1exh Found another minor bug. The spell Blink is cast on a friend to teleport him in battle. But if the friend moves before the spell is cast, a message like " has been blinked" is shown. So there is no character name. I guess the game looks at the spot for a character but does not find one anymore. The character is not blinked of course.

I would expect one of the following:

  • Blink the moved character
  • Let the spell fail and show a message about it

I decided to implement the "fail message" in Ambermoon.net. It is a bit odd but in Ambermoon even support spells like Healing can miss if the character has moved before casting. So I added this behavior to Blink as well to be consistent. It is kind of a game mechanic. You have to consider speed when casting supportive spells and maybe have to increase the Speed attribute of supportive members like Healers and Alchemists.

@Pyrdacor
Copy link
Owner Author

@a1exh I wonder if someone already reported this but you can create a character with an empty name. In this case no name is shown in inventory, at the top portrait and in conversations.

@a1exh
Copy link

a1exh commented Jan 29, 2021

No one has mentioned it. But it is not really a bug unless it causes crashes due to string length errors etc? No?

@Pyrdacor
Copy link
Owner Author

Pyrdacor commented Jan 29, 2021

True. I don't know if this can cause problems in some situation but even if, this wouldn't be much of a problem as you can just pick a valid name. ;)

@kermitfrog
Copy link

Bug: when the monster ai is determining which spell to cast and on which target, there is a bug in the row spell targeting:

        0023c23a 72 00           moveq      #0x0,D1
        0023c23c 74 00           moveq      #0x0,D2
        0023c23e 76 00           moveq      #0x0,D3
        0023c240 7e 18           moveq      #0x18,D7
                             LAB_0023c242                                    XREF[1]:     0023c258(j)  
        0023c242 0f 00           btst.l     D7,D0
        0023c244 67 0a           beq.b      LAB_0023c250
        0023c246 26 52           movea.l    (A2)=>battlefield.fields[24],A3                  = null
        0023c248 36 2b 00 22     move.w     (0x22,A3),D3w
        0023c24c d2 83           add.l      D3,D1
        0023c24e 52 42           addq.w     #0x1,D2w
                             LAB_0023c250                                    XREF[1]:     0023c244(j)  
        0023c250 58 8a           addq.l     #0x4,A2
        0023c252 52 47           addq.w     #0x1,D7w
        0023c254 be 7c 00 18     cmp.w      #0x18,D7w
        0023c258 6b e8           bmi.b      LAB_0023c242
        0023c25a 4a 42           tst.w      D2w
        0023c25c 67 02           beq.b      LAB_0023c260
        0023c25e 82 c2           divu.w     D2w,D1

The loop ends when D7 is > 0x18, but it is set to that value at the loop's start and then only incremented, so the loop will always exit after 1 pass. 0x18 is 24, the index of the first field in the lowest row on the battlefield. The loop calculates the avarage last damage and is probably copied from a one before it, which does the same for the row above it. Then they forgot to change the exit condition...

I think changing

0023c254 be 7c 00 18     cmp.w      #0x18,D7w

to

0023c254 be 7c 00 1e     cmp.w      #0x1e,D7w

should be enough to fix it.

@Thallyrion
Copy link

Even though this might technically be a bug i would hesitate fixing this in the original Amiga Version as it could change the Gameplay significantly.

@Pyrdacor
Copy link
Owner Author

At least we should add it to a bug list so that it is documented. Maybe someone wants to release some advanced version later with better balancing and fixed mechanics. Some things in Ambermoon feel quiet buggy or out of balance. Some of those might just be small bugs in the code like this one.

@Pyrdacor
Copy link
Owner Author

Pyrdacor commented Feb 15, 2021

@a1exh Found another bug in original. When you buy items you store them in a temporary item grid. This grid has 4x6 slots (same amount as the merchant). But the merchant can stack all items. For example the merchant in Spannenberg sells 15 sandals as one stack. Sandals can't be stacked otherwise (inventory, chests, etc). This is also true for the temporary item grid. Sandals can't be stacked there.

This way you can fill the temporary item grid with more than the 24 items. And when you do so the game stops to react to any input. The only thing that still works is the mouse cursor.

So to reproduce the bug go to the merchant in Spannenberg and buy more than 24 non-stackable items (e.g. Robe, Leather shoes and sandals). Then the game should stop reacting.

A possible fix would be to steps:

  • Disable the "buy" button when the temporary item grid already has 24 items
  • Limit the amount you can choose from the "amount input box" for unstackable items to the amount of free slots in the temporary item grid

This is also the way I implement it in Ambermoon.net.

@dlfrsilver
Copy link

dlfrsilver commented Sep 21, 2021 via email

@kermitfrog
Copy link

[..] I have 3 ideas for the intended byte usage: [..]

Idea 2 is correct - and, of course, bugged.

What it does is the inverse of the loose-item part of remove curse with the same problem: multiplication by 6 instead of 8.

0022552c c0 fc 00 06     mulu.w     #0x6,D0
and
00225544 c0 fc 00 06     mulu.w     #0x6,D0

As for the patch, look for
53 40 C0 FC 00 06 72 00 12 29 00 13 93 73
and
53 40 C0 FC 00 06 72 00 12 29 00 14 93 73
and replace the 06 with 08

Well... that makes the data bugged as well, so, the first byte of those items should be incremented by 1.

I guess Daniel also renamed the SCIMITAR to "Krummsäbel". But only in AM2_BLIT.

What comes next? Neusee (Newlake)?? Or even worse: Edelsteinstein (Gemstone)???
I vote for keeping names as they are.

[..] SWIM from 01/95 to 01/99 [..]

So.. characters could learn to swim around a whole continent? I know, it's a fantasy setting - but that seems very unrealistic to me

@Pyrdacor
Copy link
Owner Author

Thanks for clarification. I think this is worth fixing. Does it mean that the whip reduces Parry instead and the armours Attack?

What comes next? Neusee (Newlake)?? Or even worse: Edelsteinstein (Gemstone)???
I vote for keeping names as they are.

Yeah me too.

[..] SWIM from 01/95 to 01/99 [..]

So.. characters could learn to swim around a whole continent? I know, it's a fantasy setting - but that seems very unrealistic to me

You can't cross the ocean without a boat. So this is already taken care off. I am indifferent regarding the swimming stuff.

@kermitfrog
Copy link

Thanks for clarification. I think this is worth fixing. Does it mean that the whip reduces Parry instead and the armours Attack?

Yeah, that's my interpretation, too.

Also... now that I think about it... I have to have another look at the snake helmet..

You can't cross the ocean without a boat. So this is already taken care off. I am indifferent regarding the swimming stuff.

Yes, the Ocean is not the problem...
I had another look at the swimming code and did some table calculations.
So the damage formula is

d = (100 - Swim) / 2
If d != 0:
  dmg = max(1, (d * currentLP / 100))

As (100 - 99) / 2 is rounded to 0, I'm not ruling out that taking 0 damage with swimm 99 is unintentional.

Also, a character with 200 LP should survive swimming that many rounds, depending on skill:
50: 19
75: 38
90: 75
95: 140
97: 199

Taking into account that the world is 800x800 squares big, even 140 is crazy...

or in short: my vote is on 95 is enough ;D
(but 99 won't break the game)

@Pyrdacor
Copy link
Owner Author

I also noticed that you can swim quiet long. The less your current LP the lower the damage. When you take the Thalion guys, they only get 1 damage at some point and so you can swim for hours. This felt weird to be honest. I am not sure why it is based on current LP rather than max LP.

I had some deeper look at the party characters and also the NPCs. Even the NPCs in Ambermoon have all their stats set even if you can't see them in-game. The 95 seems to be used as the max value (= master of that ability). I think there is no greater max value inside the original versions. I guess Karsten considered even a master in some ability to fail from time to time. In addition equipment which grants abilities becomes more useful/valuable. The ring of Sobek is the most prominent example. It makes you swim like a god.

I think sticking with the 95 max stat is fine.

I will use 99 in Ambermoon Advanced. But there it has other reasons. :)

@kermitfrog
Copy link

I think sticking with the 95 max stat is fine.
I will use 99 in Ambermoon Advanced. But there it has other reasons. :)

A new damage formula then? Sounds good ^^

As for the snake helmet: did I really fix a bug there, or did I confuse that with another bug??

In any case I had another look at the equip item code.
There are 2 functions to apply several modifiers.. which one is called, depends on the cursed flag. The difference between the 2 is that one adds the amounts and the other subtracts them.
I guess you knew that, but to be thorough, here is a list of all the stats that are handled that way (in case you missed one):

  • Attributes
  • Abilities
  • LP
  • SP
  • Defense
  • Damage

@Pyrdacor
Copy link
Owner Author

Pyrdacor commented Sep 22, 2021

As for the snake helmet: did I really fix a bug there, or did I confuse that with another bug??

You only found the 6 byte offset issue. But this is only relevant for cursed items with different attributes or abilities. The Snake Helmet grants STR and ATT which have index 0 so the fix has no effect / is not needed.

The problem still exists on my end, that the healer spell never detects cursed items. You said it works on your end but it never worked on my end with any game version yet.

Maybe you can check the code which checks for cursed items. It works fine at the healer but not when the spell is cast.

@kermitfrog
Copy link

Ok... so I checked the code again and I believe that the loop, as well as the rest of the function (FUN_0022a10c) is perfectly fine.

Also, the reason it works for me and does not destroy any other items is... pure coincidence!!!

So you might ask: "how do these 2 statements fit?"
Well... let's look at the relevant code before the find - item - loop:

        0022a150 41 f9 00        lea        (DAT_00265d2a).l,A0
                 26 5d 2a
        0022a156 4e b9 00        jsr        FUN_002470e4.l                                   undefined4 FUN_002470e4(void)
                 24 70 e4
        0022a15c 4e b9 00        jsr        FUN_00246600.l                                   undefined4 FUN_00246600(void)
                 24 66 00
        0022a162 70 19           moveq      #0x19,D0
        0022a164 4e b9 00        jsr        show_inventory.l                                 undefined4 show_inventory(void)
                 24 56 dc
        0022a16a 3c 1f           move.w     (SP)+,D6w
        0022a16c 41 e8 01 22     lea        (0x122,A0)=>DAT_00265e4c,A0                      = 5Eh    ^

The first statement loads the pointer to some internal structure into A0.
The last one, modifies A0 by 0x122 - setting it to the first item slot of the character pointed to by A0... well .. it would, if A0 would actually point to the selected character...

Instead it gets item indicies from completely different data, used as item slots, checking other items (or data outside the item range) for the cursed flag - in my case accidentally leading to the expected result.

So I assume one of the functions in between is supposed to set A0 to the selected character, but fails to do so.
I'll have a closer look another day.

@Pyrdacor
Copy link
Owner Author

Sounds very promising. Fixing this is a huge achievement. Thanks for your research.

@kermitfrog
Copy link

I think I found a solution :)

Also, my prior assessment about the problem beiing in another function was wrong. The pointer to the active char is actually loaded in the call right before lea (DAT_00265d2a).l,A0.
However it is loaded into A1, which is later overwritten by the pointer to the item data (not sure how I overlooked that yesterday... maybe it was just too late).

So the problem is that the pointer to the item slots is based on the wrong register.
The fix would then be

0022a16c 41 e8 01 22     lea        (0x122,A0)=>DAT_00265e4c,A0 
             |                              |
0022a16c 41 e9 01 22     lea        (0x122,A1)=>DAT_00265e4c,A0

or: replace 3C 1F 41 E8 01 22 with 3C 1F 41 E9 01 22

@dlfrsilver
Copy link

dlfrsilver commented Sep 23, 2021 via email

@Pyrdacor
Copy link
Owner Author

Great I will have a look at it tomorrow. But out of curiosity, why did it work for you then?

@kermitfrog
Copy link

Great I will have a look at it tomorrow. But out of curiosity, why did it work for you then?

The loop looked at every (wrong) item slot, and then at the cursed-flag of the item referenced by the index in that "slot" - which was whatever number was in that memory spot.
Usually that was just another item (e.g. banded armor on Netsraks neck), which were not cursed.
On the head slot, the index was high enough to reference item data that was out of bounds, so the cursed flag was read from something that was not an item - and by coincidence true.

The function that actually destroys the item, must then simply have used the item slot index, while loading the inventory by index from some global variable that is set to "whose inventory are we looking at?".

I now also tried using the spell without putting on the snake helmet, which (as expected) lead to the destruction of an innocent hat.

@Pyrdacor
Copy link
Owner Author

Sorry that I only respond now. Much to do recently. The fix for the curse spell works perfectly now. :)

@Pyrdacor
Copy link
Owner Author

I integrated the "remove curse" spell fix and also the skill penalty fix for items. I tested both and they work. This way the initial -6 attack bonus of Erik are valid again because he wears the Plate Armour. When you remove it, the 6 points are added back. So I added the -6 back to the german initial savegame.

All bonus values are now fixed for both languages. The max swim stats were reverted in the german version as well as some other changes. The only thing I kept (beside the obvious corrupted bonus values) was the crit change for Selena from 2 to 5. I think as Mando also has 5 and most (all?) max stats are a multiple of 5, it makes sense. Moreover Selena is very weak and the 3 points in crit won't hurt.

The wind shrine door is also no longer skippable by eagle/broom. And I also corrected the spawn location when you leave the wind shrine. Was 1 field off.

"Krummsäbel" is now again "SCIMITAR" in the german version and "NACRE CHAIN" is now "PEARL CHAIN" in the english version.

I will now fix two other bugs and hope to release the new original versions tomorrow. I planned it for 31.10. but I am nearly finished already.

@a1exh
Copy link

a1exh commented Sep 29, 2021

Bugfix spreadsheet updated as much as possible

@Pyrdacor
Copy link
Owner Author

Is this issue known? When you buy an important item (like a wind pearl) and leave without taking it you get a warning message but you still can leave without it. The item is then no longer part of the store so it is effectively gone forever and you won't be able to finish the game. It should at least stay at the merchant.

In conversations and battle loot you can't leave without taking important items. But you can at merchants.

@a1exh
Copy link

a1exh commented Oct 12, 2021

Yes I believe this is a known issue. I didn't even remember there was a warning msg.

@a1exh
Copy link

a1exh commented Oct 12, 2021

I can't remember the exact details but I think there is one of everything in the Thalion office? So in the past if this has happened and the user has played on for a significant amount of time and doesn't want to go that far back the advice was to go get the item from the Thalion office and continue.

@Pyrdacor
Copy link
Owner Author

Ok but then better don't sell the nav stones on the forest moon and make this mistake. ;)

I still consider this a bug as quest-based games should always ensure that you can't get stuck in my opinion (I don't consider the Thalion office as a valid solution to this). Moreover other game features try very hard to avoid losing important items. There is even an item flag for that to avoid dropping it, leaving it at NPCs or after battles.

@Pyrdacor
Copy link
Owner Author

Don't know if this was reported or even is considered as a bug, but I am pretty sure that the M-B-R and M-B-W values (magic armor level and magic weapon level) should not be added together but should use the max value.

It is pretty easy to get physical damage immunity in mid to late game by combining several low M-B-R items. As you get items with higher levels in specific stages which match the M-B-W levels of the monsters in these areas in a way that they can just hit you but lower monsters can't, I doubt that the values should be added together. Because a single iron ring will make you immune this way for the whole game.

I am not 100% sure though. @a1exh @nicodex @kermitfrog

@nicodex
Copy link

nicodex commented Oct 21, 2021

I'm the wrong person to be asked. I don't need reaction games, limited inventories, objects that wear out, or hours of fighting, but primarily want to play the story. Therefore, in contrast to players who concentrate on the game stats/mechanics, I welcome this possible balancing flaw and take it as a reward for the deep exploration of the world. In the end its a game design decision.

@Pyrdacor
Copy link
Owner Author

There is a spider in the cellar of the bandit house which does not move. It is spawned by a button in the last "you took the wrong teleporter" room. The problem is that the "random movement" bit is not set. To fix it just open map 276 inside 2Map_data.amb and change byte 0x22 from 0x02 to 0x06.

@Pyrdacor
Copy link
Owner Author

Pyrdacor commented Nov 4, 2021

I wonder that nobody has found it. When you change the active player with keys 1-6 while the dungeon map is visible, the "spell book" button is drawn above the map if you switch between magic and non-magic players. If you switch often there are all kind of strange bugs like blinking player name colors.

@a1exh Maybe you can add it to the list and/or verify.

@a1exh
Copy link

a1exh commented Nov 4, 2021

@Pyrdacor will do

@Pyrdacor
Copy link
Owner Author

Pyrdacor commented Nov 27, 2021

It is already known that you can skip events like monster encounters, traps, etc with the Jump spell. But when you skip events which prevent you from pass doors like the shop door in the Rogue's Wine Cellar, you can actually access areas of the map that weren't meant to reach. In general 3D door blocks won't block the player. But events will prevent you from enter like the "Shop" event, "Door" events etc. But as you can skip them you also can jump through the door block. And maps are designed in a way that the blocks behind walls or (logically) unpassable doors are just empty tiles.

This is often avoided. In towns where most of the shops, trainers, etc are, you can't use the Jump spell. In dungeons where the spell works, closed doors often use a blocking door block and change that to a non-blocking door block after opening (orc cave, hill caves, etc). But there are exceptions. The mentioned doors in the Rogue's Wine Cellar and also the doors in the Bandit's house cellar. They often need a lockpick but in theory you can just skip them with the Jump spell.

While this often won't matter as you either don't have the spell at the time when you play a dungeon or because the doors are blocking as mentioned above, there is at least one place where this really matters: The Amberstar door to Tarbos. You can just skip that door with the Jump spell without the need for the Amberstar.

This might be fixable by provide a blocking version of the door and change it to the non-blocking version when it's open.

@Pyrdacor
Copy link
Owner Author

@a1exh New bug found. It is not noticable in the original and I think it has a funny background.

When you talk to Father Anthony for the first time in Grandpa's house he will tell you that your Grandpa left a key for you and that he put it onto your table.

But actually there is a "create item" event inside the NPC data of Father Anthony which gives you the key. So even today Father Anthony actually gives you the key. But due to a technical detail this isn't shown. The reason is that a "exit" event follows which is used to close conversations immediately. You'll notice this when talking to him. You can't say or give anything to him. After he talked to you, the conversation ends and the window is closed.

As the "create item" event is no blocking event, the "exit" event is called immediately afterwards and therefore closes the window without showing the item grid with the key.

The funny part is this: I think the whole "I put it onto your table" part was just added to avoid this technical issue. But they forgot to remove the "create item" event in the NPC data. And as it isn't noticable, it survived for nearly 30 years in there.

I noticed it because in the remake you see the item grid at least for a moment before the window closes. I first thought it was a bug of the remake and actually fixed it! Before I realized that this is the same behavior in the original. :D

@a1exh
Copy link

a1exh commented Dec 30, 2021

@Pyrdacor
I am afraid I don't understand the data structure well enough to understand.

Was this an oversight? (Some left-over data) Or a workaround? (A limitation of the game engine they overcome by using settings in an unusual way?)

Is the key on your table before you talk to Father Anthony?

If you delete the "create item" event from the NPC data structure does the game still work as intended?

@Pyrdacor
Copy link
Owner Author

Pyrdacor commented Dec 30, 2021

The workaround is the fact that the key is on the table. I think it was planned that Anthony just gives the key to you. But then they noticed that it won't work when the conversation should terminate right after the first NPC text. So they changed to the "key on table" approach.

To do so they added a "map event" which basically is a chest at the location of the table. This map event is inactive at game start and is activated when you clear the cave-in. So this should answer your question. The key is on the table even before talking to Father Anthony.

So this workaround with the table is independent of Father Anthony.

The only thing they forgot was the NPC event which gives the item to you. It is still in the data. But you can't see it as the window closes immediately.

Events in NPCs and maps are chains. Consider the following for the Father Anthony NPC:

Talk > PrintText > GiveItem > Exit

So this means when you talk to the NPC, a text is shown. When you click, the item grid is shown with the key. But while PrintText is blocking (you need to click to proceed), the GiveItem is not. So the Exit is called immediately and so the whole window closes.

I hope it is a bit clearer now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

6 participants