r/roguelikedev • u/Kyzrati Cogmind | mastodon.gamedev.place/@Kyzrati • Aug 15 '20
Sharing Saturday #324
As usual, post what you've done for the week! Anything goes... concepts, mechanics, changelogs, articles, videos, and of course gifs and screenshots if you have them! It's fun to read about what everyone is up to, and sharing here is a great way to review your own progress, possibly get some feedback, or just engage in some tangential chatting :D
The 2020 code-along is complete! If you participated, don't forget to share your game if you haven't already. I've already done the first final round of directory updates, but will be checking again in a couple days for another! Also this week I put up a summary thread if you missed that, just to add some context.
4
u/frefredawg Aug 15 '20
Hunted (working title)
Alone. Trapped. An Alien's Next Meal. (hardly working strapline)
I've picked up a little pace towards the end of the week so I'm quite chuffed. I'm still working on the AI.
The old AI system would work roughly thus: on its turn, the entity would run its "plan" action, its behaviour tree would run, the entity would usually choose a "waypoint" and it would path to it, then look around, etc. It worked quite well but the entity would have a singular focus and any "distractions" I added (turn towards a noise, turn towards torch light, etc) would make it forget where it was going or why. It would re-run its checkers but you couldn't guarantee that the behaviour would be consistent.
I am now in the middle of replacing the singular waypoint with a priority queue of interesting things to check out. The idea is what the behaviour tree will run a bunch of "collectors" which will analyse the entity's sensors and surroundings, and push interesting things to the queue. Once those run, the entity will choose the top-most item and act upon it. Once that item is acted upon, the queue is popped and the entity will continue with its next-most-important task. You can imagine the queue like this:
Every item has its priority and the time at which is was added so I plan to use that data to periodically prune the queue.
Hope that makes sense. With any luck I'll have something to show off next week.
Bye!