more Automap info

Hier kann man Fragen über Fate stellen, die man schon immer mal beantwortet haben wollte.
Fate 1 - Fanpage

Moderatoren: sircharles, Xajorkith, erni

Antworten
Rangerous the Second
Goblin
Goblin
Beiträge: 47
Registriert: Sa 21.01.2017 - 04:15
Wohnort: US

more Automap info

Beitrag von Rangerous the Second »

Edit: I have identified many of the main memory locations that would be needed to set up the automap (referenced to invisibleshadow's megapacket running v1.6 under FS-UAE):

0x800545D0 East-West Coordinates (4 bytes, big-endian)
0x800545D4 North-South Coordinates (4 bytes, big-endian)
0x800545D8 Facing Direction (4 bytes, big-endian)
enumerated as:
0 North
1 West
2 South
3 East


0x8000E58B Location, enumerated as:
0 Larvin
1 Laronnes
2 Fainvil
3 Valvice
4 Cassida
5 Perdida
6 Pirate Rock
7 Katloch
8 Mernoc
9 In the Wilderness
10 Catakombs
11
12
13 Grottos
14 Castle Crypt
15
16
17 Agyssium

Next, I'll look for the level indicator, e.g. how deep in the Catakombs, etc.

Even with this knowlege, a fog-of-war style automap would still be quite an undertaking. It would require organizing all of the maps, duplicating structures which encapsulate unknown areas, automating line-of-site, and so on.
Rangerous the Second
Goblin
Goblin
Beiträge: 47
Registriert: Sa 21.01.2017 - 04:15
Wohnort: US

automap status

Beitrag von Rangerous the Second »

This automap is valid only for Fate v1.6 English version running under the FS-UAE emulator:

https://drive.google.com/open?id=1qlOCW ... 9x5s0Rs0ga

Here's a youtube summary:
https://youtu.be/D0dbKe4wkIo

I've included a compiled exe which can be run independently, as well as the Python source, which can be run under Python 3.7.3 IDLE.

Unzip into a folder.

Ensure the .bmp mapfiles are in the same folder.

Launch Fate on the FS-UAE emulator.

After Fate is running, launch the Python EncounterMap program.

The encounter map should now be open as a separate window. It will get its data from the currently running FS-UAE process and will assume it has the memory map of Fate v1.6 under FS-UAE.exe. If FS-UAE isn't running, it will stop. Beyond that, it simply assumes that FS-UAE is running Fate; I haven't programmed in any verification steps.

Whenever the automap is the active window, it accepts keyboard inputs, as follows:

? = This menu
Q = Quit
ESC = Quit
D = Drink (all)
F = Feed (all)
H = Heal (all)
M = Mana (all)
T = Teleport to the mouse pointer
CTRL = Draw a circle around the active party
Up/Down/Left/Right = Scroll around the automap
PgUp/PgDn = Zoom in or out of the automap
P=Debug printout of party x,y, encounter x,y, scaling and offsets

One major issue:

On the wilderness map, although party position plots correctly, encounters are not yet plotted correctly. The program uses an 8-bit variable for encounter group x and y locations. 8 bits can only represent 256 positions. The outdoor map is 640x400, neither of which can be represented within 8 bits. I believe the outdoor 256x256 encounter plot is a window into the outdoor map, but I haven't yet found the coordinates that say WHERE it should be plotted within the outdoor map. Last night I started puttering with breakpoints, but haven't yet traced it to the right place in the code.

A minor issue:

I haven't written the Python to decode Fate maps from the Amiga graphics format. Instead, it currently uses maps in a BMP format to be placed in the same folder as the automap proram, and so far I've only instantiated Larvin, Laronnes, and the Wilderness. It will take some work to either (best option) learn to decode the maps that are already in the Fate program, or (probably easiest option) instantiate all 100 or so Fate maps into BMP format. For now, whenever the game enters a location that does not have a matching map, the Python code will terminate with a file-not-found error.

Unknown/Future:

Although it seems trivial to do so, since I don't yet have it working completely as desired, I haven't taken any time to search FS-UAE for unique memory locations that would assure that there is not some unexpected memory offset for some reason, or that Fate really is being emulated. This seems like a good future effort, after more important matters have been attended to.

Credits:

I found Dragonfly's FaMe very helpful, and have taken the liberty of converting a few of those maps to BMP in order to support this automap feature. Respect!

I found invisibleshadow's Fate megapaket invaluable and just plain trouble-free to use. Gratitude!

Abyss' hex editing posts were critical enablers for this capability. Thanks!

Merope's Kompendium was another great help. Amazing!

Anyway, thanks to everyone at the Might and Magic site.

I'm still chugging away on this, but I work slowly and repeat myself a lot. I hope it hasn't been too boring.

Until then, happy gaming to all!
Rangerous the Second
Rangerous the Second
Goblin
Goblin
Beiträge: 47
Registriert: Sa 21.01.2017 - 04:15
Wohnort: US

automap update

Beitrag von Rangerous the Second »

I've now updated automap for both Fate v1.6 (English) and Fate v1.7 (Deutsche) under the FS-UAE.exe emulator.

This uses static logic that tests the contents of a few memory locations to validate whether version 1.6 or 1.7 of Fate is running. Then it uses the relevant memory locations in the detected version to support the automap.

Here's the updated link to the most recent automap routine:

https://drive.google.com/open?id=11kEPe ... NLII_e9wZ1

1) Outdoor/Wilderness encounters still do not register properly. This would require some sleuthing and stepping through the code to resolve.

2) I still have not instantiated more than a few maps. This might be a good area for collaboration, if anyone with knowledge is interested.

3) I would like to extend this capability to fate under WinUAE, but I've been unable to get Fate to run under WinUAE. I can get WinUAE to run ADFs without any problem, but for some reason I am too ignorant to get it to work with WHDLoads. *sigh*

4) In the future, it would be desirable to use a fuzzy logic approach that would be more robust to a variety of emulators and versions. What I have in mind is to search for known, unique memory sequences, and use those signatures to determine the offsets of the memory locations of interest to the automapper, even when they are shifted in memory.

However, that would take quite a lot of effort.

For now, I've accomplished a certain amount that seems kind of interesting, and as a tool it has worked pretty well for me personally, but it's unclear whether further efforts to flesh out all of the maps or to generalize the automap tool to other memory configurations would be a fruitful use of time.

As always, thanks for all the help and support on this incredible web site, and happy gaming!

Respectfully,
Rangerous the Second
Rangerous the Second
Goblin
Goblin
Beiträge: 47
Registriert: Sa 21.01.2017 - 04:15
Wohnort: US

automap status

Beitrag von Rangerous the Second »

I've been fairly happy with the Python automap of Fate v1.6 under FS-UAE, except for the outdoor, wilderness map. I had hoped that someone might be willing to provide a folder of all the Fate maps in BMP format, using the game's naming system. That would have completed all but the outdoor wilderness flaw.

Since automap has met my needs in its current form, and there seems to be very little player or forum activity with Fate, I've moved on to other things (most recently, a utility to provide non-human input to Wasteland's auto character generator, which doesn't stop rolling until the next Wasteland character has met the user's defined minimums [LOL-goodbye re-roll rhythm!]).

Thanks for all the help on this great website. I'm really sorry to see that these golden oldies are mostly played out with little external interest, but I can understand that it's really a very limited subset of people who care to spend time within the gaming limitations of 1991, given that so many really great modern games are available.

Viva nostalgia!
Benutzeravatar
Abyss
Titan(in)
Titan(in)
Beiträge: 2078
Registriert: So 10.12.2006 - 21:41

Beitrag von Abyss »

Sorry for bad English, I have to use Google translator.

I'm still working on getting it to work. In the video it looks great. But somehow I'm too stupid ...

But I do not give up. An Active Map where you can see every NPC would be great.
Benutzeravatar
Dragonfly
Dieb(in)
Dieb(in)
Beiträge: 64
Registriert: So 21.02.2016 - 14:01

Beitrag von Dragonfly »

Hi Rangerous,

You usually don´t get much feedback in this forum - so don´t be despaired, just live with it :D .

I am very busy at the moment and have just very little spare time - to little to invest it for 'Fate'. But I like the idea of what you do and maybe can provide some tipps.

Maps:
When you need all the maps, you could get them easily with 'FateMaster'. Just go to the Maps-Tab, set size to 100% and copy the map(s) to clipboard; and from there to any image-processing program you like, then save it as 'bmp'.


Wildernis:
The Wildernis is divided into quadrants, each 256*256(from 0 to 255) fields, starting from the bottom-left. So, there must be a byte holding the quadrants-id (maybe it´s the same byte, which holds the level-id in dungeons).


Greetings,
Dragonfly
Rangerous the Second
Goblin
Goblin
Beiträge: 47
Registriert: Sa 21.01.2017 - 04:15
Wohnort: US

new approach?

Beitrag von Rangerous the Second »

Alright, thank you for the feedback. I'll try a new approach which should be more generic. It may work no matter which emulator is used, and for either the German v1.7 or the English v1.6, but it will take me some time to complete.

I'll search windows for a process called either winuae.exe or fs-uae.exe (done).

Whichever process was found, i'll search for signature features that are nearby important memory locations (half-started).

Once important memory locations are reliably identified inside the Amiga emulator process, the automap should work OK (except in the wilderness, which i still do not understand [that is a low priority]).

It will probably be a while before i have completed this more challenging task, because it does not assume in advance that i know where these important memory locations are located. It will be more of a "fuzzy search."

