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!

Quote:- A wizard that's been battered offered me a peace treaty. I said no. One turn later, I offered him a peace treaty; he said no. In CoM1 the wizard still would have accepted.
Refusing the offer drops the peace interest variable by 100, just like CoM I. Whether that is enough to refuse next turn or not depends on how much it was originally, but in general you shouldn't refuse something the AI offers if you want it. You might need to wait for a while before the variable grows back and they offer it again or accept it if you make the offer.

Quote:- On the topic of peace treaties, I've never been able to get one in CoM2. Doesn't matter if the wizard has been thoroughly beaten, or if I've offered tribute, or if it's the same turn they offered a treaty. They'll offer things but never accept. (Spell trading not included since that doesn't seem reliant on relations.)

I see nothing unusal in the code. Are you offering the peace correctly? I mean, by doing it when their peace interest variable is high?

https://masterofmagic.fandom.com/wiki/Peace_Interest

Quote:- And, following that line of thought, Charismatic seems thoroughly worthless, at least on high difficulty levels. Everyone just rejects every offer, every time. (This and the last comment were compounded by the tribute bug before. I see it's fixed now so I'll try Charismatic again for a playthrough.)

Same here except these use Treaty Interest : https://masterofmagic.fandom.com/wiki/Treaty_Interest

Quote:- Final comment on this, but there should probably be a countdown timer before a wizard can re-declare war after signing a peace treaty. The beaten-down wizard offered his treaty again (a turn after refusing mine) and I accepted; one turn after that, he declared war again. He's Ruthless / Perfectionist but regardless of personality type, I don't think wizards should engage in suicidal behavior unless they're Chaotic. Another wizard, one I've never even seen on the map, did the same thing to me later; war off / war on within two turns.

I checked and the condition that PeaceCounter<=0 exists at the beginning of the "NeedforWar" procedure. It's not possible to declare war though anything except a "warning based" war declaration which requires you to do something to trigger a warning or most likely multiple warnings.

The only other possible explanation would be that war declaration has a bug that causes it to apply to the wrong player. I'm not seeing that kind of bug either.

Quote:Guardian works for founded cities now but doesn't work on conquered cities. In this file I've conquered a lizardman city in a desert, note that its max size is still 4. The Klackon city to the northeast also didn't change its max size after being conquered. https://ufile.io/b5ptb0gb

Guardian works on your home race cities. As you mention two different races there I assume you didn't know that.

Quote:- Sky Fires doesn't work. It seems to throw a total of 2 fire bolts per battle and they're thrown at completely random tiles, usually with nothing in them. You can try it out in this game: https://ufile.io/8oldbxrs
The flying sounds and animation time of nothing moving tells me there are air elementals here and you can't see them.

Quote:Enemy AI don't seem to properly reevaluate targets that have changed. I've noticed multiple times that I can reload and move a unit that was attacked over the end turn and the AI won't move to the location that it planned -- usually a node. Here's a really egregious example: move all my units out of Gronk, which Flandre is planning to attack. With no units left in the city she reroutes to some other destination and ignores the completely undefended city:

