Author Topic: Matrix Cubed  (Read 415 times)

Offline marlin1500

  • Newbie
  • *
  • Posts: 6
Matrix Cubed
« on: September 16, 2016, 10:08:41 AM »
Can anyone point me in the right direction on how to edit some of the battles in terms of what monsters appear in them? Compared to the 1st game some of the battles have stupid combinations of enemies that are not consistent with the 1st game.  To start with I'm tying to change the battles when you board a Mer Med Cruiser, most of them spam you with stun grenade equipped robots.  I want to make them the same as the 1st game where they are largely made of MER Warriors with a few robots added on.  Which file controls the battle enemy combinations?

Offline marlin1500

  • Newbie
  • *
  • Posts: 6
Re: Matrix Cubed
« Reply #1 on: September 18, 2016, 01:37:32 AM »
After doing a bit of googling, the encounters are in the ECL file, I've decompiled it, but cant find where the monster entries are.  Are the monster numbers in the Gold Box monster editor, are the monster ids, in Hexidecimal that are in the ECL file? If so which is it the number on the left or right of the monster name in the editor?  I assume the number of monster in the fight are the next number but can't find any matchs with the actual battles in game.  Anyone know what is going on?

Offline jhirvonen

  • Jr. Member
  • **
  • Posts: 76
Re: Matrix Cubed
« Reply #2 on: September 18, 2016, 07:49:41 AM »
This might help if you haven't already read it:
http://personal.inet.fi/koti/jhirvonen/gbc/manshoon.html

If Matrix Cubed uses the same format as the other GB games, you need to figure out the LOAD MONSTER command id and then find the wanted battle by the monster ID &
monster count.

Example from Pools of Darkness:

1AAE   0B 00 0D 00 01 00 0D   (1 x Kalistes, monster record $0D)
1AB5   0B 00 25 00 07 00 25   (7 x Drow Champion, $25)
1ABC   0B 00 28 00 08 00 28   (8 x Drow Wizard, $28)
1AC3   0B 00 07 00 05 00 07   (5 x Pet of Kalistes, $07)

Where $0B is the LOAD MONSTER command.

Also, Gold Box Explorer might be of help when browsing the ECL file.

Offline marlin1500

  • Newbie
  • *
  • Posts: 6
Re: Matrix Cubed
« Reply #3 on: September 19, 2016, 03:46:04 AM »
Thank you that same format appears in the Matrix ecl, however any changes I make to the file have no effect in the game.

For example.
0B 00 34 00 06 00 34

Should be 6 Ram warriors, I've changed it to be
0B 00 35 00 06 00 35
Which now should be 6 Ram Technicians, however nothing changes.

Do I need to so anything other then modify the ecl file for the changes to take affect?

well this is beyond me I did mass replacements in a hex editor "0B 00 XX 00" to "0B 00 22 00" which should have changed the monster type but left the icon the same, but nothing changed.

Stupid question I assume you don't have to start a new game for changes to ecl1.dax to take affect?
« Last Edit: September 19, 2016, 07:38:59 AM by marlin1500 »

Offline jhirvonen

  • Jr. Member
  • **
  • Posts: 76
Re: Matrix Cubed
« Reply #4 on: September 19, 2016, 12:15:47 PM »
Should be 6 Ram warriors, I've changed it to be
0B 00 35 00 06 00 35
Which now should be 6 Ram Technicians, however nothing changes.

Do I need to so anything other then modify the ecl file for the changes to take affect?

That should do it.

well this is beyond me I did mass replacements in a hex editor "0B 00 XX 00" to "0B 00 22 00" which should have changed the monster type but left the icon the same, but nothing changed.

Did the monster stats / name change? The first ID might be an index to the monster data record and the second one to the icon.

Stupid question I assume you don't have to start a new game for changes to ecl1.dax to take affect?

Probably not.

If you have a save game near the encounter I could give it a try. Or is it a random encounter you're trying to change?

Btw, how do you rebuild the DAX-file or do you edit the DAX-file without decompiling it?


Offline marlin1500

  • Newbie
  • *
  • Posts: 6
Re: Matrix Cubed
« Reply #5 on: September 19, 2016, 06:25:10 PM »
I edited the ecl file directly.

I used daxdump on it but that generated 90 or so files.

I'm trying to edit random encounters.

I will send you the save file after work, I've boarded a ram ship trying to alter the ram warrior as a test.

Offline jhirvonen

  • Jr. Member
  • **
  • Posts: 76
Re: Matrix Cubed
« Reply #6 on: September 21, 2016, 03:11:21 PM »
If you use DAXDump to decode the ECL DAX-file, check file ECL1_021.bin. In the end of the file there are several sequences of 34 which might be the list of monsters in an encounter.

I tried changing some of those to other monster indexes and the encounter changed to reflect that. The game displayed an error message "pic not found" before the combat started so to avoid that you might need to use a monster that has a 3d view sprite.

Note that you can also edit the game's memory directly with the hex editor HxD (from the menu Extras -> Open RAM -> DosBox, search for a sequences of bytes from the ECL file to find the data). For testing purposes it's probably easier than tinkering the ECL file directly as it's run-length encoded.

Offline marlin1500

  • Newbie
  • *
  • Posts: 6
Re: Matrix Cubed
« Reply #7 on: September 22, 2016, 05:41:15 PM »
Great thanks, can you send me what you changed in the encounter files so I can compare.  Can you send me the ecl1 file and any daxdump ones you used.

I can't find anything in the ram that looks like the code in ecl. Like wise the datdump ECL1_021.bin does not have the 34 hex values in the same format.  The pic error is probably due to you have to change the monster id & the icon id eg.  "0B 00 0D 00 01 00 0D" to " 0B 00 0E 00 01 00 0E".

I am buggered I've tried so many combinations of changes to the ecl1 file eg.  "0B 00 34 00 08 00 34" to "0B 00 34 00 20 00 34" or " 0B 00 35 00 08 00 34" and I am not seeing any changes after changing every instance of 0B 00 34, I must be doing something simple wrong.  Please send me you ecl1 file, can you change every encounter with say 6 ram warriors to 25 ram warriors, so I can see how this works.
« Last Edit: September 23, 2016, 03:24:06 AM by marlin1500 »

Offline jhirvonen

  • Jr. Member
  • **
  • Posts: 76
Re: Matrix Cubed
« Reply #8 on: September 23, 2016, 04:29:41 PM »
I did just a quick test and didn't keep the changed files.

But here's a quickly made DAXBuilder tool with a GUI that might help:
http://personal.inet.fi/koti/jhirvonen/gbc/daxbuilder.zip

It needs to be put in the same folder as Gold Box Companion as it needs some of the data files from it.

Run it, set game folder / select the game and the DAX-file. Extract the DAX contents and then open the ECL1_021.bin from the extact-folder with a hex editor.

Starting roughly at hex offset F60 and onwards there are several sequential byte runs of 34/32/36 etc. which some of probably are the encounter contents.

So probably not all encounters are created with the 0B command but use lists / tables.

After hex editing, rebuild the DAX with DAXBuilder. Of course, the game must be reloaded after changes. It's probably best to restart DOSBox as well.

That's all I know. I can't point you at exact offsets to change as the format of the ECL files is not completely understood.

Also, try using Gold Box Explorer to figure out the ECL file structure.

Offline marlin1500

  • Newbie
  • *
  • Posts: 6
Re: Matrix Cubed
« Reply #9 on: October 04, 2016, 06:35:32 PM »
I got the random encounters to change, I reckon the 0B values determine the fixed battles.