Platform Masters development (August 18, 2013) - how I apply jaggedness (part 2/2)
https://www.patreon.com/ulillillia --- Published on Aug 19, 2013
This video spans nearly 2 hours and is split into 2 segments. You've seen in the previous video what the effects of the jaggedness is, but how would you like to learn how I do it? The process is highly repetitive and involves several steps.
The fourth phase is running the shapes through my program. This has just 3 steps. First, I need to update my program to add in a new condition and set the parameters as needed. There are 4 main parameters I set. Jaggedness controls the intensity - the lower, the rougher the result will be. AngleVariation controls how much of an angular offset there is on that part of the cone. Black means it points more clockwise, to the left as you see the image, white means it's counterclockwise, to the right in the image. Scaling determines how far away the object is. This value is expressed in SU - 3 SU is exactly 2048 CU or slightly more than 300 feet or about 91.5 meters. If I want the hills or mountains to start smooth and get rougher with increasing maximum height, I have an offset for the scaling. Second, I show you my routine to generate the output. Note the complexity of the formula for lighting. Oh my all those sines and cosines! Third, I check the output to see if I'm satisfied. If I am, I continue to the next phase. If I'm not, I readjust the parameters and rerun my program.
The fifth phase is applying the new lighting. This uses 7 steps. First, I import each layer, starting with the last object in the farthest layer and working my way up. Second, I get rid of the all-black boundaries around each object, making it transparent. Third, I align each object as needed, placing it above my brighter layer (the "lighting lit" layer), or, if one is not present, the base layer. I start with the first object in the set and work down the list, following the same route I used in phase 2-2. If the image loops over the edge and it's visible, I duplicate it and move it the pixel repeat span to the other side. Fourth, I merge all of the lighting layers. Fifth, I set the layer opacity to 57.3% which, according to my lighting formula, is very close to what I actually need. Sixth, I set the layer's mode to multiply for darkening, crop the layer then rename it. Seventh, I repeat steps 1 through 8 for every object.
The sixth and final phase is finalizing the revised hills or mountains. There are 5 steps for this. First, I make all needed layers visible for the set. Second, I flatten the image, with black as the background color, copy it, undo the flattening, then paste it into my output image. Third, I repeat steps 1 and 2 for every set for the world. Fourth, I get rid of the black around the image to get the transparency. Fifth, I get rid of all unrelated layers by making them visible, merging them, then deleting the merged layer. Sixth, I crop the image to the layer. Seventh, I save the final output. Eighth, I repeat steps 6 and 7 for all sets. Ninth, I copy the saved output into my game engine's main image directory, backing up the originals in a zip file. Tenth, and finally, I preview the output in the game engine.
