Announcement: Be excellent to each other.


Caravel Forum : DROD Boards : Bugs : Stabbing nigh-invulnerable NPCs on entrance
New Topic New Poll Post Reply
Poster Message
Tahnan
Level: Smitemaster
Avatar
Rank Points: 2436
Registered: 11-14-2005
IP: Logged
icon Stabbing nigh-invulnerable NPCs on entrance (0)  
I fear this isn't a bug, that it results from the game logic. But it's counterintuitive and anyway.

If you've got an NPC that's shaped like something stabbable, it defaults to "vulnerable". You can, of course, start its script with "Imperative: Invulnerable". But, stop me if I'm wrong, Beethro's stabbing goes off before scripting. That means that, if Beethro enters so that his sword is over one of those NPCs, it'll die before its invulnerability can run.
04-27-2008 at 08:57 AM
View Profile Send Private Message to User Show all user's posts High Scores This architect's holds Quote Reply
calamarain
Level: Smitemaster
Avatar
Rank Points: 933
Registered: 03-25-2007
IP: Logged
icon Re: Stabbing nigh-invulnerable NPCs on entrance (0)  
quote:
Tahnan wrote:
I fear this isn't a bug, that it results from the game logic. But it's counterintuitive and anyway.

If you've got an NPC that's shaped like something stabbable, it defaults to "vulnerable". You can, of course, start its script with "Imperative: Invulnerable". But, stop me if I'm wrong, Beethro's stabbing goes off before scripting. That means that, if Beethro enters so that his sword is over one of those NPCs, it'll die before its invulnerability can run.
I like the use of nigh-invulnerable there :) They're not completely invulnerable of course, but definitely have the Tick's power.

____________________________
My Holds
Click here to view the secret text

04-27-2008 at 10:39 AM
View Profile Send Private Message to User Send Email to User Show all user's posts This architect's holds Quote Reply
Jatopian
Level: Smitemaster
Avatar
Rank Points: 1841
Registered: 07-31-2005
IP: Logged
icon Re: Stabbing nigh-invulnerable NPCs on entrance (0)  
Technically, all bugs result from game logic. Remember that old adage about computers only doing exactly what they're told? Yeah.

Anyway, I can confirm that this happens.

____________________________
DROD has some really great music.
Make your pressure plates 3.0 style!
DROD architecture idea generator
04-27-2008 at 05:51 PM
View Profile Send Private Message to User Show all user's posts This architect's holds Quote Reply
mrimer
Level: Legendary Smitemaster
Avatar
Rank Points: 4466
Registered: 02-04-2003
IP: Logged
icon Re: Stabbing nigh-invulnerable NPCs on entrance (0)  
quote:
Tahnan wrote:
If you've got an NPC that's shaped like something stabbable, it defaults to "vulnerable". You can, of course, start its script with "Imperative: Invulnerable". But, stop me if I'm wrong, Beethro's stabbing goes off before scripting. That means that, if Beethro enters so that his sword is over one of those NPCs, it'll die before its invulnerability can run.
Yes, your analysis is correct. I'm opening to fixing this, but it might be trickier than we assume. The relevant game code current looks like this:
	//Process the swordsman's movement onto the first square.
	ProcessPlayer(CMD_WAIT, CueEvents);

	//Init NPCs after initial room state checks and modifications are performed.
	this->bExecuteNoMoveCommands = true;
	if (!this->swordsman.IsInRoom())
		SetPlayerRole(M_BEETHRO); //place player in room now as default (Beethro)
	this->pRoom->PreprocessMonsters(CueEvents);
	this->bExecuteNoMoveCommands = false;
I may be wrong, but I don't think fixing this for all cases is as simple as preprocessing the NPCs before processing the player's entrance move. This is because the player's state at room entrance can be affected by the commands executed by the NPCs. Reversing the order could break rooms (e.g. the player used to be able to break something on entrance, but now the NPCs take his sword away before that's possible; or v.v.). It could also expose new inconsistencies we haven't thought of yet.

