FRUA & DUNGEON CRAFT Community Forums

Hacker's Hideout => Hacking UA => Topic started by: jhirvonen on January 21, 2012, 09:33:05 AM

Title: Gold Box Companion - tool for GB games
Post by: jhirvonen on January 21, 2012, 09:33:05 AM
I was planning to replay Pool of Radiance and programmed a tool to help with some of the user interface issues (mainly lack of fix-command etc.).

(I know of the FRUA remake module but somehow wanted to play the original still)

If someone dares to test it, it's available here with more info and some screenshots:
http://personal.inet.fi/koti/jhirvonen/gbc/
Title: Re: Gold Box Companion - tool for GB games
Post by: nologgie on January 21, 2012, 10:08:24 AM
I don't have time to test it right now, but it looks great!

Thanks!  :D :D :D
Title: Re: Gold Box Companion - tool for GB games
Post by: GoldBoxFan on January 21, 2012, 02:12:08 PM
I just played POR from end to end a couple years ago to get all the text from it. Too bad your aid didn't exist back then. I'd rather try it in NWN1 or NWN2.
Title: Re: Gold Box Companion - tool for GB games
Post by: Ishad Nha on January 21, 2012, 07:35:01 PM
It looks good. Here in the Hacking UA sub-forum we have decrypted a lot of the files from Gold Box games. This is the place to do research for any new programs or editors.
Title: Re: Gold Box Companion - tool for GB games
Post by: Donnie Ewald on January 22, 2012, 06:01:15 AM
Oh wow, this is quite nice. I look forward to giving it a go in the future. Very nice.
Title: Re: Gold Box Companion - tool for GB games
Post by: GoldBoxFan on January 22, 2012, 08:59:42 AM
Any chance you can get Neverwinter Nights - Online to save games? It is the 10th Gold Box Game.
Title: Re: Gold Box Companion - tool for GB games
Post by: Ishad Nha on January 22, 2012, 09:17:17 AM
It would need to be able to both save and load, tricky stuff.
Another approach is to run the NWN game files using another Gold Box game, like Treasures of the Savage Frontier. This assumes that the games have the same sort of Ecl functions, which I don't know if it is true.
If it worked you might need to rewrite the Ecl files to reflect the fact that TSF has one Ecl file while NWN has three or more.
There may be other complications like different offset numbering systems.
Title: Re: Gold Box Companion - tool for GB games
Post by: Donnie Ewald on January 22, 2012, 04:29:52 PM
Greetings jhirvonen!

I gave GBC a go today and have hit a brick wall. I'm on Windows XP and using DOSBox 0.74. I've tried it with the D-Fend Reloaded frontend and without it. Either way no characters are found. You can see my screenshot that has Champions of Krynn, GBC, and MHS (http://memoryhacking.com/), which is another memory editor open. MHS finds the character name in DOSBox memory; but, GBC doesn't. Any ideas?
Title: Re: Gold Box Companion - tool for GB games
Post by: jhirvonen on January 23, 2012, 11:50:56 AM
Odd that it doesn't find even the first character. I don't use D-Fend Reloaded myself but don't see how that could affect it.

If you can, test it with some other GB game?
Title: Re: Gold Box Companion - tool for GB games
Post by: Donnie Ewald on January 23, 2012, 06:43:48 PM
I've tried it with Pools of Darkness, Pool of Radiance and Champions of Krynn. I'll do some more tinkering this weekend and report back.
Title: Re: Gold Box Companion - tool for GB games
Post by: Donnie Ewald on January 29, 2012, 01:53:19 PM
It worked successfully with Dark Queen of Krynn! What is GBC coded in? Would it be possible to feed a specific memory address to it instead of it searching to begin?
Title: Re: Gold Box Companion - tool for GB games
Post by: jhirvonen on January 29, 2012, 03:22:43 PM
Nice that you got it working for at least one game.

GBC is written in Delphi.

If you find the name of the first character in MHS, you could put this to GBC search wizard's address range start and it should find it from there.

I've tested this with several WinXP installations, with real installs and with VMware virtual installs and now also on Win7. All had vanilla DOSBox 0.74 and I was logged in with administrator rights (not sure if this has any meaning). In these cases the characters are always found inside the default address range.

If it's working with Dark Queen it should work with the others as well. The same search routine is used for all 9 games.
Title: Re: Gold Box Companion - tool for GB games
Post by: Donnie Ewald on January 29, 2012, 06:04:24 PM
I don't know Delphi, can't help at all. :(  I tried GBC with Champions of Krynn again and had no luck. I found the address in MHS and copied it over to GBC and no luck there either, I even tried backing off a few bytes in case that mattered. I'm logged in as an admin and GBC works with DQK; but, not COK. Very odd.
Title: Re: Gold Box Companion - tool for GB games
Post by: Ishad Nha on January 29, 2012, 06:18:37 PM
DQK is different in its use of FRUA-style Glb files rather than normal Gold Box dax files. But that would not be so relevant here.
You could try it on FRUA then try Pools of Darkness.
Are you using DosBox or something else Donnie?
Title: Re: Gold Box Companion - tool for GB games
Post by: Donnie Ewald on January 29, 2012, 06:39:58 PM
Yep, using DosBox 0.74 just like expected. GBC reads and edits the memory directly of that process and not the files themselves. I've tried GBC with Pools of Radiance tonight after downloading the newer archive from the site with all the maps and it works with that game. It doesn't change the map when I leave town and head to the slums though.
Title: Re: Gold Box Companion - tool for GB games
Post by: GoldBoxFan on January 29, 2012, 06:51:43 PM
Now if somebody would try it with Neverwinter Nights - Online.  :)
Title: Re: Gold Box Companion - tool for GB games
Post by: jhirvonen on January 29, 2012, 08:57:21 PM
I've tried GBC with Pools of Radiance tonight after downloading the newer archive from the site with all the maps and it works with that game. It doesn't change the map when I leave town and head to the slums though.

At the moment you have to select the map by hand as I don't know how to get the area index (if there's any) from the memory.

So you got PoR working? I didn't change the search routines in the new version at all...

Title: Re: Gold Box Companion - tool for GB games
Post by: jhirvonen on January 30, 2012, 03:41:32 PM
I made a test utility to read DOSBox memory:

http://personal.inet.fi/koti/jhirvonen/gbc/test.zip

Search for character name in MHS, then enter  the address found in MHS to the test util and click read and check if it reads the memory correctly (=character name is first string displayed). If not, I may have to change the reading process.
Title: Re: Gold Box Companion - tool for GB games
Post by: Donnie Ewald on January 31, 2012, 04:16:52 AM
Yep, your test util sees the text just fine with the address from MHS.

Title: Re: Gold Box Companion - tool for GB games
Post by: Donnie Ewald on February 05, 2012, 03:44:11 PM
Greetings jhirvonen,

I've decided to give Pool of Radiance another play and use GBC along with it. You can pull which map the user is on in this game by reading it from memory. In my instance, the horizontal coordinate is stored at: 0x04344CAD and the map location is stored at 0x043466DC or 0x043632EA. Those two memory locations match the numbers listed here (http://ua.reonis.com/index.php?topic=1912.0), whenever I'm in the slums, it displays 0x14. This should make the map more user friendly. :D
Title: Re: Gold Box Companion - tool for GB games
Post by: jhirvonen on February 07, 2012, 09:46:14 AM
Very nice find Donnie!

Btw, looking at the "test memory read" screenshot, you have two space characters after the name "DONALD"... GBC's string compare checks that the string ends with a zero byte so there might be the answer why the names are not found in GBC. Can you send me the savefile for Champions of Krynn? (joonas.hirvonen@pp.inet.fi).

EDIT:
Actually, I found out that my "import character names from a saved game" trimmed the trailing space chararacters. I uploaded a hopefully fixed version:
http://personal.inet.fi/koti/jhirvonen/gbc/gbc.zip


I'm now playing Silver Blades and noticed that for example in the huge ruins of Old Verdigris, 16x16 sized maps is used for mapping the whole thing. If you use a blank 16x16 map to display party location you'll see how the party location jumps from place to place when going through doors etc. The coordinates on the game screen do not correspond to those in the memory. You FRUA experts probably knew this already. I won't bother mapping the ruins or the mines in SotSB, the cluebooks are enough for those.


Title: Re: Gold Box Companion - tool for GB games
Post by: Donnie Ewald on February 07, 2012, 11:20:45 AM
I tried your new version of GBC and it worked with Champions of Krynn right away. Much thanks!
Title: Re: Gold Box Companion - tool for GB games
Post by: Ishad Nha on February 07, 2012, 06:26:08 PM
This issue was discussed in the "Secret of the Silver Blades Hub" topic.
http://ua.reonis.com/index.php?topic=991.0 (http://ua.reonis.com/index.php?topic=991.0)
In this topic you will find Simeon Pilgrim's decrypt of the Ecl files.
This use of a 16x16 map to create a much larger town was used for the Mines and the Crevasses too. It is a common device in Gold Box games.
from one of the posts in the SSB topic:
The usual town x,y coordinates found at offsets 5,121 and 5,122 [of the save game file] suggest that map P is simply town 2 with a lot of events. The coordinates will tell me exactly what module is being used at any point.
The "57,27" coordinates are found at offsets 1,019 and 1,021.
Title: Re: Gold Box Companion - tool for GB games
Post by: Ishad Nha on March 28, 2014, 08:01:52 PM
The Dark Queen of Krynn Hub shows what we achieved in decrypting this game, a fair bit. It also has links to a DC template that shows all the DQK maps, just the thing for adding these maps to Gold Box Companion.
Title: Re: Gold Box Companion - tool for GB games
Post by: Gwindor on July 19, 2014, 04:17:30 PM
I never got Gold Box Companion to work with Dark Queen of Krynn. I got it to work with all the other games. I was wondering if or how I might get it to work with DQK.

Right now I am playing Death Knights again, and GBC has messed up the reading of the files, to some degree. GBC correctly reads in many of the basic stats of the characters, but GBC thinks my fighter has 255 1st-level cleric spells to memorize. The DKK game does not let my fighter memorize 255 cleric spells!(obviously)
Title: Re: Gold Box Companion - tool for GB games
Post by: SilentThief on July 19, 2014, 10:40:28 PM
I'm now playing Silver Blades and noticed that for example in the huge ruins of Old Verdigris, 16x16 sized maps is used for mapping the whole thing. If you use a blank 16x16 map to display party location you'll see how the party location jumps from place to place when going through doors etc. The coordinates on the game screen do not correspond to those in the memory. You FRUA experts probably knew this already. I won't bother mapping the ruins or the mines in SotSB, the cluebooks are enough for those.

I was curious about how they did this, I knew it had to be procedural (a map with a bunch of rooms, and jumping around to different rooms to complete the huge map). This is awesome that you have the means to show this. I will have to check this out

ST the curious
Title: Re: Gold Box Companion - tool for GB games
Post by: Ishad Nha on July 19, 2014, 11:55:10 PM
DQK and FRUA use a very different file format,glb, compared to the earlier Gold Box games, dax.
GBC must be able to handle both file formats if it is to read DQK.
Title: Re: Gold Box Companion - tool for GB games
Post by: jhirvonen on July 21, 2014, 07:13:43 AM
I never got Gold Box Companion to work with Dark Queen of Krynn. I got it to work with all the other games. I was wondering if or how I might get it to work with DQK.

Right now I am playing Death Knights again, and GBC has messed up the reading of the files, to some degree. GBC correctly reads in many of the basic stats of the characters, but GBC thinks my fighter has 255 1st-level cleric spells to memorize. The DKK game does not let my fighter memorize 255 cleric spells!(obviously)

I can try to find the problem if you send me some save files for both games and maybe tell me what DosBOX and game versions you're using.
joonas.hirvonen@pp.inet.fi

 
Title: Re: Gold Box Companion - tool for GB games
Post by: jhirvonen on September 25, 2015, 07:41:24 PM
I've released a new beta version of Gold Box Companion.

- Support for Unlimited Adventures, Buck Rogers: Countdown to Doomsday and Matrix Cubed.
- Automapping for all games.
- Journal entries / passwords can be viewed from a menu.
- Save game editor where you can backup saves, add/replace party characters and edit inventory.

12 games is a big number of titles to support so there are most likely bugs and quirks still left.

Screenshots and more information:
http://personal.inet.fi/koti/jhirvonen/gbc/

Direct download link:
http://personal.inet.fi/koti/jhirvonen/gbc/gbc.zip

Very experimental event placer for all other games than FRUA:
If you right click on the map it will show event numbers. Control + right click allows you to enter / change event on the location.
This could be used for a live map editor where you could immediately walk around the map and test events. Spawning a training hall would be useful in some cases.

Title: Re: Gold Box Companion - tool for GB games
Post by: Donnie Ewald on September 26, 2015, 07:20:25 AM
This is looking better and better over time. Well done! What I wouldn't've given to have this available when I played through the games.
Title: Re: Gold Box Companion - tool for GB games
Post by: Ishad Nha on September 26, 2015, 10:13:33 AM
You could add a Jump function, enabling the party to jump from town to town. In at least some of the Gold Box games it is known how to do this. As lists of Geo and Ecl records are known for all Gold Box (known for the two Buck Rogers games?), you can use File Compare to compare two save games when you enter a new town.
Save, enter the new town, save in a new slot, then compare the two files.
Title: Re: Gold Box Companion - tool for GB games
Post by: marainein on September 26, 2015, 09:08:57 PM
I've released a new beta version of Gold Box Companion.

- Support for Unlimited Adventures, Buck Rogers: Countdown to Doomsday and Matrix Cubed.
- Automapping for all games.
- Journal entries / passwords can be viewed from a menu.
- Save game editor where you can backup saves, add/replace party characters and edit inventory.

12 games is a big number of titles to support so there are most likely bugs and quirks still left.

Screenshots and more information:
http://personal.inet.fi/koti/jhirvonen/gbc/

Direct download link:
http://personal.inet.fi/koti/jhirvonen/gbc/gbc.zip

Very experimental event placer for all other games than FRUA:
If you right click on the map it will show event numbers. Control + right click allows you to enter / change event on the location.
This could be used for a live map editor where you could immediately walk around the map and test events. Spawning a training hall would be useful in some cases.

Excellent work. I'm currently using this to investigate the lizard man keep in pool of radiance - but I can't get the map to work (the rest of the HUD comes up ok). The area view is disabled normally for this geo. Am I doing something wrong?
Title: Re: Gold Box Companion - tool for GB games
Post by: jhirvonen on September 27, 2015, 02:48:52 AM
Excellent work. I'm currently using this to investigate the lizard man keep in pool of radiance - but I can't get the map to work (the rest of the HUD comes up ok). The area view is disabled normally for this geo. Am I doing something wrong?

If you press the "search wizard" button on the HUD, the HUD closes and you'll see the start window and the log again. There should be a message if the map or party location wasn't found.
If you mail me a save game I could try it out.
joonas.hirvonen@pp.inet.fi
Title: Re: Gold Box Companion - tool for GB games
Post by: marainein on September 27, 2015, 02:27:38 PM
Excellent work. I'm currently using this to investigate the lizard man keep in pool of radiance - but I can't get the map to work (the rest of the HUD comes up ok). The area view is disabled normally for this geo. Am I doing something wrong?

If you press the "search wizard" button on the HUD, the HUD closes and you'll see the start window and the log again. There should be a message if the map or party location wasn't found.
If you mail me a save game I could try it out.
joonas.hirvonen@pp.inet.fi
Hey - it seems to be a problem when I'm loading a game in wilderness map mode then entering a dungeon - I can send you a saved game if you want.
Title: Re: Gold Box Companion - tool for GB games
Post by: jhirvonen on September 27, 2015, 09:49:28 PM
Excellent work. I'm currently using this to investigate the lizard man keep in pool of radiance - but I can't get the map to work (the rest of the HUD comes up ok). The area view is disabled normally for this geo. Am I doing something wrong?

If you press the "search wizard" button on the HUD, the HUD closes and you'll see the start window and the log again. There should be a message if the map or party location wasn't found.
If you mail me a save game I could try it out.
joonas.hirvonen@pp.inet.fi
Hey - it seems to be a problem when I'm loading a game in wilderness map mode then entering a dungeon - I can send you a saved game if you want.

Yes, the map location is searched for only once at the same time when the character search is done. So, when loading a game in wilderness mode, you have to save the game after entered a normal map and then search again.

