I feel like these monthly devblogs have been getting away from me a bit. From now on I’m going to just nail the date down here and say I’m going to always have these up by the 10th, since that gives me plenty of time to recover from the traditional rent panic and wrap up whatever loose ends I want to have before the post goes up.
Anyway.
I guess the first thing that should be said is immediately after spending last month’s DevBlog complaining about being unable to increase the framerate, I went and did the extremely obvious thing that I mentioned in that post and that, unsurprisingly, boosted the framerate massively. It’s still not a stable 60 frames a second, but it gets there on some of the more bare-bones levels and is stable above 50 on some of the more complex ones so it’s fine. Of course, I immediately tanked that framerate back down to 30 or so by engaging in a month-long project to add a sweet water effect to the game. In fact, the entirety of the last month has been spent on working on this sweet water effect.
This effect is achieved with a combination of copying and flipping the screen buffer, overlaying a texture on top, applying a displacement map on top of that to warp the image, and then running that through a color matrix filter. I’ve fixed a lot of the slowdown by cutting the draw area down to just the section of screen that needs to be drawn, rather than drawing the whole screen worth of water and then masking the parts I need out, but it could still use some more optimization. I’m a bit frustrated that this effect is taking so long to get working, during which I’m not making ‘content’, but I’m also pretty happy – this water effect is actually something I’ve been thinking about for a long time, and honestly now that I’ve got something in place I can think of a lot of rather interesting applications beyond the obvious. The ripples and displacements might be applied to make grass ripple in the wind, the reflections can be used for other reflective surfaces, and the improvements I’m making to the particle system to allow entities (like the water) to spawn particles for special effects will have limitless applications.
There’s still some work left to be done here. I have the architecture in place to add splashing effects and whatnot as entities enter and exit the water area, but these effects have yet to be tested or implemented. With that major revision done, further work on the water system will probably mostly be in the vein of tweaks and refactoring, which I can do gradually as needed over the life of the project. Some glistening white areas might also be nice, but I’ll probably add that to a wishlist for later. Next, I’ll be focusing on really building out the first few areas of the game and ensuring the first couple enemies function properly. i am, of course, months behind the project planning schedule I had earlier devised, but at this point I’m just trying to maintain morale and make steady progress – I can see about working harder and faster as I gain aptitude with (and slowly improve) my tool set.