Author Topic: Gold Box Companion - tool for GB games  (Read 19545 times)

Offline jhirvonen

  • Jr. Member
  • **
  • Posts: 92
Re: Gold Box Companion - tool for GB games
« Reply #75 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.

Offline ProphetSword

  • Mod Designer
  • Administrator
  • Hero Member
  • *****
  • Posts: 2898
  • FRUA Lives!
    • Lands of Adventure
Re: Gold Box Companion - tool for GB games
« Reply #76 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.
LANDS OF ADVENTURE: An Old-School Style CRPG

More Information Here: http://landsadventure.blogspot.com/

Offline Donnie Ewald

  • Administrator
  • Sr. Member
  • *****
  • Posts: 266
    • Ego's Abode
Re: Gold Box Companion - tool for GB games
« Reply #77 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.

Offline Donnie Ewald

  • Administrator
  • Sr. Member
  • *****
  • Posts: 266
    • Ego's Abode
Re: Gold Box Companion - tool for GB games
« Reply #78 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.


Offline jhirvonen

  • Jr. Member
  • **
  • Posts: 92
Re: Gold Box Companion - tool for GB games
« Reply #79 on: December 25, 2016, 10:34:40 AM »
Here's something to test:



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.

Offline Donnie Ewald

  • Administrator
  • Sr. Member
  • *****
  • Posts: 266
    • Ego's Abode
Re: Gold Box Companion - tool for GB games
« Reply #80 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 if you'd like to carry this type of work forward and expand FRUA in many more ways!  :D

Offline ProphetSword

  • Mod Designer
  • Administrator
  • Hero Member
  • *****
  • Posts: 2898
  • FRUA Lives!
    • Lands of Adventure
Re: Gold Box Companion - tool for GB games
« Reply #81 on: December 26, 2016, 05:38:56 PM »
Awesome!  This is exactly what I was asking for.  Incredible work.
LANDS OF ADVENTURE: An Old-School Style CRPG

More Information Here: http://landsadventure.blogspot.com/

Offline Dedup

  • Newbie
  • *
  • Posts: 10
Re: Gold Box Companion - tool for GB games
« Reply #82 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.
« Last Edit: January 26, 2017, 12:08:56 AM by Dedup »

Offline jhirvonen

  • Jr. Member
  • **
  • Posts: 92
Re: Gold Box Companion - tool for GB games
« Reply #83 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/

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.

Offline Dedup

  • Newbie
  • *
  • Posts: 10
Re: Gold Box Companion - tool for GB games
« Reply #84 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.
  • 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?
  • 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.  Of course this wouldn't work for games like DQK and FRUA since they use unique icons for every character instead of having individual head and body pieces.
« Last Edit: February 03, 2017, 08:49:38 PM by Dedup »

Offline Moonbeam111

  • Newbie
  • *
  • Posts: 23
Re: Gold Box Companion - tool for GB games
« Reply #85 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.

Offline jhirvonen

  • Jr. Member
  • **
  • Posts: 92
Re: Gold Box Companion - tool for GB games
« Reply #86 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.

Offline Moonbeam111

  • Newbie
  • *
  • Posts: 23
Re: Gold Box Companion - tool for GB games
« Reply #87 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.
« Last Edit: February 05, 2017, 11:28:33 AM by Moonbeam111 »

Offline jhirvonen

  • Jr. Member
  • **
  • Posts: 92
Re: Gold Box Companion - tool for GB games
« Reply #88 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.

Offline Moonbeam111

  • Newbie
  • *
  • Posts: 23
Re: Gold Box Companion - tool for GB games
« Reply #89 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.
« Last Edit: February 05, 2017, 01:33:08 PM by Moonbeam111 »