Always relevant ScriptedPawns in MonsterHunt
Posted: Mon Oct 08, 2018 3:39 am
and why it is not a good design.
I made a new thread because this has nothing to do with the teleporting of queen. In that thread was stated that in map Arden+fix1 the monster counter counts different depending on setting ScriptedPawns to "AlwaysRelevant" or not. I digged into why such can happen and found, that the setting of game's "Difficulty" also affects the number of existing monsters at game start. Sadly the wiki is still down so I have to derive the chain of events from the source code only: When an Actor enters the game, it is passed to function IsRelevant() of the GameInfo Actor. That one in turn asks the BaseMutator's function "AlwaysKeep()", if that Actor should always be kept. If true, that Actor stays in game and other Mutators are not asked about that. The original MonsterHunt code as well as MonsterHunt2Gold do so (see this post for details).
If the BaseMutator says that this Actor is not worth to be kept in every case (BaseMutator.AlwaysKeep() returns FALSE), the GameInfo's function IsRelevant() proceeds: the game difficulty level is compared with the Actor's bDifficulty setting:This means that depending on that bDifficulty some Actors only appear at certain game difficulty levels.
Coming back to that different Monster amount in map Arden+fix1 you'll probably anticipate what is the case there - yes, some monsters have some none default bDifficulty settings what leads to a different number of monsters depending on game's difficulty setting:Running that map with difficulty=4 (what means nothing is left out by difficulty check) has the same effect as setting ScriptedPawns to "AlwaysRelevant". The number of monsters is 171 then.
If a mapper is so silly to assign game flow relevant events to Actors with different bDifficulty values, players may get stuck depending on game's difficulty level. But this is not the case in map Arden+fix1. (Although there exists a Nali appearing only at difficulty level 0 and 1 and his death triggers a CreatureFactory, this is without consequences because that CreatureFactory has no SpawnPoints. ) If such would happen, it is a mistake of the mapper but not a reason to declare all ScripedPawns as AlwaysRelevant. Mapping has to follow the game design, but game behaviour shouldn't be changed because there may be broken maps.
Why isn't setting ScriptedPawns to AlwaysRelevant a good design then?
Two reasons: The first is that other mutators are not participated on the decision if a ScriptedPawn is relevant or not (with the consequences not to being passed to IsRelevant() and CheckReplacement()). The other reason is ignoring mapper's setting of appearance of monsters depending on game's difficulty level.
I made a new thread because this has nothing to do with the teleporting of queen. In that thread was stated that in map Arden+fix1 the monster counter counts different depending on setting ScriptedPawns to "AlwaysRelevant" or not. I digged into why such can happen and found, that the setting of game's "Difficulty" also affects the number of existing monsters at game start. Sadly the wiki is still down so I have to derive the chain of events from the source code only: When an Actor enters the game, it is passed to function IsRelevant() of the GameInfo Actor. That one in turn asks the BaseMutator's function "AlwaysKeep()", if that Actor should always be kept. If true, that Actor stays in game and other Mutators are not asked about that. The original MonsterHunt code as well as MonsterHunt2Gold do so (see this post for details).
If the BaseMutator says that this Actor is not worth to be kept in every case (BaseMutator.AlwaysKeep() returns FALSE), the GameInfo's function IsRelevant() proceeds: the game difficulty level is compared with the Actor's bDifficulty setting:
Code: Select all
if (Difficulty==0 && !Other.bDifficulty0 )
|| (Difficulty==1 && !Other.bDifficulty1 )
|| (Difficulty==2 && !Other.bDifficulty2 )
|| (Difficulty==3 && !Other.bDifficulty3 )
...
return False;
Coming back to that different Monster amount in map Arden+fix1 you'll probably anticipate what is the case there - yes, some monsters have some none default bDifficulty settings what leads to a different number of monsters depending on game's difficulty setting:
Code: Select all
Difficulty | Monster amount
0 | 168
1 | 168
2 | 170
3 | 170
4 | 171
If a mapper is so silly to assign game flow relevant events to Actors with different bDifficulty values, players may get stuck depending on game's difficulty level. But this is not the case in map Arden+fix1. (Although there exists a Nali appearing only at difficulty level 0 and 1 and his death triggers a CreatureFactory, this is without consequences because that CreatureFactory has no SpawnPoints. ) If such would happen, it is a mistake of the mapper but not a reason to declare all ScripedPawns as AlwaysRelevant. Mapping has to follow the game design, but game behaviour shouldn't be changed because there may be broken maps.
Why isn't setting ScriptedPawns to AlwaysRelevant a good design then?
Two reasons: The first is that other mutators are not participated on the decision if a ScriptedPawn is relevant or not (with the consequences not to being passed to IsRelevant() and CheckReplacement()). The other reason is ignoring mapper's setting of appearance of monsters depending on game's difficulty level.