I couldn't quite figure how the wilderness maps work and they seem to work different in every game.
Title: Re: Gold Box Companion - tool for GB games
Post by: marainein on September 27, 2015, 10:06:38 PM
Excellent work. I'm currently using this to investigate the lizard man keep in pool of radiance - but I can't get the map to work (the rest of the HUD comes up ok). The area view is disabled normally for this geo. Am I doing something wrong?

If you press the "search wizard" button on the HUD, the HUD closes and you'll see the start window and the log again. There should be a message if the map or party location wasn't found.
If you mail me a save game I could try it out.
joonas.hirvonen@pp.inet.fi
Hey - it seems to be a problem when I'm loading a game in wilderness map mode then entering a dungeon - I can send you a saved game if you want.

Yes, the map location is searched for only once at the same time when the character search is done. So, when loading a game in wilderness mode, you have to save the game after entered a normal map and then search again.

I couldn't quite figure how the wilderness maps work and they seem to work different in every game.

Fair enough. The other thing I noticed was that NPC combat icons weren't showing up on the HUD. I'm not sure if that's a bug or not.
Title: Re: Gold Box Companion - tool for GB games
Post by: jhirvonen on September 28, 2015, 12:48:35 PM
The other thing I noticed was that NPC combat icons weren't showing up on the HUD. I'm not sure if that's a bug or not.
For PC characters I create the combat icons from pregenerated head/body bitmaps located in the GBC's Games\<game>\ -folder. NPC icons are not shown unless there are bitmap files named after the NPC in that folder. (Hero_1.bmp and Hero_2.bmp, for example). I could of course get the pics from CPICx.DAX-files.
Title: Re: Gold Box Companion - tool for GB games
Post by: Milos Gulan on October 01, 2015, 05:01:40 PM
This is looking better and better over time. Well done! What I wouldn't've given to have this available when I played through the games.

I agree with this and thank You very much for this wonderful tool. Site looks amazing and I hope I will have time soon to look trough that and to update to new version of the program.
Title: Re: Gold Box Companion - tool for GB games
Post by: marainein on October 02, 2015, 06:12:10 PM
I'm going to write a tool(sort of monitor mode/debugging) for monitoring the execution of ecl code while the games run (inside of dosbox), so I can better analyze how they work. I can do this by adding it to dosbox, but it might work well as an addition to Gold Box Companion - jhirvonen, if you're interested, let me know.
Title: Re: Gold Box Companion - tool for GB games
Post by: jhirvonen on October 03, 2015, 01:29:27 AM
I'm going to write a tool(sort of monitor mode/debugging) for monitoring the execution of ecl code while the games run (inside of dosbox), so I can better analyze how they work. I can do this by adding it to dosbox, but it might work well as an addition to Gold Box Companion - jhirvonen, if you're interested, let me know.

Sure! I was thinking of adding a feature when you mouse over a map location -> shows the related ECL script but at this point I know very little how ECLs work.

 I guess the info on these files is scattered around here and in Simeon's Curse-code / Gold Box Explorer?

Title: Re: Gold Box Companion - tool for GB games
Post by: Ishad Nha on October 03, 2015, 01:54:17 AM
Simeon's EclDump program will show how the CAB Ecls work. This gives you a feel for how they work in other Gold Box games. Check his profile for the EclDump link. (Anyone who wants this program: go to his profile, wave cursor over Profile Info, then hold cursor over Show Posts, then click on Attachments.)
My Dark Queen of Krynn and (Offline) Neverwinter Nights Ecl spreadsheets will show the Ecls at the Byte level, hopefully:
DQKECLA.zip, DQKECLB.zip, NWNEclDecryptsA.zip and NWNEclDecryptsB.zip
Title: Re: Gold Box Companion - tool for GB games
Post by: marainein on October 03, 2015, 06:06:16 AM
I'm going to write a tool(sort of monitor mode/debugging) for monitoring the execution of ecl code while the games run (inside of dosbox), so I can better analyze how they work. I can do this by adding it to dosbox, but it might work well as an addition to Gold Box Companion - jhirvonen, if you're interested, let me know.

Sure! I was thinking of adding a feature when you mouse over a map location -> shows the related ECL script but at this point I know very little how ECLs work.

 I guess the info on these files is scattered around here and in Simeon's Curse-code / Gold Box Explorer?
Yeah, the ecldump program Ishad mentioned is the primary source - GBE basically contains a copy of that. I have a fair bit of understanding as to how the ECLs work, but they're difficult to analyze statically. Some static analysis I did: http://ua.reonis.com/index.php?topic=2519.0

To do dynamic analysis, we're probably going to have to be able to set breakpoints (and ideally, watchpoints) in the running game executables. I know that dosbox has some debugging features. How does GBC interface with dosbox?
Title: Re: Gold Box Companion - tool for GB games
Post by: jhirvonen on October 03, 2015, 08:37:44 AM
To do dynamic analysis, we're probably going to have to be able to set breakpoints (and ideally, watchpoints) in the running game executables. I know that dosbox has some debugging features. How does GBC interface with dosbox?

Interfacing is done by grabbing / searching / reading / writing DOSBox's memory.

The functions I have used:

To find the DOSBox window:
https://msdn.microsoft.com/en-us/library/windows/desktop/ms633515(v=vs.85).aspx
https://msdn.microsoft.com/en-us/library/windows/desktop/ms633520(v=vs.85).aspx

To open the process:
https://msdn.microsoft.com/en-us/library/windows/desktop/ms633522(v=vs.85).aspx
https://msdn.microsoft.com/en-us/library/windows/desktop/ms684320(v=vs.85).aspx

Read the process:
https://msdn.microsoft.com/en-us/library/windows/desktop/ms680553(v=vs.85).aspx

One thing you could try is to modify a map location's ECL-script in the memory.
"Backup" the existing ECL so it can be restored.
If there's a some kind of "end script", "goto end" or something like that in the ECL commands, you could insert that command into the script to make it halt when wanted.
You could also experiment by replacing commands with another one and so on.

By tweaking the game executables or using a custom version of DOSBox of course would give you more control.
Title: Re: Gold Box Companion - tool for GB games
Post by: marainein on October 04, 2015, 12:07:20 AM
We have a very Inception like situation here, with virtual machines nested inside each other - the ECL VM inside a dos game being emulated by dosbox which is running in windows (which in my case, is itself running inside a virtual machine)

Interfacing is done by grabbing / searching / reading / writing DOSBox's memory.

The functions I have used:

To find the DOSBox window:
https://msdn.microsoft.com/en-us/library/windows/desktop/ms633515(v=vs.85).aspx
https://msdn.microsoft.com/en-us/library/windows/desktop/ms633520(v=vs.85).aspx

To open the process:
https://msdn.microsoft.com/en-us/library/windows/desktop/ms633522(v=vs.85).aspx
https://msdn.microsoft.com/en-us/library/windows/desktop/ms684320(v=vs.85).aspx

Read the process:
https://msdn.microsoft.com/en-us/library/windows/desktop/ms680553(v=vs.85).aspx

Thanks - how do you actually set a breakpoint via the windows api? Maybe I'm missing something, but I couldn't find it among the debugger documentation you linked to.

By tweaking the game executables or using a custom version of DOSBox of course would give you more control.
I'd like to avoid that, if I can somehow.

One thing you could try is to modify a map location's ECL-script in the memory.
"Backup" the existing ECL so it can be restored.
If there's a some kind of "end script", "goto end" or something like that in the ECL commands, you could insert that command into the script to make it halt when wanted.
You could also experiment by replacing commands with another one and so on.
That sounds like a more flexible approach. There's an ECL command 'exit', which is just a single byte of 0. But I presume it resets the program counter and maybe other things.

What I really want is an ECL op that will pause the game, so the debugger can examine the memory contents, restore the original ecl byte code for the next command, and maybe modify whatever the ECL virtual machine is using as an instruction pointer or return stack, so it will point to the next command correctly. The ideal command would be one which doesn't have any arguments, so the rest of the ECL space could be filled with that command byte. I've got some ideas, but I'll have to do some pondering.
Title: Re: Gold Box Companion - tool for GB games
Post by: jhirvonen on October 04, 2015, 10:53:34 AM
how do you actually set a breakpoint via the windows api? Maybe I'm missing something, but I couldn't find it among the debugger documentation you linked to.

