![]() |
Introducing
DiverSim!
|
![]() Be playful, click on me! |
|
|
|||
|
|
Run Diver-Sim! [IE optimised version] |
DiverSim is an attempt at implementing a full-flavoured Java diving simulation. It's intended as a training aid for novice divers, but hopefully will be of interest to others. The aim is to model some of the more important factors involved in a typical dive, including tissue nitrogen loading, air use, buoyancy, etc. This project was implemented as part of a final year Masters computing project. It was therefore done in my spare time, subject to deadlines, so I couldn't include everything I would have liked to include.
IMPORTANT! Although the model includes nitrogen uptake in tissues, it is not intended as a replacement for dive tables or a dive computer. Just because the model indicates that a dive profile or series of actions is safe, does not mean that is actually is. Diver-Sim is intended as a supplement to the standard dive training, or as an appetiser to draw new people into dive training - it does not replace training in any way, and should not be used as the basis of a dive plan. If in doubt about any aspect of a dive always consult your club diving instructor.
| What Does it Model? A number of things are modelled in real-time, to a greater or lesser degree. These are:
|
Want to take DiverSim to the next
level? I don't have time to develop the project any further and the code hasn't been changed for awhile. If you have Java programming skills and feel like a challenge, contact me to discuss how it can be taken forward. |
The model also has a stab at estimating whether decompression sickness is likely to be induced in the current situation. Note that the risk of DCS will tend to rise only during an ascent phase when tissue nitrogen tensions exceed set limits. A general barotrauma light indicates overly speedy ascents, and will stay lit if the injury is likely to be permanent!
| You can view the current state of the tissues in real time. Figure 1 shows the current pressure difference for each tissue type. As a diver descends, the ambient environmental pressure increases proportionally, creating a pressure differential and forcing nitrogen into the tissues to equalise the pressure (green bars). At the end of the dive, on ascent, the opposite occurs with partial pressure of nitrogen in the tissues exceeding that of the environment creating a negative gradient (the red bars). If this negative pressure difference is too great, bubbles may be formed in blood and tissues possibly leading to Decompression Sickness. |
Figure 1 - pressure differentials in tissue compartments |
General Notes
What do
I Need to Run it With?
Simulations are usually run as stand-alone applications, so this is a somewhat experimental venture on my part. As you can see from above, a fair amount of calculation code is required, together with animation support, and the graphics themselves. This means that the simulation can take a little while to load (about 2mins @ 28.8kbps the first time, 30secs thereafter with caching) - please be patient!
Java applets are only partially compiled, and the browser is responsible for the final stage of compilation and execution. From the browsers I've tested, Netscape Communicator v4 works best (www.netscape.com). Internet Explorer v4 (www.microsoft.com) works fine apart from a cosmetic problem with the fish animations in some builds of version 4 (see help for more details).
The simulation runs well on a Pentium 150 PC, but at a pinch may be playable on a 486 PC (or the equivalent for other processors). Note that remaining on-line whilst you play may slightly slow the simulation if the modem decides to chat in the background. Both Netscape and IE4 allow you to visit the page in 'off-line mode' once it is in the local cache (i.e. you've visited the page before), so you can avoid horrendous phone bills.
To add spice to the simulation, there are a number of animations, bless 'em:
![]() |
Theodore | Behaviour of the little critters... Fish can have three different dispositions. When they see the diver, they will do one of the following:
|
![]() |
Spike | |
![]() |
Freddy | |
| Finsbury |
Is DiverSim supported by Wild Rabbit Software?
No. DiverSim is hosted on the Wild Rabbit Software site for free as a courtesy. Their main site is www.wildrabbitsoftware.com
Is DiverSim a commercial product?
No. If you want to include it on your page, please don't copy it (there are many parts, so this would be difficult anyway...) but link to this page. This location will always have the latest version.
What are the keys?
Use the cursor keys to control the diver, and the +/- keys to inflate and deflate the STAB jacket. The 'c' key toggles the console on/off - this may speed up the simulation on slower machines.
The keys don't seem to be doing anything! What could be wrong?
Click anywhere on the Applet window to make sure that the Applet receives the keyboard events, rather than the browser. Hold down the minus key until you start to sink.
Is there anything I can do to speed DiverSim up?
The following may help:
- Keep playing - the simulation will tend to speed up (become slightly less jumpy) after a minute or two as background browser and Operating System tasks (& JIT compilation) are completed.
- switch off the bubbles and fish (b and f keys respectively), or the variable display (v key)
- Disconnect any modem and play the sim off-line (requires Netscape or IE v4)
- Close any other browser windows - these may contain animations or Java applets which are using processor time
- Exit any other open applications - even when not in use, they will be using system resources.
- If you're using a browser version earlier than version 4 (for Netscape & IE), upgrade (they are free, after all) - the Java compilers are significantly faster in the new versions.
How does the nitrogen model compare to other dive computers on the market?
There are a variety of dive computers on the market. The models used in most commercial dive computers will probably be based on similar principles to that used in Diver-Sim, but will take more factors into account and use a more extensive model. Diver-Sim is first and foremost intended as a training aid, and should not be used to infer that a specific dive profile is safe.
Does the model include decompression stops?
Not yet. It may be interesting to compare dives according to the tables and the nitrogen levels in relation to decompression stops.
Can I specify the maximum depth, etc.?
Read the on-line help for guidance on this, or use the options page
Can I recharge the cylinder / do longer dives?
Press the 'r' key to recharge the cylinder (works at any depth).
What's the significance of the cube at the top?
Umm...not a lot to be honest. I wrote it a little while ago as an exercise, and I coudn't think of anything better to do with it...It may do some good in forcing the browser to pre-start the Java VM before jumping to the main applet (that's my excuse and I'm sticking to it).
Differences between Netscape v4 and IE4
Various differences seem to exist between the Java implementations. Diver-Sim will try to detect which browser is being used, and adjust accordingly. This means that fish and bubbles will not be scaled when using Internet Explorer, amongst other minor differences. Where there are differences, Netscape v4 is the reference browser used for testing of Diver-Sim. If this all sounds rather silly for a 'cross-platform environment', it does to me to.
Some of the images are manipulations of images I came across whilst wandering the web. Because most of these are copies of copies of copies, I have no idea of the original ownership. If anyone knows, or wants to claim credit for these images, I'd be happy to give a credit to the original artist.
Pages associated with Diver-Sim, all Java code and the simulation itself are ©1998 Philip Barton
If you want to get in touch, please contact me at phil-barton@ntlworld.com