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

Create an account  

 
New experimental version

Possible bug? Or is this intended? When attacked on a ship, after the first turn a giant spider's web becomes available for casting. Here's a save.

(Also, the spiders node close to my capital is the one that was attacked by a stack of 4 ww bears and 4 sprites and lost, I don't know if it killed any of the spiders within)


Attached Files
.gam   SAVE4.GAM (Size: 151.94 KB / Downloads: 1)
Reply

Yes, that's a bug.
When you have no unit selected, the "selected unit's spells" is indetermined but they are checked anyway even though it should be skipped.
Reply

That node has 5 Spiders. 4 Bears and 4 Sprites shouldn't have attacked it, unless they were buffed or had an invisible unit in the 9th slot. It's fairly close though.
Reply

Miraculously found the savegame, I've now seen it attack and die 3 times. First thing that happens on the turn.


Attached Files
.gam   SAVE5.GAM (Size: 151.94 KB / Downloads: 1)
Reply

That stack is intercontinental.
Intercontinental attacks can't access unit ratings and use a simplified calculation where spiders are way less powerful.
Maybe enabling intercontinetal attacks to hit lairs wasn't a good idea?

Or intercontinental attacks might need a better than "equal" ratio, like "double" instead to be on the safe side? This way spiders will eat up a lot of doomstacks.
Reply

Problem is, there are some units where their touch attack (poison, stoning touch etc) is a large part of the unit's strategic power and these aren't included in intercontinental at all. (tho even buffs, levels etc aren't either...)

(in case of cockatrices, most of their power comes from that...)

On the other hand, touch attacks aren't as relevant in normal combat so there not including them is the better decision.
Reply

Why don't intercontinental use the same values? (Not saying they should, just didn't realize they used completely different values.)
Reply

Because calling the "unitValue" procedure from there crashes the game for no reason - (probably out of memory or stack or something like that).

That's the only problem - all the targets are already marked on the map so it has them precalculated, the only thing missing is the value of its own stack. Which means I had to make my own way to find targets instead of using what's available.

...I wonder, if I could make it reserve double the amount of memory for that structure with targets, and use the second half to store own stack strength...as other stacks are being calculated there anyway it should work...
ehhh...not easy at all and we'd need to test the whole thing all over agai...wait, it's not that simple.
Intercontinental attacks don't just look at total stack power. They also look at which of the units are seaworthy - attacking a ship full of hammerhands using 2 water elementals is a perfectly good move even though the defender is like 10x more powerful - the units can't participate in the battle. So the precalculated targets can't be used unless it's on land, and there is no way I'll conveniently find so much free space in the original target seeking mapping procedure to squeeze all of those movement type checks in.

Also if the targets need to be calculated, then even successfully calling "unit value" would not work - it would iincrease the time consumed by possible as much as a factor of 100 - and this is what takes the most time from AI turns already - about 30-50 seconds in worst case.

(not to mention randomly allocating a ton of extra memory is anything but safe - game might thrown an out-of-memory error at unexpected times. Although this one is in EMS I believe so it should be safe...)
Reply

Thanks for the explanation. As I expected, you have extremely good reasons for the intercontinental targetting. What about going at it the other way, add the movement check into the initial strategic value strength for a target? so if the target is on water and can't move, then it's strategic value gets set to 0 (instead of intercontinental targetting ignoring those units)? I'm assuming that probably also would take too much space, from the other end, but that's the only thing I can think of.
Reply

Have looked at it to see if there is space or not and there is one thing I don't understand.

The procedure that generates the target map is in the same segment as the intercontinental procedure. Yet the far call works from one and not the other.

So it probably can't be caused by the the segments. Which only leaves the stack overflow. There is some unnecessary stack space allocated but not that much...only 100 bytes.
Reply



Forum Jump: