Editing Talk:Skill level (section) From DoomWiki.org Warning: You are not logged in. Your IP address will be recorded in this page's edit history. Anti-spam check. Do not fill this in! == Respawn delays == <pre> if (!respawnmonsters) return; mobj->movecount++; if (mobj->movecount < 12*35) return; if ( leveltime&31 ) return; if (P_Random () > 4) return; </pre> I am too fried from finals to figure it out exactly but it looks like it takes at least 12 seconds for monsters to respawn, then after that each tic it first checks if the leveltime is a multiple of 32 (so the bitwise-and is zero) and then it calls P_Random which goes from 0 to 255 and returns if the value is greater than 4 so i guess that means that after 12 seconds, the probability of a respawn in any given tic is 1/32 * 5/255 or 6.13e-4 which suggests that on average it should take 1632 + (12*35) tics or 58.6 seconds for a monster to respawn 08:41, 11 December 2007 (UTC) :This is interesting. I'd like to see a graph that shows the probability (as a percentage) of respawn on a second-by-second basis. To note, however: The probability of a pseudorandom number being less than 5 is not 5/255; it would be x/256, where x is the number of bytes less than 5 among the 256 pseudorandom numbers. [[User:Zaximus|Zack]] 19:22, 11 December 2007 (UTC) ::Looked at the code again, the pseudorandom table is unsigned char rndtable[256], I sorted the values and got 6 numbers <= 4 (0, 0, 2, 2, 3, 4 - why the hell didn't they use all the possible values? 145 appears 5 times in the table). That changes it to an average time of 51 seconds to respawn instead of 59... ::: Thanks - you beat me to it. :) I got the same result. 51.0 seconds (plus one third of a tic, which is negligible). By the way, you can sign your comments on talk pages with four tildes ("~") :) ::: EDIT: If it interests anybody or is deemed worthy enough for this article, 51.0s is the mean average respawn time, while 38.72s (38s + ~24 tics) is the median average (where 50% of all demons respawn in 12-38.72s and 50% respawn after 38.72s). This is determined by calculating T = 32 log(x) / log(250/256) + 12(35), where x is the percent of respawns that occur after T tics. Also, the mode average respawn time is ~12.5s. [[User:Zaximus|Zack]] 04:51, 12 December 2007 (UTC) :::: US$0.02: Careful there. Any NM player will tell you that the averages are much less important than the fluctuations, because that's what determines how quickly you can backtrack through a level. That said, if the article currently says the minimum is 8 seconds, and you think it's obvious from the source that it's 12 seconds, then I would suspect ''every'' number of originating from a pre-source-release walkthrough, wherefore you are absolutely correct that a rewrite is in order. [[User:Ryan W|Ryan W]] 05:15, 12 December 2007 (UTC) ::That's a good idea. I've made that graph and added it to the [Spawning] article. [[User:Fuchsia tude|Fuchsia tude]] ([[User talk:Fuchsia tude|talk]]) 19:38, 13 December 2015 (CST) Summary: All contributions to DoomWiki.org are considered to be released under the CC BY-SA 4.0 International (see Doom Wiki:Copyrights for details). By contributing, you agree to be bound by the Terms of Use. Your changes will be visible immediately. Please enter a summary of your changes above. Do not submit copyrighted images or text without permission! This includes text taken from in-game codices or logbooks, or from official instruction manuals, strategy guides, and other such books. This project is not affiliated with id Software, Raven Software, ZeniMax Media, Bethesda SoftWorks, or any other commercial software developer or publisher. Use of trademarked logos and other protected intellectual property is solely for the purpose of analysis and critical commentary on the identified products and associated fan community activity, and does not imply any endorsement by any of these organizations or their employees, past or present. Upload images to the wiki. Don't forget to categorize pages! For testing, please use a sandbox. View this template Cancel | Editing help (opens in new window)