Rogue Tactics – Day 2

Now comes the fun part.

Which is apparently also the part that starts making me think “this would be a lot easier if I was using Python/implementing it from scratch.” No offense to T-Engine, it’s a neat and capable engine that has saved me a lot of time, but it’s always harder to work with someone else’s code.

I’ve been working on getting allies and enemies to take turns based on something less simple than a round-robin fashion; it would factor in the ‘time cost’ of their last action, with more complex maneuvers incapacitating them for longer periods of time. If I understand T-Engine’s standard energy system correctly, it differs from this mostly in that an actor’s turn will not end if sufficient energy still remains for them to perform another action.

My first idea was to replace the energy system with a priority queue, but Lua makes it less than trivial to implement a priority queue and I’m not sure I have a full grasp on how T-Engine tracks actors within a level. So it’s probably easier to adapt the energy system to my needs. My first attempt at this involved switching around many comparisons such that actors took their actions at energy level 0 and those actions added their time cost to the energy level, which then decreased by 1 per tick; I wanted to ensure that the energy level for an actor never went negative because I was concerned that it might have odd side effects.

Well, trying to change around things that drastically had odd side effects as well, such as completely breaking the AI. Thus I’ll be trying another approach closer to the standard energy system. Just writing this blog post has given me some ideas.

Nothing to show off today as a result of all this, though as aforementioned, it’s unlikely my 7DRL will be visually impressive or fun at any point.

Leave a Reply