What happens here is, by removing the units, the city slightly decreases in target priority. It goes from 2690 to 2600. (the units in the city are no longer there so they won't be killed so the attack is worth that much less.)
Your fortress is 12 tiles from the stack and has a target priority of ~24000.

So the attack priority of the fortress is 2041.
The empty city is...skipped, eh. I've already checked and it was added as a target so something must be removing it later.
Oh ok, I get it.

Basically this is how the system works. Unless there are exceptional circumstances, each target can only be attacked by one stack. If a further away stack that comes earlier in the processing order already noticed the city, it is removed from the list of targets. So basically, the AI says "I can take that with those 1 sprites so these good armies can be used for something else, let's attack his capital and that other big well garrisoned city".

While this is a good system for enabling the AI to attack many targets simultaneously and being less vulnerably to manipulation (at best the one stack heading towards that target will be affected instead of possibly every stack on the continent), it also means it misses the opportunity to attack the target using the nearest stack.

There are two ways to solve this :
1. Allow the AI to attack the same target with multiple stacks if special circumstances apply. This already exists as a feature and works fine, but we need to add a new condition that can spot this corner case without sending too much stacks to the city. Maybe "if target has no defenders and distance<=3" could work fine?
This is easy but doesn't really solve the underlying problem. We also can't omit the "undefended" part because using one's best stack on a weak city that has 1 spearmen and losing the stack to combat spells is a horrible move.
2. Overhaul the whole system to use an algorhytm that optimizes target selection in a way that if there is a closer stack to use, it replaces the one initially ordered to attack that target, and the further stack picks a new target.
This is probably a bit more difficult but I think should be reasonably doable though it brings us to uncharted territory.
The downside here is that this system doesn't allow attacking the same target with multiple stacks which the current version can do and which is pretty important in some cases (like one city being surrounded by 5 enemy stacks, or the AI trying to send a lot of smaller armies through a single tower)

...there might be more to it than this though. A stack targeting the city shouldn't remove it as a target completely, it only sets the target value to 1. I'll have to investigate this further.
Ok, it was skipped because the priority was lower and if it's lower then it skips the whole block to not look for a path and save on processing time. So that's fine but it also means we can't put in a condition that depends on path length to prioritize the target higher. Which means "if target has no defenders and distance<=3" can't use the path length, only the distance ignoring the actual path taken. Which means the player can abuse this by surrounding the empty city with spearmen and only opening it up on the opposite side the AI can't reach in a turn.
Using the path itself would likely make AI turns significantly longer because currently that is skipped on all targets that do not have enough priority to be chosen over the already found best regardless of the path length found.

Quote:- Sorry for asking again but I don't think you answered before -- why don't life drain and syphon life give hero / creature casters health anymore? I rather liked that mechanic in MoM. Death could use the help, too; it doesn't feel all that strong in the early game in CoM2.

Missing feature, I'll add it.

Quote:- The ruins spawned from neutral monsters destroying settlements are odd. Uncommon monsters seem to often spawn rares -- which would be a cool way of generating new treasure in the game, except that I've gotten results like 120 gold from killing 6 angels and an earth elemental (which somehow spawned from an earth elemental plus 2 war bears and a wild boar). That's more of a punishment than a fun mechanic.

Definitely a bug, these should have the monsters that created it and nothing else.
The code doesn't seem to be wrong though. Might be related to the "10 units in lair" bug, I'll need saves for this.
Oh, maybe that... newly created lairs don't seem to zero the variable for defending unit type and amount.

Quote:- The "Revolting Raiders" setting is a bit of a letdown. The most intimidating neutral city stack I've seen was 9 halfling shaman; not that hard. Also, even when I've had neutral cities nearby, they seem to rarely spawn stacks. It seems like there's a timer to spawn a neutral stack, and it chooses between ruins and settlements? Anyway in the majority of games, the wizard AI takes the enemy settlements before they can spawn a single stack. I think with this setting on a few things should be true: 1) all the neutral cities should have a wall and 2) start with a full garrison; 3) they should all have either a fighter's guild or wizard's guild, or failing that, barracks and an alchemist. That seems like giving a lot to the player; except those structures are almost always destroyed by conquest.

Neutral towns have a separate timer from monsters but they only have one timer instead of one per player targeted - as there is no guarantee everyone's territory has a neutral town. So there are fewer of them.
They can only be the units already present in the neutral city which means smaller towns that don't start with a high end military building will send crappy units.
However in the earlier CoM I versions we did have neutral towns that started with more military buildings and it was close to unplayable, even without the option being on. Basically, high end units are too hard to deal with in the first part of the game, even if that neutral "only" sends 3 minotaurs or 2 nightmares at you, it's bad. Of course that was before those required 1406 to be built.
I don't think the neutrals should start with more buildings or larger cities - exactly because the sent units depend on the city itself, this isn't like monsters where the units scale by turn count. A Sorcery node will not send Sky Drakes at you on turn 30 but a neutral town will send magicians, minotaurs, hammerhands, or whatever else assuming they have the unit available.

Maybe the option could increase the chance for the neutral towns to build military buildings or raise their production amount. That doesn't lead to immediately having units that are unbeatable, but might give the cities better units over time.

Quote:- One more hard mode raiders idea: what if neutral stacks could spawn with a hero? I think that'd be really neat and add some challenge, particularly if the hero could spawn at higher than base level.


Hero data has a lot of stuff that's wizard related - without an owning wizard, either every access to hero data needs to be special-cased for neutrals, or the game will crash.
Kinda like how whenever a neutral tries to look at "do I have global enchantment X" the game crashes. (was the problem for those efreets.)
Reply

Long story short, I don't think the AI not detecting the attack opportunity on the empty city can be fixed within the system.

However maybe we could add a new AI turn phase

"Detect attack opportunities"

Which checks the AI's units on a per-unit basis and if any is close to an unguarded city then...

eh no, we can't do that. If it checks paths then the AI turns will be slow. If it does not then it becomes vulnerable to player abuse (empty city surrounded by spearmen).

So here is the big question.
Do we need to fix this?
I mean, rerouting the AI's strongest stack to my capital has uses but it'll turn back immediately as soon as I put my units back into it and if I don't, in 2-3 turns that nearby sprite that was targeting it instead will conquer the empty city.
This only really helps the player if the other stack targeting the city comes from very far which is certainly possible but unlikely. Intercontinental stacks have a ranged of 12 for targeting and land based stacks have to be on the same continent.

Also, this is a very risky maneuver in the first place. If the AI has any ships with units in them outside my visible range but within attack range, the city is lost. If the AI's better stack comes first in the processing order, it'll still attack my city. etc.

Speaking of processing order. In the original game the AI processed the oldest stack first. In CoM II they are processed in the order of map coordinates (lowest Y then lowest X first). That's definitely wrong because that rearranges the processing order as units move possibly changing their targets each turn.

Edit : Making the AI sort the stacks and process the oldest first made them attack the empty city, so it seems to be helping. Those weak stacks of 1-2 units that hog the target from the good stack tend to be newer units than the already built stacks.
Reply

Update :

Quote:2020-09-07
-Fixed bug : AI counts everyone's settlers and engineers when deciding if it has enough of them or needs more.
-Fixed bug : The AI doesn't recognize Lizard/Draconian settlers being able to leave the continent on their own when deciding if they want to build mroe settlers or have enough.
-Fixed bug : AI research priorities ignore the research priority table.
-AI research priority of Summoning Circle increased.
-Fixed bug : Neutral units that can cast Fire Elemental cause Range Check error.
-When the AI moves undetected invisible units during combat, sound and animation will not be displayed.
-Fixed bug : Lake and River Mouth were not listed as invalid targets for Corruption
-Fixed bug : Cities with no units in them weren't marked as "enemy" targets by the AI
-Fixed bug : AI unit ratings didn't apply the "minimum of 1" correctly.
-Added missing feature : Life Drain/Syphon Life heals the casting unit.
-Fixed bug : When monsters reduce a city to ruins, additional copies of the secondary monster are not added to the ruin.
-Fixed bug : When a new lair is created, the monster variables are not zeroed
-AI now processes their stacks in the order of oldest to newest when assigning overland targets.
-AI now processes their naval stacks in the order of oldest to newest when assigning destinations.
-Fixed bug : AI sends intercontinental units to the main action continent even if they are already there.
-Fixed bug : Building destruction report is visible during the AI's turn
Reply

Hi Seravy,
I've played the original way back then, and I've enjoyed Caster of Magic for a few campaigns (~250 hours). Good Job there!

I'd like to help you test the Alpha build of CoM II

I don't know how often I'll post bugs here, but I think I know my way around a Spell of Mastery or two.
Reply

(September 7th, 2020, 15:34)zerkeron Wrote: Hi Seravy,
I've played the original way back then, and I've enjoyed Caster of Magic for a few campaigns (~250 hours). Good Job there!

I'd like to help you test the Alpha build of CoM II

I don't know how often I'll post bugs here, but I think I know my way around a Spell of Mastery or two.

Download link sent!
Reply

Quote:
Quote: Wrote:- Sky Fires doesn't work. It seems to throw a total of 2 fire bolts per battle and they're thrown at completely random tiles, usually with nothing in them. You can try it out in this game: https://ufile.io/8oldbxrs
The flying sounds and animation time of nothing moving tells me there are air elementals here and you can't see them.

Er, did you try any other battles? I tried multiple targets and got the same result: two fireballs hitting completely random tiles somewhere around turns 4-10. According to the spell description there should be two per turn, so 12 total; and the spell description also says they hit enemy units. I just tested it again and noticed that actually, the damage that's dealt from the two fireballs is actually inflicted on my own unit.

Try taking the gargoyle from the stack north to fight the lone swordsman. Note that by turn 10 only two fireballs have been thrown and the gargoyles are missing health.
Reply

Quote:Er, did you try any other battles? I tried multiple targets and got the same result: two fireballs hitting completely random tiles somewhere around turns 4-10. According to the spell description there should be two per turn, so 12 total; and the spell description also says they hit enemy units. I just tested it again and noticed that actually, the damage that's dealt from the two fireballs is actually inflicted on my own unit.

No, I assumed the Air Elementals were the problem.
The spell does do 2 attacks per battle, maybe the description is inaccurate.
Hitting your own unit shouldn't happen, maybe the condition for target player is wrong or missing.
I'll check both tomorrow.
Reply

Quote:So here is the big question.
Do we need to fix this?
I mean, rerouting the AI's strongest stack to my capital has uses but it'll turn back immediately as soon as I put my units back into it and if I don't, in 2-3 turns that nearby sprite that was targeting it instead will conquer the empty city.
This only really helps the player if the other stack targeting the city comes from very far which is certainly possible but unlikely. Intercontinental stacks have a ranged of 12 for targeting and land based stacks have to be on the same continent.

There are two issues here: 1) save-scumming exploits; and 2) the AI looking weird or broken to the player. In my opinion, #2 is the one that should worry you more, and it may happen more frequently than you expect. 

