Storm Highway by Dan Robinson
Storm chasing, photography and the open roadClick for an important message

STORM - Graphical Lightning Simulator

By DAN ROBINSON
Storm Chaser/Photographer
25 Years of Storm Chasing
Important Message
Dan's RSS/XML feed
Dan's YouTube Video Channel

A note from Dan (August 2013): Please be aware that this is a 'legacy' page from a very old version of this web site (written in 1996!). The original EXE file here was developed in the late 1990s, in the age of Pentium II (300 Mhz) and slower computers. Therefore, the program runs much too fast on modern computers to be of any use. You will need to dowload a DOS emulator that can be artificially slowed down to mimic a late 1990s-era computer. Then, either run the storm300.exe in that environment, or run the storm300.bas file in QBasic (which will also need to be downloaded). I made a 64-bit version of the EXE and added it to the page, but again, the program will run too fast on most any computer made after 1998.

I've done some minimal tinkering with the code to try and change the time delays to work on modern (fast) computers, but so far I've not been successful. This is not a major priority, but one day I might get around to devoting some time to it.

Original text of this page (circa 1996):

ScreenShots

Below: Lightning strikes the tower

This a lightning simulation program written using MS DOS QBASIC. Realism is attempted by following actual scientific behaviors of lightning, with varying numbers of subsequent return strokes, the 'ribbon' effect, branches, brighter first return stroke, etc. The lightning channel starting point, main channel path and the branch paths are all randomly generated, so no two bolts will look the same.

Interested in how the program works? Click here to find out.

Running the program:

The EXE versions of STORM will run on any PC at either the DOS prompt, or from the Windows RUN command on the Start Menu.

* To exit the EXE program, hold down the 'Q' key, wait for the prompt, and type 'Y' (capital letter).

To enhance the viewing of this program, view in a completely dark room with the monitor's contrast set to darken the 'blackness' of the screen (some monitors have a greenish glow with the contrast set low).

Note- Version 4.4 has new features: a new horizon shape, and periodic 'power flashes' when a strike to electrical equipment occurs.

Download instructions:

Right-click on the version you choose, and save the file.

Sorry, this program cannot run on Macintosh computers.

Download STORM Version 4.5 (64 bit Windows) EXE File (1.7MB) storm64.exe
Download STORM Version 4.4 (32 bit Windows), optimized for 300mhz Pentium II EXE File (113KB) storm300.exe
Download STORM Version 4.3 (16 bit Windows), optimized for 386 PCs EXE File (113KB) storm386.exe
Download STORM Version 4.2 (16 bit Windows), optimized for 286 PCs EXE File (113KB) storm.exe
Download STORM Version 4.4 (QBasic source code) BAS File (49KB) storm300.bas
To exit the EXE program:

Hold down the 'Q' key, then when asked, type 'Y' (capital letter).

Special Keys:

* Hold down the CTRL (control) key to intensify the storm.
* Press the space bar repeatedly (don't hold it down) to increase the chances that the lightning will hit the tower.
* Press '1' to 'freeze' the first return stroke (with branches) of the next bolt. (press '2' to resume program)

How it works

STORM uses random number generation to plot all of the coordinates for the lightning channel and the branches:

  • A random delay time is generated before each strike.
  • A random starting point on the horizontal axis at the top of the screen is generated.
  • The computer then generates random x and y increments in a general downward direction, adds them to the last pair of coordinates, and stores each pair of coordinates in a large array.
  • About 10 times along the channel, the program generates several branch paths in the same way- generating incremental coordinates propagating either right or left away from the main channel.
  • The coordinate generation process completes when the y value reaches the 'ground'.
  • The program generates a set of random numbers for the number of subsequent return strokes, delay between return strokes, horizontal wind force (ribbon lightning) and whether the lightning will strike a transformer (power flash) or a tree (flying sparks).
  • After all coordinates have been generated and stored in the arrays, the program draws lines to connect all of the points. Why are all of the coordinates plotted before drawing? The random coordinate generation process is relatively slow, and drawing the lines as they are plotted slows the visual motion of the channel and reduces realism. Drawing preplotted points is an almost instantaneous process, allowing for a faster and more authentic-looking lightning flash.
  • For the first stroke, the main channel is drawn three pixels wide to simulate the bright first return stroke, and the branches are drawn 1 pixel wide.
  • The screen is redrawn to erase the channels.
  • The subsequent return strokes consist of only the main channel (no branches) and are dimmer (1 pixel wide) than the first return stroke, as in nature. The screen is redrawn after each return stroke.
  • If the main channel coordinates generated get close (about 10 pixels away) to the radio tower, the channel will connect to the tower, and the resulting lightning will strike the tower. Pressing the space bar will cause the next lightning bolt to begin directly above the tower, increasing the chances of a direct hit. However, since the coordinates are generated randomly, the lightning channel path plot will often drift right or left of the tower by the time it reaches the 'ground', so pressing the space bar does not guarantee a direct tower hit.
  • The occasional intracloud 'anvil crawler' flash will streak across the sky. The channel generation for these flashes is less complex and less authentic than the cloud to ground strokes. Maybe when I get time (like, when I retire, by which time someone will have a better program out!) I'll redo the anvil crawlers to behave like their natural counterparts.

25 Years of Storm Chasing
Important Message
Dan's RSS/XML feed
Dan's YouTube Video Channel

This web site is made possible by support from CIS Internet.
CIS Results-Oriented Internet Marketing

GO: Home | Storm Chasing | Photography | Extreme Weather Library | Stock Footage | Blog

Featured Weather Library Article:

Lightning types
Anvil crawlers, bolts from the blue, sheet, ribbon and bead lightning. Learn how to identify each!
More Library Articles

All content © Dan Robinson. All usage requires a paid license - please contact Dan for inquiries.

Web Site Design and Internet Marketing by CIS Internet