The forum for General Discussion
POST REPLY
Post Jul 12, 2018 00:30
Hi!

I just started using this software yesterday, and I'm really enjoying it. I like that I can use it alongside pretty much any game, but noticed that only a few games have the auto tracking feature.

I saw that the latest update adds auto tracking for another game, and I was wondering what is involved in making an auto tracking profile? I've got a lot of free time, and own a lot of grid based games - is making some new auto tracking profiles something someone can learn to do, or is it something really complicated?

Thanks,
- PJ
Site Admin
Post Jul 12, 2018 10:59
Hi PJ, thanks for using Grid Cartographer, I'm glad you're enjoying it :)

I think creating Game Link profiles is pretty technical, but it is possible. The guy who made the "Gateway to the Savage Frontier" profile did that without any real involvement from me after we'd worked on a couple of profiles together, so I guess it's can be taught / figured out. I'll do my best to give an overview of the process at least.

The two main parts of the process are:

1. Figuring out which memory addresses in the emulated memory hold information about the player. Specifically: the X/Y position in the current map, the facing direction and finally some identifier for what map you're on.

The current method for doing this is to use a modified version of DOSBox I made which has some rudimentary memory scanning features in it. You can download that here:
http://www.gridcartographer.com/files/d ... emscan.zip

The process is similar to using something like Cheat Engine. You start with all addresses as possible candidates and then exclude them based on what move you just made, eg. move forward and then look for all the values that increased.

It's not super friendly so I'm working on a new tool using the pro/steam edition scripting system. This also ties in the upcoming LibRetro support which will not work as an extension to dosbox and needs a compatible equivalent.


2. Writing a profile XML which specifies these address and provides rules to decode the information. The profile is used to setup the map correctly and drive the avatar marker. As well as creating new region tabs as you move between maps (or placing you within a single large world map in the case of Might and Magic). Grid Cartographer asks DOSBox for the data at the addresses you found and the rules in the profile decode and reformat that into the correct format.

Since there isn't much in the way of technical documentation for this, perhaps the best way to figure out the profile XML at the moment is to look at the ones that already exist. If you open up the base0.zip data file in the installation, you'll find a folder 'gamelinkprofiles' with all the current ones.

Grauken has setup a wiki here which might also help: http://gridcarto.wikidot.com/

If you do make a profile for a new game, there's a folder in the user data here:
C:\Users\%USERNAME%\AppData\Roaming\David Walters Development\Grid Cartographer 4 Pro Edition\Game Link Profiles
that you can copy them into, and the log file will tell you if there's any problems:
"C:\Users\%USERNAME%\AppData\Roaming\David Walters Development\Grid Cartographer 4 Pro Edition\log.txt"

Hope this is useful information, please let me know if you have any questions!
Site Admin
Post Jul 13, 2018 15:16
I've scared you off with a a wall of text haven't i :ohdear:
Post Jul 14, 2018 23:57
No, this is great - I don't know how I'll go, but I'm going to take a big look at it, as it is a lot easier mapping when the cursor follows the game location, and I own most of the step based games on GOG, so I've got plenty to try it out on :)
Post Jul 15, 2018 05:11
Hi, I've been trying it out with Curse of the Azure Bonds. I found x, y and facing memory locations. When I'm in Grid Cartographer, with the gamelink hud showing, I can see the x, y and facing values change as I move about in the game, but I haven't worked out anything else yet, so nothing actually happens on the map grid.

I've been running the dosbox you linked to for checking the memory, outside of grid cartographer, because when I run it inside of grid cartographer, using gamelink, a message displays "please update dosbox". Do I need to run it using gamelink to use the F4: netpeek packets feature, because when I run it outside of grid cartographer, without gamelink, pressing F4 doesn't do anything...

It was fun exploring this, and seeing how to examine the dosbox memory, but this is probably a bit complex for me to find out some of the information (map ID, ground level, etc).

