Bug or Feature? Kill Monster Scripting Problems

A forum for discussing map making ideas and problems for the Myth series.
Post Reply
User avatar
Phex
Posts: 251
Joined: Tue Aug 24, 2004 6:26 pm

Bug or Feature? Kill Monster Scripting Problems

Post by Phex »

I was playing my old plugin Five Kingdoms recently and recognized that a major scripting bug appeared which i never noticed before. But I am totally sure that I have tested this issue thoroughly when making this plugin and I am totally sure that it has not occured back then. Its too bad that I cant run an older version of Myth on my vista machine to test if this bug really originates from an update. Therefore I will try to describe the problem as good as I can.

On all maps, one team (the so called undead) has a necromancer (a shade) on their side who is followed by some guards (stygian knights). When the necromancer dies, all his guards are killed too automatically by a script. This script is very simple and uses just two actions:
1. a test unit which tests for necromancers in a container
2. a unit control which is conditionally activated and kills the guard monsters with the kill monster( 0 ) command.
To no surprise this works well and the guards die when the necromancer is killed. But now comes the bug! The player percentage in the f7 menu does not change when the guards die. It stays constant although it can clearly be seen that the stygian knights fall to the ground in pieces spitting out green fumes. Also, the game will not end when the undead team has no units left, it seems as if it would assume that the stygians are still alive.

My assumption is that in a recent update some changes were made to the script processor which modified how the "kill monster"-command worked - maybe specifically for multiplayer maps? Or at least I have no idea what else could have happened. I hope someone can help me...

regards,
Phex

PS: To look at the script you can untag the plugin which I linked in the first paragraph of this post and open any of the new maps you want. Go to the section "------ NECRO & GHOSTS ---------" where the two responsible actions are placed.
Image
Myrd
Site Admin
Posts: 4029
Joined: Fri Mar 19, 2004 10:17 pm

Re: Bug or Feature? Kill Monster Scripting Problems

Post by Myrd »

Can you make and post a test plugin that can reproduce this issue early on?

That way, we can easily try it out with earlier versions to see when the bug was introduced.

There were changes to related code in previous updates to fix other bugs with player percentages, so it is possible that this got broken. If we can figure out the cause, I will look at fixing this for 1.7.2.
User avatar
Phex
Posts: 251
Joined: Tue Aug 24, 2004 6:26 pm

Re: Bug or Feature? Kill Monster Scripting Problems

Post by Phex »

Myrd wrote:Can you make and post a test plugin that can reproduce this issue early on?
Done. Just start the multiplayer TEST map in this plugin and wait 1-2 seconds after the planning time has expired. All your units except one are getting killed with a script but your counter still stays on 100%. I dont think that this behaviour is desired. There is also a single player TEST map within this plugin which works in the same way.
Myrd wrote:If we can figure out the cause, I will look at fixing this for 1.7.2.
That would be great!
Attachments
KillMonstersTestPlugin.7z
(119.47 KiB) Downloaded 121 times
Image
Myrd
Site Admin
Posts: 4029
Joined: Fri Mar 19, 2004 10:17 pm

Re: Bug or Feature? Kill Monster Scripting Problems

Post by Myrd »

I get the same behaviour in 1.7.1, 1.7.0, 1.6.0, and 1.5.1. If it ever worked differently, it would have been a long time ago.
User avatar
Phex
Posts: 251
Joined: Tue Aug 24, 2004 6:26 pm

Re: Bug or Feature? Kill Monster Scripting Problems

Post by Phex »

That is really strange, I could have sworn it worked differently when I tested it back then... :?

Is there any reason why this map action is designed to not reduce the player's unit count like it does now? If not, is there any chance that you will chance it to work like I was expecting it to work? I mean, it does not seem reasonable at all right now! Didn't they have common sense when designing this? Why is it even possible to kill units with a script without changing the player's unit count? The unit count should reflect the count of units the player has on the map, no matter how they get killed, destroyed or teleported away!

I hope that this wrong behaviour could be easily fixed for my own maps by introducing a new script action that checks for units and eliminates the team if there are none left - if that still works for script-killed monsters, I'm not sure anymore. But I would really prefer a killing monster action that was more intuitive for mapmakers anyway.

Thank you for looking at this.
Image
Graydon
Posts: 1605
Joined: Sun Mar 21, 2004 5:10 pm

Re: Bug or Feature? Kill Monster Scripting Problems

Post by Graydon »

Try using the Delete flag, on the same subjects, in a subsequent control action after they've been killed off.
Image
vinylrake
Posts: 3591
Joined: Wed Apr 07, 2004 12:52 pm
Location: here
Contact:

Re: Bug or Feature? Kill Monster Scripting Problems

Post by vinylrake »

is there any chance that the reason the player unit count doesn't automatically go down when units are killed/teleported/whatever could be because the mapmaker might have further plans for the units after some some delay? so that during that delay when no player units are visible on the map ( before being raised/appearing-after-teleporting/whatever) an endgame condition that checks for player units=0 might be inadvertently triggered ending the game before the units are back/visible on the map?
User avatar
Phex
Posts: 251
Joined: Tue Aug 24, 2004 6:26 pm

