NokiMo
blindvoid
blindvoid

patreon


ProjectDragonfly Update May2022

Found out you can put images in text posts this makes these updates way more clean lmao.

Anyways, made big progress on the LUA scripting this month. Turns out right after complaining about not understanding it in the last update post it all made sense immediately and I've managed to integrate a good amount of the game to a LUA api. This proved to be a lot of busy work though, a lot of it is just porting functions that affect the C++ environment that can be called from LUA, most of these functions I had already made in C++ thankfully but still need to be basically rewritten so LUA can understand it. Haven't gotten around to all of that yet but most of the fundamentals are in LUA.

So what I've done is basically have C++ call LUA every frame to update gameplay stuff. I've heard this is not the best way to do things as calling LUA from C++ is apparently fairly costly for the cpu (whereas calling C++ from LUA is not so costly) but while I have noticed the cpu usage go up slightly it's not even close to what the rendering and collision detection would take up in the end so I'm not worried about that. I have also hooked up LUA to listen to certain game events such as OnAttackLanded, OnEnemyKilled, OnFamiliarCollision etc, this is where I could see calls to LUA being a lot more frequent given the right situations so I'm going to keep an eye on that but it's still proving to not be that big a deal.

What I've done with this so far is be able to move all of the stage control to LUA, meaning I can now script stages, acts and bosses completely from LUA now. I've also integrated a simple version of the shop though I need a bit more functionality for that which I can't be bothered to do right now. I can also script new items from lua now and I must say it is so much better than doing it in C++ and I'm immediately glad I set this up.

Here's an example of an act script in LUA (section of a stage)
This one just spawns three enemies with fairly simple aimed attacks.
Boss attacks will work similarly just with some extra variables for boss health and so on.

Here's an example of an item script that summons a familiar that fires homing projectiles.

Here they are in game together.

Apologies if my code looks unhinged, but basically LUA is just a joy to program in, and what's more, right now it'd even be possible to theoretically mod in new acts and items seamlessly into the game as long as someone knew the API.

The main things I still need to do before I can properly start working on the gameplay is go through and interpret all the C++ functions so that I can work with all the object types in LUA (Particle Effects, Auras and Modifiers still need to be done for example) which is simple but pretty mind numbing work. Another pretty big thing is going to be allowing me to script in sprites and possibly shaders via LUA. This is something I am not particularly looking forward to as there are a lot of possibilities when it comes to how sprites can be manipulated and how shaders can be applied and how things should be rendered. I'm not yet certain how I want to approach it and I'm kinda worried about having to rethink how the game is rendered in the first place. I'm hoping I can have another breakthrough immediately after posting this cause if not I feel like I'm gonna be thinking about it for a while.

Thankfully that is possibly the last big hurdle before I can call the engine complete enough to start making the damn game. Really hoping I can get that done by next month but I won't make any promises. Really proud of how far it has come  regardless considering a had no idea how to use C++ when I started.

Comments

Hell yeah!!! It's really coming together! I wish I was the slightest bit proficient in programing so I could understand what you've done, but its exciting nonetheless.

Oblivion


Related Creators