New day, new stuff to develop. Platformowe Karły / Platforms & Dwarfs (I hate in-dev names, a title like Gnomyssey has more elegance, even if it’s just a pun, argh :/) are having a water/sea rework. The previous version of water (which you can find two posts ago) wasn’t hitting the „Let’s do something fancy with pixel art” graphics level that I wanted for this game to have.Like usually in those cases I’ve decided to do some Google-Fu and I’ve stumbled upon various sea themed pictures and pixel art, and after brief analyzing I was able to find tons of things that would not work for a game, but on the other hand I was able to adopt few cool ideas.
Firstly- water surface level. It will be procedurally generated now, instead of using premade images/animations of waves. This process will be actually really simple- let’s say X is height of water, counting from the bottom of level, and it has value of 64. Y is width of one „water tank” and it will have value of 1 (pixel). Next water tank will have Y = 1 as well, but X will have a random parameter, for example 10% chance of changing height by 1 (either lower it or raise it), but only if height is lower then 68 and higher then 60. By setting the percentage chance as low as 10% I was able dodge the „saw blade” waves, but still allowing waves to by quite various height and width.
Just a disclaimer- the image below don’t have random surface level script added, because I’m still tweaking it.
Secondly- lights hitting the surface level. Simple script that will have random chance (this time around 20%) chance to draw a short line starting at X, Y and then lowering X values by -1, and raising Y by +1 in each step. There is also a tiny chance to add short (1-2 pixels) tail to end of each sun ray.
Next stop is dark „shadow” for every object that will be under the surface level. To indicate that this a object is submerged and that those waters are dangerous I’ve decided to hide submerged objects and show only their body „shadow”. This trick was used in various games in the past, and it’s forcing player to avoid directly swimming in water if possible. Various modern pixel art games are focusing much on transparency of water, which is cool, but it gives player a feeling that not only he can swim in water, but it’s also safe and maybe there will be some diving elements later in the game. To be honest I don’t feel like adding diving for now and would prefer to use water as hidden enemy from time to time, which actually sounds rather funny, because player will spend a lot of time near water, but in a boat or ship.
Last but not least are clouds. Yup, it’s like a year in development and I’ve just added clouds… kinda late. Here there are no math (almost) involved. Currently I’m thinking of adding around 20 base clouds which will be randomly placed on the horizon, and can be colorized to change weather on fly. On the other hand I would prefer for clouds to be more static and just be a part of parallel background. Again, two-minded, most likely time and cost will decide which option will be selected in the end.
There are few other things like bubbles, water splash, wind gusts, but those will come little bit later, as they do not require much math to consider while drawing them.
End result looks like this (again, without waves on water surface):
PS: Maybe Gnomysey isn’t such a bad title after all?