Linguica Posted August 29, 2014 I'm poking around the Doom source code and I see the following:// P_NoiseAlert // If a monster yells at a player, // it will alert other monsters to the player. // void P_NoiseAlert ( mobj_t* target, mobj_t* emmiter ) [etc...] And I was like "wait what? That doesn't happen." So I poke around a bit and I notice that the only place P_NoiseAlert is called is within P_FireWeapon, where both "target" and "emmiter" (sic) are set to the player firing a gun, as per normal. So it seems clear that they intended to code in behavior where a monster's alert noise would basically act as a player gunshot noise and could cascade to wake up more monsters. That's the only reason for P_NoiseAlert to be able to have a separate "target" (presumably a player) and "emmiter" (presumably some other monster making its wake-up noise). So I guess it's possible that Carmack simply forgot to call P_NoiseAlert() inside A_Look() (which I think is the function that makes a monster wake up), but that seems sloppy and not characteristic of him. It seems more likely that he implemented it, but then it turned out to suck because a monster waking up and alerting other monsters ended up recursively waking up every other monster in the level or something. Has anyone ever tried "re"-implementing this feature to see what happens? 0 Share this post Link to post
Blastfrog Posted August 29, 2014 Neat find. It probably was a deliberate omission and not just forgetfulness. It would most likely recursively wake many more monsters than intended even with the use of block sound flags on linedefs. Perhaps it would be a more viable feature if monster roars were absolutely blocked by any sound blocking lines, rather than two in succession as is the default behavior. That would allow the other monsters in the immediate area to get pissed off without suffering a recursive effect. From a game design perspective, it wouldn't be terribly detrimental as the player is likely to start shooting anyway once a monster is alerted to his presence. And of course, monsters flagged to ambush would wait until the player comes into visible range regardless of this scrapped behavior being in or not. 0 Share this post Link to post
abyrvalg Posted August 30, 2014 That's pretty neat. Pretty sure some interesting maps could be made abusing this behaviour. 0 Share this post Link to post
cybermind Posted August 30, 2014 I believe that this feature has been removed because of negative effect on game's perfomance (especially on big maps) 0 Share this post Link to post
fraggle Posted September 2, 2014 Cool hack. cybermind said:I believe that this feature has been removed because of negative effect on game's perfomance (especially on big maps) I can buy that too. As soon as one monster sees you he wakes up all his buddies, which is probably bad for performance in 1993 on a 486. It might also be the case that it subverts the "sound cannot cross this line" flag. 0 Share this post Link to post
scifista42 Posted September 2, 2014 It could have worked meaningfully if the monster only alerted monsters in its line of sight (360° around). But I realize that sound propagation code works in a completely different way. 0 Share this post Link to post
dew Posted September 2, 2014 Nice find. Another possible explanation for removing it is, as usual, laziness. I can imagine they ran into scenarios where they wanted a monster to see you and come after you, but other monsters kept waking up, ruining the intended placement and grouping in corners. And maybe placing enough sound blocking lines everywhere or adding a "mute" flag was too much bother. Basically, Doom AI works best when it's hardcore dumb and this is a possible step towards smart retards thinking themselves into failure. 0 Share this post Link to post
Quasar Posted September 2, 2014 I noticed that a long time ago. It's clearly a left-over feature from development that represented a discarded idea, as you posit. 0 Share this post Link to post
kb1 Posted September 4, 2014 Yes, a very cool find! I am actually amazed at how 'clean' the Doom source really is. It is as if Carmack knew what he wanted the game to do, and then wrote the code. No huge chunks of commented-out code, none of this trial-and-error mess, just pretty straight forward stuff. What does everyone else think about this? I know that I'd have to try everything 10 different ways until I was satisfied :) 0 Share this post Link to post
VGA Posted September 4, 2014 Maybe the source got cleaned up during the development of the patches after the release and then before getting published. During the actual development it was probably just a mess. 0 Share this post Link to post
Linguica Posted September 4, 2014 The source was actually cleaned up and refactored somewhat by Bernd Kremier (sp) prior to release. It actually caused some problems because some of the stuff he did broke demo compatibility. It also kind of sucks that we don't have the "real" source code for historical purposes. As for commented-out code, there is some. I noticed some commented out stuff for some of the more hardcore math calculations, and there's stuff like the unfinished sliding door code. 0 Share this post Link to post
plums Posted September 4, 2014 Not to mention the complete removal of DoomEd sources because he couldn't get NeXT filenames to work properly. f) DoomEd The NeXTStep DoomEd sources in the dump were garbled (filenames - prolly an issue of ISO9660 with or w/o extensions). Somehow Bear never got around to send me a list of the correct filenames, and I won't bother guessing without a NeXT box at hand. There is a plethora of useful editors for DOOM. I suggest using DEU for X11. 0 Share this post Link to post
VGA Posted September 4, 2014 Guess that guy got trusted with the source and thought he'd make it his bitch. 0 Share this post Link to post
Bloodshedder Posted September 4, 2014 VGA said:Guess that guy got trusted with the source and thought he'd make it his bitch. Actually he was planning to write a book about it. Never happened, though. 0 Share this post Link to post
Maes Posted September 4, 2014 P_NoiseAlert does very little by itself, actually. All it does is setting a global variable "soundtarget" (which is what is actually used as a target for angered monsters), and calls P_RecursiveSound, which does all the recursive sector-by-sector sound propagation. I presume the only real reason for separating emitter and target, is that in Doom there are virtual sound emitter objects which are not thinkers or do not stick around long enough, so the source of a sound itself might not be targettable. An example of such sources are doors and crushers, and exploding barrels/rockets. This would allow monsters to wake up on other events (e.g. the sound of a barrel or rocket explosion in a sector away from the player), and/or to target something arbitrary upon some sound-generating event like a platform being lowered, which could indicate an intrusion. This could be used as a base for a scripting subsystem and setting up more complex behaviors in a map (for example, it would allow waking monsters up without firing, by setting up a new type of sector special, e.g. "PlatformRaiseWithAlertingNoise", which is probably what id had in mind at some point). A more complex behavior would be the ability to set waypoint targets, e.g. an alert causing monsters to simply seek (without necessarily attacking) a noise source, causing them to muster at a specified point after an "alarm" had been set off. 0 Share this post Link to post
Jonathan Posted September 4, 2014 Didn't Carmack give Killough and maybe some of the other Boom guys access to the original source for reference purposes? 0 Share this post Link to post
geekmarine Posted September 4, 2014 I will admit, I've always wished monster noises would alert other monsters. It seems weird sometimes when a monster will open fire on me, and a monster next to him will just stand there if his back is turned until I open fire. I always figured the reason it wasn't done like that, though, was because it would set off unintended chain reactions of an entire level full of monsters being woken up at the same time. And then you'd have problems of the monsters all coming to look for the player, abandoning their posts and leaving rooms empty - making for a really intense first battle but then leaving the rest of the map barren lol. 0 Share this post Link to post
Guest Unregistered account Posted September 4, 2014 Amazing find! This would probably work better if the monsters' alert sounds only reached a certain radius + only woke up monsters in their line of view. But yeah, I am glad John removed it. Makes stealthily sneaking around monsters so much easier. geekmarine said:I will admit, I've always wished monster noises would alert other monsters. It seems weird sometimes when a monster will open fire on me, and a monster next to him will just stand there if his back is turned until I open fire. Actually, that would probably work pretty well, if the "sound radius" (there's probably a technical term but I've never delved within the code of Doom) was super-small, so the gunshot could only alert monsters almost right next to them. Maybe? 0 Share this post Link to post
fabian Posted September 4, 2014 Jonathan said:Didn't Carmack give Killough and maybe some of the other Boom guys access to the original source for reference purposes? I have heard about that rumor before. Does this mean that Boom has been derived from a different version of the source code than all the other early ports? 0 Share this post Link to post
Linguica Posted September 4, 2014 Indeed http://www.doomworld.com/10years/ports/ports01_2.phpAs mentioned earlier, changes made to DOOM in both the original Linux porting process as well as during Bernd Kreimeier's editing had left a number of problems in the source, especially for demo and map compatibility. Although it was unknown to the community for several years, it was later revealed that John Carmack gave the BOOM team limited, temporary access to the original DOS DOOM source, in part to help remedy these problems. So BOOM is actually a hybrid between DosDOOM v0.2 and the original MS-DOS DOOM source. 0 Share this post Link to post
Da Werecat Posted September 4, 2014 Quake does something similar. When a monster sees another monster getting angry at a player, it will get angry too. But this system replaces alerting by noise instead of complementing it. 0 Share this post Link to post
Quasar Posted September 5, 2014 Linguica said:Indeed http://www.doomworld.com/10years/ports/ports01_2.php BTW if anybody wants to ask who my source was for that information, it was Lee Killough. Unfortunately I believe the document where he revealed this information was his infamous whyiquitdoom.txt, which he later took down and regularly requests to be taken down from the Internet if it is re-uploaded. 0 Share this post Link to post
Linguica Posted September 5, 2014 LOL, I just Googled 'lee killough "why i quit doom"' and the only thing on Google about it is an IRC log where I say I still have that file. Sorry past me, I didn't hold on to it I guess! 0 Share this post Link to post
Jonathan Posted September 6, 2014 Yeah, that's where I remember it from. I can't remember family birthdays, but I can remember the contents of ragequit screeds I read fifteen years ago. Thanks brain! 0 Share this post Link to post