Posts: 10,492
Threads: 395
Joined: Aug 2015
Quote:It looks as if Tweaker previously reported $502 for spell desirability, and $4 for the spell category (fixed damage).
2 is AI spell category : if two spells have the same number the AI will avoid researching more than one until later. It's also used when the AI wants to know if they have a spell of that type to cast, for example do they have a city curse or not. In general no one should change this unless they are rewriting the AI.
5 is AI desirability : This is how much the spell is worth in trades. CoM uses it for nothing else but 1.31-1.52 also prefers researching these earlier if it's higher.
4 is Spell category : This is used for branching the code for the spell's effect. For example 0 will summon a creature, 1 will buff a unit. This can be used to replace a spell with a different, generic spell, for example add a new summon or direct damage spell.
In case of Fairy Dust this means :
2 : The AI thinks this is a minor direct damage spell.
5 : The AI assumes this spell is not worth very much when trading
4 : This spell performs a direct damage effect when cast, using the parameters as attack strength and flags.
Quote:I guess that even if all walls have been broken, that units in the center still benefit from a +3 defense?
In Caster, yes. In 1.5x, I don't remember, you have to check the wiki.
As far as I remember Insecticide has a more serious bug though, the walls applied even if you weren't fighting in a city combat, like on a node. But that was many years ago, maybe I remember wrong.
Quote:Noble seems to be 20 gold/turn now instead of 10 gold/turn.
Is that intended? Or should I just remove it if CoM is active?
Yes, that's actually intended. I don't remember but there might be more than one places in the exe that use the number though.
However, the "10" or "20" for Noble is located at two places in the EXE. $96664 has add [bp-8],10 and $BCB2D has add [bx],10.
So if you want to change it, it needs to be changes at both places.
Yes, the game has two identical functions for calculating the gold income and both are used for different purposes. Crazy.
Posts: 10,492
Threads: 395
Joined: Aug 2015
A list of the categories, there are more but the remaining ones are unique spells like Disjunction :
Code: SGSummon = 0;
SGUnitBuff = 1;
SGCityBuff = 2;
SGCityCurse = 3;
SGCombatSpell = 4;
SGOther = 5;
SGWizardTargeting = 6;
SGGlobalEnchantment = 9;
SGCombatGlobal = 10;
SGItemCreation = 11;
SGSaveorDie =12;
SGUnitCurse = 13;
SGUnitcurseNoSaves = 14;
SGUnitBuffNormalUnit = 15;
SGUnitCurseNormalUnit = 16;
AI Categories, the most notable ones are (I don't know if my table is for CoM or MoM, sorry, probably a mixture of both, spells have been moved around between these quite a bit):
0 - AI cannot use
7 - Weak unit buff
8 - Weak city buff
A - Medium city buff
E - Curse
1C - Overland Direct Damage
1D - Strong unit buff
20 - Medium summon
2C - Defensive city buff
33 - Strong city buff
34 - Building destruction
38 - Good summon
46 - Combat AOE spell (like Flame Strike)
4A - Top summons
4E - Very good summons
4F - Massive city destruction
50 - Global Enchantment
As far as CoM goes, the AI mostly only uses the categories for summons to avoid researching two of the same tier, and to determine which priority casting a summoning spell or city enchantment should be. Pretty much the other categories are no longer used and any spell related decisions are hardcoded for the specific spell.
Posts: 973
Threads: 20
Joined: Oct 2010
(March 13th, 2020, 19:21)Seravy Wrote: A list of the categories, there are more but the remaining ones are unique spells like Disjunction :
Code: SGSummon = 0;
SGUnitBuff = 1;
SGCityBuff = 2;
SGCityCurse = 3;
SGCombatSpell = 4;
SGOther = 5;
SGWizardTargeting = 6;
SGGlobalEnchantment = 9;
SGCombatGlobal = 10;
SGItemCreation = 11;
SGSaveorDie =12;
SGUnitCurse = 13;
SGUnitcurseNoSaves = 14;
SGUnitBuffNormalUnit = 15;
SGUnitCurseNormalUnit = 16;
That matches what I already had, although I have a couple more:
Code: SPELLCATEGORY_Dispel = 0x12, // dispel magic, dispel magic true. Max cost = base cost * 5.
SPELLCATEGORY_Disenchant = 0x13, // disenchant area, disenchant true. Max cost = base cost * 5.
SPELLCATEGORY_Disjunction = 0x14, // disjunction, disjunction true. Max cost = base cost * 5.
SPELLCATEGORY_Counter = 0x15, // counter magic. Max cost = base cost * 5. Functions otherwise like 0x0a, so it's likely that other area spells could be modded, though effects would likely be undefined.
SPELLCATEGORY_Variable_damage = 0x16, // variable cost damage spells; max cost = base cost * 5. Otherwise identical to 0x04. The extra effect per extra mana spent is probably determined by the flags, it isn't coded here.
// Life Drain, Fire Bolt, Ice Bolt, Lightning Bolt, Psionic Blast, Fireball
// base spell strength + (mana - cost)
SPELLCATEGORY_Banish = 0x17,
Are those valid?
Quote:AI Categories, the most notable ones are (I don't know if my table is for CoM or MoM, sorry, probably a mixture of both, spells have been moved around between these quite a bit):
Since you are not sure, I'll just list the AI Category as a number for now.
--I like ILSe
Posts: 10,492
Threads: 395
Joined: Aug 2015
Quote:Are those valid?
Yes, but variable cost damage spells, variable cost enchantments (Counter Magic) and variable save or die spells (Banish) are not used in CoM.
In general, if the number is $11 or higher (or was it 12?) that means the spell uses a slider for cost.
March 14th, 2020, 13:04
(This post was last modified: March 14th, 2020, 13:40 by I like Serena.)
Posts: 973
Threads: 20
Joined: Oct 2010
Tweaker version 0.3.3 is out!
You can find it in the usual location on sourceforge:
https://sourceforge.net/projects/momrtgt/
Changes- Revised solution to find Steam version of MoM and CoM, so that it still works in e.g. Windows Vista.
That is, the dependency to GetModuleFileNameA in psapi.dll that was introduced in 0.3.2 has been eliminated again.
- Show all fields such that they are consistent with Caster of Magic as per Seravy's comments.
- Visualize palettes and cursor images from FONTS.LBX in LBX editor based on information from Drake178.
Replacing them does not work (yet).
- Released a Linux version as well, built in Ubuntu 18.04 (WSL).
--I like ILSe
Posts: 10,492
Threads: 395
Joined: Aug 2015
A minor problem that has been somewhat annoying for various reasons. When saving a set of images from the LBX, there is no way to have an output with consistent naming.
There are these cases :
1. Filename does not end with 0.
You get name.png, name_1.png, name_2.png etc.
the first file is missing the _0 making this inconsistent, I have to rename the files manually a lot if I want to read those files in a for loop or mass rename them or anything. (I don't remember if I also need to rename to read it in the tweaker again, maybe not.)
2. Filename ends with 0 and there are less than 10 files.
You get name0.png, name1.png, name2.png etc.
Yay, finally consistent output, but does not work with more than 9 images in the animation.
I used to have problems here as well though, if the 0 is not intended to be the workaround for the first problem but an actual part of the filename then the expected output would be name0_0.png, name0_1.png, name0_2. png. This comes up when I saved something named after the index of the entry, like say I use names "index19", "index20","index21". Index21's first file will be index21.png but index20's second file will also be index21.png as it replaces the 0 with 1 so I have to save indexes ending zero specifically as "index20x.png" instead to avoid the filenames overlapping.
3. If the filename ends with 0 and there are more than 10 files :
Then you get name0.png to name9.png but afterwards you get name0_10.png, name0_11.png and so on.
Ideally, the best solution I see that fixes all of these is to always attach _0 to _99 at the end, regardless of what the last character of the name is and not special-case files that end with a zero.
Posts: 224
Threads: 4
Joined: Sep 2019
I tried running the shell on Ubuntu 18.04.4, freshly updated.
./MoMTweaker: error while loading shared libraries: libdouble-conversion.so.1: cannot open shared object file: No such file or directory
Am I missing something?
March 16th, 2020, 06:33
(This post was last modified: March 16th, 2020, 13:10 by I like Serena.)
Posts: 973
Threads: 20
Joined: Oct 2010
(March 15th, 2020, 17:03)JustOneMoreTurn Wrote: I tried running the shell on Ubuntu 18.04.4, freshly updated.
./MoMTweaker: error while loading shared libraries: libdouble-conversion.so.1: cannot open shared object file: No such file or directory
Am I missing something?
Hmm... apparently there are some more dependencies nowadays than there used to be. Sorry for that.
It's a bit tricky to figure out which dependencies are needed exactly, since they are all 'just' available in my current system, and they are part of the system libraries.
That is, I have for instance that libdouble-conversion.so.1 library in /usr/lib/x86_64-linux-gnu/libdouble-conversion.so.1.
Anyway, I'll see if I can make it nicely deployable so that it works on any Linux platform.
--I like ILSe
Posts: 973
Threads: 20
Joined: Oct 2010
Fixed the Linux dependencies, and I have uploaded a new version: https://sourceforge.net/projects/momrtgt...z/download
It's a bit bigger now.
Since the previous Linux version did not work properly, I have deleted it.
--I like ILSe
March 16th, 2020, 19:01
(This post was last modified: March 17th, 2020, 11:11 by JustOneMoreTurn.
Edit Reason: added more error message
)
Posts: 224
Threads: 4
Joined: Sep 2019
The new linux64 version runs, but it won't connect.
~/dos/momt$ ./MoMTweaker.sh
Teeing output to cout_cerr.log
Output tee'ed from cout
Output tee'ed from cerr
__cplusplus=201402
ps -e | awk '/dosbox/ { print $1; }' >dosbox.pid
Trying process 'dosbox' with pid=1882
Search for MoM Data Segment (DS) Identifier (size 47): Borland C++ - Copyright 1991 Borland Intl.
WARN: PTRACE_ATTACH: Operation not permitted
WARN: PTRACE_ATTACH: Operation not permitted
WARN: PTRACE_ATTACH: Operation not permitted
WARN: PTRACE_ATTACH: Operation not permitted
WARN: PTRACE_ATTACH: Operation not permitted
WARN: PTRACE_ATTACH: Operation not permitted
WARN: PTRACE_ATTACH: Operation not permitted
WARN: PTRACE_ATTACH: Operation not permitted
WARN: PTRACE_ATTACH: Operation not permitted
WARN: PTRACE_ATTACH: Operation not permitted
WARN: PTRACE_ATTACH: Operation not permitted
WARN: PTRACE_ATTACH: Operation not permitted
WARN: PTRACE_ATTACH: Operation not permitted
WARN: PTRACE_ATTACH: Operation not permitted
WARN: PTRACE_ATTACH: Operation not permitted
WARN: PTRACE_ATTACH: Operation not permitted
WARN: PTRACE_ATTACH: Operation not permitted
WARN: PTRACE_ATTACH: Operation not permitted
WARN: PTRACE_ATTACH: Operation not permitted
WARN: PTRACE_ATTACH: Operation not permitted
WARN: PTRACE_ATTACH: Operation not permitted
WARN: PTRACE_ATTACH: Operation not permitted
WARN: PTRACE_ATTACH: Operation not permitted
WARN: PTRACE_ATTACH: Operation not permitted
WARN: PTRACE_ATTACH: Operation not permitted
WARN: PTRACE_ATTACH: Operation not permitted
WARN: PTRACE_ATTACH: Operation not permitted
Could not find DATASEGMENT_IDENTIFIER (size 47)
Could not find LOCAL_DIRECTORY
Tot time reading process memory = 0 seconds
Tot time finding signatures = 0 seconds
Gtk-Message: 09:34:12.940: GtkDialog mapped without a transient parent. This is discouraged.
Gtk-Message: 09:34:43.744: GtkDialog mapped without a transient parent. This is discouraged.
Restoring cerr
Output restored from cerr
Restoring cout
Output redirection restored
I tried a fix, changing ptrace_scope to 0 in /etc/sysctl.d/10-ptrace.conf, which didn't work either. I'm guessing that your computer is set up for software development, with all sorts of extra tools and settings active.
./MoMTweaker.sh
Teeing output to cout_cerr.log
Output tee'ed from cout
Output tee'ed from cerr
__cplusplus=201402
ps -e | awk '/dosbox/ { print $1; }' >dosbox.pid
Trying process 'dosbox' with pid=4599
Search for MoM Data Segment (DS) Identifier (size 47): Borland C++ - Copyright 1991 Borland Intl.
WARN: PTRACE_ATTACH: Operation not permitted
WARN: PTRACE_ATTACH: Operation not permitted
WARN: PTRACE_ATTACH: Operation not permitted
WARN: PTRACE_ATTACH: Operation not permitted
WARN: PTRACE_ATTACH: Operation not permitted
WARN: PTRACE_ATTACH: Operation not permitted
WARN: PTRACE_ATTACH: Operation not permitted
WARN: PTRACE_ATTACH: Operation not permitted
WARN: PTRACE_ATTACH: Operation not permitted
WARN: PTRACE_ATTACH: Operation not permitted
WARN: PTRACE_ATTACH: Operation not permitted
WARN: PTRACE_ATTACH: Operation not permitted
WARN: PTRACE_ATTACH: Operation not permitted
WARN: PTRACE_ATTACH: Operation not permitted
WARN: PTRACE_ATTACH: Operation not permitted
WARN: PTRACE_ATTACH: Operation not permitted
WARN: PTRACE_ATTACH: Operation not permitted
WARN: PTRACE_ATTACH: Operation not permitted
WARN: PTRACE_ATTACH: Operation not permitted
WARN: PTRACE_ATTACH: Operation not permitted
WARN: PTRACE_ATTACH: Operation not permitted
WARN: PTRACE_ATTACH: Operation not permitted
WARN: PTRACE_ATTACH: Operation not permitted
WARN: PTRACE_ATTACH: Operation not permitted
WARN: PTRACE_ATTACH: Operation not permitted
WARN: PTRACE_ATTACH: Operation not permitted
WARN: PTRACE_ATTACH: Operation not permitted
Could not find DATASEGMENT_IDENTIFIER (size 47)
Could not find LOCAL_DIRECTORY
Tot time reading process memory = 0 seconds
Tot time finding signatures = 0 seconds
not permitted
WARN: PTRACE_ATTACH: Operation not permitted
WARN: PTRACE_ATTACH: Operation not permitted
WARN: PTRACE_ATTACH: Operation not permitted
WARN: PTRACE_ATTACH: Operation not permitted
WARN: PTRACE_ATTACH: Operation not permitted
WARN: PTRACE_ATTACH: Operation not permitted
WARN: PTRACE_ATTACH: Operation not permitted
WARN: PTRACE_ATTACH: Operation not permitted
WARN: PTRACE_ATTACH: Operation not permitted
WARN: PTRACE_ATTACH: Operation not permitted
WARN: PTRACE_ATTACH: Operation not permitted
Could not find DATASEGMENT_IDENTIFIER (size 47)
Could not find LOCAL_DIRECTORY
Tot time reading process memory = 0 seconds
Tot time finding signatures = 0 seconds
|