Actually I don't set breakpoints. All is done by just by memory modification. I forgot to mention the WriteProcessMemory-function.
https://msdn.microsoft.com/en-us/library/windows/desktop/ms681674(v=vs.85).aspx

Title: Re: Gold Box Companion - tool for GB games
Post by: marainein on October 04, 2015, 02:06:04 PM
how do you actually set a breakpoint via the windows api? Maybe I'm missing something, but I couldn't find it among the debugger documentation you linked to.

Actually I don't set breakpoints. All is done by just by memory modification. I forgot to mention the WriteProcessMemory-function.
https://msdn.microsoft.com/en-us/library/windows/desktop/ms681674(v=vs.85).aspx
I meant "can it be done at all, if so, how?"
Title: Re: Gold Box Companion - tool for GB games
Post by: GGekko on October 13, 2015, 07:12:14 AM
I noticed a funny thing with GBC when using it along with FRUA: it seems the search wizard fail to find the correct offset for character name when a magic effect is applied to the previous character in the list. I noticed that with using "The Realm" modules (i.e. "hacked" modules) when:
- The following magic effects are applied (non-exhaustive): "Bless" (spell), "Invisibility" (ring), "Fire resistance"(ring)
- Joining cleric or mage scrolls in the inventory
I seems that in those cases, the encoding format of the character sheet add some bytes, which cause the error (the application does not look at the "proper" place to find the next character name)

Is it a known issue? Is there a way to manually change the offset where the wizard look?
Title: Re: Gold Box Companion - tool for GB games
Post by: jhirvonen on October 13, 2015, 11:24:38 AM
Aaargh, I thought I had it working. Special abilities and effects add 10 bytes each to the character record but as far as I know there's no easy way to get the number of active effects.

Can you send me a save file where some of those effects you mentioned are active? And if you could also send / link the exact module you where using.
Title: Re: Gold Box Companion - tool for GB games
Post by: Mtdl on October 13, 2015, 06:55:07 PM
Just dropping in to tell you that I really like the goldbox companion, jhirvonen. It makes playing the goldbox games much more enjoyable, especially the automapping. Looking forward to your next updates and thanks for your work.
Title: Re: Gold Box Companion - tool for GB games
Post by: marainein on October 25, 2015, 12:31:13 AM
Special abilities and effects add 10 bytes each to the character record but as far as I know there's no easy way to get the number of active effects.
Exactly. The CCH files vary in size, according to how many items and effects there are, and I can't find any information for determining how many of each are present, yet it must be there. It's not documented in CCHFORM.TXT in the hackdocs. This is a long shot, but does anyone actually know anything more about the CCH format than what's in the hackdocs?

Edit - I partially retract that. Offset 193 appears to hold the number of items in the inventory. I suppose it's possible to calculate the number of special effects by taking the file length, subtracting the number of items times 18, subtracting the base file length of 398, and dividing the remainder by 10.
Title: Re: Gold Box Companion - tool for GB games
Post by: jhirvonen on October 25, 2015, 07:16:34 AM
Special abilities and effects add 10 bytes each to the character record but as far as I know there's no easy way to get the number of active effects.
Exactly. The CCH files vary in size, according to how many items and effects there are, and I can't find any information for determining how many of each are present, yet it must be there. It's not documented in CCHFORM.TXT in the hackdocs. This is a long shot, but does anyone actually know anything more about the CCH format than what's in the hackdocs?

Edit - I partially retract that. Offset 193 appears to hold the number of items in the inventory. I suppose it's possible to calculate the number of special effects by taking the file length, subtracting the number of items times 18, subtracting the base file length of 398, and dividing the remainder by 10.

That is true for single character CCH files. In Gold Box Companion I need to read the character names for FRUA / Dark Queen from QSV-savefiles where all characters are stored so you it's tricky. Only the first character is at fixed offset. I use the number of items as you mentioned and then browse forward trying to get the 4 bytes of "pointer to next character" matching. This would be easy if the "pointer to next character" really was an offset to the next character but it seems to be a multiply of the CCH record base length (398 for FRUA).

If you press Ctrl+D in the search window in GBC you'll toggle the debug-mode and get more information in the log window when loading a FRUA / Dark Queen save.

The special abilities case in GBC has been fixed for FRUA but I haven't yet fixed the bundled scrolls issue.
Title: Re: Gold Box Companion - tool for GB games
Post by: Null Null on October 25, 2015, 12:44:01 PM
Thought I'd post this here as well in case it's of some use to you in your coding and hacking--did you know that Gateway and Curse, and Treasures and Pools, have similar enough character save file formats that you can move characters from one game to the other? However, some of the custom-Treasures items give you weird names when pulled into Pools (as you might expect with Treasures being the later game). You might be aware already, but if not, it might help you unlock a few puzzles. I recall one item becomes 'MMUNE TO ELECTRICITY', suggesting that the ongoing effect display strings are stored somewhere near the item name strings.


 Thanks so much for everything!
Title: Re: Gold Box Companion - tool for GB games
Post by: marainein on October 25, 2015, 02:56:45 PM
Special abilities and effects add 10 bytes each to the character record but as far as I know there's no easy way to get the number of active effects.
Exactly. The CCH files vary in size, according to how many items and effects there are, and I can't find any information for determining how many of each are present, yet it must be there. It's not documented in CCHFORM.TXT in the hackdocs. This is a long shot, but does anyone actually know anything more about the CCH format than what's in the hackdocs?

Edit - I partially retract that. Offset 193 appears to hold the number of items in the inventory. I suppose it's possible to calculate the number of special effects by taking the file length, subtracting the number of items times 18, subtracting the base file length of 398, and dividing the remainder by 10.

That is true for single character CCH files. In Gold Box Companion I need to read the character names for FRUA / Dark Queen from QSV-savefiles where all characters are stored so you it's tricky. Only the first character is at fixed offset. I use the number of items as you mentioned and then browse forward trying to get the 4 bytes of "pointer to next character" matching. This would be easy if the "pointer to next character" really was an offset to the next character but it seems to be a multiply of the CCH record base length (398 for FRUA).

If you press Ctrl+D in the search window in GBC you'll toggle the debug-mode and get more information in the log window when loading a FRUA / Dark Queen save.

The special abilities case in GBC has been fixed for FRUA but I haven't yet fixed the bundled scrolls issue.
The special effect format says that the last two bytes signal whether there are further special effects in this chain. Can you use that to count the number of special effects?

I really admire the work you're doing here jhirvonen, and the approach you're using of modifying memory while the game is running is more powerful than the approach of looking at saved data files and trying to figure out what they do that we've traditionally been using. What percentage of the data files do you understand now?

Also, forgive my ignorance, but what's the bundled scroll issue?

PS - do you know what all those 4 byte fields at the start of the CCH file actually are? Are they far pointers to memory structures that get set and used at run time?
Title: Re: Gold Box Companion - tool for GB games
Post by: marainein on October 25, 2015, 03:08:38 PM
Thought I'd post this here as well in case it's of some use to you in your coding and hacking--did you know that Gateway and Curse, and Treasures and Pools, have similar enough character save file formats that you can move characters from one game to the other? However, some of the custom-Treasures items give you weird names when pulled into Pools (as you might expect with Treasures being the later game). You might be aware already, but if not, it might help you unlock a few puzzles. I recall one item becomes 'MMUNE TO ELECTRICITY', suggesting that the ongoing effect display strings are stored somewhere near the item name strings.


 Thanks so much for everything!
Well, they share a common game system :P. Yes, I know they can be imported...the code that does the importing/translating from pool of radiance to coab https://github.com/simeonpilgrim/coab/blob/master/engine/ovr017.cs#L234 (https://github.com/simeonpilgrim/coab/blob/master/engine/ovr017.cs#L234) is some of the most helpful in understanding the character formats for both games.

But my original question was and still is, does the community know more about the cch format for FRUA than what is in the CCHFORM.TXT file?

Edit - sorry Null, you actually meant that Pools of Darkness and Treasures of the Savage Frontier have (maybe) byte identical character files, both 509 bytes in length? That I did not know.
Title: Re: Gold Box Companion - tool for GB games
Post by: jhirvonen on October 25, 2015, 04:42:37 PM
The special effect format says that the last two bytes signal whether there are further special effects in this chain. Can you use that to count the number of special effects?

Probably... I tried to figure out the effect chain in Dark Queen but could not understand it completely.

What percentage of the data files do you understand now?

In the GBC package there's a Resources-folder which has automatically generated offset lists of all values that I know of character / monster data records. Also in the GBC package there's the monster browser / editor which has a Hex dump - tab where you can see the monster data as a hex dump and have the option to hide known bytes so you can easily see what's still unknown. The known offsets are also listed on the hex dump - tab. Many of those unknown offsets are probably filler bytes and some might be used to store values at runtime?

The formats are also in this file:
http://personal.inet.fi/koti/jhirvonen/gbc/formats.zip

For FRUA, my info comes from the CCHFORM.TXT hackdoc.

Also, forgive my ignorance, but what's the bundled scroll issue?

In FRUA (and maybe Dark Queen?) you can (J)oin scrolls in the inventory to a bundle. This creates some special case in the character record. I haven't had time to check it but in the hackdocs there's some "number of bundles" -value mentioned.

PS - do you know what all those 4 byte fields at the start of the CCH file actually are? Are they far pointers to memory structures that get set and used at run time?

I'm not sure about FRUA but in the Dark Queen they still seem to be multipliers of the characer record size, even at runtime.

Title: Re: Gold Box Companion - tool for GB games
Post by: Ishad Nha on October 25, 2015, 08:29:16 PM
As I recall, you can join scrolls to form a bundle.
Never forget the Official SSI Playtester Mode for DQK and PD! Click this link:
http://ua.reonis.com/index.php?topic=1034.0
Both games also have their own topics:
http://ua.reonis.com/index.php?topic=981.0
http://ua.reonis.com/index.php?topic=1033.0

Gold Box games cheat codes
http://ua.reonis.com/index.php?topic=1082.0

This all should be pinned to a topic at the beginning of this forum.
Title: Re: Gold Box Companion - tool for GB games
Post by: Mtdl on October 27, 2015, 01:49:25 PM
I'm going through The Dark Queen of Krynn at the moment and I'm encountering a bug with the automap. The first time I run the companion I always get "map not found". The second time I use the search wizard I usually get the map, but the cursor won't move. I have to re-search several times before I get the map and the cursor correctly moving on the map.

I used the companion with Death knights of Krynn and it worked perfectly, so I suppose it has something to do with the updated engine.
Title: Re: Gold Box Companion - tool for GB games
Post by: jhirvonen on October 27, 2015, 02:10:13 PM
I'm going through The Dark Queen of Krynn at the moment and I'm encountering a bug with the automap. The first time I run the companion I always get "map not found". The second time I use the search wizard I usually get the map, but the cursor won't move. I have to re-search several times before I get the map and the cursor correctly moving on the map.

Send me a save file and I'll take a look at it.
joonas.hirvonen@pp.inet.fi

Party location is difficult to get right as its not usually at fixed offset related to the character / map data and the coordinates are usually 00-0F and the facing is 00, 02, 04 or 06 (N, E, S, W). If you're at location 00,05 facing N the location bytes would be 00 05 00... leads to many false positive seach results. So it's best to move to another location like 08,04 and turn to face some other direction than north.
Title: Re: Gold Box Companion - tool for GB games
Post by: Mtdl on October 27, 2015, 05:18:18 PM
Allright, I sent you my save by mail. By the way, do you plan on creating other tools like this for other games? It would be cool, for instance, for the early Wizardries.
Title: Re: Gold Box Companion - tool for GB games
Post by: jhirvonen on October 27, 2015, 06:10:29 PM
Allright, I sent you my save by mail. By the way, do you plan on creating other tools like this for other games? It would be cool, for instance, for the early Wizardries.

I tried the save and GBC found the map + correct party location / facing.

One thing you could try is:
- with the save you sent, turn the party to face west, save the game
- close GBC if it's running
- delete the settings-file \Data\Settings.dat under GBC's folder
- restart GBC
- you have to enter the folder to Dark Queen as the settings file was deleted
- load the save, search with GBC

GBC saves the last known address of party location and tries it next time so it might have got it wrong the first time.

Depending on your OS and other stuff, this might or might not help. Dark Queen is a tricky engine to work with as it very undocumented apart from some similiarity with FRUA.

Yes, I might do tools for other old games at some point. I've done one for Eye of the Beholder 1 & 2:
http://personal.inet.fi/koti/jhirvonen/ase/
Title: Re: Gold Box Companion - tool for GB games
Post by: Mtdl on October 27, 2015, 11:20:13 PM
Yes, it does seem to work with this save. I played for a while this afternoon and it was in the area before the underwater part that I had trouble with (the cave after the first forest). Unfortunately, I don't have a save file for this area.

