1
Programming / working with AI library of sorts
« on: March 22, 2016, 08:37:06 AM »
I have been tinkering with a rewrite of my messy AI routines and got the first one done. It's super simple, just a rat that selects a room, travels there and then patrols along the walls. If enemy comes close, it switches to combat mode and starts fighting. After enemy either dies or runs away, the rat returns patrolling the room. It's a rough draft still, for example any creature with different name is considered as an enemy (so player can see rats and beetles fighting with each other). Current code is at: https://github.com/tuturto/pyherc/blob/master/src/herculeum/ai/rat.hy and https://github.com/tuturto/pyherc/blob/master/src/herculeum/ai/firebeetle.hy
Most likely it doesn't make sense to publish this as a real standalone library, but I'm still trying to have it be mostly nicely contained within the codebase of the game. There are actual finite state machines for AIs that are generally per monster and then underlying set of functions that implement specific behaviour. Combining the functions and a bit of logic in state machines is how I envision the library working in the end.
A bit further down the road I would like to add more complex things, like scavenging level for gear and selecting what items to use or deciding when it makes sense to take a short cut over a trap instead of going around. Maybe even throw in a bit of fuzzy logic, so I can raise level of abstraction from solid numbers to ranges of things.
But this is where I'm drawing a blank. What else should there be that would create interesting creatures and situations? I like having monsters that player can lure to fight with each other for example. And maybe a group of creatures that move together as a loose band. But what else would be interesting? What are memorable creatures from other creatures, mainly because how they functioned?
Most likely it doesn't make sense to publish this as a real standalone library, but I'm still trying to have it be mostly nicely contained within the codebase of the game. There are actual finite state machines for AIs that are generally per monster and then underlying set of functions that implement specific behaviour. Combining the functions and a bit of logic in state machines is how I envision the library working in the end.
A bit further down the road I would like to add more complex things, like scavenging level for gear and selecting what items to use or deciding when it makes sense to take a short cut over a trap instead of going around. Maybe even throw in a bit of fuzzy logic, so I can raise level of abstraction from solid numbers to ranges of things.
But this is where I'm drawing a blank. What else should there be that would create interesting creatures and situations? I like having monsters that player can lure to fight with each other for example. And maybe a group of creatures that move together as a loose band. But what else would be interesting? What are memorable creatures from other creatures, mainly because how they functioned?