The way I discovered this bug was in nodes. I usually have a single unit defending nodes. When I see an enemy wizard pathfinding to attack the node, I move the unit off -- because the enemy's forces are sufficient to take the node. From my perspective as the player I'm thinking: "These enemy wizards want to steal my node!" Then the wizard's forces move away from the node, which just looks broken -- I thought he wanted the node, but what he actually wanted was an algorithm. But that's not good, from a player perspective; I should feel like the AI "wants" normal things a human would want.

Could the system be fiddled a bit when it comes to attacks on towns and nodes? Specifically, if target units are designated that are on a town tile or node tile, then change the target of the AI stack to the town / node itself rather than the stack once the decision has been made to attack. That will look right, to the player. And if they attack a 0 unit town with a 9 unit stack, so what? Then it's a very well defended town, which is challenging in itself.
Reply

(September 7th, 2020, 17:51)Seravy Wrote:
Quote:Er, did you try any other battles? I tried multiple targets and got the same result: two fireballs hitting completely random tiles somewhere around turns 4-10. According to the spell description there should be two per turn, so 12 total; and the spell description also says they hit enemy units. I just tested it again and noticed that actually, the damage that's dealt from the two fireballs is actually inflicted on my own unit.

No, I assumed the Air Elementals were the problem.
The spell does do 2 attacks per battle, maybe the description is inaccurate.
Hitting your own unit shouldn't happen, maybe the condition for target player is wrong or missing.
I'll check both tomorrow.

