What does light under water look like?

When putting EmoSquid together, I had to decide how to handle this. One of the first things I decided was that the player character was simply going to have a ball of light around it. The terrain is all coral, so it’s acceptable that light goes through it. This was also a gameplay decision, as trying to see in three dimensions is complex enough without having line of site blocked as well.

The light is blue, ignoring the green of actual ocean underwater. This more represents the common idea of light underwater rather than any attempt at reality. One touch that does model reality somewhat is that the deeper one travels, the darker the light gets. In early versions of the game, enemies did not have their reflected light diminished, which looked very strange indeed. The current version of the game lights all objects based on the amount of light reaching them from the player.

Images after the break!The biggest advantage to having the light ball is that it gives a better idea of how far things are in 3D. Everything at the same light level is the same distance away, regardless of verticalness. This helps establish quickly if something on the same plane as the player is closer or farther away than something several vertical levels away.

All of the main image area is drawn using TextAsGraphics. Because the library has an extension of JPanel as one of the concrete implementations, it was very easy to use the Swing builder in NetBeans to move things around while designing the layout for EmoSquid. This can be seen in the first versus third image where the output area has been moved.

The first image is simply playing around with gradient coloring, so it’s especially funky. Here’s several examples of the lighting conditions in early versions of the game:

Underwater is all purple, right?


A bit more realistic than the first attempt, but a bit flat.


Example of Text As Graphics used in EmoSquid


Nice bright light source. This really shows off the light decrease from vertical distance.