Regarding the demi-human level caps, did someone report any bugs with temporarily switching their race to human (mages not getting their spells, saving throws not working correctly, ect.)? It seems to work fine so far (I'm using it to level my dwarf as a ranger), but I'm wondering, because I am planning to play Pools of Darkness next with a demi-human party using your editor to level them past their caps.
Title: Re: Gold Box Companion - tool for GB games
Post by: Ishad Nha on October 28, 2015, 01:09:35 AM
Progression goes:
(Ruins of) Caergoth,
Draconian Caves,
Underwater Area. (It is all one map too.)

Use Playtester Mode if you want to get around, it involves loading a supplied save game.
Title: Re: Gold Box Companion - tool for GB games
Post by: Mtdl on October 30, 2015, 08:58:30 PM
I seem to have a problem with the automap again, this time in Kristophan city (Dark Queen of Krynn). I tried all the steps you mentionned above and while it worked in the other areas, it simply won't there. The search wizard finds all my characters but it cannot find a map. I tried increasing the search range, with no success. Reloading in different areas with different facings doesn't work either. If you're interested in checking it out, I'll send you my savefile, jhirvonen, I made a copy.
Title: Re: Gold Box Companion - tool for GB games
Post by: jhirvonen on October 30, 2015, 09:30:23 PM
Yes, send it.
Title: Re: Gold Box Companion - tool for GB games
Post by: Ishad Nha on October 31, 2015, 01:48:58 AM
GBC always displays a map, even when the original game does not?
In some areas of some Gold Box games, the game does not display a map. This is presumably a decision made by the designers.
Title: Re: Gold Box Companion - tool for GB games
Post by: jhirvonen on October 31, 2015, 06:12:08 AM
I seem to have a problem with the automap again, this time in Kristophan city (Dark Queen of Krynn). I tried all the steps you mentionned above and while it worked in the other areas, it simply won't there. The search wizard finds all my characters but it cannot find a map. I tried increasing the search range, with no success. Reloading in different areas with different facings doesn't work either. If you're interested in checking it out, I'll send you my savefile, jhirvonen, I made a copy.

I tried your save and the map was found. My TDQoK is version is 1.0, DOSBox is 0.74. What OS are you using?

GBC always displays a map, even when the original game does not?
In some areas of some Gold Box games, the game does not display a map. This is presumably a decision made by the designers.

Yes, the map is always displayed regardless of the availability of the Area-command.
Title: Re: Gold Box Companion - tool for GB games
Post by: Mtdl on October 31, 2015, 10:42:00 AM
My DQK is version 1.1. I'm using Windows 8.1. Dosbox is 0.74. I tried it again to make sure and it still won't display the map. I'm using D-Fend , if this makes a difference.
Title: Re: Gold Box Companion - tool for GB games
Post by: jhirvonen on November 01, 2015, 09:57:17 AM
My DQK is version 1.1. I'm using Windows 8.1. Dosbox is 0.74. I tried it again to make sure and it still won't display the map. I'm using D-Fend , if this makes a difference.

I think I found the problem. The maps datafile GEO.TLB is different between game versions 1.0 and 1.1. I have attached a new datafile for DQK, unzip it to "GBC\Games\07. The Dark Queen of Krynn\"-folder.
Title: Re: Gold Box Companion - tool for GB games
Post by: Mtdl on November 01, 2015, 10:33:22 PM
It works. Thanks! By the way, is there a way to add notes on the maps? In the older version, where I used your tool to map myself, it was possible, but I don't see it mentionned in the instructions for this version.
Title: Re: Gold Box Companion - tool for GB games
Post by: jhirvonen on September 18, 2016, 07:39:36 AM
Forgot to mention here that I released a small update to GBC some weeks ago:

(http://personal.inet.fi/koti/jhirvonen/gbc/graphics/screen05.jpg)

(http://personal.inet.fi/koti/jhirvonen/gbc/graphics/screen04.jpg)
This version is meant to be used with the GOG.com game versions or with vanilla DOSBox 0.74. It probably won't work with the various other versions of DOSBox.

http://personal.inet.fi/koti/jhirvonen/gbc/ (http://personal.inet.fi/koti/jhirvonen/gbc/)
Title: Re: Gold Box Companion - tool for GB games
Post by: Ishad Nha on December 11, 2016, 08:33:34 PM
One thing I forgot to mention last year: I looked at many of the outdoor zones and I was able to figure out where the map was.
To find any notes I may have made, you will need to examine the hub/topic for each game. They are all found in this Hacking UA sub-forum.
Title: Re: Gold Box Companion - tool for GB games
Post by: jhirvonen on December 18, 2016, 01:23:28 PM
I added an option to Gold Box Companion to level up characters without visiting a training hall. The level up dialog is started by pressing LEVEL UP from the HUD.

Screenshot (http://personal.inet.fi/koti/jhirvonen/gbc/graphics/screen14.jpg)

- The level up isn't limited by demihuman level limits. Game level limits can also be removed if wanted.
- Does not cost anything.
- You can level up several experience levels. Experience points are not wasted.
- Max hit points are automatically rolled.

The stat changes per experience level are controlled with editable text file so you can do some modding as well.

The files were generated by automatically leveling characters in the games from level 1 to max level and saving
the character data from memory after each level up. Then the data were compared and the stat lists generated
based on differences between level ups.

For a test, I added the option to play as paladins, rangers and monks in Pool of Radiance.
- For paladins and rangers, you create a level 1 fighter and convert it to a paladin or a ranger in GBC's character editor. There's a button for this.
- For monks, you create a level 1 thief and convert it. Monks can not use any items, get AC bonuses and unarmed attacks.
In Pool, you can only level these classes with the level up dialog. Can be exported to Curse where paladins and rangers should work normally.

FRUA has a bug where all thief saving throws are set to zero starting from level 1. When you level up with GBC the values from Pools of Darkness are used.

Dark Queen sets all saves to zero with all classes at level 19 so this is probably a bug as well. GBC level up uses the level 18 saves so the game will be more difficult this way.

Gold Box Companion homepage (http://personal.inet.fi/koti/jhirvonen/gbc/)
Title: Re: Gold Box Companion - tool for GB games
Post by: ProphetSword on December 18, 2016, 02:59:37 PM
I tried to use this tool with FRUA recently.  I saw a lot of potential for things that would come in handy for designers if they were to be added, but I have no idea if it's the kind of thing you'd want to pursue.  If so, let me know and I'll tell you what I was thinking.
Title: Re: Gold Box Companion - tool for GB games
Post by: jhirvonen on December 19, 2016, 02:09:59 PM
What do you have in mind?
Title: Re: Gold Box Companion - tool for GB games
Post by: ProphetSword on December 19, 2016, 04:07:16 PM
For example, when I'm designing in FRUA, I frequently use Quest Stages and steps.  The problem with these is that in order to test a quest step further down the chain, you have to run through all previous steps or have a save game where they have already been tripped.

One module I'm working on is currently on step 12 of Quest Stage 1. This is very hard to test.  I would either need to do an actual run through of the unfinished game and save at step 11, or I would need to run through all previous 11 steps in testing mode to test step 12 (which in my case is impossible, since testing mode does not allow us to transfer to different maps).  This is a massive pain.  While using GBC, I thought it would be nice if a designer could access the save game info and change the Quest values on the fly for just this reason.

I have no idea if this is possible or something anyone would even want to look into (or if it's something anyone besides me would want).  Just thought I'd throw it out there.

It clearly has no effect on any other Gold-Box game, and while players of FRUA might be able to use it in case they run into a glitch, I think mostly designers might find a real use for it.
Title: Re: Gold Box Companion - tool for GB games
Post by: jhirvonen on December 21, 2016, 03:44:11 PM
I'm not at all familiar how events and quests work in FRUA but took a quick glance at the hackdocs files GEOEVENT.TXT and SAVGAM.TXT.

Quest-related stuff from SAVGAM.TXT:

Quest 1                      88  1 byte         0 thru 255
Quests 2-44 occupy offsets 89-131.

Step 1 event count          508  2 bytes        0 thru 65,535
Offsets 510-523 are used for event counts for steps 2-8.

Event Flag                  524  1 byte         0 thru 255
Flags to indicate whether events have occurred begin here
and continue for 3900 bits.  First possible event in overland
module 1 is at offset 536, bit value 16.  Next event is 32,
then 64, then 128, then bit value 1 of offset 537, etc., through
offset 1023.  In case it wasn't clear before, these bits are set
whenever an event is tripped for the first time, even if it is not
set to "do only once".  The allocation of these flags is the root
of the "Dungeon 36" bug -- since 100 bits per module are required
to track whether events have occurred (important for the "do only
once" check), we have no reliable way to keep track of any events
for dungeon 36 (module 40) and beyond.  Bits reserved for module
zero are wasted.

Do you know if quest step/stage is saved to those quest-bytes starting at offset 88? Comparing two save games with different quest stages could reveal something.

Most of the character record stuff is stored in memory and on disk in exactly the same format so if that quest byte array can be located in memory then it is easy to adjust the values.
Title: Re: Gold Box Companion - tool for GB games
Post by: ProphetSword on December 21, 2016, 08:13:28 PM
I would imagine that they probably are stored there, since there are a limit to the number of steps available in a Quest Stage (I want to say it's 255, but I'm not 100% sure on that).  Beyond that, I don't know.  Maybe someone else who knows about how that stuff works could chime in.
Title: Re: Gold Box Companion - tool for GB games
Post by: Donnie Ewald on December 22, 2016, 04:52:46 AM
I tinkered with a similar idea to this in the past and eventually stopped developing it to a faulty memory routine:

http://ua.reonis.com/index.php?topic=736.msg4305#msg4305

...it listed the values of Keys, Special Items, and Quests and would've been a logical step to be able to edit those. I can pull up the code this weekend and give a nudge if needed. I recall it being easier than I expected.
Title: Re: Gold Box Companion - tool for GB games
Post by: Donnie Ewald on December 24, 2016, 10:46:10 AM
For Ben's request, the spot you want to hone in on is found in SAVGAM.TXT:

Quote
Key 1                        68  1 byte         0 thru 255
Keys 2-8 occupy offsets 69-75.

Item 1                       76  1 byte         0 thru 255
Items 2-12 occupy offsets 77-87.

Quest 1                      88  1 byte         0 thru 255
Quests 2-44 occupy offsets 89-131.

No guarantee that the display of variables will work for anyone other than me with DOSBox and FRUA; but, I tweaked my VarPeek program and have attached it. Wrong weekend to look into this; but, I might see how hard it would be to edit the values in the listing.

Title: Re: Gold Box Companion - tool for GB games
Post by: jhirvonen on December 25, 2016, 10:34:40 AM
Here's something to test:

(http://personal.inet.fi/koti/jhirvonen/gbc/graphics/fruatool.jpg)

FRUA_Tool.exe is added to the GBC package:
http://personal.inet.fi/koti/jhirvonen/gbc/gbc.zip

- You need to use GBC to configure FRUA folder pointing to the design-subfolder. If you have had problems getting GBC to work, this won't probably work either.
- GBC is not needed after this but might be handy to see event indexes on the map.
- Start FRUA and load a game. Start FRUA-Tool.

- Double click on key/item to set it to 1 or 0.
- Double click on a quest to name it.
- Quick buttons to set a quest to a certain value.
- Event's occured-state can be toggled.
- Shows some info on events when clicked on. Not much currently.
- You can click previous/next to jump to previous/next chained event.
- You can save/restore states of all variables.

In the save game files, what are these?
Quote
Step 1 event count          508  2 bytes        0 thru 65,535
Offsets 510-523 are used for event counts for steps 2-8.
Title: Re: Gold Box Companion - tool for GB games
Post by: Donnie Ewald on December 25, 2016, 10:59:43 AM
Well done! I successfully tested it and it displayed/edited the values that I expected. You know, I'd happily share the work that I did with UAInject (http://ua.reonis.com/index.php?topic=719.0) if you'd like to carry this type of work forward and expand FRUA in many more ways!  :D
Title: Re: Gold Box Companion - tool for GB games
Post by: ProphetSword on December 26, 2016, 05:38:56 PM
Awesome!  This is exactly what I was asking for.  Incredible work.
Title: Re: Gold Box Companion - tool for GB games
Post by: Dedup on January 25, 2017, 11:00:30 PM
I've used GBC to convert a couple of my fighters to a ranger and a paladin in Pool of Radiance.  I noticed that now that they are at level 2 they don't have the sweep attack that fighters get against weak opponents.  I'm guessing that this is probably due to the fact that the classes were not fully implemented in the game. 

Does anyone know if there is a way to manually add the sweep capability to characters?  I took a look at the character effects in the save game editor but it didn't yield any clues.

-edit-
I did find a work around for this.  I hex edited an equal amount of fighter levels into the character and now he has the sweep ability.  On the character sheet screen it lists his class as ranger but where the level is it says 2/2.  I tried leveling him with GBC and didn't encounter any issues as only his ranger level went up.  I also checked to make sure it didn't divide his XP as if he was multi-class character and that seems to work fine as well.  I'm just going to have to remember to edit in the fighter levels every time he levels, though I'll probably remove them when I'm ready to import to Curse of the Azure Bonds just in case it causes any unforeseen issues.
Title: Re: Gold Box Companion - tool for GB games
Post by: jhirvonen on January 29, 2017, 02:36:52 PM
I've used GBC to convert a couple of my fighters to a ranger and a paladin in Pool of Radiance.  I noticed that now that they are at level 2 they don't have the sweep attack that fighters get against weak opponents.  I'm guessing that this is probably due to the fact that the classes were not fully implemented in the game. 

Hey, thanks for noticing this. There's an attribute "WARRIOR LEVEL" or "ATTACK LEVEL" in the character record which the game sets in combat. Seems that it is reset on every round. As you said it's probably tied to the fighter levels.

I made a dirty hack for it:
For paladins and rangers in PoR, the fighter level is automatically set during combat but cleared when not in combat. So you'll see 2/2 etc. if you view the character record when in combat but a plain 2 when outside combat.

http://personal.inet.fi/koti/jhirvonen/gbc/ (http://personal.inet.fi/koti/jhirvonen/gbc/)

Other fixes
- Hopefully fixed a bug where the HUD and map windows were not shown on multi-monitor setups.
- Setting for the HUD window to stay on top. Off by default.
Title: Re: Gold Box Companion - tool for GB games
Post by: Dedup on February 03, 2017, 08:12:50 PM
Cool.  It's certainly easier than hex editing the save every time I level them up.  Will definitely adjust my characters and give it a try.

Thanks.

-edit-
I tried it out and it works well.  Good job!

I also remembered a couple of feature suggestions I had for GBC.
Title: Re: Gold Box Companion - tool for GB games
Post by: Moonbeam111 on February 04, 2017, 06:31:44 PM
Hey simple question here.

My character symbol on the map is showing up as a dot instead of an arrow and I don't know why. Its only like this on my laptops but on my desktop computer it shows up normally as an arrow. Not too much of a problem just makes it hard to know which direction my PC's are facing.

Also, when I use the level up feature (i don't know if this is a bug or not) it levels me up like it should but I can still level up in-game.

By the way, I am using hacked FRUA modules with this; I don't know if that would be a problem feature-wise with Gold Box Companion.
Title: Re: Gold Box Companion - tool for GB games
Post by: jhirvonen on February 05, 2017, 05:02:31 AM
For the GBC level up feature, would it be possible to have the option to roll HP randomly like in the regular game instead of it just giving you the max?
Yes, this should be added.

This one would probably be a pain to implement but I'll ask anyways.  I think it would be nice if there was an option to automatically change a character's combat icon based on what weapon they have currently equipped and whether or not they're holding a shield.
This might be tricky. It probably wouldn't work in combat as the game probably has loaded the combat icons into memory and wouldn't reflect the changes when you change equipment.

At one point I thought of equipment sets, where you could easily switch between 1-3 sets like melee / ranged / xxx. It's just difficult to get the THAC0, equipment effects etc. right.

Looking back at the games, it would have been nice if you could have tagged your hand-equipped items in the inventory with set numbers. You could tag 1 or 2 hand-equipped items for one set. For example, tag a sword with 1 and a shield with 1, a bow with 2 and arrows with 2. Then in combat switch between the sets by just pressing 1 or 2.

My character symbol on the map is showing up as a dot instead of an arrow and I don't know why. Its only like this on my laptops but on my desktop computer it shows up normally as an arrow. Not too much of a problem just makes it hard to know which direction my PC's are facing.
The arrow is drawn with the font Wingdings (regular) which should be on every Windows installation. If it's missing from your laptops, try copying (and installing) it from your desktop computer. If this doesn't help, I'll look more into it.

Also, when I use the level up feature (i don't know if this is a bug or not) it levels me up like it should but I can still level up in-game.
Not sure what you meant with this. Like level up in GBC to level 2 and then in-game again to level 2 or higher?

As you know, in training halls you can only get 1 level and your xp amount is set 1 point below xp needed for next level. If you use the GBC level up, it doesn't adjust the XP and you should get several level ups if you have the XP for it.

There might be a bug of course.

By the way, I am using hacked FRUA modules with this; I don't know if that would be a problem feature-wise with Gold Box Companion.
Usually shouldn't matter.
Title: Re: Gold Box Companion - tool for GB games
Post by: Moonbeam111 on February 05, 2017, 11:17:23 AM
Quote
The arrow is drawn with the font Wingdings (regular) which should be on every Windows installation. If it's missing from your laptops, try copying (and installing) it from your desktop computer. If this doesn't help, I'll look more into it.

That didn't work.  :(

Quote
Not sure what you meant with this. Like level up in GBC to level 2 and then in-game again to level 2 or higher?

As you know, in training halls you can only get 1 level and your xp amount is set 1 point below xp needed for next level. If you use the GBC level up, it doesn't adjust the XP and you should get several level ups if you have the XP for it.

There might be a bug of course.
No, you're right thats what I meant. However, I leveled up in GBC and it shows in the XP meter that I don't have enough experience to level up again; yet at the same time I can still level up in game if I were to go to a training hall. I can tell because the color of the characters name changes in FRUA when they can level up and this color doesn't change back to the original when I level up in GBC.

Also is there a way for GBC to recognize the ingame character icons and display them as they are ingame. The pregenerated icons don't match how my characters actually look when I created them.
Title: Re: Gold Box Companion - tool for GB games
Post by: jhirvonen on February 05, 2017, 12:58:53 PM
Quote
The arrow is drawn with the font Wingdings (regular) which should be on every Windows installation. If it's missing from your laptops, try copying (and installing) it from your desktop computer. If this doesn't help, I'll look more into it.
That didn't work.  :(
Is there anything different in Windows settings in your laptops compared to your desktop PC? Different Windows version, different language setting or something?

You can use the Windows tool Character Map to compare the font Wingdings on both computers. Can't check it now but I probably used glyphs 0xE7-0xEa for the arrow symbol.

Quote
No, you're right thats what I meant. However, I leveled up in GBC and it shows in the XP meter that I don't have enough experience to level up again; yet at the same time I can still level up in game if I were to go to a training hall. I can tell because the color of the characters name changes in FRUA when they can level up and this color doesn't change back to the original when I level up in GBC.
Did you try to level up such character in a training hall? A check to change the color is probably made when character gains / loses experience. Hopefully you can't level him up.

However, I'll have to fix that character name color.

Also is there a way for GBC to recognize the ingame character icons and display them as they are ingame. The pregenerated icons don't match how my characters actually look when I created them.
At the moment, no. I would need to to add a FRUA graphics decoder.

If you really need those then...

From the Help-file:
You can use custom combat icons by putting them into the corresponding game's data folder found under the GBC-folder.
For example, for a character named Wulfgar, create two 24x24 bitmaps named "Wulfgar_1.bmp" and "Wulfgar_2.bmp".

Gold Box Explorer can extract FRUA icons.
Title: Re: Gold Box Companion - tool for GB games
Post by: Moonbeam111 on February 05, 2017, 01:31:03 PM
Quote
Is there anything different in Windows settings in your laptops compared to your desktop PC? Different Windows version, different language setting or something?

You can use the Windows tool Character Map to compare the font Wingdings on both computers. Can't check it now but I probably used glyphs 0xE7-0xEa for the arrow symbol.

Oh right! You reminded me that I forgot I had both my laptops set to Japanese locale instead of English locale. When I restarted my laptops after applying the English locale the black arow showed up instead of the black dot.

Quote
Did you try to level up such character in a training hall? A check to change the color is probably made when character gains / loses experience. Hopefully you can't level him up.

However, I'll have to fix that character name color.

Good news. It appears that I can't level up my character in the training hall when I use the exp level up through GBC. The color doesn't change back to normal when using the GBC program but that gets fixed when you select "train character" in the training hall. It tells you you don't have enough exp and it simply changes the color back to normal.

Quote
Quote
Also is there a way for GBC to recognize the ingame character icons and display them as they are ingame. The pregenerated icons don't match how my characters actually look when I created them.

At the moment, no. I would need to to add a FRUA graphics decoder.

If you really need those then...

From the Help-file:
You can use custom combat icons by putting them into the corresponding game's data folder found under the GBC-folder.
For example, for a character named Wulfgar, create two 24x24 bitmaps named "Wulfgar_1.bmp" and "Wulfgar_2.bmp".

Gold Box Explorer can extract FRUA icons.

That's a shame. It would be cool to have in a future update but for now I will just use your workaround. Thanks again.
Title: Re: Gold Box Companion - tool for GB games
Post by: Dedup on February 07, 2017, 06:47:47 AM
Just a bit of a warning for those who want to play Pool of Radiance with the Ranger and Paladin.  Don't get level drained.  Weird stuff starts to happen when you try to restore them.  First the character's gender will cycle from male-->female-->copper-->' '.  Second, the restoration spell won't actually restore the level but give the character, literally, 10,000,000 xp.  This was done just using restoration scrolls so maybe  GBC's Fix-Drain option will work better.

-edit-
I just tested GBC's Fix-Drain option and it seems to work fine for the Paladin and Ranger.  Just don't use any restoration scrolls on them.
Title: Re: Gold Box Companion - tool for GB games
Post by: Moonbeam111 on February 08, 2017, 12:24:59 PM
Something has happened. I was transferring saves from one module to another and I got weird multiple items in Frua in my PC's inventory called "one". When I tried to load the save from GBC it told me "number of items out of range". I supposed it has something to do with these weird items that appeared in my inventory. I dropped them but still now GBC wont let me load the save anymore and I definitely can't play FRUA without GBC's help.
Title: Re: Gold Box Companion - tool for GB games
Post by: jhirvonen on February 08, 2017, 01:41:27 PM
Something has happened. I was transferring saves from one module to another and I got weird multiple items in Frua in my PC's inventory called "one". When I tried to load the save from GBC it told me "number of items out of range". I supposed it has something to do with these weird items that appeared in my inventory. I dropped them but still now GBC wont let me load the save anymore and I definitely can't play FRUA without GBC's help.
Can you mail me the modules and save files before / after transferring and I could take a look. Use the email address from the GBC Help.txt.

Title: Re: Gold Box Companion - tool for GB games
Post by: jhirvonen on February 09, 2017, 09:06:44 AM
Something has happened. I was transferring saves from one module to another and I got weird multiple items in Frua in my PC's inventory called "one". When I tried to load the save from GBC it told me "number of items out of range". I supposed it has something to do with these weird items that appeared in my inventory. I dropped them but still now GBC wont let me load the save anymore and I definitely can't play FRUA without GBC's help.

It seems that character Yenros has somehow 17 items already in GAME 10 save slot A. As far as I know the maximum items per character in all Gold Box games is 16.

Try dropping one item in GAME 10, making a save and then exporting characters to GAME 12. I suggest doing the dropping in GAME 10 before transferring so that something won't corrupt the character or item data.

I didn't try with UAShell, just plain FRUA but after dropping one item GBC loaded the save slot fine. Don't know if those designs are hacked designs or not.

Btw. should the character Hordak be dwarf? He has dwarven bonus effects on him but his race is currently human.

Title: Re: Gold Box Companion - tool for GB games
Post by: Moonbeam111 on February 09, 2017, 09:41:20 AM
Something has happened. I was transferring saves from one module to another and I got weird multiple items in Frua in my PC's inventory called "one". When I tried to load the save from GBC it told me "number of items out of range". I supposed it has something to do with these weird items that appeared in my inventory. I dropped them but still now GBC wont let me load the save anymore and I definitely can't play FRUA without GBC's help.

It seems that character Yenros has somehow 17 items already in GAME 10 save slot A. As far as I know the maximum items per character in all Gold Box games is 16.

Try dropping one item in GAME 10, making a save and then exporting characters to GAME 12. I suggest doing the dropping in GAME 10 before transferring so that something won't corrupt the character or item data.

I didn't try with UAShell, just plain FRUA but after dropping one item GBC loaded the save slot fine. Don't know if those designs are hacked designs or not.
Thanks that worked! Yes they are hacked designs.

Quote
Btw. should the character Hordak be dwarf? He has dwarven bonus effects on him but his race is currently human.
Yes Hordak should be a dwarf. Thanks for catching that, I don't know what the cause for it could be. Should I just go into the editor and set him as a dwarf again?
Title: Re: Gold Box Companion - tool for GB games
Post by: jhirvonen on February 09, 2017, 02:28:04 PM
Yes Hordak should be a dwarf. Thanks for catching that, I don't know what the cause for it could be. Should I just go into the editor and set him as a dwarf again?
Yes.
Title: Re: Gold Box Companion - tool for GB games
Post by: Moonbeam111 on February 15, 2017, 05:44:22 PM
How do I get past this error I'm having? It's saying "ERROR: Name for character does not match! (character record at $0)".

The save I have works on the old GBC version but the new one shows the aforementioned error.
Title: Re: Gold Box Companion - tool for GB games
Post by: jhirvonen on February 15, 2017, 07:30:09 PM
How do I get past this error I'm having? It's saying "ERROR: Name for character does not match! (character record at $0)".

The save I have works on the old GBC version but the new one shows the aforementioned error.
What game? If you can send me the save (+ design if FRUA) + some info, I'll take a look.
Title: Re: Gold Box Companion - tool for GB games
Post by: Moonbeam111 on February 15, 2017, 07:50:50 PM
How do I get past this error I'm having? It's saying "ERROR: Name for character does not match! (character record at $0)".

The save I have works on the old GBC version but the new one shows the aforementioned error.
What game? If you can send me the save (+ design if FRUA) + some info, I'll take a look.


Game, save and info sent to your email.
Title: Re: Gold Box Companion - tool for GB games
Post by: AV8R on March 19, 2017, 10:11:03 AM
jhirvonen,

Thanks for your excellent work on GBC, it makes the Gold Box games so much more enjoyable. I have a question: seeing that you've extracted the DAX character icons (mostly enemies) into a folder called DAX-Icons, is there a way to assign some of these icons to your own player characters? For example, I have a female fighter I'd like to assign the "Vala" icon to so it shows in-game. Is there a way to do that using GBC?
Title: Re: Gold Box Companion - tool for GB games
Post by: jhirvonen on March 19, 2017, 10:28:50 PM
I have a question: seeing that you've extracted the DAX character icons (mostly enemies) into a folder called DAX-Icons, is there a way to assign some of these icons to your own player characters? For example, I have a female fighter I'd like to assign the "Vala" icon to so it shows in-game. Is there a way to do that using GBC?

When figuring out DAX-file encoding I did something like that:
http://personal.inet.fi/koti/jhirvonen/gbc/screens.html (http://personal.inet.fi/koti/jhirvonen/gbc/screens.html)

Start IconMod.exe from the GBC-folder. Some documentation can be read from IconMod.txt.

It's experimental at best. Can only be used on some of the EGA-games and the color palette is not accurate. As player icons are made of a head and a body icon, you have to replace the head graphics with an empty transparent image (CLEAR ICONS button in IconMod) and use the body graphics for icons. There's the RESTORE ORIGINAL button to restore the original file if something goes wrong.