whew boy, it's been a while!
As mentioned before, i've been prioritizing updates on
tigsource but I'll still try to remember to update here
So to catch yall up,
I took a contracting job to make a mobile game (in stencyl) which took a long time and is the main reason for my absence on the game. That has been recently finished and released, and I have since started working on Ghost Bird again!
I began by deciding to remake the whole game.
I built off of the original LD build into what it is now, meaning theres a ton of left over crappy code and assets that i don't want. I'm basically going to be manually programming the most important parts (game scale stuff) and copy/pasting the complicated stuff (shaders and lighting)and probably just copy-paste all the other stuff while moving things around, etc.
I've even written a design doc exclusively on how i'm going to organize my code and assets (which i won't share because it is probably of no use to anyone else)
I've also made some cool things take a look:


now aint that neat.

this is mainly progress from rebuilding the game. the previous images were all on the previous build. This one is (and will be) a lot cleaner, but most of this is copied code so its not much faster, but that's fine.
I have
finally gotten around to fleshing out the design for the world/story/etc. with the help of a friend or two. I've mapped out the base layout of the world, including zones and path progression. I've also figured out a general story and some branching paths/endings. Next will be to go into more detail, designing rooms and puzzles, etc.
and finallyy neW THINGS IM EXCITED ABOUT!

Check out these new and improved shrooms!!
Now, the mushrooms aren't the thing i'm so excited about, just a vessel of it:
I have finally figured out a way to draw on top of my lighting shader while still under the other shaders!*
*It's not actually drawn on top, as we will see in my explanation belowThe thing I disliked most about my lighting, specifically the colored lights part, is that it washed out, flattened, and overpowered basically everything on screen in that area. I've spent the most time tweaking color values in such a way to minimize over-flooding necessary detail, while maximizing the prettiness of the lights, because the less opaque I make the lights, the less likely i'll get the colors to match up to the ones I want in my palette. for instance: the brightest blue in that latest gif needs to be fairly opaque in order to turn out that color, but because I couldn't draw beneath the shader, it would just make every pixel in that area that color, and I really hated it. You can tell in the older mushroom gif how low-intensity the lights are. That's the other end of the extreme, and neither looks that great in my eyes, or at least it's not perfect.

This is what they looked like before, and what they would've looked like if I didn't make the lights so dim. The light itself looks so much cooler, but it's totally useless if you can't see what's emitting it!
So, I basically needed a way to draw between the shaders.
For the longest time this has been the last thing i've considered impossible to do. I never thought I'd be able to do the original lighting, never thought i'd be able to turn it into a shader, never thought i'd optimize the lighting algorithm enough to use in the game, etc. etc. I've surpassed them all for the most part, except
the one; drawing between shaders. I spent a long time thinking about this and basically regarded it as impossible to do in Stencyl. I needed to be able to split shaders into layers and draw between them, so I could have my pixel quantization, color palette, and screen warp shaders still in effect and the lighting shader overwritten. Before transitioning to shaders I could do this pretty well:


I have 2 different layers of lighting here: One in front of tiles, and one behind. and
both are behind this beautiful ghost bird.
This was great because I could have high-intensity light on the background, while maintaining detail on the tiles and other stuff immediately behind the light.
(Also these gifs just made me realize I've forgotten to add the light-trail thing in the newer build. maybe it looks better without it? I don't know. Let me know what you think please thanks)
Anyway, here's how I did it.
Just like the dumb hacky way I'm currently sending the tile data and light color arrays to the shader (arrays of 10-digit integers, mod-ing/floor dividing to grab sections of digits as data), This "fix" is too, dumb and hacky.
Basically I'm doing another check in the lighting shader to see if it should draw onto the current pixel or not. The only data any pixel could have is 3 8bit RGB colors (and a useless constant alpha). So What I'm doing is i'm quantizing
(boy I guess I love this word) each 255 integer to a multiple of 16, and checking if each R G and B value is a multiple of 16, and iff it is, don't draw on top of it.

vec4 origColor = texture2D(uImage0, vTexCoord);
if((colored) && (mod(floor(origColor.rgb * 255.0 + 0.5), 16.0) == vec3(0.0))){
gl_FragColor = origColor;
} else {
Because this is terrible and hacky, this basically only works in the case that Ghost Bird is in currently. I'm restricting the game to a small color palette, so I can almost guarantee that none of the colors in the game will randomly create a false-positive for this check. Even the lighting that uses very much off-palette colors, which
used to be drawn on screen normally, is being drawn within the same shader so there's no way these colors could accidentally create false positives either. Any other game and there would be random misplaced pixels.
Also I'm not too sure about the nitty-gritty details of shaders, but this extra check could possibly be saving GPU time. I've read that if-statements are not good because of divergence (maybe this specific check is ok though?), so that may attribute to a slower shader, but if it's not too much slower the check basically exits the whole shader code for that pixel, which has a ton of stuff like color blending, etc.
But yeah. There you go. Final annoyance solved. I have full control over what colors are drawn to the screen. I no longer have anything to whine about besides my own working speed.
Time to go make everything even more pretty!