SakeTami
thinmatrix
thinmatrix

patreon


Homegrown Update - Particle Effects

This month I've been adding support for a much needed feature to the Homegrown engine: particle effects! Interacting with the world now feels so much more real and satisfying, with little rocks, dust clouds, falling leaves and water splashes while you're carrying out actions in your garden.

You can download and try out the current version of Homegrown here (for “Gamer tier"+ patrons): https://www.patreon.com/posts/game-download-72441007

And the code is available here (for “Programmer Tier"+ patrons): https://www.patreon.com/posts/code-download-72497667

I've implemented a particle system a few times previously, and I had a working system in Equilinox which I used quite often as a reference while working on the new system this month. However, the code for the particles in Equilinox had been getting a little bit messy and, given that I was planning on adding support for even more features this time round, I decided to restructure it from scratch.

In terms of code architecture I decided to try a component based solution for the particle effects this time, to better handle the large number of different features and settings a particle effect can have. When creating a new particle effect I can now just select the features I want it to have from a growing repository of components, such as animation, air resistance, gravity, terrain collision, specific spawn areas, etc. The particle effects can be constructed in the code or loaded up from a file. Here's an example particle effect file for the dust effect, showing all its components along with their relevant settings:

The main benefit of the component based system is that it's incredibly simple to add support for new features for the particle effects, without any existing code needing to be edited at all. If, for example, I wanted to add support for particles to get blown around a bit by the wind, I would create a new WindComponent class containing all the code and settings for this new feature, and that's it! Then, for any particle effect where I want that effect, I would simply add a WindComponent during the particle system creation. In Equilinox, updating particles was done all in one big class and any new features had to be integrated into that mess, potentially breaking the previously added features. This new system feels a lot more scaleable!

Speaking of adding support for new features, I've added a few new ones to the particle system that I didn't have in Equilinox. The big one is that I have support for both 2D particles (textured quads that always face the camera) as well as 3D particles (particles are actual 3D meshes). I had a feeling that using 3D meshes for the particle effects might fit the art-style of this game a bit better than the flat 2D particles and so far I'm very happy with my decision! With leaves and rocks rotating around in 3D, plus big billowing dust clouds, it feels like a definite step up from the effects I had in Equilinox.

A couple of other new features include the option for particles to be affected by air resistance, the option for particles to bounce on the terrain, and options for the particles to change size throughout their life. The particle system is still a WIP and I've got a few more new components planned, to add to the pool of possible features that particle effects can choose from.

I've already started putting these new particle fx to good use and most of the main actions in the game now have some sort of accompanying effect. And I have to say, it makes such a difference to how playing the game feels! Your actions feel so much more impactful now and you can actually see your actions taking place instead of just waiting for a progress bar to complete. All in all I'm very satisfied with how it has all gone so far and I look forward to improving the particle effects further in the future.

A new devlog video is on its way in the next couple of days (filming is done, just got to edit it.) Sorry it's been a bit of a wait since the previous one - I was away on holiday for a week at the start of the month and then I was ill for a bit (just an annoying cold) so progress was a little slower than usual. I'm back on track now though, so it's full speed ahead!

Thanks as always for all the support and do let me know if you have any feedback about the new particle effects!

Karl

Homegrown Update - Particle Effects Homegrown Update - Particle Effects

Comments

The particle effects make it feel so much nicer! Nice job

hawkfalcon

I'm happy for your progression in knowledge (something I personally treasure) and the fact that it wasn't your health that kept you away this time. That's something to celebrate!

KC Oaks

Just gonna throw an idea out from left field. Can we have programmable robots that help us automate our farming?

Really, very nice job. Congrats for everything, but in special about your own improvement progression of knowledge with the particle system

Albert Gutiérrez


More Creators