Or maybe we do want this logic to be switched around for all cases, but we should realize it could alter all kinds of room entrance behavior where scripting is involved. Let's discuss this further.

____________________________
Gandalf? Yes... That's what they used to call me.
Gandalf the Grey. That was my name.
I am Gandalf the White.
And I come back to you now at the turn of the tide.

[Last edited by mrimer at 04-29-2008 05:35 PM]
04-29-2008 at 05:31 PM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores This architect's holds Quote Reply
Jatopian
Level: Smitemaster
Avatar
Rank Points: 1841
Registered: 07-31-2005
IP: Logged
icon Re: Stabbing nigh-invulnerable NPCs on entrance (0)  
quote:
mrimer wrote:
the player's state at room entrance can be affected by the commands executed by the NPCs. Reversing the order could break rooms (e.g. the player used to be able to break something on entrance, but now the NPCs take his sword away before that's possible; or v.v.).
IMO the current behavior in these cases is also inconsistent, and so much the better if we can correct this entire class of errors at once.

____________________________
DROD has some really great music.
Make your pressure plates 3.0 style!
DROD architecture idea generator
04-29-2008 at 10:23 PM
View Profile Send Private Message to User Show all user's posts This architect's holds Quote Reply
Tim
Level: Smitemaster
Avatar
Rank Points: 1976
Registered: 08-07-2004
IP: Logged
icon Re: Stabbing nigh-invulnerable NPCs on entrance (+1)  
quote:
mrimer wrote:
I may be wrong, but I don't think fixing this for all cases is as simple as preprocessing the NPCs before processing the player's entrance move. This is because the player's state at room entrance can be affected by the commands executed by the NPCs. Reversing the order could break rooms (e.g. the player used to be able to break something on entrance, but now the NPCs take his sword away before that's possible; or v.v.). It could also expose new inconsistencies we haven't thought of yet.
I can think of a new inconsistency if you want. (and probably more)

For example, what happens if that character wasn't set as "Invulnerable", but "Critical Hero"? Does that mean that Beethro will die as soon as he enters the room?

Characters have been vulnerable on room entrances since JtRH, like most other monsters, and therefore I'd say it is intuitive.
On the other hand, I know we've changed the serpent's behaviour before, but that didn't affected too many rooms.

I'd propose a much easier solution: Keep the current behaviour as is. In a new major version rewrite (and after more discussion to see if we really want this), add a new type of character that starts as invulnerable.

____________________________
The best way to lose customers is to let little kids running loose on a forum with too many mod points.

[Last edited by Tim at 04-30-2008 12:24 AM]
04-30-2008 at 12:21 AM
View Profile Send Private Message to User Show all user's posts This architect's holds Quote Reply
Doom
Level: Smitemaster
Avatar
Rank Points: 3090
Registered: 07-05-2004
IP: Logged
icon Re: Stabbing nigh-invulnerable NPCs on entrance (0)  
quote:
Tim wrote:
For example, what happens if that character wasn't set as "Invulnerable", but "Critical Hero"? Does that mean that Beethro will die as soon as he enters the room?
What happens when there's a bomb in place of that character? Halph? Normally these things don't activate on turn 0, so they shouldn't activate when scripted either.

quote:
Characters have been vulnerable on room entrances since JtRH, like most other monsters, and therefore I'd say it is intuitive.
Characters, fine. Invulnerable characters can be made a perfectly valid case for, however. Think about placing a wubba in place of that character. Normal invulnerability doesn't allow stabbing on turn 0, so scripted invulnerability shouldn't allow it either.