Re: Bug or Feature? Kill Monster Scripting Problems

Post by Phex »

Graydon wrote:Try using the Delete flag, on the same subjects, in a subsequent control action after they've been killed off.
Thanks for that hint, I will try it out. I think you are not going to change the game code in any way concerning this, I suppose?
vinylrake wrote:is there any chance that the reason the player unit count doesn't automatically go down when units are killed/teleported/whatever could be because the mapmaker might have further plans for the units after some some delay?
What is the unit count good for then? You just have to consider that really rare case of "dead but alive" units in your endgame condition if you plan to use it like that. That should be obvious especially for single player maps. In any case its totally unintuitive that obviously killed units count to the number of alive units.
Image
Chicken Berel
Posts: 29
Joined: Thu Oct 21, 2010 3:16 pm

Re: Bug or Feature? Kill Monster Scripting Problems

Post by Chicken Berel »

Maybe they were just....MOSTLY dead.
Thats how Mel Brooks put it.
Myrd
Site Admin
Posts: 4029
Joined: Fri Mar 19, 2004 10:17 pm

Re: Bug or Feature? Kill Monster Scripting Problems

Post by Myrd »

Phex wrote:
Graydon wrote:Try using the Delete flag, on the same subjects, in a subsequent control action after they've been killed off.
Thanks for that hint, I will try it out. I think you are not going to change the game code in any way concerning this, I suppose?
I think if you put the Delete Monster flag on the same map action as the Kill Monster flag, it will do what you want.

Unless you find something that was broken by some previous update, I don't see a reason to change the code.
vinylrake
Posts: 3591
Joined: Wed Apr 07, 2004 12:52 pm
Location: here
Contact:

Re: Bug or Feature? Kill Monster Scripting Problems

Post by vinylrake »

Phex wrote:What is the unit count good for then? You just have to consider that really rare case of "dead but alive" units in your endgame condition if you plan to use it like that. That should be obvious especially for single player maps. In any case its totally unintuitive that obviously killed units count to the number of alive units.
it's good for keeping track of units that are actually dead? you are assuming teleported off the map / invisible means 'dead'? teleported units aren't 'obviously killed', and while i can see how that might often or even usually be the case, it doesn't seem any less intuitive to me that if you want a unit THAT HASN'T ACTUALLY BEEN KILLED to count as *dead* that you have to tell the game engine that the unit is 'dead', than your assumption that all units not currently visible are dead.
Graydon
Posts: 1605
Joined: Sun Mar 21, 2004 5:10 pm

Re: Bug or Feature? Kill Monster Scripting Problems

Post by Graydon »

I believe the reason it works the way it does is that Kill Monsters flag in the CTRL action were only ever designed to be used by Bungie on the Dark team... that is, campaign only, on a team that you'd never see a unit count for (in which case it simply wouldn't matter). Furthermore, the description for Delete Monsters is 'removes monsters for higher difficulties' or something along those lines... essentially doing the opposite of what setting monsters as timid--->legendary does. So if you tested for Legendary difficulty then if true deleted two of the 4 player dwarves, the player still has 100% units, and any TUNIs checking for player vitality less than X won't factor in the deleted units that you never had access to. It'd be pretty lame to go for a vidmaster and not be able to complete it with 100% due to the script killing your units at the start for the harder difficulty increment.
Image
User avatar
Phex
Posts: 251
Joined: Tue Aug 24, 2004 6:26 pm

Re: Bug or Feature? Kill Monster Scripting Problems

Post by Phex »

Graydon wrote:It'd be pretty lame to go for a vidmaster and not be able to complete it with 100% due to the script killing your units at the start for the harder difficulty increment.
"Delete Monster" and "Kill Monster" are two totally different actions though. Delete Monster should exactly do what you depicted here. For Kill Monster on the other hand you can even specify whether the desired unit should suffer a soft or a hard death - thats not at all designed to remove the player's units at the start. I'm not even entirely sure if an endgame condition would consider them dead (meaning "Unit Count = 0"). So it makes no sense to not change the unit count when using this action.

Or, if you really do not want to have script actions affect the unit count, then at least the netgame ending condition should check for monsters killed by a script and end the game if no monsters are left for a single player. That missing netgame condition is what actually annoys me, I just thought it would be tightly connected to the player unit count.
Image
User avatar
Phex
Posts: 251
Joined: Tue Aug 24, 2004 6:26 pm

Re: Bug or Feature? Kill Monster Scripting Problems

Post by Phex »

If you are interested, I have attached a recording of a regular netgame with a bugged unit count. One team is assigned -3% towards the end of the game.
Attachments
unitcountbug.7z
(19.54 KiB) Downloaded 128 times
Image
Myrd
Site Admin
Posts: 4029
Joined: Fri Mar 19, 2004 10:17 pm

Re: Bug or Feature? Kill Monster Scripting Problems

Post by Myrd »

Phex wrote:If you are interested, I have attached a recording of a regular netgame with a bugged unit count. One team is assigned -3% towards the end of the game.
Interesting, I'll have to investigate.

EDIT: Looks like a day-0 Myth bug where explosions are not ignoring monsters after they've teleported out. I'll fix it for 1.7.2.
Post Reply