Code Monkey home page Code Monkey logo

Comments (30)

Metibor avatar Metibor commented on May 18, 2024 2

Ok I added the event bits and it seems to work perfectly. The action event is a bit tricky but I found a way it works. Needs testing for all kind of maps though.

This is great that it works out! 🥳

I tested the dictionary stuff. It's not about wrong values. Even "crypt key" and "ruins" work. The crash depends on the amount of entries. The maximum number seems to be 113 entries. So if you remove some other entries you can set the last byte to 7 and get the 3 texts. I guess it is some bug and didn't occur often in original as you need almost every single dictionary word.

We should send a bug report to the Thalion guys. 😂

from ambermoon.net.

Thallyrion avatar Thallyrion commented on May 18, 2024 1

I will definitely help with these taks. Unfortunately i don't have time atm but after coming wednesday i can start.

from ambermoon.net.

Metibor avatar Metibor commented on May 18, 2024 1

Here are some Values

Offset Value Initial Value Comment
00 01 Year 03 D2 = 978 I don't think the date (Year, Month and Day) is used anywhere, but it is partially implemented
02 03 Month 00 01 = 1 goes from 01 to 12 (x01-x0C) on first round then increases Year but is then only reset to 7
04 05 Day of Month 00 0F = 15 always goes from 01 to 31 (x01-x1E) then increases Month
Tested with Month 01, 02 and 12
3C 3D Current Travel Type 00 00 The current Travel Type of the party
3E 3F Special Item active 00 00 x01 Compass
x02 Monster Eye
x04 DayNight
x08 WindChain
x10 MapLocation
x20 Clock
Higher values are loaded, accepted & saved but have no effect
40 41 Game Options 00 00 x01 Music (0=On 1=Off)
x02 Fast fight mode
x04 Text justified
x08 3D floor texture
x10 3D ceiling texture
Higher values are loaded, accepted & saved but have no effect

Time
In game time advances for 5 minutes every

  • 10 seconds real time
  • 2 steps on world map (Lyramion)
  • 5 steps on indoor maps
    Diagonal movement in 2D maps only counts as 1 step
  • 5 steps on 3D maps (only forward and backward movement counts)
    It seems that the change of a square in 3D maps always counts as 1 step

Haven't tested world movement with other transportation methods yet. Only on foot.

The real time timer gets reset when

  • The player moves in any direction on 2D maps
  • The player moves forward or backward on 3D maps

Interesting observation: If the player only rotates in a 3D map via mouse, the rotation stops after 10 seconds and the user has to release the mouse button and the in game time advances for 5 minutes

The Amiga version is able to load a decoded save game (Party_data.sav) from one of the 10 save games. This helped a lot! :-)

Edit: 3C 3D added

from ambermoon.net.

Metibor avatar Metibor commented on May 18, 2024 1

Events and Dictionary

Offset Type Description
0x0D14 ubyte Value is added to the current value:
x02: One time popup at X=4, Y=3 in Großvaters Keller (ID: 258 / x0103)
x04: Defeating the Brunnenmolch at X=10, Y=10
0x0D15 ubyte Value is added to the current value:
x04: Answering the Riddle mouth at X=10, Y=17
Also adds 01 03 0A 11 00 00 at the end of the save game
0x3504 ubyte[14] Each bit corresponds to a word in dictionary.[language]
Start value in 0x3504 is 01, which is "HALLO" / "HELLO"
Setting x3512 to a value higher than 01 "ÄRGER" / "TROUBLE" crashes the game, although it should go up to 07 (02 = GRUFTSCHLÜSSEL, 04 = RUINEN)

from ambermoon.net.

Pyrdacor avatar Pyrdacor commented on May 18, 2024 1

Welcome back. We still need the information about quest progress and monster defeat.

The quests are controlled by global variables. That's what I already know. But we need to find the exact location of them in the savegame.

For example healing Sally will change some variable so her father gives you a reward. After that he won't give it to you again but will talk more friendly to you. Other quests are freeing the people in luminor's tower or delivering the picture to the head of newlake.

The savegame before and after completing a quest should be compared and the differences must be evaluated or at least gathered.

Same goes for monsters. Before and after defeating a monster group should change something in the savegame.

Today I decoded how NPC conversations work. Next update will contain NPC and ability to talk to them. 2D NPCs are already working on my end.

from ambermoon.net.

Pyrdacor avatar Pyrdacor commented on May 18, 2024

Wow cool findings. Thanks a lot. Will add them to the game soon.

from ambermoon.net.

Metibor avatar Metibor commented on May 18, 2024

Here are the number of steps you can take per 5 minutes for all transportation methods.

Value Name Steps
0 Walk 2
1 Horse 3
2 Raft 2
3 Ship 4
4 Magical disc 2
5 Eagle 6
6 Flying 🦸‍♂️ 256
7 Swim 2
8 Witch's Broom 4
9 Sand lizard 3
A Sand ship 4

from ambermoon.net.

Pyrdacor avatar Pyrdacor commented on May 18, 2024

Interesting. Do you know if and where flying is used?

from ambermoon.net.

Metibor avatar Metibor commented on May 18, 2024

The bottom of the save game is a little bit different than described here
Before the events are the fighting positions.

Offset Type Description Start Value
0x35E4 ubyte[6] Fighting positons for all party members
Possible values from 00 to 0B
01 02 03 04 08 09
0x35EB * Events (see below).
0x35EB + (Number of Events * 6) uword unknown, but possibly End marker? 00 00

from ambermoon.net.

Metibor avatar Metibor commented on May 18, 2024

Regarding the flying:
No, not really.
I just manipulated one of the transportation locations in the save game to "Flying".
Then you can "enter" the "vehicle" once you stand on the position.
Works for all transportation methods, including swimming.

Oh, and you can't exit the flight mode! So it's not very usable.
I think it is a leftover for game testing. Maybe there is a cheat to activate/deactivate it.

from ambermoon.net.

Pyrdacor avatar Pyrdacor commented on May 18, 2024

Offset Type Description
0x0D14 ubyte One time popup: Changes from 00 to 02 after the first text message appears in Großvaters Keller (ID: 258 / x0103)

I guess it's a bit flag storing a bit for each popup text? Wouldn't make much sense to store a 2. But not sure about it.

from ambermoon.net.

Pyrdacor avatar Pyrdacor commented on May 18, 2024

About the flying. Not all transports can have locations. I guess using an eagle in savegame wouldn't work well as well. I also think it's a cheat as it seems to be able to fly over high mountains and very fast. It would be interesting to find a cheat in the original game now. :D

from ambermoon.net.

Pyrdacor avatar Pyrdacor commented on May 18, 2024

Ok the event data at 0x0D14 are the global variable bits. There is a map event which sets a global variable to 0 or 1. The one-time popup in Großvaters Keller sets global var 129 to 1 and the Brunnenmolch event sets 130 to 1. This means there are 16 bytes before that for variable 0 to 127 (I guess for Lyramion world map events). So they start at 0x0D04.

There is also a condition event which checks for global vars. But it isn't used for the mentioned events which is strange. I guess text popups are implicitly dependent on global vars. But I haven't figured out how yet. The same is true for triggers. The condition event can force a specific trigger (like hand cursor) but for text popups this isn't used. Instead it has an own value just for that. I looked for a value for the global var value but the Brunnenmolch event chain doesn't have any value at all I guess.

from ambermoon.net.

Pyrdacor avatar Pyrdacor commented on May 18, 2024

I did a bit more research. Triggering the text popup in front of the house of bandits will set global vars 1, 2 and 3 to 1. In the savegame byte 0x964 is set to 0x0e (which is a value with 3 bits set in a row). But the offset to 0xd14 (which should contain the bits for global vars 129 and 130) is 944 bytes away and not 16 bytes (1 bit per variable) as I thought before. I don't get it yet.

from ambermoon.net.

Pyrdacor avatar Pyrdacor commented on May 18, 2024

I updated the known values in the Ambermoon git repo and added you to the special thanks section there. :)

from ambermoon.net.

Metibor avatar Metibor commented on May 18, 2024

I did a bit more research. Triggering the text popup in front of the house of bandits will set global vars 1, 2 and 3 to 1. In the savegame byte 0x964 is set to 0x0e (which is a value with 3 bits set in a row). But the offset to 0xd14 (which should contain the bits for global vars 129 and 130) is 944 bytes away and not 16 bytes (1 bit per variable) as I thought before. I don't get it yet.

I didn't do the math, but could it be something like:
Base offset + (MapID * N bytes) + (EventID for MapID * bit) = Position in save game to set/unset
Where N is a constant that is high enough to contain the number of events for the map with the highest number of events.

This wastes much space in the save game but is easy to calculate, I think.

from ambermoon.net.

Metibor avatar Metibor commented on May 18, 2024

I updated the known values in the Ambermoon git repo and added you to the special thanks section there. :)

Thank you! 😊

Have you seen my comment regarding the dictionary entries starting at 0x3504?

Starting value "HALLO" / "HELLO"
grafik

All bits set up to "ÄRGER" / "TROUBLE"
grafik

Setting x3512 to 02 or higher crashes the game for me, although there are 2 entries left in the dictionary.
I don't know if it is possible to get the entries 02 = GRUFTSCHLÜSSEL and 04 = RUINEN

from ambermoon.net.

Pyrdacor avatar Pyrdacor commented on May 18, 2024

About the event bits. I thought of something similar. Maybe I'll have the time to test a few things soon.

Yeah I saw your edit about the dictionary but just forgot to add it then. Will do so tomorrow. Could it be that bit 1 of last byte is not used. Did you try to skip the one bit and use a value like 5 (4 + 1) without the 2? Or something like that?

I guess checking Gruftschlüssel should be easy with cheat items. Maybe I can do so tomorrow.

from ambermoon.net.

Pyrdacor avatar Pyrdacor commented on May 18, 2024