quote:
I'd propose a much easier solution: Keep the current behaviour as is. In a new major version rewrite (and after more discussion to see if we really want this), add a new type of character that starts as invulnerable.
No thanks. Adding new variations of an element for every inconsistency gets just messy. I don't want to start right clicking characters to know when exactly they become invulnerable...
04-30-2008 at 12:54 AM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores This architect's holds Quote Reply
Beef Row
Level: Smiter
Rank Points: 471
Registered: 12-28-2005
IP: Logged
icon Re: Stabbing nigh-invulnerable NPCs on entrance (0)  
quote:
Doom wrote:
Invulnerable characters can be made a perfectly valid case for, however. Think about placing a wubba in place of that character. Normal invulnerability doesn't allow stabbing on turn 0, so scripted invulnerability shouldn't allow it either.



I hate to do a pure "I agree" post, but I agree with Doom on this. If you have a character with effectively the same ability as a wubba, it doesn't make sense to have a turn 0 exception, and there's no risk of death if this is adjusted.

The critical hero preprocessing option would be an ugly crash, BUT giving critical heros turn 0 invulnerability would be no more inconsistent than giving it to bombs or Halph, so I think it would be entirely reasonable to preprocess and then protect in this case. (If they were right ON the room entrance this might be an issue though. Are things that are 'stepped on' on entry deleted even before preprocessing?)

____________________________
"Now I will repeatedly apply the happy-face rule"
04-30-2008 at 07:36 AM
View Profile Send Private Message to User Send Email to User Show all user's posts Quote Reply
mrimer
Level: Legendary Smitemaster
Avatar
Rank Points: 4466
Registered: 02-04-2003
IP: Logged
icon Re: Stabbing nigh-invulnerable NPCs on entrance (0)  
quote:
Beef Row wrote:
(If they were right ON the room entrance this might be an issue though. Are things that are 'stepped on' on entry deleted even before preprocessing?)
Yes, that's correct. Stomped NPCs act pretty much as if they're not in the room at all until reentering on a different tile. Note this applies only to NPCs that are visible (i.e. already in the room) before preprocessing.

____________________________
Gandalf? Yes... That's what they used to call me.
Gandalf the Grey. That was my name.
I am Gandalf the White.
And I come back to you now at the turn of the tide.

[Last edited by mrimer at 04-30-2008 07:55 AM]
04-30-2008 at 07:44 AM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores This architect's holds Quote Reply
Tahnan
Level: Smitemaster
Avatar
Rank Points: 2436
Registered: 11-14-2005
IP: Logged
icon Re: Stabbing nigh-invulnerable NPCs on entrance (0)  
quote:
Doom wrote:
Characters, fine. Invulnerable characters can be made a perfectly valid case for, however. Think about placing a wubba in place of that character.
Perhaps even more pertinently: think about having either a wubba NPC (with no script), or a goblin NPC whose only command is "Invulnerable". They'll act in entirely identical ways--with the single exception of the player entering with his sword over them, in which case one survives, and one doesn't. That, to me, is what makes no sense.
04-30-2008 at 05:19 PM
View Profile Send Private Message to User Show all user's posts High Scores This architect's holds Quote Reply
Monkey
Level: Master Delver
Avatar
Rank Points: 186
Registered: 03-21-2006
IP: Logged
icon Re: Stabbing nigh-invulnerable NPCs on entrance (0)  
Wouldn't it be simple enough to process invulnerability commands first? :?

____________________________
lurking
05-01-2008 at 12:28 AM
View Profile Send Private Message to User Show all user's posts This architect's holds Quote Reply
mrimer
Level: Legendary Smitemaster
Avatar
Rank Points: 4466
Registered: 02-04-2003
IP: Logged
icon Re: Stabbing nigh-invulnerable NPCs on entrance (0)  
quote:
Monkey wrote:
Wouldn't it be simple enough to process invulnerability commands first? :?
Yes, it is possible to add a special routine before the player's entrance is processed that checks NPC scripts in order to run Imperative commands and nothing else. Then would would also add, as mentioned above, a guard against stabbing Critical Hero NPCs on turn 0.

____________________________
Gandalf? Yes... That's what they used to call me.
Gandalf the Grey. That was my name.
I am Gandalf the White.
And I come back to you now at the turn of the tide.