Thanks for following up with me. I appreciate the interest.

------------------------------------------------------------------------

Post Script:

So far, I have only analyzed Fate v1.6 and Fate v1.7. Because of the work involved, I probably will not extend this analysis to other versions.

Here is an example of the memory signature features that i am talking about:

The unique string "W+A+D+S+CrMeMg" starts 14 bytes before the encounter table (encounters = 99 entries of 24 bytes each). This means that the encounter table can be reliably found across multiple versions with different emulators. I am only concerned that if Fate allows remapping the control keys, this "unique" signature may be able to be changed.

In both v1.6 and v1.7, the unique string "D:c" is found twice. The first instance is followed by two bytes which specify the active map (for example, "90" is the wilderness map).

The unique string "Winwood" appears three times. The second occurrence is the beginning of the party section of memory (500 bytes per character x 28 characters). The occurrences which have an "!" two bytes prior to "Winwood" are not the desired locations.

My problem is with the "Encounter Type" table. In both German v1.7 and English v1.6 under fs-uae.exe, it begins at 0x080002EFA. I sort of recall that under WinUAE (which I cannot get running on this newer computer), it was found at 0x07FFF2EFA using ArtMoney, and maybe at 0x00002EFA using WinUAE's built-in debugger. Those WinUAE addresses could be bad information, because it's been a while since I had WinUAE working on a computer I use. Anyway, each entry is 64 bytes long. Data in the "Encounter Type" table changes when you move to a new unique area (for example, you encounter different kinds of things in Larvin than you encounter in the wilderness). Unfortunately, so far I have found no reliably invariant features in the table or in nearby memory.

As you can imagine, the "fuzzy search" approach looks as if it might be fairly reliable once it is programmed properly, but it will take a little while to get it right.

Another feature I have not investigated, but that would be nice to have, is the current encounter entry. (going from memory, I could be wrong here): Once you begin discussions, the encounter leader's name and 500 bytes of character data is listed.

The party (x,y) location and heading appear to be reliably accessible by counting a specific number of bytes offset above the party table and below the encounters table. These offsets appear stable across both German v1.7 and English v1.6 versions.

So, summarizing, it will take a little time to implement these fuzzy searches, which do not assume specific a priori knowledge of the memory locations of interest.

Thanks!
Rangerous the Second
Goblin
Goblin
Beiträge: 47
Registriert: Sa 21.01.2017 - 04:15
Wohnort: US

Wildernis@Dragonfly

Beitrag von Rangerous the Second »

The Encounter Table encodes each encounter group's x,y location into two bytes (one each for x and y). As you noted, this is able to encode (x,y) locations through an extent of (0 to 255,0 to 255) or, if signed, (-128 to 127,-128 to 127).

Regrettably, Wilderness locations have a greater extent of (0 to 639,0 to 479) which cannot be encoded in only one byte each.

Based on my experiments, I have determined that Wilderness encounters add each group's unique (x,y) locations to an encounter base (x',y') location. Therefore, each Wilderness encounter group is located at (x+x',y+y').

The encounter base (x',y') location always changes in increments of 32, which effectively means that the Wilderness can be considered to be composed of encounter tiles of 32*32 extent.

With reasonably diverse encounter groups, I can find the current encounter base (x',y') value -- it takes about 10 to 15 minutes per attempt, if I do not get too confused while I am doing it. However, it changes in ways I do not know how or when to predict. These changes are only very loosely related to Winwood's movement -- they are not reliably derivative of Winwood, in either time or in space.

We don't know the structure of the encounter base (x',y') value. One thing that we do know is that Winwood's Party location is encoded in 12 bytes: 4 bytes x, 4 bytes y, and 4 bytes heading. We might reasonably hypothesize that the encounter base (x',y') values are encoded similarly (e.g. 4 bytes for x, 4 bytes for y). Alternatively, they could easily be encoded in just one byte per value, or any number of bytes in between. This makes the search more complex, and complexity requires more patience to conduct the greater number of trials that complexity engenders.

So, ... more work to do :)
Benutzeravatar
Abyss
Titan(in)
Titan(in)
Beiträge: 2078
Registriert: So 10.12.2006 - 21:41

Beitrag von Abyss »