I read the description again; you're right. "During each battle, two fire bolt spells will hit enemy units between turns 4 and 10 randomly."

It's just a bit ambiguous in the wording. I think I assumed it was two per turn because that's a very powerful / good effect. Two in the entire battle, on the other hand, is sort of... unreasonably weak? It's honestly not worth researching and casting if that's the effect, at least not at an early point in the game. If it's later on when you can research it in a few turns and cast it in two turns, then sure, fine, but then the effect is a drop in the bucket against the type of enemies you'll be facing.

It would be interesting and worth it if the number of fire bolts was somewhat random, like maybe between two and six. Also matches well with the overall randomness of Chaos.
Reply

Quote:Could the system be fiddled a bit when it comes to attacks on towns and nodes? Specifically, if target units are designated that are on a town tile or node tile, then change the target of the AI stack to the town / node itself rather than the stack once the decision has been made to attack. That will look right, to the player. And if they attack a 0 unit town with a 9 unit stack, so what? Then it's a very well defended town, which is challenging in itself.

It doesn't do that. The AI makes a new decision for all of their stacks every turn.
Now that the AI assigns the targets in the order of unit age like in the original system, the problem should be reduced.

The important thing is, if orders are assigned in the order of unit age, then assuming everything else in unchanged, the same results will be generated each turn - the stacks will consistently move towards the same target.

