Devtober Day #8


Welcome back to Day 8 of Devtober, in which rigidbodies make me cry and the world continues to crumble around me.

Today's been yet another day of chugging along trying to implement the item system, and it's been pretty slow-going, to be honest. I've been doing a lot of work with rigidbodies today, since items will exist in the worldspace and have physics interactions when not stored by an inventory. In case you don't happen to know what a rigidbody is, they're essentially a type of physics object that are handled by the engine's internal physics system rather than having their interactions be managed via scripts, which is useful when realistic physics collisions are needed.

Unfortunately, I don't actually have a lot of experience using rigidbodies, since I usually tend to manage all the physics in my games via scripts. Rigidbodies are kinda weird in the way that you're not supposed to modify their positions directly, but rather indirectly by applying forces to them. This makes trying to manipulate rigidbodies in a controlled manner pretty hard since you can't just directly set their positions. Or at least, you can, but it'll likely result in a bunch of physics bugs due to the way Godot's physics engine works. And since items are meant to be locked in place when being stored in an inventory such as a workstation or shelf, as well as vice-versa when being retrieved, you might be able to see where the difficulties in implementing such a system might start to creep in.

As for actual features I was able to implement today, we have the item-grabbing mechanic, which will be the primary way players are able to manipulate items while they're not stored in an inventory of some kind. It works pretty similar to the grab mechanics from source engine games such as portal and half-life, where the player is basically "levitating" the item in place rather than holding it physically. This also was a massive pain to implement, not because it was mechanically difficult, but because it was pretty hard to find a solid implementation for it online that wasn't too overly complex for my needs. After probably a full hour of searching, I managed to finally find a solution that took quite literally only three lines of code, which I was both incredibly thankful for, but also incredibly miffed that the solution I spent so long looking for was indeed that simple.

Well, being able to chuck items into the void has been pretty cathartic, at least.

This devlog has been a short one since most of my work today has just been coding, but progress is progress, I suppose. Really, I just can't wait to finally be done with this and get on to the more fun stuff.

Soon...


Anyway, that's about it for now. 'Till tomorrow,

- Ian, Lunarium Works

Get Voxelsmith

Download NowName your own price

Leave a comment

Log in with itch.io to leave a comment.