Are you, in fact, a pregnant lady who lives in the apartment next door to Superdeath's parents? - Commodore

Create an account  

 
Real-Time Game Tweaker

(October 22nd, 2015, 18:01)Question Wrote: Can someone please explain how to change the accessories creation penalty? I'm looking at the "how to mod" thread but it's a bit confusing.

You need a hex editor. You load the wizard.exe file. Go to the address specified. If the byte(s) there matches what's written, you replace them with what's in the instructions and save. If it's not wizards.exe then it'll be mentioned which file instead.

Quote:The unit data in wizards.exe also seems to have incorrect numbers for upkeep. For example, dwarven swordsmen are listed as having 2 upkeep, which can't be true since they have 0 upkeep except for food....
Unless you play my mod, unit upkeep is hardcoded to get overwritten by [Cost/50] rounded down, or zero if spearmen.
The field in unit data has no effect for normal units (but it does work for fantastic units) at all unless this behavior is first removed.


Edit : more diplomacy info

[bx-5C86] is a 6 byte array for a timer in turns. The AI will not declare war or break your treaties during this period of time. It is used when forming a new treaty or when the AI pays you to avoid war when you threathen them.

Also, which I never would have guessed, the AI wizards trade spells between each other.
Reply

(October 22nd, 2015, 14:35)Seravy Wrote: "I've always been rather prissy of not allowing any crashes to creep into the tweaker, and I don't want any in there now."

I actually get crashes regularly. Not while using the tweaker, don't think that ever happened, but when I don't use it for a while and leave it open, and then start a game and hit connect later, it crashes about half the time. Opening a fresh one always works without a problem.
The connect button also seems to not like it when the game was running for a long time, then it simply fails to connect, and I have to restart the game to be able to.

Yes. Switching to an entirely new process seems to have the problem that some references to the old one are not properly cleaned up in time. I'll see if I can fix that.

If the connect button does not work, that means that the signature in MoM that the tweaker looks for, has been corrupted.
The signature is at DS:0.
Typically it gets corrupted if the game writes data to a null pointer - a bug in the game.
Quitting and continuing the game will fix that - and you'll be playing with a game that is no longer corrupted. smile



Btw, can we split the different topics that are coming up into different threads?
I'm starting to lose track of what I've addressed and what is still open.
--I like ILSe
Reply

(October 22nd, 2015, 17:06)Seravy Wrote: (this is "bx-5C98h" in memory)

What do you mean by bx-5C98h?
--I like ILSe
Reply

(October 21st, 2015, 10:11)Question Wrote: -I tried to use the spell picker, but life spells are invisible (See screenshot)

You're missing the background images and icons.
I have downloaded the latest tweaker and I see the same problem.
I'll see to it that it gets fixed in the next version.
--I like ILSe
Reply

(October 23rd, 2015, 08:00)I like Serena Wrote:
(October 22nd, 2015, 17:06)Seravy Wrote: (this is "bx-5C98h" in memory)

What do you mean by bx-5C98h?

It's DS:10000h-5C98h+bx where bx is used as the index in the array so you can ignore that, 0 is the first wizard's first array element.

Sorry for using these negative values but that's how they show up in the disassembler so it's easier this way.

The start of the wizard structure is "bx-6136h" in wizards.exe.
Reply

I have created the following tickets in sourceforge to try to keep track of the bugs and improvements of the tweaker:
https://sourceforge.net/p/momrtgt/tickets/32/
https://sourceforge.net/p/momrtgt/tickets/33/
https://sourceforge.net/p/momrtgt/tickets/34/
https://sourceforge.net/p/momrtgt/tickets/35/
--I like ILSe
Reply

(October 22nd, 2015, 18:01)Question Wrote: I loaded up itempow.lbx but i dont see anything that is preventing swords from getting up to +6 attack...im guessing its hardcoded somewhere?
The tweaker allows you to change itempow.lbx freely, but the game that uses it may feel differently.
I suggest to change it, and see if the Create Artifact screen displays it correctly, and then see if you can create it and if you get what you wanted.
Some changes will work, others will behave different than intended.
At least the game doesn't seem to crash.


Quote:I think people would be interested in the spell picker because it would be a lot more user friendly than the current option of changing spells after starting a game.

For example, if i want to change my spells, i have to first use the tweaker to check which spells are either researchable or knowable. Then i have to check which spell levels they are in. Then i have to update the research candidates as well, and in order to do that i need to look up the code for the spells as well (which i have to open the tables for). Its a lot of going back and forth compared to ticking some check boxes.
Ah. So you're not interested in MoM-1.1 spell selection functionality - you just want a more user friendly way to select spells?


Quote:I dont understand how to use the build queue thing though, can someone please explain it?
This is still under development.
The next version will have more functionality.

The dialog will show what the status is everywhere and what the tweaker thinks should be built.
Then you can apply that.
Or to automate, you can check the Auto-apply flag.

Currently the logic around what should be built and when is hard coded.
That logic is displayed in the dialog, but can as yet not be changed.


