YTread Logo
YTread Logo

Doom's RNG

Jun 03, 2021
We've all been there: at some point, a returned missile hits you in the face and you lose a lot of health, but the next hit barely leaves a mark. What about Sami men who can't hit you no matter how hard they try? The next day they become elite snipers. This, of course, is all handled by Dooms' pseudo-random number generator or better known as RNG. How does it work? What elements of the game are affected by Orange? What will happen if he makes Metal Orange? This of course it will. will be covered in this video the way rng works in

doom

is quite simple in the code there is a table with 256 random values ​​and an index number points to one of these values ​​when the level starts this index will be sent to zero in the first inch of the table whenever a monster weapon or anything requires a random value, the value that the index points to will be returned, the index will move to the next value in the table when done once, the index, which is 255 , if set to 0 Doom does not use a random seat when starting the game, the game will always use the same RNG values ​​if the players' timing is consistent, see this example.
doom s rng
I'm going to load myself with

doom

to break one. I'm not going to move. I'll fire the gun once and that's it. Take note of how some women approached me and how much damage I suffer when they shoot me. Let's do it again and once again, as you may have noticed, the result was the same every time. That's why. Playing demos works with these rng methods as the only thing that matters is the player inputs and when the RNG functions are called, one more thing I would like to point out that there are actually two Indies that are used for RNG, one is used for global stuff that affects all players in network games, so things like weapon damage, monster AI, etc., it is to prevent network games from sinking, let's call it random P, the second index is only used for the perspective of specific players, so things like the screen melts and Sun casts this.
doom s rng

More Interesting Facts About,

doom s rng...

I'll call them random for most of the video. I'll talk specifically about P Rendon at the end. I'll show what is affected by random M, so let's see how monsters make use of random P when a new level begins for each monster. This idle animation gets a random scroll. This is why monster groups don't sync when they are idle. Newly spawned monsters also gain a random number of player tokens, but resolve fewer. I'm not sure what it is, but hey, it's an orange call when a monster discovers a The player will play an alert sound. Most monsters use a single sound, but there is a special case for zombies and imps.
doom s rng
The zombies will randomly use one of their three warning signs and Ames will use one of the two walking monsters to randomly play a search for sons. every tick of the game there is a point, 18 percent chance of playing a search sound, there are 35 game kicks in a second, so let's say roughly there is a 40 percent chance of making a sound for every second, When a monster chases a target, it will randomly choose the direction in an attempt to find a path to the enemy. When a monster tries to walk and is blocked by a wall, it will set a random number of attempts before changing direction when the target of a monster is in sight, it will call RNG on every tick and compare RNG value with a distance between it and the target, the closer the target is, the more likely it will act against missile attack monsters that lack technology like pinkies They will not call this orange function when the player is using partial miscibility, the monster sprite angle will.
doom s rng
You receive a random displacement when attacking, in addition, another displacement is running the calculator to determine the displacement of the projectile, this means that the angle of the monster sprites will not always correspond to the direction of the projectile. There is a special condition when damaged monsters you may have noticed if you kill an enemy by dealing less than 40 damage and the mouse is located higher than you, there is a 50% chance that the monster will fall forward, damaging the monsters. , also makes RNG see if they should play your paint animation, each monster has its own unique paint chance programmed with the loss saw having the highest and lowest arc monsters damaged by smashes will call RNG up to four times to calculate the splashes of blood pushed in the direction when a monster dies in the death of a player sons just like sons alert most monsters only have one once again new Zombies and hips get special treatment by having to kill the sons that they will play.
Another call will be made during a monster's death animation to play the first frame a little faster. You can see this when you kill a large group of zombies. The son will play. the next death animation for him before others, even when dead monsters will still call orange, of course, only if you play alive and on difficulty or with responsive monsters enabled, orange will determine when it's time to respond, this is how the RNG affects the behavior of monsters. see how they fare in combat all zombies call RNG twice to determine their shot compensation and a third call for damage each shot or pellets will deal 3 to 15 damage shotgunners fire three paddles at a time so this orange routine called cheng honest three times also Call the RNG for the fourth time during the firing check.
This shot checks to see if the target is out of sight or dead. If true, the chain gunner must stop shooting. However, this shot has a very low chance of ignoring that outside of sight or death control, the chain gunners won. You don't always stop shooting at times when you were hidden or dead, the spider demon used the same attack as the shotgunner and the same fire control as the chain gunner, but with a much lower chance of firing freely, the naazy too shares the same attack as the chain gunner. but slower, let's talk about the image project house.
There is something interesting about projectiles in general. Every project in the game uses the same energy algorithm for damage. A number between 1 and 8 is first generated and then multiplied by the damage based on the projectiles for the IMP fireballs to be based on. the damage is set to 3 and then multiplied by a random number between 1 and 8, which sells the fireball damage between 3 and 24 coincidentally with the melee damage because many monsters share the same IMP count. I'll quickly review the damage of each monster, fun In fact, the returned missiles are not really affected by the RNG, there is no coin flip, whether the missiles should aim or go crazy, it does not depend on which game detects the players.
It is strange that it is an unguided missile, if it will even be guided, it remains a monster. to discuss and that is the sin icon the spitting spawn cube will spawn a random demon here is a list of the demons that will spawn and their spawn chance the sin explosions icon upon death is an orange festival that affects the explosions in 3d position up Speeds and variation of the duration of the animation in the next few hours. General combat affected by orange blood that appears after shooting. An enemy will call the RNG three times, twice to set the random position and once to advance the first frame a little faster, so this frame variation when you shoot. with a super shotgun for example the same thing happens with bullets, the fist causes RNG three times to set the damage and the angle of the player's damage was between two and twenty, the madman, this glitch is multiplied by ten, the chainsaw is exactly the same but attacks faster and Of course, the wizard multiplier does not apply here.
The pistol, shotgun and machine gun use the same algorithm. The damage is set randomly between 5 and 15 and the distribution is also random. There is a small exception for pistols and machine guns, where the first shot is always 100% accurate, the super shotgun is quite large for each paddle, they will call RNG five times, there are twenty pilots in each shot, resulting in the a whopping 100 or engineer calls every time we pull the trigger to receive RNG calls waiting for the horizontal to extend another two for extends vertically and the fifth for damage which is between 5 and 15, just like the cyberdemon , players' rockets deal between 20 and 160 damage, excluding splash damage, rocket explosion animations, first frame as a small random scroll to add variation to the animation length, this is actually applies to every projectile hit in the game, the plasma rifle caused RNG for everything it is shooting on every click of the game, there is a 50% chance the rifle will place another shot frame, the plasma rifle's base damage plasma is 5, since you also used the general orange missile algorithm, this value will be multiplied by a value between 1 and 8, setting the damage of the plasma ball between 5 and 40 projectiles that animate will have a small random displacement in the first frame to create a variation in the duration of the animation.
The base damage of BFGS is 100, resulting in projectile damage. between 100 and 800 upon projectile impacts, the player will emit 40 invisible BFG traces that each direction randomly damages each tracer will cause between 49 and 87 damage in theory, the maximum damage dealt by the BFG is 4280 damage, but due to the shape in which the order of the random values ​​are placed in the RNG table, this damage is impossible to achieve with a good rng, the maximum damage is around 2200 and the average is around 1800s, so all of that is related With combat, let's look at how the environment uses RNG, a bit of an obscure feature. but the radiation suit does not always protect you for every second you walk on very damaging floors, there is a 2.3 percent chance that the acid or lava will penetrate through your suit and damage you normally by charging all sectors that have strobe or flashing lights receive random compensation. then they are meat and different intervals the flashing lights will set a random light value every 4 ticks the flashing lights alternate their light for a random period of time there is a raised type that oscillates up and down with a random timeout each time and limit is reached when answering, roman deathmatch game orange will be a code to select a random deathmatch spawn, just like anything affected by random P, there are some random M calls, so let's look at them.
The famous melting screen uses many RNG calls to configure the vertical rows of melting pixels. Offsets the face of the status bar cause RNG each suit to determine the sprite the building is located on Dowon's middle screen. I'll start with a random animation scroll also on the middle screen there is an animation flag scheduled to animate buildings in a random order, but this type of animation ended Unused sounds also use M randomly. It is used to add variation in sound tones. The chainsaws are programmed to have fewer pitch changes than anything else in the game and the sound for picking up items or power-ups is programmed to have no pitch changes. at all and now for the less loud call exiting the game in Vanilla Doom, when you exit the game a random sound from a sass list or play what sound is random.
Oh yeah, the sounds aren't actually based on which game takes you out. You know more now that we've discussed everything that makes use of RNG in Doom. Let's try something fun since the table of random values ​​is built into the binary or executable. In this case, since I'm using Windows, you can edit it to modify it. In RNG all we have to do is open a hex editor, go to the address 0 0 1 for C 2 e 0 and replace the next 256 bytes with any value you want. I'm doing this, you can essentially remove the randomness completely if they will consist of just one value, but for some experiments, what if we set each value to 0?
The first thing you'll notice is that the screen melt no longer has random scrolling, so the entire screen slides down and bounces vertically. We will play the third sound constantly and They will only attack when you get close, they will also do minimal damage, just like your pistol, the plasma rifle doesn't, anyway, your super shotgun turns into a damn sniper rifle and the icon from sin will only generate imps. Now let's change. the values ​​to try with a 1 let's see what the sin icon does now Oh God Oh No, this is what real hell should look like, let's quickly kill the final boss, the deadly explosions are not very satisfying anymore, so yes, there are a lot experimentation.
Anyway, you can do too much with the RNG table to show in this video. Thanks so much for looking.I hope you learn a new thing or two in an entertaining way. I really appreciate all the support I've been receiving lately. You are incredible. I'll see you next time

If you have any copyright issue, please Contact