Ok, I give up. I can not get it to work. Is there a step by step guide for dummies? ;(
Benutzeravatar
Ajam
Fahnenträger(in)
Fahnenträger(in)
Beiträge: 96
Registriert: Sa 04.05.2002 - 21:18

Beitrag von Ajam »

Hallo Rangerous,

i've seen your Video on Youtube and now i want to play and end the game for the third time.

Thanks for your great work.

in the next days i will try your Automap-system.

Till later

Ajam
Benutzeravatar
Ajam
Fahnenträger(in)
Fahnenträger(in)
Beiträge: 96
Registriert: Sa 04.05.2002 - 21:18

Beitrag von Ajam »

For me the Automap works fine. You have to be Administrator to use the Automap.

Sadly the automap does not work for the Dungeon. :(

Thanks for your work, Rangerous.

Greetings Ajam
Rangerous the Second
Goblin
Goblin
Beiträge: 47
Registriert: Sa 21.01.2017 - 04:15
Wohnort: US

update

Beitrag von Rangerous the Second »

[quote="Ajam"]You have to be Administrator to use the Automap.[/quote]

Thanks for the kind words, and also for letting us all know that it must be run as administrator.

Sorry it's taken me so long, but I had to learn a great deal to achieve the current version, and I'm a slow learner :)

This version has significant updates, although the core functionality is basically the same. Instead of assuming certain fixed memory locations, the updated automap searches through all of the emulator's memory for unique fingerprints that reference Fate memory locations of interest. This may take several minutes, but appears to be more generic and robust than the previous method.

I've tested both 1.6 and 1.7 with FS-UAE.exe emulation. I believe that the total memory fingerprint search method should also work with WinUAE.exe, but I'm unable to test that because I'm too ignorant to get WinUAE working again. Even though WinUAE supported my original Fate experience, I couldn't get it to work after I updated to a new PC... *shrug* so I guess I'm an FS-UAE guy from here on out.

Sorry about the failures in the dungeons. It just needed appropriate dungeon bmp files. For now, I've "fixed" that by naming blank white files appropriately, so you can see potential dungeon encounters, but you can't see the structure of the dungeon map. Anyone can drop the actual dungeon BMPs into the same folder as the automap program, and they'll work. They just have to be named correctly.

I really appreciated exploring the maps in FateMaster, but when I used the "copy to clipboard" button and then pasted them to Paint, they all turned out black, so I was unable to leverage the great work that's already been done there.

Here's the link to the current automap archive:
https://drive.google.com/open?id=1qlOCW ... 9x5s0Rs0ga

It includes automap.exe that can be run by anyone, although thanks again for sharing that it must be run as administrator (right click on it and select "run as administrator").

It also includes the Python 3.7 source code, so that you can see exactly what's happening and tweak it to your heart's content.

There is still a massive failure on the wilderness map: the random encounters often do not register properly, so they often show in the wrong place. The only time I'm sure their positions are plotted correctly (on the outdoor map) is when I've just stepped out of a town or city. Maybe someday I'll fix this, if I ever learn where the appropriate anchor offset is located in Fate's memory.

Both town and wilderness encounters reset as you cross from civilization to wilderness and vice versa, so whenever I want to build a particular party composition, I enter and exit cities and towns, and then teleport directly to any friendly classes that I would like in my party. This takes very little time and allows some fun experimenting.

Anyway, thanks, everyone, for your help and interest. Sorry I'm a terribly slow and fairly inept programmer, but I hope someone finds it a little bit useful.

Best Regards, Rangerous the Second

Edit: updated link with more city maps but still no dungeon maps
Zuletzt geändert von Rangerous the Second am Fr 15.11.2019 - 02:10, insgesamt 1-mal geändert.
Benutzeravatar
Ajam
Fahnenträger(in)
Fahnenträger(in)
Beiträge: 96
Registriert: Sa 04.05.2002 - 21:18

Beitrag von Ajam »

Hey Rangerous,

you don't have to apologize. You did a great job. Your Automap is the main reason, i end Fate for the third time. And now i hear, you worked a lot for a new update, i'm thinking about the fourth Runthrough.

Great work! And thanks a lot!

Greetings
Rangerous the Second
Goblin
Goblin
Beiträge: 47
Registriert: Sa 21.01.2017 - 04:15
Wohnort: US

still has bugs

Beitrag von Rangerous the Second »

I just played with it for a bit, and it still has problems. Specifically, I think I should fix it so that you can move the map around using the mouse, because it's too easy to get lost using keyboard zoom and arrow keys. Because of that challenge, it's no fun to use right now, except for the very limited case of setting up your ideal party.

I got the FateMaster clipboard to work, so I also copied all the city maps to the correct filenames, but haven't got to the dungeon maps yet. They'll still be all white, and will show encounters, but not map details.

I'll give a shout when it's a little nicer to use.

Kind Regards, Rangerous II
Benutzeravatar
Ajam
Fahnenträger(in)
Fahnenträger(in)
Beiträge: 96
Registriert: Sa 04.05.2002 - 21:18

Beitrag von Ajam »

I'm looking forward to this! :)

Thanks
Chira
Goblin
Goblin
Beiträge: 35
Registriert: Do 20.07.2006 - 11:51

Beitrag von Chira »

Hey Rangerous,
i wanted to say thank you. the automap works very well and makes the game much easier/more pleasant.
great job :respekt:
Antworten

Zurück zu „Fate - Gates of Dawn“