This was the only actual difference between CoM I and CoM II so unless the AI did obviously wrong moves in CoM I, it won't do them in CoM II anymore.

While this doesn't fundamentally change this particular scenario, it does improve it greatly. The larger stack originally targeting the city is much less likely to lose the target to a smaller other stack hogging it because the larger stack has more units and likely spent more time in play as it's already built up into a stack which takes time. So while the system doesn't guarantee anything, it still has a very good correlation with "strongest stack picks their target first" due to those stack having more and older units usually. Of course we could simply use stack strength directly but then we lose the consistency - a buff to the AI stack's units, a change in hero equipment, anything could result in a different stack becoming strongest and taking over the target.

However now that there is an array for storing and sorting the stacks that attack, maybe implementing the system where closer stacks override further away stacks could be added easier? All it needs to do is store the distance and coordinates of the assigned attacker on the target, and if the new attacker has less distance then send them instead and insert the original attacker back into the attacker queue to find a different target for them. The "multiple stacks attack the same target" special conditions can be solved too by any "secondary" stack attacking a target this way (they only do it if they found nothing else to attack) not getting stored on the target, so they don't get replaced even if the primary attacker is. Yes, this might work.

Edit : Or maybe not? This definitely breaks consistency completely - a new unit spawned nearby an enemy city can take over attacking that target from another stack which now being free to do so will also take over a different target from a different stack and so on, causing a chain reaction. Except, there is a new kind of consistency introduced, the "new" attacker will always be closer than or equal to the old one which is good in theory. In practice though distance is trivial to manipulate so idk, on the other hand if the player managed to manipulate the distance so that the attacking unit is now further away than the previous turn that pretty much means if they kept the target they'd never reach it (basically they are blocked by a moving wall of spearmen that don't let it reach the city ever.)

So maybe, just maybe, it works? What does everyone think?

Quote:It's just a bit ambiguous in the wording. I think I assumed it was two per turn because that's a very powerful / good effect. Two in the entire battle, on the other hand, is sort of... unreasonably weak? It's honestly not worth researching and casting if that's the effect, at least not at an early point in the game.

It actually was added as Chaos's new powerful uncommon spell, I believe it's that good. Don't forget this is an uncommon. 12 free fire bolts every battle would be a very rare tier effect.
2 Fire Bolts means you basically have like 1 halberdier worth of enemy force removed for you in every battle for free. That's ridiculously powerful if you fight a lot of battles, considering it's at uncommon tier when a halberdier is still a relevant unit.
Of course I might be overestimating the spell but we'll have to playtest it to see.
Reply



Forum Jump: