User:MoltonMontro/notes

From SDG Wiki
Jump to navigation Jump to search

Warmth and temperature

MoltonMontro: Could you explain how Warmth works in Unturned? Specifically, I'm interested in how items like the Heatstim (has "Warmth 111") can affect PlayerLife and what "111" represents in the math. More generally, I'm interested in how Warmth increases/decreases, and how quickly. (Asking within the context of: adding wiki pages for temperature-relevant content, and adding Warmth to ItemData.md on the U3-Docs repo.)

Nelson: [Warmth] is kind of horribly messy. While warmth is greater than zero, the area temperature is overridden by "Warm" (the same buff as a Campfire), [warmth] decreases by 12.5 per second. When I get the chance to rework some of the player status features I intend to tidy up those values.

Vehicle speed formulas

MoltonMontro: From my understanding, Speed_Min and Speed_Max values should be multiplied by 3.6 to be converted to kph, but whenever I go in-game to verify this the Speed_Max value seems to be multiplied by 4.5 instead. Is 4.5 the correct and intended multiplier?

Nelson: Speed_Max is multiplied by 1.25; the car adjusts wheel torque trying to match a specific kph. Since trains are newer they do not multiply by 1.25.

MoltonMontro: To clarify – for calculating the maximum forward speed, this is effectively just Speed_Max * 3.6 * 1.25. ([This is true] for all engine types except trains.)

Scorpion-7 Yukon designs

Nelson: All of that [Scorpion-7] stuff was inspired by LEGO Arctic [sets].

Yukon's abandoned barn

MoltonMontro: Does the abandoned barn in northwest Yukon belong to the nearby camp at Kluane Lake?

Nelson: It's an abandoned barn that nobody remembers. Originally in reference to the snowy devtest map.

SDG colors (RGB)

The appearance colors used for Nelson's in-game character.

  • Skin: (203, 154, 30)
  • Hair: (33, 61, 145)

Breakdown of ballistics

Advanced ballistics has more to do with the UseableGun class than the ItemGunAsset class. I'm primarily working on documenting how properties for asset classes work, as opposed to how these are actually implemented by useables, buildables, or constructables. But, here's a general rundown:

  • Ballistic_Drop is bullet drop. The lower the value, the slower the bullet drops per iteration. Setting it to 0 would remove bullet drop entirely—the Shadowstalker railguns have no bullet drop.
  • Ballistic_Steps is the bullet lifespan. The lower the value, the shorter the lifespan.
  • Ballistic_Travel is the "travel speed". The lower the value, the shorter the bullet travels per iteration.

There is no single formula that could be given to accurately describe how they work together. They're perhaps best represented as their individual values. There are relevant formulas for converting between Ballistic_Steps, Ballistic_Travel, and/or Range. But these are used to calculate the default values for ballistics, in the event that a value is missing. Practically, it's Ballistic_Steps * Ballistic_Travel = Range, although you do not need to specify a value for both Steps and Travel. Instead, only specify one value, and the game will calculate the other (based on Range value). If you assign both a custom Steps and a custom Travel, then they should equal the assigned Range when multiplied together – otherwise, you'll have a value mismatch (which will appear in the error logs).

Understand that when I say something occurs "per iteration", there is an if/continue loop that keeps iterating until the raycast is valid. With each iteration, two important things occur. First, the position of the bullet moves (current direction) * Ballistic_Travel. Second, bullet drop changes the Y vector of the current direction.

"Current direction" initially represents whichever direction the player was originally facing when they fired the bullet (i.e., "forward"), with randomization to the top/right based on the gun's range of spread. But this is only true for the first iteration. With each iteration, the current direction's Y vector will be decremented by the value of Ballistic_Drop.