Nathaniel3W
Member
coyotecraft":4k3mrrlz said:.. but damn, I was struggling to make it work. Like WHY ISN'T MY ALIAS FUNCTIONING?! [3hrs later] Oh, I see. Wait. Now it's only playing 4 frames. Did I change something somewhere... [3hrs later] WHY DOES RPG MAKER HAVE A MAX FRAME COUNT! Where is it even using this?
I've spent my share of time tracking down undesired behavior to some optimization that someone made somewhere inside an engine I didn't write from scratch. Unreal wasn't designed for sprites and so it does some annoying texture compression (with different compression for each color channel) that really messes up the sprite colors.
As for what I've been up to, I spent most of the day tracking down a bug that was crashing my game. The interpreter detected 100,000 iterations on a function and crashed. I went through all the code line by line over and over. It looks like my code was working as intended. It just required a lot of iterations: If the AI wants to make a ranged attack, but there are no targets in range, find each player unit, for each player unit find all the hexes within range, and find a path to each hex, and find which path is shortest. So depending on how many player units there are, and how open the terrain is, one of the functions in the pathfinding algo gets called a lot.
Some of my players had been reporting seemingly random crashes during battles and I thought my battle system was pretty solid. But today I got lucky and got put in a situation where the bug happened 100% of the time so I was able to test the bug properly. I ended up caching some of the info to reduce the amount of times the problem function gets called, and the pathfinding algo now runs a lot faster and doesn't crash. Honestly though, if I knew of a variable somewhere that just increases the amount of iterations before the interpreter crashes, I would have just increased it and worked on something else.
This is something I already know, but I just become more aware of it sometimes. Making a game requires a lot of work on stuff on some really in-the-weeds details, most of which nobody will ever notice.