[Last edited by mrimer at 05-01-2008 02:36 AM]
05-01-2008 at 02:35 AM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores This architect's holds Quote Reply
Briareos
Level: Smitemaster
Avatar
Rank Points: 3515
Registered: 08-07-2005
IP: Logged
icon Re: Stabbing nigh-invulnerable NPCs on entrance (0)  
quote:
mrimer wrote:
quote:
Monkey wrote:
Wouldn't it be simple enough to process invulnerability commands first? :?
Yes, it is possible to add a special routine before the player's entrance is processed that checks NPC scripts in order to run Imperative commands and nothing else.

Couldn't that still break in case variables are changed and checked, which can alter the control flow (i.e. an NPC can be vulnerable some of the time)? So either you throw control flow and variable altering commands into the mix, or it'll be inaccurate again...

np: Ladytron - The Beginning Of The End (Y34RZ3R0R3MIX3D)

____________________________
"I'm not anti-anything, I'm anti-everything, it fits better." - Sole
R.I.P. Robert Feldhoff (1962-2009) :(

[Last edited by Briareos at 05-01-2008 11:11 AM]
05-01-2008 at 11:10 AM
View Profile Send Private Message to User Send Email to User Visit Homepage Show all user's posts Quote Reply
Tim
Level: Smitemaster
Avatar
Rank Points: 1976
Registered: 08-07-2004
IP: Logged
icon Re: Stabbing nigh-invulnerable NPCs on entrance (0)  
Okay, some other idea then, as we've already have two variations of characters right now, visible and non-visible. Is it perhaps better to add another property called "invulnerable"?

I'm very suspicious of preprocessing of the existing character type monsters, especially when that's limited to only the first turn. Not only because I think those kind of things belong to some kind of constructor functions ;), but switching the movement orders is certainly going to break existing rooms where characters are used for timing. (Perhaps this is a good reason to ask people not to make timing rooms with characters?)
quote:
Tahnan wrote:
Perhaps even more pertinently: think about having either a wubba NPC (with no script), or a goblin NPC whose only command is "Invulnerable". They'll act in entirely identical ways--with the single exception of the player entering with his sword over them, in which case one survives, and one doesn't. That, to me, is what makes no sense.
Can I ask what you mean by "making no sense"? Are you implying that it doesn't makes sense because a wubba character works different from a goblin character because they are different kind of characters, and thus having different contexts? In normal speaking languages, a sentence can have different meanings in different contexts, does that make no sense to you? (Apologies if this sounds harsh, but please remember that English is not my first language, and I don't know how to make this softer. and this is my fifth rewrite.)

____________________________
The best way to lose customers is to let little kids running loose on a forum with too many mod points.
05-01-2008 at 11:54 AM
View Profile Send Private Message to User Show all user's posts This architect's holds Quote Reply
mrimer
Level: Legendary Smitemaster
Avatar
Rank Points: 4466
Registered: 02-04-2003
IP: Logged
icon Re: Stabbing nigh-invulnerable NPCs on entrance (0)  
quote:
Briareos wrote:
quote:
mrimer wrote:
quote:
Monkey wrote:
Wouldn't it be simple enough to process invulnerability commands first? :?
Yes, it is possible to add a special routine before the player's entrance is processed that checks NPC scripts in order to run Imperative commands and nothing else.

Couldn't that still break in case variables are changed and checked, which can alter the control flow (i.e. an NPC can be vulnerable some of the time)? So either you throw control flow and variable altering commands into the mix, or it'll be inaccurate again...
You are quite correct. This suggestion does seem to have a slippery slope -- or rather a gravity well -- of sucking more and more scripting commands into its domain in order to be completely useful. All in all, this seems to be a messy issue, it could alter and break existing rooms, and I don't think it should be touched so close to a 3.2 release. We can still consider adding new features in future versions like Tim's suggestion of a new flag for NPCs for rooms that absolutely need invulnerable NPCs on turn 0.

