Today was mostly spent fixing the mess I made yesterday in trying to do some refactoring:
* Fix faded textbox for non-convo text
* Map transitions
* Fix radial menu from refactor; persists map transitions and renders properly (Game class updates its objects)
* Simplified pathing function
The pathfinding is still a lot slower than I'd like when there are a lot of npcs moving around at once. I probably need a resumable pathfinding function that npcs who are travelling far can process a little bit each frame as they start following the path. I'm pretty sure the actual function is as optimized as it's going to get. Another option that I have thought about a lot in the past is dividing my map into islands and pathing between those first. That would narrow the search a lot. I can't believe I'm still thinking about pathing. Tomorrow/sat - back to the gameplay man.
Addendum: I hadn't actually finished optimizing astar. Did some searching and found a really dumb optimization to add, and what do you know, no more slowdown. Yay for random tinkering!
This was a quite productive day. First of all, I created a bonus system for gathering resources which seems to be working great. Second, I made a weighed random function for choosing an event for them to have different probabilities. I also had some great ideas on how to improve Crystal Kindom and what else to implement, but that's for later. :)
Yesterday's update can be found here.
In a case of any questions or suggestions, don't hesitate to contact me here or on twitter. ;)
For more updates, you should follow my twitter account - @PeterLauris and the account of Crystal Kingdom - @CrystalKingdom_.
Still trying to solve the same issue; getting the cost of movement to each tile on the map from the unit's current tile. Immediate neighbours would be a cost of 1 for grass tiles, 2 for the neighbours of neighbours etc. Some tiles would have increased cost, say forests might have a base cost of 2, so going through two forest tiles would cost 4.
Then gotta represent that as a highlighted area of possible moves.
I'll get that working eventually but for now I've just added a river to my demo map. (The highlighted area here is just for immediate neighbours, getting it to iterate correctly is proving difficult in a functional language :p)
Not much today. All I did was changing the level format. Now each level uses a json object and a png image. I also did some testing with optimization, but it didn't really work. And I fixed some of the enemy's bugs. All I have to do with him right now is jumping, which isn't actually necessary, but I'd like to have it, and some basic AI (follow and kill). Then I'll work on enemy jsons.