I looked a bit more into the event bits. The difference between offsets 0x964 (world map outside house of bandits) and 0xd14 (grandfather's cellar) is 944 (decimal). This divided by 8 is 118 which is the map index offset between both maps (141 to 259). So I assumed that there are 8 bytes per map which would be 64 event bits per map. I calculated the start of the section to 0x4FC when including map index 0. For map 8 (which is some world map) there is bit 1 set. This map has events in contrast to surrounding maps so this was strong evidence.

And then I thought about it and looked at the events on map 259. There are 2 collections. The events themselves and the event list which is referenced by map tiles. The list is never longer than 64 I guess cause that would mean that more than 64 tiles would trigger events.

Then I checked the two popups (end of stairs and pond lizard). These are entries 1 and 2 of the event list which would match the 0x02 and 0x04 you mentioned earlier. So every event list index is bound to a bit in the 64 bits per map. These bits turn events on or off.

The action event which I thought to be a global variable set action seems to be either a "event bit set action" or something like "disable the current event list entry". I will check this out too.

Ok this is definately true. Event 12 in grandfathers house has initially the bit set. This is the hidden key on the table in the hero's room which is only unlocked after the grandfather dies. Moreover event 2 is set after initial event popup (value 4).

from ambermoon.net.

Pyrdacor avatar Pyrdacor commented on May 18, 2024

Ok I added the event bits and it seems to work perfectly. The action event is a bit tricky but I found a way it works. Needs testing for all kind of maps though.

from ambermoon.net.

Pyrdacor avatar Pyrdacor commented on May 18, 2024

I tested the dictionary stuff. It's not about wrong values. Even "crypt key" and "ruins" work. The crash depends on the amount of entries. The maximum number seems to be 113 entries. So if you remove some other entries you can set the last byte to 7 and get the 3 texts. I guess it is some bug and didn't occur often in original as you need almost every single dictionary word.

from ambermoon.net.

Pyrdacor avatar Pyrdacor commented on May 18, 2024

Maybe they left one poor developer in Gütersloh who patiently waits for this one bug report for years. 😁

About the event bits. It is a bit strange that there are 64 bits. Because everyone who decoded the map tile data thinks that the map event index of a tile is encoded by 5 bits (1-31). I wonder why there are 64 bits. Maybe the second 32 bits are used for something else or the tiles/blocks can store more than 32 indices. Have to check if there is any map with more than 32 events inside the event list.

from ambermoon.net.

Pyrdacor avatar Pyrdacor commented on May 18, 2024

We did make good progress. Most savegame data is already decoded. As Ambermoon uses reserve space (e.g. chest locked states for 511 chests while there are only nearly half that amount), I guess that there are more than 528 event bit sections. But it will be hard to find out how much as the rest will always be 0. Maybe 1000? 1024? Would be cool because a lot of unknown data would make sense then. 😁

from ambermoon.net.

Pyrdacor avatar Pyrdacor commented on May 18, 2024

Ok 3D maps can have more than 32 map events. Spannenberg has 41. So the 64 event bits make sense.

from ambermoon.net.

Thallyrion avatar Thallyrion commented on May 18, 2024

Ok i'm back and i see a lot has happened already. Could you please give me some direction as to what would be usefull to decode next and to avoid doing things twice.

from ambermoon.net.

Pyrdacor avatar Pyrdacor commented on May 18, 2024

Ok I found out that the global variables are located at offset 0x0104. There are 1024 bytes. Each bit is used for one variable. So there are 8192 global variable bits.

The map event bits (which control if a map event is active/triggerable) start directly behind that at offset 0x0504. There are event bits for maps 1 to 1024 while only 1 to 528 are used in Ambermoon of course. There are 8 bytes (64 bits) per map.

So the savegames are decoded up to offset 0x2504. From this offset up to 0x3504 there is an unknown gap of 0x1000 (4096) bytes. Then only after the dictionary word bits there is possibly some unknown data and that's it. So we almost decoded all of the savegame data. Yay! :)

Oh and one word at offset 0x3A is also unknown. Maybe someone will find out its meaning.

from ambermoon.net.

Pyrdacor avatar Pyrdacor commented on May 18, 2024

Ok the 4096 bytes at 0x2504 are bits which control if characters are visible on the map or not. Like enable states of NPCs/monsters/party members. So were almost done with savegames. :)

from ambermoon.net.

Pyrdacor avatar Pyrdacor commented on May 18, 2024

Update: We now have all important data from the savegame. There is not much left to decode and I don't miss anything at the moment. So I will close this for now. If you have some more info, feel free to reopen this. Thanks for your help. :)

from ambermoon.net.

Thallyrion avatar Thallyrion commented on May 18, 2024

I was just doing some stuff with fights, so this is not needed anymore?

  • Defeat a monster group (somewhere defeated monsters must be tracked)

from ambermoon.net.

Pyrdacor avatar Pyrdacor commented on May 18, 2024

No it's not needed anymore. I decoded the character bits today. They control if map characters are active. This includes monsters. So after fights the active bit is just changed and the monster will no longer appear on the map.

from ambermoon.net.

Related Issues (20)

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.