Since the current behavior has existed since the advent of scripting and it's definitely not a bug, I'm going to mark it as such and not change this for 3.2.

____________________________
Gandalf? Yes... That's what they used to call me.
Gandalf the Grey. That was my name.
I am Gandalf the White.
And I come back to you now at the turn of the tide.
05-01-2008 at 04:34 PM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores This architect's holds Quote Reply
Jatopian
Level: Smitemaster
Avatar
Rank Points: 1841
Registered: 07-31-2005
IP: Logged
icon Re: Stabbing nigh-invulnerable NPCs on entrance (0)  
quote:
mrimer wrote:
Since the current behavior has existed since the advent of scripting and it's definitely not a bug
It's not? How?

____________________________
DROD has some really great music.
Make your pressure plates 3.0 style!
DROD architecture idea generator
05-01-2008 at 10:15 PM
View Profile Send Private Message to User Show all user's posts This architect's holds Quote Reply
mrimer
Level: Legendary Smitemaster
Avatar
Rank Points: 4466
Registered: 02-04-2003
IP: Logged
icon Re: Stabbing nigh-invulnerable NPCs on entrance (0)  
quote:
Jatopian wrote:
quote:
mrimer wrote:
Since the current behavior has existed since the advent of scripting and it's definitely not a bug
It's not? How?
It's a feature.

____________________________
Gandalf? Yes... That's what they used to call me.
Gandalf the Grey. That was my name.
I am Gandalf the White.
And I come back to you now at the turn of the tide.
05-01-2008 at 10:44 PM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores This architect's holds Quote Reply
Tahnan
Level: Smitemaster
Avatar
Rank Points: 2436
Registered: 11-14-2005
IP: Logged
icon Re: Stabbing nigh-invulnerable NPCs on entrance (0)  
Even though this is not getting fixed, I'll try to elucidate:

quote:
Tim wrote:
quote:
Tahnan wrote:
Perhaps even more pertinently: think about having either a wubba NPC (with no script), or a goblin NPC whose only command is "Invulnerable". They'll act in entirely identical ways--with the single exception of the player entering with his sword over them, in which case one survives, and one doesn't. That, to me, is what makes no sense.
Can I ask what you mean by "making no sense"? Are you implying that it doesn't makes sense because a wubba character works different from a goblin character because they are different kind of characters, and thus having different contexts? In normal speaking languages, a sentence can have different meanings in different contexts, does that make no sense to you?
It doesn't sound harsh; but I'm also not quite sure I know what you mean. My point was this:

1. A stationary, has-no-scripting, invulnerable character should always act the same, i.e. it should sit there and not do anything, including dying, regardless of its appearance.
2. A wubba is a stationary, has-no-commands, invulnerable character.
3. A goblin set "invulnerable" is a stationary, has-no-scriping(*), invulnerable character.
4. Therefore, a wubba and an invulnerable goblin should act the same.

...but they don't, when stabbed on Turn 0, and that's what makes no sense to me.

(The asterisk indicating that it does technically have scripting, i.e. the "set me invulnerable" command. But it's a command that takes no turns to execute, and "(in)vulnerability" feels to me like an inherent quality like "(in)visibility", the latter being set by a checkbox. So it feels, to me, like having essentially no scripting.)
05-01-2008 at 11:18 PM
View Profile Send Private Message to User Show all user's posts High Scores This architect's holds Quote Reply
New Topic New Poll Post Reply
Caravel Forum : DROD Boards : Bugs : Stabbing nigh-invulnerable NPCs on entrance
Surf To:


Forum Rules:
Can I post a new topic? No
Can I reply? No
Can I read? Yes
HTML Enabled? No
UBBC Enabled? Yes
Words Filter Enable? No

Contact Us | CaravelGames.com

Powered by: tForum tForumHacks Edition b0.98.8
Originally created by Toan Huynh (Copyright © 2000)
Enhanced by the tForumHacks team and the Caravel team.