As a French person I feel like it's my duty to explain strikes to you. - AdrienIer

Create an account  

 
Caster of Magic II Bug Reports!

Re: gold and hiring heroes, I always keep a reserve for that purpose. From my understanding, the RNG is just a flat chance each turn so it's entirely possible that you'll just never get an offer. Even Fame guarantees nothing, so far as I know (which is one of the reasons I view it as a worthless retort).

I did get an offer in 1407, by which time I had a bunch of Fame.
Reply

Here's the save file for seeing a Sorcery player casting useless spells on a Death unit: https://ufile.io/783a2mwd

Take the skeleton northeast to attack the Rogue's / light purple player's stack. He'll probably cast Vertigo, possibly Confusion. In the same game there's Rjak, who has Exorcise and usually uses it on my Shadow Demons -- but sometimes he casts Confusion instead.
Reply

Darn, I forgot to check the log.txt file. However, with AIprod ending with BBUILDING=0; AI cities still seemed to build at random. I saw one town build a swordsman, and others build a building or housing or a settler, but that's the same behaviour as when Uprio is used to set BBUILDING. It certainly seems like BBUILDING is not being used for the decision for what to build. There's obviously some other part of the program that determines what gets chosen for building. AIprod allows you to override CHOSEN, but apparently not BBUILDING (or at least it gets ignored). I'll try again later to see if log.txt shows anything useful. Neutral cities built units up to 9, then switched to housing I think.

I would like to try boosting AI garrisons. An AI might declare war on me, while having several well-developed cities (cathedrals, etc), with a single swordsman defending it. That spoils the challenge.

BTW, that update somehow glitched my copy, because cmd-shift-s simply did not work (nor did any other combo I tried); it was just treated as a regular 's' which saved the game. Editing MODDING worked. Maybe the next update will overwrite whatever went wrong.
Reply

Ctrl-Shift-S only works on the Wizards screen.

I checked the source and the buildbuilding variable is definitely used.
However there are a few exceptions :
-Settlers, Engineers and Ships can be built even if units are not wanted
-Trade Goods can be built even if buildings are not wanted.

Of course if the variable is read wrong from the script somehow, it's still possible there is a bug.
Reply

(May 25th, 2022, 22:01)Seravy Wrote: Ctrl-Shift-S only works on the Wizards screen.

Ahhh, that's the part I forgot.  duh     It had been a long time since I last toggled it, so it slipped from my memory.

I did notice that settlers were being built, even in new towns with one pop, but I may have deleted the 'when to build a settler' portion of AIprod for that experiment.  I guess that settlers--and engineers--are not built by random when 'build a unit' is selected.

The log file was quite interesting.  I liked how it explained why combat and diplomatic decisions were made.  It didn't show anything useful regarding _why_ it chose to build a unit or building.  I get the impression that there's a subroutine that weighs priorities from building.xxx and maybe factors in garrison and population and threat levels.  This generally chooses a building until the city is pretty much maxed out (cathedral, war college), and then it will start producing higher-end units and send units off to garrison other towns.  AIprod will force mandatory buildings, but when it runs out of those, selection returns to that other subroutine.  The portion calculating UPrio decides whether BBUILDING is 0 or 1 ... but that value doesn't seem to change AI behaviour.  From the description, setting BBUILDING to 0 should make a city produce nothing but units after the mandatory buildings are finished, but it doesn't, which seems like a bug.

Next experiment is to reduce building priorities in buildings.xxx and see if that results in more units.
Reply

Quote:Next experiment is to reduce building priorities in buildings.xxx and see if that results in more units.

It doesn't. Building priorities are used to decide which building is chosen over the other.

I looked at the source code and it literally has the lines

"If bbuilding then goto skip" for the unit part and "if not bbuilding then goto skip" for the building part. The only things that can ignore this are the settlers, engineers, trade goods and ships that are before those lines.

Edit : looked at a log file and it always produced the correct thing, if "unit was chosen" appeared then it always built a unit and "building was chosen" always resulted in a building.
So unless these didn't match the actual value in BBuilding, there is no bug.

I recommend adding "Debuglog STRS(BBUILDING)" at the end of the script. If this produces matching logs - BBUILDING = 0 and "unit was chosen" and BBUILDING = 1 and "Building was chosen" then that confirms there is no bug. If it doesn't then the variable is read incorrectly.
Reply

Debuglog helped, and it showed that BBUILDING=0 was in fact working. I managed to get even small towns building swordsmen. I don't know why it didn't seem to be working before. Puttering around with this also reminded me of the scripts.txt file, which should be useful next time I need to figure out this sort of issue.

Now I'll have to try again with modding AIprod to get it to build at least some garrison early.

How do I add text to debug log, to indicate which variable is being displayed? "Debuglog STRS(BBUILDING)" just adds a '1' or '0' to the file, in between two lines of 'settler wanted ...'
Reply

Debuglog "Variable name=" + STRS(Variable);
Reply

Thanks. Since this isn't a real bug, I'll continue the discussion in the modding thread.
Reply

I don't know if it's a bug, but I once found a phantasmal doom weapon, if you have doom on a weapon, phantasmal should be forbidden and vice versa...
Reply



Forum Jump: