Author Topic: UGE - FRUA Hacking  (Read 2621 times)

Offline Nol Drek

  • Dungeon Craft Tester
  • Hero Member
  • ***
  • Posts: 2108
    • Nol Drek's Web Site
UGE - FRUA Hacking
« on: June 26, 2013, 05:01:46 PM »
Many things that people want to change in a hacked UA design, are accomplished by making changes to UA's main executable file - ckit.exe.

Hexadecimal editing can be daunting to the uninitiated. Luckily, there is a Decimal editor out there called Universal Game Editor. This is useful for people who have ten fingers.
http://frua.rosedragon.org/pc/misc/uge10.txt
http://frua.rosedragon.org/pc/misc/uge10.zip

Do you want to change the race names, starting equipment, or the items available in shops? Would you like to modify one of the classes, change the exp tables, or fix the thief saving throw bug? Chances are that there is a UGE module that already does what you want. They are all collected here:
http://frua.rosedragon.org/pc/hacks/ckituge.txt
http://frua.rosedragon.org/pc/hacks/ckituge.zip

Krys Tamar wrote a UANL article describing the process of using UGE.
http://frua.rosedragon.org/pc/uanews/uanl28/tc-uge1.htm

Unfortunately, you can't create a diff.tbl file through UAShell anymore if you are using DosBox instead of actual DOS. If you know how to get an actual DOS C:\ command prompt on your windows machine (on mine I go to Start and type cmd) then it is a matter of doing a file compare using the "fc" dos command and redirecting the output to a text file.

Get a DOS C:\ command prompt
This link explains how for users of Windows 8, 7, Vista, XP, 2000, NT, ME, 98, 95, and 3.x
http://www.computerhope.com/issues/chdos.htm

This command displays a list of all the differences between 2 files:
fc file1.xyz file2.xyz

For example, if your FRUA is installed in a directory c:\frua, you would type:
fc c:\frua\ckit.exe c:\frua\default.dsn\panic.xxx

And this command writes all those differences to a text file instead of to your monitor:
fc c:\frua\ckit.exe c:\frua\default.dsn\panic.xxx > diff.txt

Open that "diff.txt" text file in Notepad, and you will have all the necessary information you need to create a diff.tbl file.

If you are not familiar with using a DOS C:\ command prompt, remember that you can always type the word "exit" to return to the safety of a windowed environment (the same way you get out of DosBox). Better yet, start a letter writing campaign to the good people at DosBox saying, "I want you to implement the "fc" DOS command".
"Into the Drachensgrab Mountains!"

http://www.noldrek.com

Offline Milos Gulan

  • Hero Member
  • *****
  • Posts: 3030
Re: UGE - FRUA Hacking
« Reply #1 on: June 26, 2013, 05:54:36 PM »
Thanks for that, it sure will be useful, i might try it soon :)

Offline ProphetSword

  • Mod Designer
  • Administrator
  • Hero Member
  • *****
  • Posts: 2861
  • FRUA Lives!
    • Lands of Adventure
Re: UGE - FRUA Hacking
« Reply #2 on: June 26, 2013, 06:24:01 PM »
With your permission, I'd like to make this a Sticky topic.  Just not sure whether I should keep it here under General Discussion or move it to the hacking boards.  Any thooughts?
LANDS OF ADVENTURE: An Old-School Style CRPG

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

Offline Vix

  • Mmmm ... Spider Slushies!
  • Administrator
  • Hero Member
  • *****
  • Posts: 1110
Re: UGE - FRUA Hacking
« Reply #3 on: June 26, 2013, 06:37:41 PM »
Hacking

Offline Nol Drek

  • Dungeon Craft Tester
  • Hero Member
  • ***
  • Posts: 2108
    • Nol Drek's Web Site
Re: UGE - FRUA Hacking
« Reply #4 on: June 27, 2013, 11:27:58 AM »
With your permission, I'd like to make this a Sticky topic.  Just not sure whether I should keep it here under General Discussion or move it to the hacking boards.  Any thooughts?

Yes, a sticky in the hacking boards makes sense.
"Into the Drachensgrab Mountains!"

http://www.noldrek.com

Offline Ishad Nha

  • Hero Member
  • *****
  • Posts: 925
