How close are lightning strikes in Terraria?

That was lighting… and thunder. You might know that when lightning strikes, the   thunder is almost always delayed by some time. The  flash appears first, and then the thunder follows.  This is because the speed of light is much,  much faster than the speed of sound. While  

The light from the lightning flash reaches  you almost instantly, the sound from thunder   actually takes a measurable amount of time  to reach you from the lightning flash.  This delay is approximately three seconds for  every kilometer, or five seconds for every mile. 

So how does this apply to Terraria? Well, the  observant among you might notice that thunder   in Terraria does have a delay to it relative  to the lightning strike. It’s a short delay,   but it is there, and it is measurable.  This means we can actually calculate how  

Far away the related lightning strike should  be from the player, even if we can’t see it.  For example, this thunderclap takes 1.42 seconds  to appear after the lightning strike, meaning the   strike took place around half a kilometer away. However, that’s just one instance. Overall,  

The delay between thunder and lighting  is random, so if you want to find out   the total range of lightning distances,  you’ll need to look within the code. If   you look in the method NewLightning(), you’ll  notice that the thunder delay timer ranges  

Between 1 and 120 ticks, or 0.016 and 2 seconds. When this timer hits zero, it’ll play one of seven   random thunder noises, which is what you hear. And  on top of that, some of these noises themselves   are also delayed. For example, while Thunder_5  starts immediately, with no delay, Thunder_2  

Has a full 3/4-second delay before it begins. This adds a full 0.75 seconds to the longest   possible delay, meaning the actual  lightning-thunder delay in Terraria   actually ranges between 0.016 and 2.75 seconds.  The average thunder delay is around 0.85 seconds.  So, now that we know that – how  does it translate to distance? 

Well, let’s start with the longest. 2.75 seconds  at the speed of sound is about 935 meters – just   shy of a kilometer. That’s actually relatively  close, and it’s just about the distance from   spawn to the Dungeon on a small world. On the other hand, the shortest one is  

Actually comically short. A 0.016 second delay  – or one tick – corresponds to a distance of   about five meters. Yeah. Rendered on the  screen, it would be roughly here. Quite   close – but the Terrarian’ll probably be fine. Unfortunately, lightning isn’t rendered in  

Terraria, so you’ll never get to see  it, but it’s funny to think about.  So, that’s it for this short video. It’s  interesting to dissect such a benign and   obscure mechanic sometimes – hell, I even  forgot this lightning thing existed for  

Months because I left the config toggle off  after this video. Still, I think these little   details in Terraria 1.4 is what makes it  feel so much more alive than 1.3 ever did.

How close is lightning during storms in Terraria?
Closer than it probably would be
100% pointless discord: https://discord.com/invite/yJrCt9YFz5

Music:
Terraria – Rain

Credits:
Very Loud Thunder from Close-Range Positive Lightning Strike by MidwestStormChasing

Positive lightning strike (HQ sound) by spike95ist

Freepik, Icons

#terraria

Mods and Packs:
Foundry & Alchemy (Pack) – https://steamcommunity.com/sharedfiles/filedetails/?id=2440505684
Fancy Lighting [Ultra Preset] (Mod) – https://steamcommunity.com/sharedfiles/filedetails/?id=2822950837
Stanberry Font (Pack) –
https://steamcommunity.com/sharedfiles/filedetails/?id=2559652586
Stormdark UI (Pack) –
https://steamcommunity.com/sharedfiles/filedetails/?id=2448259079
DragonLens (Cheat Mod) –
https://steamcommunity.com/sharedfiles/filedetails/?id=2939737748
Better Zoom (QoL) –
https://steamcommunity.com/sharedfiles/filedetails/?id=2562953970
Character Stats (QoL) –
https://steamcommunity.com/sharedfiles/filedetails/?id=3033200611

How close is lightning during storms in Terraria?

16 Comments

  1. I believe Redigit said somewhere on the forums that 1.4.5 might give thunderstorms some more content, so maybe this info could be used at some point, who knows?

Leave A Reply