-
-
Notifications
You must be signed in to change notification settings - Fork 20
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
Comments
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:
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. |
The implementation of the writers will be tracked here: #53 |
@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. |
Sounds good. I'll try to make some diff files for the more obscure bug fixes to help satisfy my curiosity |
@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. |
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 |
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. |
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) |
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 |
No there is only he/she and his/her. So I guess grandchild is a good solution. |
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. |
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:
|
Thanks. I can change the text and move this bug to the FIXED page. |
@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. |
Thanks this has never been reported. Is it 100% reproducible? |
Daniel Schulz has noted two semi-related things
It is not obvious if these are bugs or as intended. |
I only tested with german v1.01 (22-11-1993). But with this version it is reproducible. |
@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:
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. |
@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. |
No one has mentioned it. But it is not really a bug unless it causes crashes due to string length errors etc? No? |
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. ;) |
Bug: when the monster ai is determining which spell to cast and on which target, there is a bug in the row spell targeting:
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
to
should be enough to fix it. |
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. |
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. |
@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:
This is also the way I implement it in Ambermoon.net. |
Scimitar in French is 'Cimeterre' .
Le mar. 21 sept. 2021 à 17:13, Pyrdacor ***@***.***> a écrit :
… I guess Daniel also renamed the SCIMITAR to "Krummsäbel".
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#52 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AVPMYYVDW4D5YKO6BA4NOZTUDCOJFANCNFSM4TFXKG5A>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
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.
As for the patch, look for Well... that makes the data bugged as well, so, the first byte of those items should be incremented by 1.
What comes next? Neusee (Newlake)?? Or even worse: Edelsteinstein (Gemstone)???
So.. characters could learn to swim around a whole continent? I know, it's a fantasy setting - but that seems very unrealistic to me |
Thanks for clarification. I think this is worth fixing. Does it mean that the whip reduces Parry instead and the armours Attack?
Yeah me too.
You can't cross the ocean without a boat. So this is already taken care off. I am indifferent regarding the swimming stuff. |
Yeah, that's my interpretation, too. Also... now that I think about it... I have to have another look at the snake helmet..
Yes, the Ocean is not the problem...
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: 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 |
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. :) |
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.
|
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. |
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?"
The first statement loads the pointer to some internal structure into A0. 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. |
Sounds very promising. Fixing this is a huge achievement. Thanks for your research. |
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 So the problem is that the pointer to the item slots is based on the wrong register.
or: replace |
Excellent, I follow your latest fixes, its great really :).
Le jeu. 23 sept. 2021 à 17:51, kermitfrog ***@***.***> a
écrit :
… 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
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#52 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AVPMYYVOPE435HLEQXTBBFDUDNEHZANCNFSM4TFXKG5A>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
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. 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. |
Sorry that I only respond now. Much to do recently. The fix for the curse spell works perfectly now. :) |
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. |
Bugfix spreadsheet updated as much as possible |
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. |
Yes I believe this is a known issue. I didn't even remember there was a warning msg. |
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. |
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. |
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 |
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. |
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. |
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. |
@Pyrdacor will do |
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. |
@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 |
@Pyrdacor 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? |
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:
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. |
The goal is to create a stable patched Ambermoon version in german and english. We focus on the english patch for now.
The text was updated successfully, but these errors were encountered: