So, I did a lot of smallish things this week, that all sort of add up to not much in terms of visible updates. However, there were some very important things I did this week. I started the laborious process of moving my ECS system over to TypeScript. That's gonna be involved, and until it's fully ready and tested, I'm not gonna try and use it live. I did, however, completely re-do and clean up my binary heap, priority queue, and dijkstra implementations. Dijkstra now works both as a pathfinding algorithm optionally implementing A*, and as a map-processor that returns a new map with costs for every cell.
I did all that work on the Dijkstra and related things because I learned that pathfinding algorithms are useful for more than just pathfinding on a regular map. I've been poking at a GOAP-style system, where you establish various goal-states and actions and have the AI use those for planning its next action. It turns out if you treat actions as edges of a graph and unique states as nodes, you can use Dijkstra's Algorithm to find the best plan of action. I've been thinking about how to implement a heuristic to move it over to A*, but the only one I can think of so far would be figuring out how to calculate some sort of numerical difference between the start state and the goal state, and I don't know if we could even make that an admissible heuristic. Either way, a lot of that work is in place now so I can more freely play with my GOAP stuff.
I finally go Tooltips working more or less dynamically. At least on the Canvas side. I need to add a secondary event-handler to process hovers over other UI pieces, but I think that should be easier. Right now I'm using Phaser's InteractiveCandidate system that decides what InputHandler is closest and that calls back to Aether.Tooltip, setting the data source and flipping it to visible. I think it works so far, and I'm struggling coming up with a better option. The only other option I can think of is simply having each InputHandler checking each tick whether it's currently being hovered over. I think having it tied to the InteractiveCandidate system is probably the cleanest way, and its got a short circuit that if there aren't any candidates available, it doesn't check anything deeper.
Unfortunately, the work on the GOAP and Dijkstra stuff waylaid any progress I'd made on the Weightroom work. I poked at the IndexedDB stuff a little bit, but that's a lot of stuff and I'm not sure I'm quite ready yet to build my own data store from the ground up. I do still want to get it working with LocalStorage, and I think that's going ot be one of my main priorities next week.
This next week I would like to get the Weightroom experiments working with localstorage and one wrestler, at the very least make it functional enough to add exercise sets. I'm also planning on getting my TextConsole working at parity with my previous one, so I can go back to entering text-based commands in it and have the context switching functioning properly. Additionally, I've been running into a variety of tiny bugs related to the AMD load-order which is causing the game to crap out as its trying to load. I'd like to get some of those rooted out if I have time. Finally, I would like to get a basic GOAP implementation running.