It took way damn longer than I meant it to and it was far more frustrating than I thought it would be, but the new entity system is fully armed and operational.
I was going to use this space to complain about exactly why it was frustrating, what I was trying to do and why it didn’t work, but I find at this point that I don’t really feel like it. Suffice it to say, due to some specifics of how haXe is implemented I had to either add a bunch of extra semantically redundant lines of boilerplate code to all of my behaviors or dig deep into the intricacies of the haXe macro system in an extremely complex and specific way that would likely leave me sidetracked for at least another week, if not a month or two. I chose the former, but I didn’t like it. I will say this, though: If you’re going to replace a simple system, like C’s #define code replacement feature, with a powerful system, like haXe’s macros, maybe make it so it’s not a nightmarish clusterfuck to achieve the functionality of the original system with the new system? Thanks.
Anyway. The new entity system seems to work perfectly. It should be safer and less bug-prone now, since entity behavior parameters are now type-safe unless specifically bypassed. It’s also a lot easier to separate which properties belong to the entity template, which are saved with the specific entity instance, and which are transitory and only needed for calculations while the entity is in use. These all being neatly separable will make it a lot easier to create a tool to edit these values, which is what I’ve started working on now.
The trickiest part of creating this parameter editor tool is that I have no real way of knowing beforehand what each parameter will be. Most of them will be basic data types, strings, integers, boolean flags. A few of them will be arrays of the same, which are a bit trickier. Some of them will be custom classes, needed for animation handling and other complex instructions, and those may be quite tricky – and, making them more difficult, in most cases these complex types are themselves stored in arrays, meaning I’ll have to tackle both those problems at once.
I’m not really worried though. I have a lot of tools to work with here, and this is a much more manageable problem than before, when parameters were scattered everywhere and I had no real way of knowing what to save and what to delete with the entity aside from manually flagging each parameter. I think there’s a good chance I can get this editor complete within a week, at which point the entity editor will be done. Again. Goddammit.
From there, I’ll finish making the test storytelling system and make sure it works. After that… either make some test enemies that can actually fight back, making the secondary attack work, or adding a basic lighting system.
Hopefully progress will pick up again now that I have that onerous horseshit out of the way.