SamSuka
blindvoid
blindvoid

patreon


ProjectDragonfly Update Jul2022

Decent progress this month, not as much as I had hoped but enough to be satisfied. I mostly focused on getting all the remaining rendering functionality to LUA and also sorting out an entity storage on the LUA side that doesn't interfere with the entity storage on the C side but allows for greater functionality in LUA. It's really all about making things easier for me in the future and designing a workflow that makes sense.

First things first, rendering.

Things might not look all that different apart from the obvious poison auras I managed to re-implement (thought they need some tweaking), but the main thing here is that now EVERYTHING that is rendered here is defined in LUA. Of course all the rendering is done by C but the visuals are completely scriptable with LUA now which is super nice.

I had a few roadblocks getting to this point, Render Textures at first were giving me a lot of trouble. Essentially I've hard coded 64 layers that you can create drawables on and you can also create a Render Texture that acts as a layer inside another layer, which can then have more layers inside that which have more sprites or whatever else you want to render. This is a pretty important feature that allows the type of effects seen in the poison aura (where there are multiple circles that combine kinda morph into a single blob if they touch). There were multiple instances of me putting layers inside themselves which caused all sorts of madness but I'm pretty sure they are working nicely right now.

The second main issue was applying shaders which I thought might happen last month. How I had it before was that you could apply a shader to an object all fine but if you changed any uniform values in that shader it would change the uniforms for all objects that used that shader. Normally how you apply a shader is you change the uniform values immediately before rendering that object. Unfortunately because I didn't want LUA to handle the rendering directly this was not possible via LUA without created a bunch of copies of the shader which seemed really inefficient. My solution to this is not entirely clean either but it does work, so any object that has a shader will also create a table of uniform values that it will apply to itself right before it renders itself. The reason I don't like it so much is that there are about 15 different uniform types not including uniform arrays which means in my current implementation I have to store 30 most likely empty tables and I'm worried about how much processing that takes if you had say 500 objects all using a shader. It works though, which is the goal, but I'm still potentially worried about performance there.

On a better note, managed to sort out a great entity creation and storage system on the LUA side:

This is basically how you can define an entity type now, sprites and effect and everything. This shows a simple point pickup but you can do this for enemies that handle their sprites and players and auras and pretty much anything. You could technically do it for bullets and shots but they are handled more by C simply because there are so many and they don't need to be so complex, but the option is there which is nice for extra special bullets if I get to that point.

The game building workflow is looking pretty ideal right now, though I still have a couple things I want to do before working on gameplay. I wanna really flesh out the particle system so I can finalize the syntax for it, and maybe fix and extend the sound and music system so I can add a bit more of that. Once that's done though I really wanna start working on a stage and a boss and really polish it as much as I can to see how the style works out. Won't make any promises as to what I'll get done next month so I'll keep it a surprise.


More Creators