Re: UGE - FRUA Hacking
« Reply #5 on: December 01, 2016, 06:52:44 PM »
UGE won't run natively on Windows 10, but DosBox will run UGE normally.
On Split Screen display I was not expecting the Compare function to work on DosBox but it did?!
So far UGE seems to work quite well.

File Compare program, Nol made one available in this topic:
http://ua.reonis.com/index.php?topic=2675.0

Gold Box Games: Buck Rogers, Forgotten Realms, Savage Frontier and Krynn Series
Eight games are covered here:
http://blog.aulddragon.com/2012/07/uge-modules-for-gold-box-games/
but Gold Box Companion is better in every way.

Eye of the Beholder Trilogy:
Much better than UGE is All Seeing Eye, a program by jhirvonen
http://personal.inet.fi/koti/jhirvonen/ase/
Currently this only works for EoB1 and EoB2.

For EoB3, a module was developed by Gotcha from the Gog forums:
http://avatar.home.xs4all.nl/crap/EOB3-UGE.rar
There seems to be no equivalent of the Ravenloft #/Menzoberrenzan save.dat file. Instead you have Items_##.bin

Following link was provided, a while ago, by Simeon Pilgrim:
http://rewiki.regengedanken.de/wiki/List_of_file_formats

For those who are not familiar with DosBox: the configuration file is called "dosbox-0.74.conf", omit quotes.
It is found at a place like this:
C:\Users\[LoginName]\AppData\Local\DOSBox\

This text is put at the very end of the file:
MOUNT C C:\OldGames
C:
cd C:\UGE10
UGE

(Create a folder called OldGames and put the UGE folder there. I assume the use of UGE10 for the UGE folder name.)
If you exited out of UGE, DosBox is still running and you want to restart UGE, just type UGE and hit Enter.
« Last Edit: January 26, 2017, 07:42:56 PM by Ishad Nha »

Offline Ishad Nha

  • Hero Member
  • *****
  • Posts: 925
Re: UGE - FRUA Hacking
« Reply #6 on: December 31, 2016, 01:58:58 AM »
As far as I can tell, UGE is abandonware. Below is advice on how to "register" it, this is to be done in a hex editor. There should only be the relevant six Bytes in the resulting file.
Comment was found at:
http://www.bunnzy.org/applications/universal-game-editor-v10

One Response to “Universal Game Editor v1.0”

    RegUGE Says:
    June 19th, 2008 at 5:50 pm

    Registration:
    Make a file named UGE.KEY in the same folder as UGE.EXE
    Put the following 6 bytes of info into it:
    94 20 41 F2 4C 63
    Save it and exit. UGE will act like it’s registered.

    For the Game Utilities by Jack Hartman:
    GU-PE.KEY
    94 2D 21 92 BC 60

    GU-EOB2.KEY
    94 5C 8F F2 A3 60

    enjoy.
« Last Edit: December 31, 2016, 02:02:14 AM by Ishad Nha »

Offline Ishad Nha

  • Hero Member
  • *****
  • Posts: 925
Re: UGE - FRUA Hacking
« Reply #7 on: January 02, 2017, 05:49:55 AM »
UGE has a Cluster insert mode for giving the same variable to each PC.
However, there is no Cluster alteration mode. It seems that any alteration must be done one PC/NPC at a time. For example, the EOB3 variable "Char 01 Qty arrows" has the wrong Variety Type and Range. They are listed as 1 byte and 0 thru 255 respectively when they should be 2 bytes and +/- 32,767.

One approach is to rewrite UGE or create your own equivalent of it.*

Another approach is to insert corrected versions of the variable with Cluster function, then delete the old versions one at a time.

A third approch is to write a program just for Cluster alteration, it could use modulus to find and replace the variables easily enough. For example, each EOB3 record is 627 Bytes long.

A fourth approach is to use a hex editor for this purpose.
All mdl files have lines of 26 Bytes each. Numbering from 0 through 25 gives the following four-part scheme:
(A) Byte 0 lists the length of the Name.
(B) Bytes 1 through 20 give the letters of the name.
(C) Bytes 21 through 24 record the starting offset of the variable.
(D) Byte 25 tells you what type of variable it is.

Now examination shows that the final byte in the listing is 255, whereas variables with the correct type and range have 254, so we need to change the 255 to a 254.                           
Normally you could use the Replace function to do a search for the " Qty arrows" part of the name and then replace Byte 25. However, in between parts (B) and (D) lies part (C) which is different for every variable. (This is no problem if you have a Replace function that can accept wild-card characters.)

Here last Byte of this record and the first Byte of the next record form a pair that is found only once in any PC record. Hence Replace function could be used easily.


*We need Cluster alteration, cluster deletion, a version of the Lst list file that lists the actual values too. Also, storage of record length at the end of the file.

Offline Ishad Nha

  • Hero Member
  • *****
  • Posts: 925
Re: UGE - FRUA Hacking
« Reply #8 on: January 08, 2017, 07:40:13 PM »
All mdl files have lines of 26 Bytes each. Numbering from 0 through 25 gives the following four-part scheme:
(A) Byte 0 lists the length of the Name.
(B) Bytes 1 through 20 give the letters of the name.
(C) Bytes 21 through 24 record the starting offset of the variable.
(D) Byte 25 tells you what type of variable it is.

This enables the creation of module mdl files all in one go, by use of a spreadsheet. I created a new module for the Mage spells in EOBIII. If you have a table of data and you don't like entering variables one at a time this approach may be of interest.

Here is the list of bytes for (D):
FC   4-byte:  +/- 2,147,483,648
FD   2-byte:  0 thru 65,535
FE   2-byte:  +/- 32,767
FF   1-byte:  0 thru 255
00   1-byte:  +/- 127

For text, the string can be between 1 and 20 Bytes in length, inclusive. So just insert the hexadecimal version of the length.
« Last Edit: January 21, 2017, 02:10:45 AM by Ishad Nha »

Offline Ishad Nha

  • Hero Member
  • *****
  • Posts: 925
Re: UGE - FRUA Hacking
« Reply #9 on: January 24, 2017, 07:04:55 AM »
Creating a UGE Module file from a list of data, by using a spreadsheet is not hard to do.
The spreadsheet attached below is meant to be one size fits all, able to generate any sort of Mdl file.
It is helpful if you have, or can acquire, basic knowledge about how to
use a spreadsheet program.
This approach is meant for a situation where most variables are repeated in the
record of each PC.
I have included a worked example.
Also included are the Mdl files for all three of the EoB games.

Detailed lists of classes will be found in hex1 and hex2, links provided in the spreadsheet.
For EoB3 go to the original mdl file, link is found in Reply #5, the post for December 2 last year.

Edit:
(Spreadsheet is now found in the following post.)
« Last Edit: January 29, 2017, 05:47:39 AM by Ishad Nha »

Offline Ishad Nha

  • Hero Member
  • *****
  • Posts: 925
Re: UGE - FRUA Hacking
« Reply #10 on: January 29, 2017, 05:45:19 AM »
UGE is meant for PC records which are all of equal length.
My new version of the spreadsheet can also handle save files where the records
are of unequal length.
« Last Edit: January 29, 2017, 05:48:51 AM by Ishad Nha »

Offline Ishad Nha

  • Hero Member
  • *****
  • Posts: 925
Re: UGE - FRUA Hacking
« Reply #11 on: February 06, 2017, 10:28:46 PM »
UGE is a solid and stable program but it has its limitations, so it is not literally a Universal editor, there are a few games it is useless for.
What it can't handle:
(a) a variable starting point
(b) PC record sizes that vary from save to save.
(c) PC records that are of unequal size.
(d) bit manipulation

(a) This problem has a possible work around:
copy the sequence of PC records from a save game file
save the sequence as a file in its own right, call it "Sequence.sav"
create a module for Sequence.sav
alter Sequence.sav in UGE, in the normal UGE way
once done, copy its contents and then paste back into the original save file.

(c) I devised a spreadsheet that could handle this, see post above.

I find the interface to be a bit restrictive, a bit small and you can't use your mouse.

Also, it does not handle the actual decryption of save game files. Decryption is an art form

Game Wizard is an alternative, like ASE it checks the memory directly.

Offline Ishad Nha

  • Hero Member
  • *****
  • Posts: 925
Re: UGE - FRUA Hacking
« Reply #12 on: February 23, 2017, 05:40:17 AM »
UGE cannot handle all 1990s games. The two Dark Sun games are shining examples of this fact.
In such a case, try and figure out how to avoid the need for hex editing in the first place...

 

anything