I was wondering, given that I can find x, y and facing, is it possible to create a profile that does nothing more than move the avatar according to x, y and facing, and leaves it up to the player to do everything else in grid cartographer manually?
Site Admin
Post Jul 15, 2018 08:50
Hey PJ, great to hear from you.

The memscan version of dosbox I linked is a bit out of date with what GC v409 expects but you don't need to use Grid Cartographer to make it work. The F4 feature is an older thing too, instead use the mon command and F3 to get the same result.

It should be possible to create a profile that's just a "wide open space". The map in Wizardry 6 is setup like that:

Code: Select all

	<regions>

		<region id="1" name="Maze" ground_floor="true" start_floor="G" auto_create="true" >
			<grid infinite="true" origin_tl="true" />
		</region>

	</regions>
You'd then have a view like this:

Code: Select all

		<packetview region="1">
 			<xpos offset="5" length="1" min="0" max="f" />
			<ypos offset="6" length="1" min="0" max="f" />
			<face offset="7" length="1" mask="6" n="0" e="2" s="4" w="6" />
			<const_floor>G</const_floor>
		</packetview>
Since you specifically mentioned Curse of the Azure Bonds, here's an incomplete profile for it. I hit a bit of a dead end when I realised that it made extensive reuse of tiled sub-areas of the map and it then teleports you around. It's a bit hard for me to explain but it basically got very weird and I parked work on it in pursuit of simpler games.

Here's my current work in progress:
http://www.gridcartographer.com/share/c ... ial%5D.xml
Post Jul 15, 2018 23:58
Thanks! I'll try this out.
Post Jul 23, 2018 09:21
Hi again. What I can't work out is that the xml profile needs the packet header/footer/etc information. How do I obtain that information?

I've tried writing my own program in Quick Basic 4.5 for DOS as well, using DosBox. I've got the memory locations for the movement, facing, etc, that my program generates, but I need to be able to find its packet information so that Grid Cartographer can see it. At the moment, I've provided the numbers for dosbox, and for my exe file, but grid cartographer doesn't see any communication from it when running it with gamelink...
Site Admin
Post Jul 23, 2018 12:23
Hi there.

Thanks for asking about this. This is actually deprecated now and I've removed the need for <packet> elements in the profile, you're safe to omit them. In the next release they'll likely be gone from all of the built-in profiles to avoid confusion.

To answer your question though, we basically make/made them up, so long as they were unique. It was the old way of GC detecting what game you were playing (before Game Link worked using shared memory like it does now and can just tell u). Game Link used to be network based in v3 and DOSBox would send a packet to GC with that header and footer and the game would be auto-detected using it.

The values are hex versions of ASCII characters in reverse order (little endian)

For example, the Savage Frontier profile:

Code: Select all

	<packet header="44314653" size="15" footer="53463144" />
https://www.asciitable.com/

Gives

D
1
F
S

and same for the footer.

-----

Cool to see you're using QuickBASIC, let me know how that goes ! You should be able to do some cool things if you have access to the 'game' source code, e.g. pass in values for a companion app / HUD that runs in the console.
Site Admin
Post Jul 23, 2018 12:34
Oh, I just realised that maybe I misunderstood your problem.

"Where does all of this stuff come from?"

Code: Select all

	<detect sys="e9b551c5" prg="35d2ef1d" ph3="0" ph2="6de93457" ph1="1fcc" ph0="0">
The easiest way to get that is in GC, go to Options > Game Link and enable the Debug HUD.
The relevant information should then be shown.

sys = SYSTEM (hash of the system name, always "DOSBox" so e9b551c5)
prg = PROGRAM (hash of the program EXE name)

The PH3,2,1,0 values are the four components in PROGRAM HASH reading from left to right.

Some games self modify - e.g. Dragon Wars saves your game inside it's EXE ! In that case PH2 should be set to "*", PH2 is the CRC32 of the EXE data, which naturally will not stay the same when you save the game. Likewise if you're in the middle of developing software the CRC32 will change too as you add/remove code, etc. Asterisk tells GC to ignore that (and we just hope the other parts are enough to allow auto-detect to work.)
POST REPLY