Quote:I noticed one possible problem with the exe customizer when editing magic.exe. It only contains landmass data for small, medium and large, but insecticide 1.40n has world options up to huge. Editing the values in the tweaker (such as by changing the min landmass tiles to 20) causes the game to freeze a lot while creating a new map. Is there an incompatability?
Maybe. I haven't really checked yet.
I created that before Kyrub added the huge land mass to Insecticide.
That was actually pretty impressive.
Since then this functionality in the tweaker is pretty much obsolete, although I think it would still work.
And as you noticed, giving it values that are too big tends to freeze the game, which is mentioned in the comment column.
I believe that's because it can get stuck in a retry loop.


Quote:The unit data in wizards.exe also seems to have incorrect numbers for upkeep. For example, dwarven swordsmen are listed as having 2 upkeep, which can't be true since they have 0 upkeep except for food....
That's probably only when you're playing Seravy's mod?
If I inspect dwarven swordsmen, they have upkeep 0 as they should.
The upkeep is the amount of gold per turn and excludes the standard food requirement.
--I like ILSe
Reply

(October 23rd, 2015, 08:16)Seravy Wrote:
(October 23rd, 2015, 08:00)I like Serena Wrote: What do you mean by bx-5C98h?

It's DS:10000h-5C98h+bx where bx is used as the index in the array so you can ignore that, 0 is the first wizard's first array element.

Sorry for using these negative values but that's how they show up in the disassembler so it's easier this way.

The start of the wizard structure is "bx-6136h" in wizards.exe.

That's fine. I just didn't understand.
Just checked that the tweaker "understands" it when you type ds:-5C98 in its address calculator.
And it will actually show what all the related offsets are in the .exe or in memory.
Btw, in the next version of the tweaker, you can also changed the file/memory directly.
--I like ILSe
Reply

More info.

[bx-5F96h] is another diplomacy array with 6 elements per wizard.
This variable is used as a direct addiction to the relations when deciding on a declaration of war (well, one type anyway), and also is used by lawful wizards to decide if they have been offended somehow.

There are only two ways to alter the value of this variable.
1. Offering a tribute adds 2+random(8) but can't raise it above 30.
2. Doing some sort of negative action runs a procedure which
-does nothing at all if they are already at war
-adds -10 if there was a wizard pact between the "offender" and the other wizard.
-adds -20 for alliance
-doubles the above for lawful wizards being offended.
-And then adds a -5 for the offender's value on every wizard NOT INVOLVED with this action.
Yes, you heard it right, getting a wizard angry, even if there is no pact, will worsen your chances with everyone except that wizard permanently.
There is no check for under/overflow here and I haven't seen one for it globally either, so doing it too many times will probably cause the variable to turn from -127 to +128.
-causes a penalty to the root diplomatic relations (the ones you start the game with based on books) if there was an alliance.
-if there was a treaty, it mutually records it in the other wizard's [bx-5FA8], by directly copying it from the treaty value.
-A random amount of 1-20 is subtracted from the visible relations.
-The "reevaluate aggression" timer in [-5C8C] is reset to 10+random(15) turns, which when expires makes the AI get a random chance to set a variable that allows attacking towns without declaration of war.
-Several other unknown purpose variables are set to the lowest possible -200 value, including [-6008h], [-5FF0h] and [-5FFCh]
-Finally if there was a treaty, it gets cancelled.

This procedure is called when

-Declaration of War (any kind) happens
-Between three AI players where two are allied with the third but at war with each other, the one with the two allies will break both alliances through calling this.
-From what I assume might be the "Threathen" menu for player diplomacy
-If you propose "Break Alliance with" if the proposal was successful those wizards will do this to each other.
-If you threathen a wizard and it fails one of the many different checks done there, not sure what that check is for.
-If your non-settlers non-engineers unit is standing near their town and you had a pact or alliance, and this is the third warning in a row. [bx-5EE2] is the number of warnings already given. (this means you actually can guard nodes near their town if you use engineers)
-Attacking them despite the "You have a treaty with" warning
-One more location I haven't been able to analyze yet.

"starting" diplomatic relations btw is [bx-5FB4], and this is the value relations are heading towards naturally if nothing else happens.
Reply

Okay, I still had some stuff pending, and I've implemented a couple of the issues mentioned.
So...

Tweaker version 0.2.9 is out!

You can find it in the usual location on sourceforge:
https://sourceforge.net/projects/momrtgt/

Changes:
  • Background images and icons are properly included again.

  • Address Calculator allows you to change values now.
    Currently only 1 byte at a time, which happens when you press Enter.
    Be careful if you change the .EXE file!

  • Renamed Building Queue dialog to Manage Cities and improved it.

  • Level Bonus table can now also be edited if you load wizards.exe.

  • All picture sequences can be replaced now, also the bigger ones.
    The palette may be a bit skewed though.
    Still need to figure out how to re-apply the correct palette.

  • Added some diplomacy information based on Seravy's comments.

  • Repop lairs will only repop if unoccupied (untested).

  • The table of prefab artifacts now shows the header 'Artifact'
    instead of 'Special'.

  • The caption includes the version of the Tweaker now.
--I like ILSe
Reply



Forum Jump: